diff --git a/TO_MERGE/agm/Goggles/CfgFunctions.hpp b/TO_MERGE/agm/Goggles/CfgFunctions.hpp deleted file mode 100644 index 4ff3eb37cd..0000000000 --- a/TO_MERGE/agm/Goggles/CfgFunctions.hpp +++ /dev/null @@ -1,25 +0,0 @@ -class CfgFunctions{ - class AGM_Goggles{ - class AGM_Goggles{ - file="AGM_Goggles\functions"; - class Init{postInit = 1;}; - class ApplyGlassesEffect; - class RemoveGlassesEffect; - class ApplyDirtEffect; - class RemoveDirtEffect; - class isGogglesVisible; - class isDivingGoggles; - class ClearGlasses; - class CheckGoggles; - class GetExplosionIndex; - class RainEffect; - class RemoveRainEffect; - class DustHandler; - class ExternalCamera; - class isInRotorWash; - class OnEachFrame; - class ApplyDust; - class RemoveDustEffect; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/agm/Goggles/config.cpp b/TO_MERGE/agm/Goggles/config.cpp deleted file mode 100644 index 8bc8ffa9b5..0000000000 --- a/TO_MERGE/agm/Goggles/config.cpp +++ /dev/null @@ -1,295 +0,0 @@ -#define COLOUR 8.0 -class CfgPatches { - class AGM_Goggles { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"Garth 'L-H' de Wet"}; - authorUrl = "https://github.com/CorruptedHeart"; - }; -}; - -#include "CfgFunctions.hpp" -#define COMBAT_GOGGLES AGM_Overlay="AGM_Goggles\textures\HUD\CombatGoggles.paa"; \ - AGM_OverlayCracked = "AGM_Goggles\textures\HUD\CombatGogglesCracked.paa"; \ - AGM_Resistance = 2; \ - AGM_Protection = 1; - -class CfgGlasses { - class None { - AGM_Color[] = {0,0,0}; - AGM_TintAmount=0; - AGM_Overlay = ""; - AGM_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; - AGM_OverlayCracked = "AGM_Goggles\textures\HUD\Cracked.paa"; - AGM_Resistance = 0; - AGM_Protection = 0; - AGM_DustPath = "AGM_Goggles\textures\fx\dust\%1.paa"; - }; - - class G_Combat:None { - COMBAT_GOGGLES - }; - - class G_Diving { - AGM_Overlay="AGM_Goggles\textures\HUD\DivingGoggles.paa"; - AGM_OverlayCracked = "AGM_Goggles\textures\HUD\DivingGogglesCracked.paa"; - AGM_Resistance = 2; - AGM_Protection = 1; - }; - - class G_Lowprofile:None { - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 2; - AGM_Protection = 1; - }; - - class G_Shades_Black:None { - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - }; - - class G_Shades_Blue:None{ - AGM_Color[] = {0,0,1}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Shades_Green:None{ - AGM_Color[] = {0,1,0}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Shades_Red:None{ - AGM_Color[] = {1,0,0}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Spectacles:None{ - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Spectacles_Tinted:None{ - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - }; - - class G_Sport_Blackred:None{ - AGM_Color[] = {1,0,0}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Sport_BlackWhite:None{ - AGM_Color[] = {0,0,1}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Sport_Blackyellow:None{ - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - }; - - class G_Sport_Checkered:None{ - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - }; - - class G_Sport_Greenblack:None{ - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - }; - - class G_Sport_Red:None{ - AGM_TintAmount=COLOUR*2; - AGM_Color[] = {0,0,0}; - AGM_Resistance = 1; - }; - - class G_Squares:None{ - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Squares_Tinted:None{ - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Tactical_Black:None{ - AGM_TintAmount=COLOUR; - AGM_Color[] = {0,0,-1.5}; - AGM_Resistance = 1; - }; - - class G_Tactical_Clear:None{ - AGM_TintAmount=COLOUR; - AGM_Color[] = {0,0,-1}; - AGM_Resistance = 1; - }; - - class G_Aviator:None{ - AGM_Color[] = {0,0,-1}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Lady_Blue:None{ - AGM_Color[] = {0,0,1}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Lady_Red:None{ - AGM_Color[] = {1,0,0}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class G_Lady_Dark:None{ - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - }; - - class G_Lady_Mirror:None{ - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - }; - - class AV_ESS_blk:None{ - COMBAT_GOGGLES - }; - - class G_Balaclava_blk; - - class G_Balaclava_combat:G_Balaclava_blk { - COMBAT_GOGGLES - }; - - class G_Balaclava_lowprofile:G_Balaclava_blk { - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 2; - AGM_Protection = 1; - }; - - class G_Bandanna_blk; - class G_Bandanna_shades:G_Bandanna_blk { - AGM_TintAmount=COLOUR*2; - AGM_Resistance = 1; - AGM_Protection = 1; - }; - class G_Bandanna_sport:G_Bandanna_blk { - AGM_Color[] = {1,0,0}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - AGM_Protection = 1; - }; - class G_Bandanna_aviator:G_Bandanna_blk { - AGM_Color[] = {0,0,-1}; - AGM_TintAmount=COLOUR; - AGM_Resistance = 1; - AGM_Protection = 1; - }; -}; - -#include "RscTitles.hpp" - -class CfgMovesBasic -{ - class ManActions - { - GestureWipeFace[] = {"GestureWipeFace", "gesture"}; - }; -}; - -class CfgGesturesMale -{ - class States - { - class GestureFreezeStand; - class GestureWipeFace: GestureFreezeStand - { - file = "\AGM_Goggles\anim\WipeGlasses.rtm"; - canPullTrigger = 0; - }; - }; -}; - -class CfgWeapons{ - class H_HelmetB; - - class H_CrewHelmetHeli_B:H_HelmetB { - AGM_Protection = 1; - }; - class H_PilotHelmetHeli_B:H_HelmetB { - AGM_Protection = 1; - }; - class H_PilotHelmetFighter_B:H_HelmetB { - AGM_Protection = 1; - }; -}; - -class RifleAssaultCloud { - AGM_Goggles_BulletCount = 4; -}; -class MachineGunCloud { - AGM_Goggles_BulletCount = 3; -}; -class SniperCloud { - AGM_Goggles_BulletCount = 1; -}; - -class AGM_Core_Default_Keys { - class wipeGlasses { - displayName = $STR_AGM_Goggles_WipeGlasses; - condition = "!(player getVariable['AGM_isUnconscious', false])"; - statement = "call AGM_Goggles_fnc_ClearGlasses;"; - key = 20; // T - shift = 1; - control = 1; - alt = 0; - }; -}; - -class AGM_Core_Options { - class showInThirdPerson { - displayName = $STR_AGM_Goggles_ShowInThirdPerson; - default = 0; - }; -}; - -class CfgCloudlets { - class Default; - class AGMRainEffect:Default { - interval = 0.001; - particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; - particleFSNtieth = 1; - particleFSIndex = 0; - particleFSFrameCount = 1; - particleFSLoop = 1; - - particleType = "Billboard"; - lifeTime = 0.5; - rotationVelocity = 1; - weight = 100; - volume = 0.000; - rubbing = 1.7; - size[] = {0.1}; - color[] = {{1,1,1,1}}; - animationSpeed[] = {0,1}; - randomDirectionPeriod = 0.2; - randomDirectionIntensity = 1.2; - positionVar[] = {2, 2, 2.5}; - sizeVar = 0.01; - colorVar[] = {0, 0, 0, 0.1}; - destroyOnWaterSurface = 1; - }; -}; diff --git a/TO_MERGE/agm/Goggles/define.hpp b/TO_MERGE/agm/Goggles/define.hpp deleted file mode 100644 index 3e7666bfaa..0000000000 --- a/TO_MERGE/agm/Goggles/define.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// Control types -#define CT_STATIC 0 -#define ST_PICTURE 0x30 - -//////////////// -//Base Classes// -//////////////// - -class RscPicture -{ - access = 0; - idc = -1; - type = CT_STATIC; - style = ST_PICTURE; - colorBackground[] = {0,0,0,0}; - colorText[] = {1,1,1,1}; - font = "puristaMedium"; - sizeEx = 0; - lineSpacing = 0; - fixedWidth = 0; - shadow = 0; - text = ""; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; -}; diff --git a/TO_MERGE/agm/Goggles/functions/fn_ApplyDirtEffect.sqf b/TO_MERGE/agm/Goggles/functions/fn_ApplyDirtEffect.sqf deleted file mode 100644 index eea86c295e..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_ApplyDirtEffect.sqf +++ /dev/null @@ -1,32 +0,0 @@ -/* - Name: AGM_Goggles_fnc_ApplyDirtEffect - - Author: Garth de Wet (LH) - - Description: - Adds dirt effect to the glasses. - - Parameters: - Nothing - - Returns: - BOOLEAN - True if succeeded false if not - - Example: - call AGM_Goggles_fnc_ApplyDirtEffect; -*/ -#include "\AGM_Goggles\script.sqf" - -if (cameraOn != player || call AGM_Goggles_fnc_ExternalCamera) exitWith{false}; -private "_dirtImage"; -AGM_Goggles_Effects set [DIRT, true]; - -if (player call AGM_Goggles_fnc_isGogglesVisible) then{ - _dirtImage = getText(ConfigFile >> "CfgGlasses" >> goggles player >> "AGM_OverlayDirt"); - if (_dirtImage != "") then { - 100 cutRsc["RscAGM_GogglesEffects", "PLAIN",0.1, false]; - (uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText _dirtImage; - }; -}; - -true \ No newline at end of file diff --git a/TO_MERGE/agm/Goggles/functions/fn_ApplyDust.sqf b/TO_MERGE/agm/Goggles/functions/fn_ApplyDust.sqf deleted file mode 100644 index b01408ed7b..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_ApplyDust.sqf +++ /dev/null @@ -1,69 +0,0 @@ -/* - Name: AGM_Goggles_fnc_ApplyDust - - Author: Garth de Wet (LH) - - Description: - Applies dust to screen. - - Parameters: - Nothing - - Returns: - Nothing - - Example 1: - call AGM_Goggles_fnc_ApplyDust; -*/ -#include "\AGM_Goggles\script.sqf" -if (call AGM_Goggles_fnc_ExternalCamera) exitWith {}; -if (player call AGM_Goggles_fnc_isGogglesVisible) exitWith { - 100 cutRsc["RscAGM_GogglesEffects", "PLAIN",2,false]; - (uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_DustPath"), GETDUSTT(DAMOUNT)+1]; - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); - SETDUST(DBULLETS,0); -}; - -if (player getVariable ["AGM_EyesDamaged", false]) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);}; -SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2)); - -private "_amount"; -_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - -AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; -AGM_Goggles_PostProcessEyes ppEffectCommit 1; -AGM_Goggles_PostProcessEyes ppEffectEnable true; -if !(scriptDone AGM_Goggles_DustHandler) then { - terminate AGM_Goggles_DustHandler; -}; -SETDUST(DBULLETS,0); -AGM_Goggles_DustHandler = [3] spawn { - private ["_loop", "_timeToSleep"]; - _timeToSleep = _this select 0; - _loop = true; - while {_loop} do { - sleep _timeToSleep; - _timeToSleep = GETDUSTT(DTIME); - - if(_timeToSleep >= (time - 2.5)) then { - _timeToSleep = time - _timeToSleep; - } else { - SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - private "_amount"; - _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); - if !(player getVariable ["AGM_EyesDamaged", false]) then { - AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; - AGM_Goggles_PostProcessEyes ppEffectCommit 1; - sleep 1; - }; - if (GETDUSTT(DAMOUNT) <= 0) then { - AGM_Goggles_PostProcessEyes ppEffectEnable false; - SETDUST(DACTIVE,false); - SETDUST(DBULLETS,0); - _loop = false; - }; - SETDUST(DTIME,time); - _timeToSleep = 3; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/agm/Goggles/functions/fn_CheckGoggles.sqf b/TO_MERGE/agm/Goggles/functions/fn_CheckGoggles.sqf deleted file mode 100644 index e03bbc6069..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_CheckGoggles.sqf +++ /dev/null @@ -1,52 +0,0 @@ -/* - Author: Garth de Wet (LH) - - Description: - Performs rain checks and checks to see whether glasses effects have been applied or not. - Checks for external camera and removes effects. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - [] execVM "AGM_Goggles\functions\fn_CheckGoggles.sqf"; -*/ -#include "\AGM_Goggles\script.sqf" -waitUntil {sleep 0.46;alive player}; -call AGM_Goggles_fnc_CheckGlasses; -["AGM_Goggles_RotorWash", "OnEachFrame", {call AGM_Goggles_fnc_OnEachFrame;}] call BIS_fnc_addStackedEventHandler; -[] spawn AGM_Goggles_fnc_RainEffect; -while {alive player} do { - sleep 1; - if (true) then { - // Detect if curator interface is open and disable effects - if (!isNull(findDisplay 312)) exitWith { - if (AGM_Goggles_EffectsActive) then { - call AGM_Goggles_fnc_RemoveGlassesEffect; - }; - }; - call AGM_Goggles_fnc_CheckGlasses; - if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith { - if (AGM_Goggles_EffectsActive) then { - call AGM_Goggles_fnc_RemoveGlassesEffect; - }; - }; - if (call AGM_Goggles_fnc_ExternalCamera) exitWith { - if (AGM_Goggles_EffectsActive) then { - call AGM_Goggles_fnc_RemoveGlassesEffect; - }; - }; - if !(AGM_Goggles_EffectsActive) then { - (goggles player) call AGM_Goggles_fnc_ApplyGlassesEffect; - } else { - if ((goggles player) call AGM_Goggles_fnc_isDivingGoggles && {underwater player}) then { - call AGM_Goggles_fnc_RemoveRainEffect; - call AGM_Goggles_fnc_RemoveDirtEffect; - call AGM_Goggles_fnc_RemoveDustEffect; - }; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/agm/Goggles/functions/fn_ClearGlasses.sqf b/TO_MERGE/agm/Goggles/functions/fn_ClearGlasses.sqf deleted file mode 100644 index ab85238818..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_ClearGlasses.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/* - Name: AGM_Goggles_fnc_ClearGlasses - - Author: Garth de Wet (LH) - - Description: - Clears all dirt, rain, dust from glasses. - Removes glasses effect (PP, overlay) and then puts it back. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Goggles_fnc_ClearGlasses; -*/ -#include "\AGM_Goggles\script.sqf" - -private "_broken"; -_broken = GETBROKEN; -AGM_Goggles_Effects = GLASSESDEFAULT; -AGM_Goggles_Effects set [BROKEN, _broken]; - -if ((stance player) != "PRONE") then { - player playActionNow "gestureWipeFace"; -}; - -null = [] spawn { - sleep 0.3; - if (cameraView == "INTERNAL") then { - addCamShake [5, 1.75, 2]; - }; -}; - -call AGM_Goggles_fnc_RemoveDirtEffect; -call AGM_Goggles_fnc_RemoveRainEffect; -call AGM_Goggles_fnc_RemoveDustEffect; diff --git a/TO_MERGE/agm/Goggles/functions/fn_ExternalCamera.sqf b/TO_MERGE/agm/Goggles/functions/fn_ExternalCamera.sqf deleted file mode 100644 index d3e3f98366..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_ExternalCamera.sqf +++ /dev/null @@ -1,19 +0,0 @@ -/* - Name: AGM_Goggles_fnc_ExternalCamera - - Author: Garth de Wet (LH) - - Description: - Returns if the camera is external or not. - - Parameters: - Nothing - - Returns: - Boolean - whether the camera is in external view or not. - - Example: - call AGM_Goggles_fnc_ExternalCamera; -*/ -if (profileNamespace getVariable ["AGM_showInThirdPerson", false]) exitWith { false }; -(cameraView == "External") diff --git a/TO_MERGE/agm/Goggles/functions/fn_GetExplosionIndex.sqf b/TO_MERGE/agm/Goggles/functions/fn_GetExplosionIndex.sqf deleted file mode 100644 index e7ac8b04f6..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_GetExplosionIndex.sqf +++ /dev/null @@ -1,28 +0,0 @@ -/* - Name: AGM_Goggles_fnc_GetExplosionIndex - - Author: Garth de Wet (LH) - - Description: - Turns 0-1 damage into a rating system of 0-3 - - Parameters: - 0: NUMBER - The amount of damage - - Returns: - NUMBER (the rating) [0-3] - - Example: - _rating = 0.05 call AGM_Goggles_fnc_GetExplosionIndex -*/ -private ["_effect", "_effectIndex"]; -_effect = _this; - -_effectIndex = switch true do { - case (_effect <= 0.04): {0}; - case (_effect <= 0.06): {1}; - case (_effect <= 0.09): {2}; - default {3}; -}; - -_effectIndex diff --git a/TO_MERGE/agm/Goggles/functions/fn_Init.sqf b/TO_MERGE/agm/Goggles/functions/fn_Init.sqf deleted file mode 100644 index 7a8710c7f7..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_Init.sqf +++ /dev/null @@ -1,111 +0,0 @@ -/* - Name: AGM_Goggles_fnc_Init - - Author: Garth de Wet (LH) - - Description: - Sets up the glasses mod for usage. Initialises variables and event handlers. - Shouldn't be called by a user/modder ever. Done by the engine. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Goggles_fnc_Init; -*/ -if (!hasInterface) exitWith {}; -#include "\AGM_Goggles\script.sqf" - -if isNil("AGM_Goggles_UsePP") then { - AGM_Goggles_UsePP = true; -}; - -AGM_Goggles_PostProcess = ppEffectCreate ["ColorCorrections", 1995]; -AGM_Goggles_PostProcessEyes = ppEffectCreate ["ColorCorrections", 1992]; -AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; -AGM_Goggles_PostProcessEyes ppEffectCommit 0; -AGM_Goggles_PostProcessEyes ppEffectEnable false; -AGM_Goggles_EffectsActive = false; -AGM_Goggles_Effects = GLASSESDEFAULT; -AGM_Goggles_Current = "None"; -AGM_Goggles_EyesDamageScript = 0 spawn {}; -AGM_Goggles_FrameEvent = [false, [false,20]]; -AGM_Goggles_PostProcessEyes_Enabled = false; -AGM_Goggles_DustHandler = 0 spawn {}; -AGM_Goggles_RainDrops = objNull; - -AGM_Goggles_fnc_CheckGlasses = { - if (AGM_Goggles_Current != (goggles player)) then { - AGM_Goggles_Current = (goggles player); - ["GlassesChanged",[AGM_Goggles_Current]] call CBA_fnc_localEvent; - }; -}; - -player addEventHandler ["Explosion", { - if (alive player) then { - call AGM_Goggles_fnc_ApplyDirtEffect; - if (GETBROKEN) exitWith {}; - if (((_this select 1) call AGM_Goggles_fnc_GetExplosionIndex) < getNumber(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_Resistance")) exitWith {}; - if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith {["GlassesCracked",[player]] call CBA_fnc_localEvent;}; - AGM_Goggles_Effects set [BROKEN, true]; - if (getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_OverlayCracked") != "" && {cameraOn == player}) then { - if (call AGM_Goggles_fnc_ExternalCamera) exitWith {}; - if (isNull(GLASSDISPLAY)) then { - 150 cutRsc["RscAGM_Goggles", "PLAIN",1, false]; - }; - (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_OverlayCracked"); - }; - ["GlassesCracked",[player]] call CBA_fnc_localEvent; - }; -}]; -player addEventHandler ["Killed",{ - [] spawn { - sleep 2; - AGM_Goggles_PostProcessEyes ppEffectEnable false; - AGM_Goggles_Effects = GLASSESDEFAULT; - call AGM_Goggles_fnc_RemoveGlassesEffect; - AGM_Goggles_EffectsActive=false; - player setVariable ["AGM_EyesDamaged", false]; - terminate AGM_Goggles_EyesDamageScript; - terminate AGM_Goggles_MainLoop; - terminate AGM_Goggles_DustHandler; - AGM_Goggles_MainLoop = [] spawn AGM_Goggles_fnc_CheckGoggles; - }; -}]; -player addEventHandler ["Fired",{[_this select 0, _this select 1] call AGM_Goggles_fnc_DustHandler;}]; -player AddEventHandler ["Take",{call AGM_Goggles_fnc_CheckGlasses;}]; -player AddEventHandler ["Put", {call AGM_Goggles_fnc_CheckGlasses;}]; - -["GlassesChanged",{ - AGM_Goggles_Effects = GLASSESDEFAULT; - - if (call AGM_Goggles_fnc_ExternalCamera) exitWith {call AGM_Goggles_fnc_RemoveGlassesEffect}; - - if (player call AGM_Goggles_fnc_isGogglesVisible) then { - (_this select 0) call AGM_Goggles_fnc_ApplyGlassesEffect; - } else { - call AGM_Goggles_fnc_RemoveGlassesEffect; - }; -}] call CBA_fnc_addEventHandler; -["GlassesCracked",{ - if (_this select 0 != player) exitWith {}; - player setVariable ["AGM_EyesDamaged", true]; - if !(scriptDone AGM_Goggles_EyesDamageScript) then { - terminate AGM_Goggles_EyesDamageScript; - }; - AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; - AGM_Goggles_PostProcessEyes ppEffectCommit 0; - AGM_Goggles_PostProcessEyes ppEffectEnable true; - AGM_Goggles_EyesDamageScript = [] spawn { - sleep 25; - AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; - AGM_Goggles_PostProcessEyes ppEffectCommit 5; - sleep 5; - AGM_Goggles_PostProcessEyes ppEffectEnable false; - player setVariable ["AGM_EyesDamaged", false]; - }; -}] call CBA_fnc_addEventHandler; -AGM_Goggles_MainLoop = [] spawn AGM_Goggles_fnc_CheckGoggles; diff --git a/TO_MERGE/agm/Goggles/functions/fn_OnEachFrame.sqf b/TO_MERGE/agm/Goggles/functions/fn_OnEachFrame.sqf deleted file mode 100644 index 660c3d7afa..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_OnEachFrame.sqf +++ /dev/null @@ -1,80 +0,0 @@ -/* - Name: AGM_Goggles_fnc_OnEachFrame - - Author: Garth de Wet (LH) - - Description: - Runs every frame checking for helicopters. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - ["AGM_Goggles_RotorWash", "OnEachFrame", "call AGM_Goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler; -*/ -#include "\AGM_Goggles\script.sqf" -if (isNull(player)) then { - ["AGM_Goggles_RotorWash", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler; -}; -AGM_Goggles_FrameEvent set [0, !(AGM_Goggles_FrameEvent select 0)]; -if (AGM_Goggles_FrameEvent select 0) exitWith { - if (vehicle player != player && {!([player] call AGM_Core_fnc_isTurnedOut)}) exitWith {(AGM_Goggles_FrameEvent select 1) set [0, false]; }; - AGM_Goggles_FrameEvent set [1, ([player] call AGM_Goggles_fnc_isInRotorWash)]; -}; -private ["_rotorWash","_safe"]; -_rotorWash = AGM_Goggles_FrameEvent select 1; -_safe = false; -if !(_rotorWash select 0) exitWith { - if (AGM_Goggles_PostProcessEyes_Enabled) then { - AGM_Goggles_PostProcessEyes_Enabled = false; - if (!scriptDone (AGM_Goggles_DustHandler)) then { - terminate AGM_Goggles_DustHandler; - }; - AGM_Goggles_DustHandler = [] spawn { - AGM_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; - AGM_Goggles_PostProcessEyes ppEffectCommit 2; - sleep 2; - AGM_Goggles_PostProcessEyes ppEffectEnable false; - }; - }; -}; -if ((headgear player) != "") then { - _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear player) >> "AGM_Protection") == 1); -}; -if !(_safe) then { - if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith{}; - if (GETDUSTT(DAMOUNT) < 2) then { - if (!GETDUSTT(DACTIVE)) then { - SETDUST(DACTIVE,true); - call AGM_Goggles_fnc_ApplyDust; - } else { - if ((_rotorWash select 1) > 0.5) then { - call AGM_Goggles_fnc_ApplyDust; - }; - }; - }; - _safe = (getNumber (ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_Protection") == 1); -}; -if (_safe) exitWith {}; -if ((_rotorWash select 1) <= 15) then { - private "_scale"; - _scale = 0.7; - if ((_rotorWash select 1) != 0) then { - _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); - } else { - _scale = 0.1; - }; - _scale = 1 - _scale; - if (!scriptDone (AGM_Goggles_DustHandler)) then { - terminate AGM_Goggles_DustHandler; - }; - if !(player getVariable ["AGM_EyesDamaged", false]) then { - AGM_Goggles_PostProcessEyes_Enabled = true; - AGM_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]]; - AGM_Goggles_PostProcessEyes ppEffectCommit 0.5; - AGM_Goggles_PostProcessEyes ppEffectEnable true; - }; -}; diff --git a/TO_MERGE/agm/Goggles/functions/fn_RainEffect.sqf b/TO_MERGE/agm/Goggles/functions/fn_RainEffect.sqf deleted file mode 100644 index a52862a20e..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_RainEffect.sqf +++ /dev/null @@ -1,61 +0,0 @@ -/* - Name: AGM_Goggles_fnc_RainEffect - - Author: Garth de Wet (LH) - - Description: - - - Parameters: - Nothing - - Returns: - Nothing - - Example: - [] spawn AGM_Goggles_fnc_RainEffect; -*/ -#include "\AGM_Goggles\script.sqf" -AGM_Goggles_RainDrops = objNull; -AGM_Goggles_Rain_Active = false; -_fnc_underCover = { - private ["_pos", "_unit"]; - _unit = (_this select 0); - if (vehicle _unit != _unit && {!([_unit] call AGM_Core_fnc_isTurnedOut)}) exitWith {true}; - _pos = eyePos _unit; - ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} -}; -private ["_lastRain"]; -_lastRain = 0; -while {alive player} do { - sleep 0.5; - if (isNull(findDisplay 312)) then { - // Ignore if player is under water - if (!AGM_Goggles_EffectsActive || {underwater player}) exitWith{call AGM_Goggles_fnc_RemoveRainEffect;}; - if (_lastRain != rain) then { - call AGM_Goggles_fnc_RemoveRainEffect; - _lastRain = rain; - // Rain is happening - if (_lastRain > 0.05 && {!([player] call _fnc_underCover)}) then { - AGM_Goggles_Rain_Active = true; - AGM_Goggles_RainDrops = "#particlesource" createVehicleLocal GetPos player; - AGM_Goggles_RainDrops setParticleClass "AGMRainEffect"; - AGM_Goggles_RainDrops setDropInterval (0.07 * (1.1 - _lastRain)); - AGM_Goggles_RainDrops attachTo [vehicle player,[0,0,0]]; - }; - }else{ - if (_lastRain > 0.05) then { - if (AGM_Goggles_Rain_Active && {[player] call _fnc_underCover}) exitWith { - call AGM_Goggles_fnc_RemoveRainEffect; - }; - if (!AGM_Goggles_Rain_Active) then { - _lastRain = -1; - }; - }; - }; - }else{ - if (AGM_Goggles_Rain_Active) then { - call AGM_Goggles_fnc_RemoveRainEffect; - }; - }; -}; \ No newline at end of file diff --git a/TO_MERGE/agm/Goggles/functions/fn_RemoveDirtEffect.sqf b/TO_MERGE/agm/Goggles/functions/fn_RemoveDirtEffect.sqf deleted file mode 100644 index 0d63dec827..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_RemoveDirtEffect.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/* - Name: AGM_Goggles_fnc_RemoveDirtEffect - - Author: Garth de Wet (LH) - - Description: - Removes dirt from the glasses. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Goggles_fnc_RemoveDirtEffect; -*/ -if (!isNull(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull])) then { - (uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText ""; -}; diff --git a/TO_MERGE/agm/Goggles/functions/fn_RemoveDustEffect.sqf b/TO_MERGE/agm/Goggles/functions/fn_RemoveDustEffect.sqf deleted file mode 100644 index a895583e02..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_RemoveDustEffect.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/* - Name: AGM_Goggles_fnc_RemoveDustEffect - - Author: Garth de Wet (LH) - - Description: - Removes dust from the glasses. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Goggles_fnc_RemoveDustEffect; -*/ -if (!isNull(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull])) then { - (uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText ""; -}; diff --git a/TO_MERGE/agm/Goggles/functions/fn_RemoveGlassesEffect.sqf b/TO_MERGE/agm/Goggles/functions/fn_RemoveGlassesEffect.sqf deleted file mode 100644 index b80f79a028..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_RemoveGlassesEffect.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - Name: AGM_Goggles_fnc_RemoveGlassesEffect - - Author: Garth de Wet (LH) - - Description: - Removes the glasses effect from the screen, removes dirt effect, removes rain effect, - removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Goggles_fnc_RemoveGlassesEffect; -*/ -#include "\AGM_Goggles\script.sqf" -AGM_Goggles_EffectsActive = false; -AGM_Goggles_PostProcess ppEffectEnable false; - -if (!isNull(GLASSDISPLAY)) then { - GLASSDISPLAY closeDisplay 0; -}; - -call AGM_Goggles_fnc_RemoveDirtEffect; -call AGM_Goggles_fnc_RemoveRainEffect; -call AGM_Goggles_fnc_RemoveDustEffect; diff --git a/TO_MERGE/agm/Goggles/functions/fn_RemoveRainEffect.sqf b/TO_MERGE/agm/Goggles/functions/fn_RemoveRainEffect.sqf deleted file mode 100644 index a3e3629bb1..0000000000 --- a/TO_MERGE/agm/Goggles/functions/fn_RemoveRainEffect.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/* - Name: AGM_Goggles_fnc_RemoveRainEffect - - Author: Garth de Wet (LH) - - Description: - Removes rain effects from the screen. Resets the rain array. - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call AGM_Goggles_fnc_RemoveRainEffect; -*/ -if (!isNull (AGM_Goggles_RainDrops)) then { - deleteVehicle (AGM_Goggles_RainDrops); -}; -AGM_Goggles_Rain_Active = false; \ No newline at end of file diff --git a/TO_MERGE/agm/Goggles/script.sqf b/TO_MERGE/agm/Goggles/script.sqf deleted file mode 100644 index 92f681915e..0000000000 --- a/TO_MERGE/agm/Goggles/script.sqf +++ /dev/null @@ -1,21 +0,0 @@ -#define GLASSESDEFAULT [false,[false,0,0,0],false] - -#define DIRT 0 -#define DUST 1 -#define BROKEN 2 - -#define GETDIRT (AGM_Goggles_Effects select DIRT) -#define GETDUST (AGM_Goggles_Effects select DUST) -#define GETBROKEN (AGM_Goggles_Effects select BROKEN) -#define GETDUSTT(type) ((AGM_Goggles_Effects select DUST) select type) - -#define SETDUST(type,value) (AGM_Goggles_Effects select DUST) set [type, value] - -#define DACTIVE 0 -#define DTIME 1 -#define DBULLETS 2 -#define DAMOUNT 3 - -#define GLASSDISPLAY (uiNamespace getVariable ["AGM_Goggles_Display", displayNull]) - -#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) diff --git a/TO_MERGE/agm/Markers/InsertMarker.hpp b/TO_MERGE/agm/Markers/InsertMarker.hpp deleted file mode 100644 index 07366a1f4b..0000000000 --- a/TO_MERGE/agm/Markers/InsertMarker.hpp +++ /dev/null @@ -1,136 +0,0 @@ - -class RscDisplayInsertMarker { - onLoad = "_this call compile preprocessFileLineNumbers 'AGM_Markers\scripts\initInsertMarker.sqf'"; - onUnload = "_this call compile preprocessFileLineNumbers 'AGM_Markers\scripts\placeMarker.sqf'"; - idd = 54; - movingEnable = 1; - class controlsBackground { - class RscText_1000: RscText { - idc = 1000; - /*x = "0 * GUI_GRID_INSERTMARKER_W + GUI_GRID_INSERTMARKER_X"; - y = "0 * GUI_GRID_INSERTMARKER_H + GUI_GRID_INSERTMARKER_Y"; - w = "8 * GUI_GRID_INSERTMARKER_W"; - h = "2.5 * GUI_GRID_INSERTMARKER_H"; - colorBackground[] = {0,0,0,0.5};*/ - }; - class Description: RscStructuredText { - colorBackground[] = {0,0,0,0.7}; - idc = 1100; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "9.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - }; - class controls { - //delete ButtonOK; - class ButtonMenuOK: RscButtonMenuOK { - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "8.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - // size = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - // sizeEx = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - text = ""; - }; - class ButtonMenuCancel: RscButtonMenuCancel { - x = "23 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "1.1 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - - text = "X"; - colorBackground[] = {0.75,0,0,0.5}; - colorBackgroundFocused[] = {0.75,0,0,0.5}; - colorBackground2[] = {1,0,0,0.5}; - }; - /*class ButtonMenuInfo: RscButtonMenu { - idc = 2400; - text = "$STR_A3_RscDisplayInsertMarker_ButtonMenuInfo"; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - };*/ - delete ButtonMenuInfo; - class Title: RscText { - moving = 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.8])"}; - idc = 1001; - text = "$STR_A3_RscDisplayInsertMarker_Title"; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "8.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - delete Description; - /*class Info: RscStructuredText { - colorBackground[] = {0,0,0,0.7}; - idc = 1101; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - };*/ - delete Info; - class Picture: RscPicture { - idc = 102; - x = 0.259984; - y = 0.4; - w = 0.05; - h = 0.0666667; - }; - class Text: RscEdit { - idc = 101; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "10.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - /*class SizeX: RscEdit { - idc = 1200; - text = "10"; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class SizeY: RscEdit { - idc = 1201; - text = "10"; - x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - };*/ - class MarkerShape: RscCombo { - idc = 1210; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class MarkerColor: RscCombo { - idc = 1211; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class MarkerAngle: RscXSliderH { - idc = 1220; - text = "10"; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - class MarkerAngleText: RscText { - idc = 1221; - x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; - y = "14.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - }; - }; -}; diff --git a/TO_MERGE/agm/Markers/clientInit.sqf b/TO_MERGE/agm/Markers/clientInit.sqf deleted file mode 100644 index e5dc72e804..0000000000 --- a/TO_MERGE/agm/Markers/clientInit.sqf +++ /dev/null @@ -1,7 +0,0 @@ -// by commy2 - -// request marker data for JIP -if (isMultiplayer && {!isServer}) then { - _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; - [_logic, "AGM_Markers_fnc_sendMarkersJIP", 1] call AGM_Core_fnc_execRemoteFnc; -}; diff --git a/TO_MERGE/agm/Markers/config.cpp b/TO_MERGE/agm/Markers/config.cpp deleted file mode 100644 index 3811f1f685..0000000000 --- a/TO_MERGE/agm/Markers/config.cpp +++ /dev/null @@ -1,47 +0,0 @@ -class CfgPatches { - class AGM_Markers { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"commy2"}; - authorUrl = "https://github.com/commy2/"; - }; -}; - -class CfgFunctions { - class AGM_Markers { - class AGM_Markers { - file = "AGM_Markers\functions"; - class onLBSelChangedColor; - class onLBSelChangedShape; - class onSliderPosChangedAngle; - class sendMarkersJIP; - class setMarker; - class setMarkerJIP; - class setMarkerNetwork; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Markers { - clientInit = "call compile preprocessFileLineNumbers 'AGM_Markers\clientInit.sqf'"; - }; -}; - -class RscPicture; -class RscText; -class RscStructuredText; -class RscButtonMenuOK; -class RscButtonMenuCancel; -class RscButtonMenu; -class RscEdit; -class RscCombo; -class RscSlider; -class RscXSliderH; - -#include diff --git a/TO_MERGE/agm/Markers/functions/fn_sendMarkersJIP.sqf b/TO_MERGE/agm/Markers/functions/fn_sendMarkersJIP.sqf deleted file mode 100644 index dd95a68d50..0000000000 --- a/TO_MERGE/agm/Markers/functions/fn_sendMarkersJIP.sqf +++ /dev/null @@ -1,15 +0,0 @@ -// by commy2 - -private "_logic"; - -_logic = _this; - -[ - [ - missionNamespace getVariable ["AGM_allMapMarkers", []], - missionNamespace getVariable ["AGM_allMapMarkersProperties", []], - _logic - ], - "AGM_Markers_fnc_setMarkerJIP", - _logic -] call AGM_Core_fnc_execRemoteFnc; diff --git a/TO_MERGE/agm/Markers/functions/fn_setMarker.sqf b/TO_MERGE/agm/Markers/functions/fn_setMarker.sqf deleted file mode 100644 index 63df5bfe11..0000000000 --- a/TO_MERGE/agm/Markers/functions/fn_setMarker.sqf +++ /dev/null @@ -1,15 +0,0 @@ -// by commy2 - -private ["_marker", "_data", "_config"]; - -_marker = _this select 0; -_data = _this select 1; - -_config = (configfile >> "CfgMarkers") select (_data select 0); -[[_marker, configName _config], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerTypeLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc; - -_config = (configfile >> "CfgMarkerColors") select (_data select 1); -[[_marker, configName _config], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerColorLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc; - -[[_marker, _data select 2], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerPosLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc; -[[_marker, _data select 3], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerDirLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc; diff --git a/TO_MERGE/agm/Markers/functions/fn_setMarkerJIP.sqf b/TO_MERGE/agm/Markers/functions/fn_setMarkerJIP.sqf deleted file mode 100644 index 9ede4d492e..0000000000 --- a/TO_MERGE/agm/Markers/functions/fn_setMarkerJIP.sqf +++ /dev/null @@ -1,26 +0,0 @@ -// by commy2 - -private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"]; - -_allMapMarkers = _this select 0; -_allMapMarkersProperties = _this select 1; -_logic = _this select 2; - -{ - _index = _allMapMarkers find _x; - - if (_index != -1) then { - _data = _allMapMarkersProperties select _index; - - _config = (configfile >> "CfgMarkers") select (_data select 0); - _x setMarkerTypeLocal configName _config; - - _config = (configfile >> "CfgMarkerColors") select (_data select 1); - _x setMarkerColorLocal configName _config; - - _x setMarkerPosLocal (_data select 2); - _x setMarkerDirLocal (_data select 3); - }; -} forEach allMapMarkers; - -deleteVehicle _logic; diff --git a/TO_MERGE/agm/Markers/functions/fn_setMarkerNetwork.sqf b/TO_MERGE/agm/Markers/functions/fn_setMarkerNetwork.sqf deleted file mode 100644 index e655c7171f..0000000000 --- a/TO_MERGE/agm/Markers/functions/fn_setMarkerNetwork.sqf +++ /dev/null @@ -1,36 +0,0 @@ -// by commy2 - -private ["_marker", "_data", "_config"]; - -_marker = _this select 0; -_data = _this select 1; - -_config = (configfile >> "CfgMarkers") select (_data select 0); -_marker setMarkerTypeLocal configName _config; - -_config = (configfile >> "CfgMarkerColors") select (_data select 1); -_marker setMarkerColorLocal configName _config; - -_marker setMarkerPosLocal (_data select 2); -_marker setMarkerDirLocal (_data select 3); - -// save properties on server machine for JIP, marker editing ready -if (isMultiplayer && {isServer}) then { - private ["_allMapMarkers", "_allMapMarkersProperties", "_index"]; - - _allMapMarkers = missionNamespace getVariable ["AGM_allMapMarkers", []]; - _allMapMarkersProperties = missionNamespace getVariable ["AGM_allMapMarkersProperties", []]; - - _index = _allMapMarkers find _marker; - - if (_index == -1) then { - _allMapMarkers pushBack _marker; - _allMapMarkersProperties pushBack _data; - } else { - _allMapMarkers set [_index, _marker]; - _allMapMarkersProperties set [_index, _data]; - }; - - AGM_allMapMarkers = _allMapMarkers; - AGM_allMapMarkersProperties = _allMapMarkersProperties; -}; diff --git a/TO_MERGE/agm/Markers/scripts/placeMarker.sqf b/TO_MERGE/agm/Markers/scripts/placeMarker.sqf deleted file mode 100644 index 248190435a..0000000000 --- a/TO_MERGE/agm/Markers/scripts/placeMarker.sqf +++ /dev/null @@ -1,51 +0,0 @@ -// by commy2 - -if (_this select 1 == 1) then { - disableserialization; - _display = _this select 0; - - _pos = ctrlPosition (_display displayCtrl 102); - _pos = [ - (_pos select 0) + (_pos select 2) / 2, - (_pos select 1) + (_pos select 3) / 2 - ]; - - switch (true) do { - case (!isNull findDisplay 12) : { - _pos = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld _pos; - }; - case (!isNull findDisplay 37) : { - _pos = (findDisplay 37 displayCtrl 51) ctrlMapScreenToWorld _pos; - }; - case (!isNull findDisplay 52) : { - _pos = (findDisplay 52 displayCtrl 51) ctrlMapScreenToWorld _pos; - }; - case (!isNull findDisplay 53) : { - _pos = (findDisplay 53 displayCtrl 51) ctrlMapScreenToWorld _pos; - }; - }; - - _pos spawn { - /*[ - allMapMarkers select (count allMapMarkers - 1), - [ - uiNamespace getVariable ['AGM_Markers_currentMarkerShape', 0], - uiNamespace getVariable ['AGM_Markers_currentMarkerColor', 0], - _this, - uiNamespace getVariable ['AGM_Markers_currentMarkerAngle', 0] - ] - ] call AGM_Markers_fnc_setMarker;*/ - - [ - [ - allMapMarkers select (count allMapMarkers - 1), - [ - uiNamespace getVariable ['AGM_Markers_currentMarkerShape', 0], - uiNamespace getVariable ['AGM_Markers_currentMarkerColor', 0], - _this, - uiNamespace getVariable ['AGM_Markers_currentMarkerAngle', 0] - ] - ], "AGM_Markers_fnc_setMarkerNetwork", 2 - ] call AGM_Core_fnc_execRemoteFnc; - }; -}; diff --git a/TO_MERGE/cse/f_configuration/CfgFunctions.h b/TO_MERGE/cse/f_configuration/CfgFunctions.h deleted file mode 100644 index bd875b8a58..0000000000 --- a/TO_MERGE/cse/f_configuration/CfgFunctions.h +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 924e7d3d1e..0000000000 --- a/TO_MERGE/cse/f_configuration/CfgHints.h +++ /dev/null @@ -1,51 +0,0 @@ -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 deleted file mode 100644 index 0a763dadf4..0000000000 --- a/TO_MERGE/cse/f_configuration/Combat_Space_Enhancement.h +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 63cf9a14b3..0000000000 --- a/TO_MERGE/cse/f_configuration/GUI.h +++ /dev/null @@ -1,3 +0,0 @@ -#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 deleted file mode 100644 index f7a525961a..0000000000 --- a/TO_MERGE/cse/f_configuration/config.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#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 deleted file mode 100644 index 87c4411f4e..0000000000 --- a/TO_MERGE/cse/f_configuration/displayEventHandler_keys.sqf +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index 1a4d0a6ce2..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_addClientSideOptions_f.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 deleted file mode 100644 index 2ca8011ed6..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForAction_f.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 deleted file mode 100644 index 9cc0a7f20b..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_addKeyBindingForMenu_f.sqf +++ /dev/null @@ -1,26 +0,0 @@ -/** - * 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 deleted file mode 100644 index 8584d1e0cf..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_getClientSideOptionFromProfile_f.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/** - * 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 deleted file mode 100644 index 78a1659906..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_getKeyBindingFromProfile_f.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/** - * 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 deleted file mode 100644 index fedcbfd211..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_getSettingDetails_f.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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 deleted file mode 100644 index 5a77824fc7..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_onKeyPressed_f.sqf +++ /dev/null @@ -1,105 +0,0 @@ -/** - * 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 deleted file mode 100644 index 21010e4beb..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_onKeyReleased_f.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 deleted file mode 100644 index a0bd859d1e..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_onListBoxKeyBindingChanged.sqf +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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 deleted file mode 100644 index dc95a8fb89..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_onListBoxSettingsChanged.sqf +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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 deleted file mode 100644 index 60ce5c91e1..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_onListBoxShowSelectionChanged.sqf +++ /dev/null @@ -1,55 +0,0 @@ -/** - * 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 deleted file mode 100644 index 8dc2352e25..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_onSettingsMenuOpen.sqf +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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 deleted file mode 100644 index 2ea37d1935..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_parseConfigForConfigurations.sqf +++ /dev/null @@ -1,22 +0,0 @@ -/** - * 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 deleted file mode 100644 index 5271e73173..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_parseModuleForConfigurations.sqf +++ /dev/null @@ -1,63 +0,0 @@ -/** - * 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 deleted file mode 100644 index 04fb6ebde3..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_saveClientSideOptionToProfile_f.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/** - * 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 deleted file mode 100644 index fbc7f2a593..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_saveKeyBindingToProfile_f.sqf +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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 deleted file mode 100644 index de6762d30c..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_settingsDefineDetails_f.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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 deleted file mode 100644 index 2df8a134a8..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyBinding_f.sqf +++ /dev/null @@ -1,65 +0,0 @@ -/** - * 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 deleted file mode 100644 index a355f8f92e..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateKeyView.sqf +++ /dev/null @@ -1,74 +0,0 @@ -/** - * 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 deleted file mode 100644 index b6d950e240..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_settingsMenuUpdateList.sqf +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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 deleted file mode 100644 index f73ebd71be..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_updateActionKeybinding_f.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 deleted file mode 100644 index 9a5efedf6f..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_updateAllKeyBindings_f.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/** - * 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 deleted file mode 100644 index 84a3e771cf..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_updateClientSideOption_f.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 deleted file mode 100644 index e6137e1444..0000000000 --- a/TO_MERGE/cse/f_configuration/functions/fn_updateMenuKeyBinding_f.sqf +++ /dev/null @@ -1,24 +0,0 @@ -/** - * 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 deleted file mode 100644 index c521de470f..0000000000 --- a/TO_MERGE/cse/f_configuration/gui/define.h +++ /dev/null @@ -1,797 +0,0 @@ - -#ifndef CSE_DEFINE_H -#define CSE_DEFINE_H -// define.hpp - -#define true 1 -#define false 0 - -#define CT_STATIC 0 -#define CT_BUTTON 1 -#define CT_EDIT 2 -#define CT_SLIDER 3 -#define CT_COMBO 4 -#define CT_LISTBOX 5 -#define CT_TOOLBOX 6 -#define CT_CHECKBOXES 7 -#define CT_PROGRESS 8 -#define CT_HTML 9 -#define CT_STATIC_SKEW 10 -#define CT_ACTIVETEXT 11 -#define CT_TREE 12 -#define CT_STRUCTURED_TEXT 13 -#define CT_CONTEXT_MENU 14 -#define CT_CONTROLS_GROUP 15 -#define CT_SHORTCUTBUTTON 16 -#define CT_XKEYDESC 40 -#define CT_XBUTTON 41 -#define CT_XLISTBOX 42 -#define CT_XSLIDER 43 -#define CT_XCOMBO 44 -#define CT_ANIMATED_TEXTURE 45 -#define CT_OBJECT 80 -#define CT_OBJECT_ZOOM 81 -#define CT_OBJECT_CONTAINER 82 -#define CT_OBJECT_CONT_ANIM 83 -#define CT_LINEBREAK 98 -#define CT_ANIMATED_USER 99 -#define CT_MAP 100 -#define CT_MAP_MAIN 101 -#define CT_LISTNBOX 102 - -// Static styles -#define ST_POS 0x0F -#define ST_HPOS 0x03 -#define ST_VPOS 0x0C -#define ST_LEFT 0x00 -#define ST_RIGHT 0x01 -#define ST_CENTER 0x02 -#define ST_DOWN 0x04 -#define ST_UP 0x08 -#define ST_VCENTER 0x0c - -#define ST_TYPE 0xF0 -#define ST_SINGLE 0 -#define ST_MULTI 16 -#define ST_TITLE_BAR 32 -#define ST_PICTURE 48 -#define ST_FRAME 64 -#define ST_BACKGROUND 80 -#define ST_GROUP_BOX 96 -#define ST_GROUP_BOX2 112 -#define ST_HUD_BACKGROUND 128 -#define ST_TILE_PICTURE 144 -#define ST_WITH_RECT 160 -#define ST_LINE 176 - -#define ST_SHADOW 0x100 -#define ST_NO_RECT 0x200 // this style works for CT_STATIC in conjunction with ST_MULTI -#define ST_KEEP_ASPECT_RATIO 0x800 - -#define ST_TITLE ST_TITLE_BAR + ST_CENTER - -// Slider styles -#define SL_DIR 0x400 -#define SL_VERT 0 -#define SL_HORZ 0x400 - -#define SL_TEXTURES 0x10 - -// Listbox styles -#define LB_TEXTURES 0x10 -#define LB_MULTI 0x20 -#define FontCSE "PuristaMedium" - -class cse_gui_backgroundBase { - type = CT_STATIC; - idc = -1; - style = ST_PICTURE; - colorBackground[] = {0,0,0,0}; - colorText[] = {1, 1, 1, 1}; - font = FontCSE; - text = ""; - sizeEx = 0.032; -}; -class cse_gui_editBase -{ - access = 0; - type = 2; - x = 0; - y = 0; - h = 0.04; - w = 0.2; - colorBackground[] = - { - 0, - 0, - 0, - 1 - }; - colorText[] = - { - 0.95, - 0.95, - 0.95, - 1 - }; - colorSelection[] = - { - "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", - "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", - "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", - 1 - }; - autocomplete = ""; - text = ""; - size = 0.2; - style = "0x00 + 0x40"; - font = "PuristaMedium"; - shadow = 2; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorDisabled[] = - { - 1, - 1, - 1, - 0.25 - }; -}; - - - -class cse_gui_buttonBase { - idc = -1; - type = 16; - style = ST_LEFT; - text = ""; - action = ""; - x = 0.0; - y = 0.0; - w = 0.25; - h = 0.04; - size = 0.03921; - sizeEx = 0.03921; - color[] = {1.0, 1.0, 1.0, 1}; - color2[] = {1.0, 1.0, 1.0, 1}; - /*colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.5])"}; - colorbackground2[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.4}; - colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - colorFocused[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])", 0.8}; - colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.8}; - */ - - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {1,1,1,1}; - colorBackgroundFocused[] = {1,1,1,1}; - periodFocus = 1.2; - periodOver = 0.8; - default = false; - class HitZone { - left = 0.00; - top = 0.00; - right = 0.00; - bottom = 0.00; - }; - - class ShortcutPos { - left = 0.00; - top = 0.00; - w = 0.00; - h = 0.00; - }; - - class TextPos { - left = 0.002; - top = 0.0004; - right = 0.0; - bottom = 0.00; - }; - textureNoShortcut = ""; - animTextureNormal = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDisabled = "cse\cse_gui\data\buttonDisabled_gradient.paa"; - animTextureOver = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureFocused = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTexturePressed = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - animTextureDefault = "cse\cse_gui\data\buttonNormal_gradient_top.paa"; - period = 0.5; - font = FontCSE; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.0,0}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.07,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; - class Attributes { - font = FontCSE; - color = "#E5E5E5"; - align = "center"; - shadow = "true"; - }; - class AttributesImage { - font = FontCSE; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; -}; - -class cse_gui_RscProgress { - type = 8; - style = 0; - colorFrame[] = {1,1,1,0.7}; - colorBar[] = {1,1,1,0.7}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; -}; - - -class cse_gui_staticBase { - idc = -1; - type = CT_STATIC; - x = 0.0; - y = 0.0; - w = 0.183825; - h = 0.104575; - style = ST_LEFT; - font = FontCSE; - sizeEx = 0.03921; - colorText[] = {0.95, 0.95, 0.95, 1.0}; - colorBackground[] = {0, 0, 0, 0}; - text = ""; -}; - -class RscListBox; -class cse_gui_listBoxBase : RscListBox{ - type = CT_LISTBOX; - style = ST_MULTI; - font = FontCSE; - sizeEx = 0.03921; - color[] = {1, 1, 1, 1}; - colorText[] = {0.543, 0.5742, 0.4102, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 1}; - colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; - colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - period = 1.2; - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 1}; - maxHistoryDelay = 1.0; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - soundSelect[] = {"",0.1,1}; - soundExpand[] = {"",0.1,1}; - soundCollapse[] = {"",0.1,1}; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; - class ScrollBar { - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = ""; - arrowFull = ""; - arrowEmpty = ""; - border = ""; - }; -}; - - -class cse_gui_listNBox { - access = 0; - type = CT_LISTNBOX;// 102; - style =ST_MULTI; - w = 0.4; - h = 0.4; - font = FontCSE; - sizeEx = 0.031; - - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - columns[] = {0.0}; - color[] = {1, 1, 1, 1}; - - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 0.2}; - colorText[] = {1,1, 1, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 0.0}; - colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; - colorActive[] = {0,0,0,1}; - colorDisabled[] = {0,0,0,0.3}; - rows = 1; - - drawSideArrows = 0; - idcLeft = -1; - idcRight = -1; - maxHistoryDelay = 1; - soundSelect[] = {"", 0.1, 1}; - period = 1; - shadow = 2; - class ScrollBar { - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - border = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - thumb = "#(argb,8,8,3)color(1,1,1,1)"; - }; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; - - -class RscCombo; -class cse_gui_comboBoxBase: RscCombo { - idc = -1; - type = 4; - style = "0x10 + 0x200"; - x = 0; - y = 0; - w = 0.3; - h = 0.035; - color[] = {0,0,0,0.6}; - colorActive[] = {1,0,0,1}; - colorBackground[] = {0,0,0,1}; - colorDisabled[] = {1,1,1,0.25}; - colorScrollbar[] = {1,0,0,1}; - colorSelect[] = {0,0,0,1}; - colorSelectBackground[] = {1,1,1,0.7}; - colorText[] = {1,1,1,1}; - - arrowEmpty = ""; - arrowFull = ""; - wholeHeight = 0.45; - font = FontCSE; - sizeEx = 0.031; - soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; - soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; - soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; - maxHistoryDelay = 1.0; - class ScrollBar - { - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - border = ""; - }; - class ComboScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; - - - -class cse_gui_mapBase { - moveOnEdges = 1; - x = "SafeZoneXAbs"; - y = "SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "SafeZoneWAbs"; - h = "SafeZoneH - 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - type = 100; // Use 100 to hide markers - style = 48; - shadow = 0; - - ptsPerSquareSea = 5; - ptsPerSquareTxt = 3; - ptsPerSquareCLn = 10; - ptsPerSquareExp = 10; - ptsPerSquareCost = 10; - ptsPerSquareFor = 9; - ptsPerSquareForEdge = 9; - ptsPerSquareRoad = 6; - ptsPerSquareObj = 9; - showCountourInterval = 0; - scaleMin = 0.001; - scaleMax = 1.0; - scaleDefault = 0.16; - maxSatelliteAlpha = 0.85; - alphaFadeStartScale = 0.35; - alphaFadeEndScale = 0.4; - colorBackground[] = {0.969,0.957,0.949,1.0}; - colorSea[] = {0.467,0.631,0.851,0.5}; - colorForest[] = {0.624,0.78,0.388,0.5}; - colorForestBorder[] = {0.0,0.0,0.0,0.0}; - colorRocks[] = {0.0,0.0,0.0,0.3}; - colorRocksBorder[] = {0.0,0.0,0.0,0.0}; - colorLevels[] = {0.286,0.177,0.094,0.5}; - colorMainCountlines[] = {0.572,0.354,0.188,0.5}; - colorCountlines[] = {0.572,0.354,0.188,0.25}; - colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6}; - colorCountlinesWater[] = {0.491,0.577,0.702,0.3}; - colorPowerLines[] = {0.1,0.1,0.1,1.0}; - colorRailWay[] = {0.8,0.2,0.0,1.0}; - colorNames[] = {0.1,0.1,0.1,0.9}; - colorInactive[] = {1.0,1.0,1.0,0.5}; - colorOutside[] = {0.0,0.0,0.0,1.0}; - colorTracks[] = {0.84,0.76,0.65,0.15}; - colorTracksFill[] = {0.84,0.76,0.65,1.0}; - colorRoads[] = {0.7,0.7,0.7,1.0}; - colorRoadsFill[] = {1.0,1.0,1.0,1.0}; - colorMainRoads[] = {0.9,0.5,0.3,1.0}; - colorMainRoadsFill[] = {1.0,0.6,0.4,1.0}; - colorGrid[] = {0.1,0.1,0.1,0.6}; - colorGridMap[] = {0.1,0.1,0.1,0.6}; - colorText[] = {1, 1, 1, 0.85}; -font = "PuristaMedium"; -sizeEx = 0.0270000; -stickX[] = {0.20, {"Gamma", 1.00, 1.50} }; -stickY[] = {0.20, {"Gamma", 1.00, 1.50} }; -onMouseButtonClick = ""; -onMouseButtonDblClick = ""; - - fontLabel = "PuristaMedium"; - sizeExLabel = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontGrid = "TahomaB"; - sizeExGrid = 0.02; - fontUnits = "TahomaB"; - sizeExUnits = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontNames = "PuristaMedium"; - sizeExNames = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; - fontInfo = "PuristaMedium"; - sizeExInfo = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontLevel = "TahomaB"; - sizeExLevel = 0.02; - text = "#(argb,8,8,3)color(1,1,1,1)"; - class ActiveMarker { - color[] = {0.30, 0.10, 0.90, 1.00}; - size = 50; - }; - class Legend - { - x = "SafeZoneX + ( ((safezoneW / safezoneH) min 1.2) / 40)"; - y = "SafeZoneY + safezoneH - 4.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "PuristaMedium"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - colorBackground[] = {1,1,1,0.5}; - color[] = {0,0,0,1}; - }; - class Task - { - icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; - iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; - iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; - iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; - iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; - color[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])"}; - colorCreated[] = {1,1,1,1}; - colorCanceled[] = {0.7,0.7,0.7,1}; - colorDone[] = {0.7,1,0.3,1}; - colorFailed[] = {1,0.3,0.2,1}; - size = 27; - importance = 1; - coefMin = 1; - coefMax = 1; - }; - class Waypoint - { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class WaypointCompleted - { - icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class CustomMark - { - icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; - size = 24; - importance = 1; - coefMin = 1; - coefMax = 1; - color[] = {0,0,0,1}; - }; - class Command - { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - size = 18; - importance = 1; - coefMin = 1; - coefMax = 1; - color[] = {1,1,1,1}; - }; - class Bush - { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = "14/2"; - importance = "0.2 * 14 * 0.05 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Rock - { - icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; - color[] = {0.1,0.1,0.1,0.8}; - size = 12; - importance = "0.5 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class SmallTree - { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = 12; - importance = "0.6 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Tree - { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = 12; - importance = "0.9 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class busstop - { - icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class fuelstation - { - icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class hospital - { - icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class church - { - icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class lighthouse - { - icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class power - { - icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powersolar - { - icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwave - { - icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwind - { - icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class quay - { - icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class shipwreck - { - icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class transmitter - { - icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class watertower - { - icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class Cross - { - icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Chapel - { - icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Bunker - { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - size = 14; - importance = "1.5 * 14 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Fortress - { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - size = 16; - importance = "2 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Fountain - { - icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; - size = 11; - importance = "1 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Ruin - { - icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; - size = 16; - importance = "1.2 * 16 * 0.05"; - coefMin = 1; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Stack - { - icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; - size = 20; - importance = "2 * 16 * 0.05"; - coefMin = 0.9; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Tourism - { - icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; - size = 16; - importance = "1 * 16 * 0.05"; - coefMin = 0.7; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class ViewTower - { - icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; - size = 16; - importance = "2.5 * 16 * 0.05"; - coefMin = 0.5; - coefMax = 4; - color[] = {0,0,0,1}; - }; -}; - -#endif \ No newline at end of file diff --git a/TO_MERGE/cse/f_configuration/gui/pauseMenu.h b/TO_MERGE/cse/f_configuration/gui/pauseMenu.h deleted file mode 100644 index c7ff74ef59..0000000000 --- a/TO_MERGE/cse/f_configuration/gui/pauseMenu.h +++ /dev/null @@ -1,46 +0,0 @@ -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 deleted file mode 100644 index 66d5532389..0000000000 --- a/TO_MERGE/cse/f_configuration/gui/settingsMenu.h +++ /dev/null @@ -1,259 +0,0 @@ -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/sys_ballistics/advancedballistics/CfgAmmo.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgAmmo.h new file mode 100644 index 0000000000..255aced8d7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgAmmo.h @@ -0,0 +1,1715 @@ +class CfgAmmo +{ + class BulletBase; + class B_556x45_Ball_Tracer_Red; + class B_762x51_Tracer_Red; + class B_556x45_Ball + { + airFriction=-0.001265; + hit=8; + typicalSpeed=750; + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=62; + AB_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + AB_ballisticCoefficients[]={0.151}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + AB_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class AB_556x45_Ball_Mk262 : B_556x45_Ball + { + airFriction=-0.001125; + caliber=0.6; + deflecting=18; + hit=11; + typicalSpeed=836; + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=77; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.361}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={624, 816, 832, 838}; + AB_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class AB_556x45_Ball_Mk318 : B_556x45_Ball + { + airFriction=-0.001120; + caliber=0.6; + deflecting=18; + hit=9; + typicalSpeed=886; + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=62; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.307}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={780, 886, 950}; + AB_barrelLengths[]={10, 15.5, 20}; + }; + class AB_545x39_Ball_7N6M : B_556x45_Ball + { + airFriction=-0.001162; + caliber=0.5; + deflecting=18; + hit=7; + typicalSpeed=880; + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=52.9; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={780, 880, 920}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class AB_545x39_Ball_7T3M : B_556x45_Ball_Tracer_Red + { + airFriction=-0.001162; + caliber=0.5; + deflecting=18; + hit=7; + typicalSpeed=883; + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class B_65x39_Caseless + { + airFriction=-0.000772; + typicalSpeed=800; + AB_caliber=0.264; + AB_bulletLength=1.295; + AB_bulletMass=123; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.263}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={760, 788, 800, 805}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class B_762x51_Ball + { + airFriction=-0.001035; + typicalSpeed=833; + hit=14; + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class AB_762x51_Ball_M118LR : B_762x51_Ball + { + airFriction=-0.0008525; + caliber=1.05; + hit=16; + typicalSpeed=790; + AB_caliber=0.308; + AB_bulletLength=1.24; + AB_bulletMass=175; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + AB_velocityBoundaries[]={853, 549, 549, 549}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={750, 780, 790, 794}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class AB_762x51_Ball_Subsonic : B_762x51_Ball + { + airFriction=-0.000535; + caliber=0.5; + hit=16; + typicalSpeed=790; + AB_caliber=0.308; + AB_bulletLength=1.340; + AB_bulletMass=200; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.235}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={305, 325, 335, 340}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class AB_762x54_Ball_7N14 : B_762x51_Ball + { + airFriction=-0.001023; + caliber=0.95; + hit=15; + typicalSpeed=820; + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=152; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.4}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={700, 800, 820, 833}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class AB_762x54_Ball_7T2 : B_762x51_Tracer_Red + { + airFriction=-0.001023; + caliber=0.9; + hit=15; + typicalSpeed=800; + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class AB_762x35_Ball : B_762x51_Ball + { + airFriction=-0.000821; + caliber=0.9; + hit=11; + typicalSpeed=790; + AB_caliber=0.308; + AB_bulletLength=1.153; + AB_bulletMass=125; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.349, 0.338, 0.330, 0.310}; + AB_velocityBoundaries[]={792, 610, 488}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={620, 655, 675}; + AB_barrelLengths[]={9, 16, 20}; + }; + class AB_762x39_Ball : B_762x51_Ball + { + airFriction=-0.0015168; + hit=12; + typicalSpeed=716; + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=123; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class AB_762x39_Ball_57N231P : B_762x51_Tracer_Red + { + airFriction=-0.0015168; + hit=12; + typicalSpeed=716; + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=117; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class B_9x21_Ball + { + airFriction=-0.00125; + typicalSpeed=390; + hit=6; + AB_caliber=0.356; + AB_bulletLength=0.610; + AB_bulletMass=115; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.17}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={350, 390, 420}; + AB_barrelLengths[]={4, 5, 9}; + }; + class AB_9x18_Ball_57N181S : B_9x21_Ball + { + hit=5; + airFriction=-0.001234; + typicalSpeed=298; + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class AB_9x19_Ball : B_9x21_Ball + { + airFriction=-0.001234; + typicalSpeed=370; + hit=6; + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class AB_10x25_Ball : B_9x21_Ball + { + airFriction=-0.00168; + typicalSpeed=425; + hit=7; + AB_caliber=0.5; + AB_bulletLength=0.764; + AB_bulletMass=165; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.189}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={360, 400, 430}; + AB_barrelLengths[]={4, 4.61, 9}; + }; + class AB_765x17_Ball: B_9x21_Ball + { + airFriction=-0.001213; + typicalSpeed=282; + hit=7; + AB_caliber=0.3125; + AB_bulletLength=0.610; + AB_bulletMass=65; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.118}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={282, 300, 320}; + AB_barrelLengths[]={4, 5, 9}; + }; + class AB_303_Ball : AB_762x51_Ball_M118LR + { + airFriction=-0.00083; + typicalSpeed=761; + AB_caliber=0.311; + AB_bulletLength=1.227; + AB_bulletMass=174; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.499, 0.493, 0.48}; + AB_velocityBoundaries[]={671, 549}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={748, 761, 765}; + AB_barrelLengths[]={20, 24, 26}; + }; + class B_408_Ball + { + airFriction=-0.000395; + typicalSpeed=910; + AB_caliber=0.408; + AB_bulletLength=2.126; + AB_bulletMass=410; + AB_transonicStabilityCoef=1; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.97}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={910}; + AB_barrelLengths[]={29}; + }; + class AB_106x83mm_Ball : B_408_Ball + { + AB_caliber=0.416; + AB_bulletLength=2.089; + AB_bulletMass=398; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.72}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={960}; + AB_barrelLengths[]={29}; + }; + class AB_338_Ball : B_408_Ball + { + airFriction=-0.000526; + caliber=1.55; + deflecting=12; + hit=20; + typicalSpeed=826; + AB_caliber=0.338; + AB_bulletLength=1.70; + AB_bulletMass=300; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.381}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={820, 826, 830}; + AB_barrelLengths[]={24, 26.5, 28}; + }; + class B_127x99_Ball + { + airFriction=-0.0006; + typicalSpeed=853; + AB_caliber=0.510; + AB_bulletLength=2.310; + AB_bulletMass=647; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.670}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={853}; + AB_barrelLengths[]={29}; + }; + class AB_127x99_Ball_AMAX : B_127x99_Ball + { + AB_caliber=0.510; + AB_bulletLength=2.540; + AB_bulletMass=750; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={1.050}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={860}; + AB_barrelLengths[]={29}; + }; + class B_127x108_Ball + { + typicalSpeed=820; + AB_caliber=0.511; + AB_bulletLength=2.520; + AB_bulletMass=745; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.63}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={820}; + AB_barrelLengths[]={28.7}; + }; + class B_45ACP_Ball + { + airFriction=-0.0007182; + typicalSpeed=250; + AB_caliber=0.452; + AB_bulletLength=0.68; + AB_bulletMass=230; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.195}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={230, 250, 285}; + AB_barrelLengths[]={4, 5, 9}; + }; + + class TMR_B_762x51_M118LR : B_762x51_Ball + { + AB_caliber=0.308; + AB_bulletLength=1.24; + AB_bulletMass=175; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + AB_velocityBoundaries[]={853, 549, 549, 549}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={750, 780, 790, 794}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + + class RH_50_AE_Ball: BulletBase + { + AB_caliber=0.5; + AB_bulletLength=1.110; + AB_bulletMass=325; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.228}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={360, 398, 420}; + AB_barrelLengths[]={4, 6, 9}; + }; + class RH_454_Casull: BulletBase + { + AB_caliber=0.452; + AB_bulletLength=0.895; + AB_bulletMass=325; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.171}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={450, 490, 500}; + AB_barrelLengths[]={4, 7.5, 9}; + }; + class RH_32ACP: BulletBase + { + AB_caliber=0.3125; + AB_bulletLength=0.610; + AB_bulletMass=65; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.118}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={282, 300, 320}; + AB_barrelLengths[]={4, 5, 9}; + }; + class RH_45ACP: BulletBase + { + AB_caliber=0.452; + AB_bulletLength=0.68; + AB_bulletMass=230; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.195}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={230, 250, 285}; + AB_barrelLengths[]={4, 5, 9}; + }; + class RH_B_40SW: BulletBase + { + AB_caliber=0.4; + AB_bulletLength=0.447; + AB_bulletMass=135; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.105, 0.115, 0.120, 0.105}; + AB_velocityBoundaries[]={365, 305, 259}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={360, 380, 400}; + AB_barrelLengths[]={4, 6, 9}; + }; + class RH_44mag_ball: BulletBase + { + AB_caliber=0.429; + AB_bulletLength=0.804; + AB_bulletMass=200; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.172}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={360, 390, 420}; + AB_barrelLengths[]={4, 7.5, 9}; + }; + class RH_357mag_ball: BulletBase + { + AB_caliber=0.357; + AB_bulletLength=0.541; + AB_bulletMass=125; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.148}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={490, 510, 535}; + AB_barrelLengths[]={4, 6, 9}; + }; + class RH_762x25: BulletBase + { + AB_caliber=0.310; + AB_bulletLength=0.5455; + AB_bulletMass=86; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.17}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={360, 380, 400}; + AB_barrelLengths[]={4, 6, 9}; + }; + class RH_9x18_Ball: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class RH_B_9x19_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class RH_B_22LR_SD: BulletBase + { + AB_caliber=0.223; + AB_bulletLength=0.45; + AB_bulletMass=38; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.111}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={330, 340, 360}; + AB_barrelLengths[]={4, 6, 9}; + }; + class RH_57x28mm: BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.495; + AB_bulletMass=28; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.144}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={550, 625, 720}; + AB_barrelLengths[]={4, 6, 10.35}; + }; + + class RH_B_6x35: BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.445; + AB_bulletMass=65; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.26}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={730, 750, 760}; + AB_barrelLengths[]={8, 10, 12}; + }; + + class RH_556x45_B_Mk262 : B_556x45_Ball + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=77; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.361}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={624, 816, 832, 838}; + AB_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + + class HLC_556NATO_SOST: BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=62; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.307}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={780, 886, 950}; + AB_barrelLengths[]={10, 15.5, 20}; + }; + class HLC_556NATO_SPR: BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=77; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.361}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={624, 816, 832, 838}; + AB_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class HLC_300Blackout_Ball: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.118; + AB_bulletMass=147; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.398}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={559, 609, 625}; + AB_barrelLengths[]={6, 16, 20}; + }; + class HLC_300Blackout_SMK: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.489; + AB_bulletMass=220; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.608}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={300, 320, 340}; + AB_barrelLengths[]={9, 16, 20}; + }; + class HLC_762x51_BTSub: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.340; + AB_bulletMass=200; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.235}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={305, 325, 335, 340}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x54_ball: BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=152; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.4}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={700, 800, 820, 833}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_762x54_tracer: BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class HLC_303Brit_B: BulletBase + { + AB_caliber=0.311; + AB_bulletLength=1.227; + AB_bulletMass=174; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.499, 0.493, 0.48}; + AB_velocityBoundaries[]={671, 549}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={748, 761, 765}; + AB_barrelLengths[]={20, 24, 26}; + }; + class HLC_792x57_Ball: BulletBase + { + AB_caliber=0.318; + AB_bulletLength=1.128; + AB_bulletMass=196; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.315}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={785, 800, 815}; + AB_barrelLengths[]={20, 23.62, 26}; + }; + class FH_545x39_Ball: BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=52.9; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={780, 880, 920}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class FH_545x39_7u1: FH_545x39_Ball + { + AB_bulletMass=80; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_muzzleVelocities[]={260, 303, 320}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class HLC_9x19_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class HLC_9x19_GoldDot: HLC_9x19_Ball + { + AB_muzzleVelocities[]={350, 380, 420}; + }; + class HLC_9x19_Subsonic: HLC_9x19_Ball + { + AB_muzzleVelocities[]={300, 320, 340}; + }; + class HLC_10mm_FMJ: HLC_9x19_Ball + { + AB_caliber=0.5; + AB_bulletLength=0.764; + AB_bulletMass=165; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.189}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={360, 400, 430}; + AB_barrelLengths[]={4, 4.61, 9}; + }; + class HLC_9x19_M882_SMG: HLC_9x19_Ball + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + + class M_mas_545x39_Ball_7N6M : BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=52.9; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={780, 880, 920}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class M_mas_545x39_Ball_7T3M : BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class B_mas_556x45_Ball_Mk262 : B_556x45_Ball + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=77; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.361}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={624, 816, 832, 838}; + AB_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class B_mas_9x18_Ball_57N181S : BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class B_mas_9x21p_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class B_mas_9x21_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class B_mas_9x21d_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={210, 250, 285}; + AB_barrelLengths[]={4, 5, 9}; + }; + class B_mas_765x17_Ball: BulletBase + { + AB_caliber=0.3125; + AB_bulletLength=0.610; + AB_bulletMass=65; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.118}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={282, 300, 320}; + AB_barrelLengths[]={4, 5, 9}; + }; + class B_mas_762x39_Ball: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=123; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class B_mas_762x39_Ball_T: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=117; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class B_mas_762x51_Ball_M118LR : B_762x51_Ball + { + AB_caliber=0.308; + AB_bulletLength=1.24; + AB_bulletMass=175; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + AB_velocityBoundaries[]={853, 549, 549, 549}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={750, 780, 790, 794}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class B_mas_762x54_Ball : BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=152; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.4}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={700, 800, 820, 833}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class B_mas_762x54_Ball_T : BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class BWA3_B_762x51_Ball_LR : BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.24; + AB_bulletMass=175; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + AB_velocityBoundaries[]={853, 549, 549, 549}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={750, 780, 790, 794}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class BWA3_B_762x51_Ball_SD : BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.24; + AB_bulletMass=175; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={300, 340}; + AB_barrelLengths[]={16, 24}; + }; + + class BWA3_B_46x30_Ball : BulletBase + { + AB_caliber=0.193; + AB_bulletLength=0.512; + AB_bulletMass=31; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.1455}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 720, 730, 740}; + AB_barrelLengths[]={4, 7, 9, 12}; + }; + + class Trixie_338_Ball : BulletBase + { + AB_caliber=0.338; + AB_bulletLength=1.70; + AB_bulletMass=300; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.381}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={820, 826, 830}; + AB_barrelLengths[]={24, 26.5, 28}; + }; + class Trixie_303_Ball : BulletBase + { + AB_caliber=0.311; + AB_bulletLength=1.227; + AB_bulletMass=174; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.499, 0.493, 0.48}; + AB_velocityBoundaries[]={671, 549}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={748, 761, 765}; + AB_barrelLengths[]={20, 24, 26}; + }; + + class rhs_ammo_556x45_Mk318_Ball : BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=62; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.307}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={780, 886, 950}; + AB_barrelLengths[]={10, 15.5, 20}; + }; + class rhs_ammo_556x45_Mk262_Ball : BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=77; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.361}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={624, 816, 832, 838}; + AB_barrelLengths[]={7.5, 14.5, 18, 20}; + }; + class rhsammo_762x51_Ball : BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class rhs_B_545x39_Ball : BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=52.9; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={780, 880, 920}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_545x39_Ball_Tracer_Green : BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_762x54_Ball : BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=152; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.4}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={700, 800, 820, 833}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x54_Ball_Tracer_Green : BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class rhs_B_762x39_Ball : BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=123; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class rhs_B_762x39_Tracer : BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=117; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + + class R3F_9x19_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class R3F_556x45_Ball: BulletBase + { + AB_caliber=0.224; + AB_bulletLength=0.906; + AB_bulletMass=62; + AB_ammoTempMuzzleVelocityShifts[]={-27.20, -26.44, -23.76, -21.00, -17.54, -13.10, -7.95, -1.62, 6.24, 15.48, 27.75}; + AB_ballisticCoefficients[]={0.151}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={723, 764, 796, 825, 843, 866, 878, 892, 906, 915, 922, 900}; + AB_barrelLengths[]={8.3, 9.4, 10.6, 11.8, 13.0, 14.2, 15.4, 16.5, 17.7, 18.9, 20.0, 24.0}; + }; + class R3F_762x51_Ball: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class R3F_762x51_Ball2: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.24; + AB_bulletMass=175; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.505, 0.496, 0.485, 0.485, 0.485}; + AB_velocityBoundaries[]={853, 549, 549, 549}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={750, 780, 790, 794}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class R3F_127x99_Ball: BulletBase + { + AB_caliber=0.510; + AB_bulletLength=2.310; + AB_bulletMass=647; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.670}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={853}; + AB_barrelLengths[]={29}; + }; + class R3F_127x99_Ball2: BulletBase + { + AB_caliber=0.510; + AB_bulletLength=2.310; + AB_bulletMass=647; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.670}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={853}; + AB_barrelLengths[]={29}; + }; + + class CUP_B_545x39_Ball: BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=52.9; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={780, 880, 920}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Green: BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Red: BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_White: BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_545x39_Ball_Tracer_Yellow: BulletBase + { + AB_caliber=0.220; + AB_bulletLength=0.85; + AB_bulletMass=49.8; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.168}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=7; + AB_muzzleVelocities[]={785, 883, 925}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x39_Ball: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=123; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x39_Ball_Tracer_Green: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=117; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class B_762x39mm_KLT: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=123; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={650, 716, 750}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_9x18_Ball: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Green: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Red: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_Tracer_Yellow: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x18_Ball_White_Tracer: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 350}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_9x19_Ball: BulletBase + { + AB_caliber=0.355; + AB_bulletLength=0.610; + AB_bulletMass=124; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.165}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={340, 370, 400}; + AB_barrelLengths[]={4, 5, 9}; + }; + class CUP_B_762x51_noTracer: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Red_Tracer_3RndBurst: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_White_Tracer_3RndBurst: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_303_Ball: BulletBase + { + AB_caliber=0.311; + AB_bulletLength=1.227; + AB_bulletMass=174; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.499, 0.493, 0.48}; + AB_velocityBoundaries[]={671, 549}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={748, 761, 765}; + AB_barrelLengths[]={20, 24, 26}; + }; + class CUP_B_127x107_Ball_Green_Tracer: BulletBase + { + AB_caliber=0.511; + AB_bulletLength=2.520; + AB_bulletMass=745; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.63}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={820}; + AB_barrelLengths[]={28.7}; + }; + class CUP_B_127x108_Ball_Green_Tracer: BulletBase + { + AB_caliber=0.511; + AB_bulletLength=2.520; + AB_bulletMass=745; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.63}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={820}; + AB_barrelLengths[]={28.7}; + }; + class CUP_B_762x54_Ball_White_Tracer: BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Red_Tracer: BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Green_Tracer: BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_762x54_Ball_Yellow_Tracer: BulletBase + { + AB_caliber=0.312; + AB_bulletLength=1.14; + AB_bulletMass=149; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.395}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={680, 750, 798, 800}; + AB_barrelLengths[]={16, 20, 24, 26}; + }; + class CUP_B_9x39_SP5: BulletBase + { + AB_caliber=0.364; + AB_bulletLength=1.24; + AB_bulletMass=250; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.275}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=1; + AB_muzzleVelocities[]={280, 300, 320}; + AB_barrelLengths[]={10, 16.3, 20}; + }; + class CUP_B_762x51_Tracer_Green: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_Red: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_Yellow: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class CUP_B_762x51_Tracer_White: BulletBase + { + AB_caliber=0.308; + AB_bulletLength=1.14; + AB_bulletMass=146; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.2}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={700, 800, 820, 833, 845}; + AB_barrelLengths[]={10, 16, 20, 24, 26}; + }; + class B_127x107_Ball: BulletBase + { + AB_caliber=0.511; + AB_bulletLength=2.520; + AB_bulletMass=745; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.63}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={820}; + AB_barrelLengths[]={28.7}; + }; + class CUP_B_9x18_SD: BulletBase + { + AB_caliber=0.365; + AB_bulletLength=0.610; + AB_bulletMass=92.6; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.125}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={298, 330, 340}; + AB_barrelLengths[]={3.8, 5, 9}; + }; + class CUP_B_765x17_Ball: BulletBase + { + AB_caliber=0.3125; + AB_bulletLength=0.610; + AB_bulletMass=65; + AB_ammoTempMuzzleVelocityShifts[]={-2.655, -2.547, -2.285, -2.012, -1.698, -1.280, -0.764, -0.153, 0.596, 1.517, 2.619}; + AB_ballisticCoefficients[]={0.118}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={282, 300, 320}; + AB_barrelLengths[]={4, 5, 9}; + }; + class CUP_B_145x115_AP_Green_Tracer: BulletBase + { + AB_caliber=0.586; + AB_bulletLength=2.00; + AB_bulletMass=1010; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.620}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={1000}; + AB_barrelLengths[]={53}; + }; + class CUP_B_127x99_Ball_White_Tracer: BulletBase + { + AB_caliber=0.510; + AB_bulletLength=2.310; + AB_bulletMass=647; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.670}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ASM"; + AB_dragModel=1; + AB_muzzleVelocities[]={853}; + AB_barrelLengths[]={29}; + }; + class CUP_B_86x70_Ball_noTracer: BulletBase + { + AB_caliber=0.338; + AB_bulletLength=1.70; + AB_bulletMass=300; + AB_ammoTempMuzzleVelocityShifts[]={-26.55, -25.47, -22.85, -20.12, -16.98, -12.80, -7.64, -1.53, 5.96, 15.17, 26.19}; + AB_ballisticCoefficients[]={0.381}; + AB_velocityBoundaries[]={}; + AB_standardAtmosphere="ICAO"; + AB_dragModel=7; + AB_muzzleVelocities[]={820, 826, 830}; + AB_barrelLengths[]={24, 26.5, 28}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgFunctions.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgFunctions.h new file mode 100644 index 0000000000..c35241da53 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgFunctions.h @@ -0,0 +1,30 @@ +class cfgFunctions { + class cse_AB_ballistics + { + class advancedBallistics { + file = "cse\cse_sys_ballistics\advancedBallistics\functions"; + class adjust_parallax { recompile = 1; }; + class adjust_turret { recompile = 1; }; + class advanced_ballistics { recompile = 1; }; + class advanced_ballistics_extension { recompile = 1; }; + class ammo_temperature_muzzle_velocity { recompile = 1; }; + class apply_turret_adjustments { recompile = 1; }; + class barrel_length_muzzle_velocity { recompile = 1; }; + class calculate_air_density { recompile = 1; }; + class calculate_atmospheric_correction { recompile = 1; }; + class calculate_hellmann_exponent { recompile = 1; }; + class calculate_retardation { recompile = 1; }; + class calculate_roughness_length { recompile = 1; }; + class calculate_stability_factor { recompile = 1; }; + class calculate_wind_speed { recompile = 1; }; + class climate_simulation { recompile = 1; }; + class display_protractor { recompile = 1; }; + class display_wind_info { recompile = 1; }; + class get_humidity_at_height { recompile = 1; }; + class get_temperature_at_height { recompile = 1; }; + class initialize_terrain_extension { recompile = 1; }; + class mirage_simulation { recompile = 1; }; + class synchronize_scope_zero { recompile = 1; }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgMagazines.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgMagazines.h new file mode 100644 index 0000000000..b1383e2d79 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgMagazines.h @@ -0,0 +1,165 @@ +class CfgMagazines +{ + class 7Rnd_408_Mag; + class 16Rnd_9x21_Mag; + class 30Rnd_556x45_Stanag; + class 30Rnd_556x45_Stanag_Tracer_Red; + class 200Rnd_65x39_cased_Box; + class 200Rnd_65x39_cased_Box_Tracer; + class 10Rnd_762x51_Mag; + class 20Rnd_762x51_Mag; + class 100Rnd_127x99_mag; + class 8Rnd_mas_9x18_Mag: 16Rnd_9x21_Mag + { + ammo="B_mas_9x18_Ball_57N181S"; + count=8; + displayName="8rnd 9mm Mag"; + picture="\A3\weapons_f\data\ui\M_16Rnd_9x21_CA.paa"; + descriptionshort="Caliber: 9x18 mm Makarov
Rounds: 8
Used in: Makarov"; + }; + class 64Rnd_mas_9x18_mag: 30Rnd_556x45_Stanag + { + ammo="B_mas_9x18_Ball_57N181S"; + count=64; + displayName="64rnds 9x18 Bizon"; + picture="\mas_us_rifle\ui\m_bizon_ca.paa"; + descriptionshort="Caliber: 9x18 mm cal
Rounds: 64
Used in: Bizon"; + }; + class 30Rnd_mas_545x39_mag: 30Rnd_556x45_Stanag + { + ammo="M_mas_545x39_Ball_7N6M"; + count=30; + descriptionshort="Caliber: 5.45x39 mm
Rounds: 30
Used in: AK74M,AKS74,AKSU"; + displayname="30rnd 5.45mm Mag"; + }; + class 30Rnd_mas_545x39_T_mag: 30Rnd_556x45_Stanag_Tracer_Red + { + ammo="M_mas_545x39_Ball_7T3M"; + count=30; + descriptionshort="Caliber: 5.45x39 mm Tracer
Rounds: 30
Used in: AK74M,AKS74,AKSU"; + displayname="30rnd 5.45mm Mag(Tracer)"; + }; + class 100Rnd_mas_545x39_mag: 200Rnd_65x39_cased_Box + { + ammo="M_mas_545x39_Ball_7N6M"; + count=100; + descriptionshort="Caliber: 5.45x39 mm
Rounds: 100
Used in: RPK74"; + displayname="100rnd 5.45mm Drum"; + mass=25; + }; + class 100Rnd_mas_545x39_T_mag: 200Rnd_65x39_cased_Box_Tracer + { + ammo="M_mas_545x39_Ball_7T3M"; + count=100; + descriptionshort="Caliber: 5.45x39 mm Tracer
Rounds: 100
Used in: RPK74"; + displayname="100rnd 5.45mm Drum(Tracer)"; + mass=25; + }; + class 30Rnd_mas_556x45_Mk262_Stanag: 30Rnd_556x45_Stanag + { + ammo="B_mas_556x45_Ball_Mk262"; + count=30; + descriptionshort="Caliber: 5.56x45 mm STANAG Mk262
Rounds: 30
Used in: M4,HK416,M16,SCAR-L"; + displayname="30rnd 5.56mm STANAG(Mk262)"; + }; + class 20Rnd_mas_762x51_M118LR_Stanag: 30Rnd_556x45_Stanag + { + ammo="B_mas_762x51_Ball_M118LR"; + count=20; + descriptionshort="Caliber: 7.62x51 mm STANAG M118LR
Rounds: 20
Used in: HK417,SR25,SCAR-H,EBR"; + displayname="20rnd 7.62mm Mag(M118LR)"; + picture="\A3\weapons_f\data\UI\M_20Rnd_762x51_CA.paa"; + }; + class 5Rnd_mas_762x51_M118LR_Stanag: 30Rnd_556x45_Stanag + { + ammo="B_mas_762x51_Ball_M118LR"; + count=5; + descriptionshort="Caliber: 7.62x51 mm STANAG M118LR
Rounds: 5
Used in: M24"; + displayname="5rnd 7.62mm Mag(M118LR)"; + picture="\A3\weapons_f\data\UI\m_M24_CA.paa"; + }; + + class Trixie_30x556_Mk262_Mag: 30Rnd_556x45_Stanag + { + scope=2; + author="Trixie"; + count=30; + descriptionshort="Caliber: 5.56x45mm
Rounds: 30
Used in: Mk12 SPR"; + displayname="30Rnd Mk262 5.56x45mm"; + ammo="cse_AB_556x45_Ball_Mk262"; + lastroundstracer=0; + tracersevery=0; + }; + class Trixie_20x762_M118LR_Mag: 20Rnd_762x51_Mag + { + scope=2; + author="Trixie"; + count=20; + descriptionshort="Caliber: 7.62x51mm
Rounds: 20
Used in: M110 SASS"; + displayname="20Rnd 7.62x51mm M118LR"; + ammo="cse_AB_762x51_Ball_M118LR"; + picture="\Trixie_recon\UI\20x762_mag.paa"; + lastroundstracer=0; + tracersevery=0; + }; + class Trixie_10x762_M118LR_Mag: 10Rnd_762x51_Mag + { + scope=2; + author="Trixie"; + count=10; + descriptionshort="Caliber: 7.62x51mm
Rounds: 10
Used in: CZ750"; + displayname="10Rnd 7.62x51mm M118LR"; + ammo="cse_AB_762x51_Ball_M118LR"; + picture="\Trixie_recon\UI\5x762_mag.paa"; + lastroundstracer=0; + tracersevery=0; + }; + class Trixie_5x762_M118LR_Mag: 10Rnd_762x51_Mag + { + scope=2; + author="Trixie"; + count=5; + descriptionshort="Caliber: 7.62x51mm
Rounds: 5
Used in: M40A3"; + displayname="5Rnd 7.62x51mm M118LR"; + ammo="cse_AB_762x51_Ball_M118LR"; + picture="\Trixie_recon\UI\5x762_mag.paa"; + lastroundstracer=0; + tracersevery=0; + }; + class Trixie_10x127_Mag: 100Rnd_127x99_mag + { + scope=2; + author="Trixie"; + count=10; + descriptionshort="Caliber: 12.7x99mm
Rounds: 10
Used in: Barret M107"; + displayname="10Rnd 12.7x99mm"; + ammo="B_127x99_Ball"; + picture="\Trixie_recon\UI\50BMGx10_mag.paa"; + lastroundstracer=0; + tracersevery=0; + }; + class Trixie_10x105_Mag: 100Rnd_127x99_mag + { + scope=2; + author="Trixie"; + count=10; + descriptionshort="Caliber: .416 Barrett
Rounds: 10
Used in: Barret M107"; + displayname="10Rnd 10.5x83mm"; + ammo="AB_106x83mm_Ball"; + picture="\Trixie_recon\UI\50BMGx10_mag.paa"; + lastroundstracer=0; + tracersevery=0; + }; + class Trixie_10x127_Amax_Mag: 100Rnd_127x99_mag + { + scope=2; + author="Trixie"; + count=10; + descriptionshort="Caliber: .50 BMG 750 gr A-MAX
Rounds: 10
Used in: Barret M107"; + displayname="10Rnd 12.7x99mm A-MAX"; + ammo="AB_127x99_Ball_AMAX"; + picture="\Trixie_recon\UI\50BMGx10_mag.paa"; + lastroundstracer=0; + tracersevery=0; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgSounds.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgSounds.h new file mode 100644 index 0000000000..d6c62fc98c --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgSounds.h @@ -0,0 +1,9 @@ +class CfgSounds +{ + class cse_AB_scope_click + { + name="cse_AB_scope_click"; + sound[]={"cse\cse_sys_ballistics\advancedballistics\sound\scope_click.wav",1,1}; + titles[]={}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgVehicles.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgVehicles.h new file mode 100644 index 0000000000..9118494399 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgVehicles.h @@ -0,0 +1,167 @@ +class CfgVehicles { + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class cse_AB_moduleAdvancedBallistics: Module_F { + scope = 2; + displayName = "Advanced Ballistics [CSE]"; + icon = "\cse\cse_main\data\cse_backblast_module.paa"; + category = "cseModules"; + function = "cse_fnc_initalizeModule_F"; + author = "Ruthberg"; + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + class Arguments { + + class FORCE_CLIENT_SETTINGS_OVERRIDE { + displayName = "Force Client Settings override"; + description = "Force Client Settings override"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class WIND_ENABLED { + displayName = "Wind drift"; + description = "Add wind drift"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class SPIN_DRIFT_ENABLED { + displayName = "Spin drift"; + description = "add spin drift"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class CORIOLIS_ENABLED { + displayName = "Horizontal Coriolis drift"; + description = "Horizontal Coriolis drift"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class EOETVOES_ENABLED { + displayName = "Vertical Coriolis drift"; + description = "Vertical Coriolis drift"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class ADVANCED_AIR_DRAG_ENABLED { + displayName = "Advanced air drag"; + description = "Enabled the advanced air drag model (only availible with compatible 3rd party ammunition)"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class ATMOSPHERIC_DENSITY_SIMULATION_ENABLED { + displayName = "Ambient air density "; + description = "The bullets ability to cut through air becomes affected by the ambient air density"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class TRANSONIC_REGION_ENABLED { + displayName = "Dispersion beyond supersonic"; + description = "Adds dispersion beyond supersonic flight of rifle bullets"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class MIL_TURRETS_ENABLED { + displayName = "Zero scope in 1/10 mil"; + description = "Adds the ability to zero your scope in 1/10 Mil steps"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class AMMO_TEMPERATURE_ENABLED { + displayName = "Ammo temperature"; + description = "Muzzle velocity changes with ammo temperature"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class DISABLED_IN_FULL_AUTO_MODE { + displayName = "Disabled during full auto"; + description = "Disables the advanced ballistics during full auto fire"; + typeName = "BOOL"; + defaultValue = 0; + }; + + class BULLET_TRACE_ENABLED { + displayName = "Bullet trace effect"; + description = "Adds a bullet trace effect to high caliber bullets"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class MIRAGE_ENABLED { + displayName = "Mirage and scope parallax"; + description = "Adds mirage and scope parallax adjustment"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class BARREL_LENGTH_INFLUENCE { + displayName = "Barrel length dependent"; + description = "Enables barrel length dependent muzzle velocity"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class VEHICLE_GUNNER_ENABLED { + displayName = "Vehicle Gunners"; + description = "Enables the advanced ballistics for rounds fired as vehicle gunner"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class EXTENSIONS_ENABLED { + displayName = "Extension allowed"; + description = "Allows the use of the DLL extension"; + typeName = "BOOL"; + defaultValue = 1; + }; + + class INIT_MESSAGE_ENABLED { + displayName = "Initialization message"; + description = "Prints a system chat message once the terrain initialization is finished"; + typeName = "BOOL"; + defaultValue = 0; + }; + + class ONLY_ACTIVE_FOR_LOCAL_PLAYER { + displayName = "Local only"; + description = "Disables the advanced ballistics for bullets coming from other players"; + typeName = "BOOL"; + defaultValue = 0; + }; + + class ONLY_ACTIVE_FOR_PLAYER_GROUP { + displayName = "Group only"; + description = "Disables the advanced ballistics for bullets coming from players in other groups"; + typeName = "BOOL"; + defaultValue = 0; + }; + + class DISABLED_BY_DEFAULT { + displayName = "Disabled by default"; + description = "Allows you to enable the advanced ballistics selectively in the unit initialization"; + typeName = "BOOL"; + defaultValue = 0; + }; + + class PRECISION { + displayName = "Calculation precision"; + description = "Allows to reduces the calculation precision to avoid frame drops (1 - maximum precision, 2 - medium precision, 3 - minimal precision)"; + typeName = "NUMBER"; + defaultValue = 1; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgWeapons.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgWeapons.h new file mode 100644 index 0000000000..c7c976f3c4 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/CfgWeapons.h @@ -0,0 +1,1598 @@ +class CfgWeapons +{ + class MGun; + class MGunCore; + class Pistol_Base_F; + class Rifle_Base_F; + class Rifle_Long_Base_F; + class hgun_P07_F + { + AB_barrelTwist=10; + AB_barrelLength=4; + }; + class hgun_Rook40_F + { + AB_barrelTwist=10; + AB_barrelLength=4.4; + }; + class hgun_Pistol_heavy_01_F + { + AB_barrelTwist=16; + AB_barrelLength=4.5; + }; + class hgun_Pistol_heavy_02_F + { + AB_barrelTwist=16; + AB_barrelLength=3; + }; + class hgun_ACPC2_F + { + AB_barrelTwist=16; + AB_barrelLength=5; + }; + class hgun_PDW2000_F + { + AB_barrelTwist=9; + AB_barrelLength=7; + }; + class arifle_Katiba_F + { + AB_barrelTwist=8; + AB_barrelLength=228.7; + }; + class arifle_Katiba_C_F + { + AB_barrelTwist=8; + AB_barrelLength=26.8; + }; + class arifle_Katiba_GL_F + { + AB_barrelTwist=8; + AB_barrelLength=28.7; + }; + class arifle_MX_F + { + AB_barrelTwist=9; + AB_barrelLength=14.5; + }; + class arifle_MX_GL_F + { + AB_barrelTwist=9; + AB_barrelLength=14.5; + }; + class arifle_MX_SW_F + { + AB_barrelTwist=9; + AB_barrelLength=16.0; + }; + class arifle_MXC_F + { + AB_barrelTwist=8; + AB_barrelLength=10.5; + }; + class arifle_MXM_F + { + AB_barrelTwist=9; + AB_barrelLength=18; + }; + class arifle_SDAR_F + { + AB_barrelTwist=11.25; + AB_barrelLength=18; + }; + class SMG_02_F + { + AB_barrelTwist=10; + AB_barrelLength=7.7; + }; + class arifle_TRG20_F + { + AB_barrelTwist=7; + AB_barrelLength=15; + }; + class arifle_TRG21_F + { + AB_barrelTwist=7; + AB_barrelLength=18.1; + }; + class LMG_Zafir_F + { + AB_barrelTwist=12; + AB_barrelLength=18.1; + }; + class arifle_Mk20_F + { + AB_barrelTwist=7; + AB_barrelLength=17.4; + }; + class arifle_Mk20C_F + { + AB_barrelTwist=7; + AB_barrelLength=16; + }; + class arifle_Mk20_GL_F + { + AB_barrelTwist=7; + AB_barrelLength=16; + }; + class SMG_01_F + { + AB_barrelTwist=16; + AB_barrelLength=5.5; + }; + class srifle_DMR_01_F + { + AB_barrelTwist=9.5; + AB_barrelLength=24; + }; + class srifle_EBR_F + { + AB_barrelTwist=12; + AB_barrelLength=24; + }; + class LMG_Mk200_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class srifle_LRR_F + { + AB_barrelTwist=13; + AB_barrelLength=29; + }; + class srifle_GM6_F + { + AB_barrelTwist=15; + AB_barrelLength=43.3; + }; + class HMG_M2 + { + AB_barrelTwist=12; + AB_barrelLength=45; + }; + + class RH_deagle : Pistol_Base_F + { + AB_barrelTwist=19; + AB_barrelLength=6; + }; + class RH_sw659 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=7.44; + }; + class RH_usp : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4.41; + }; + class RH_uspm : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=6; + }; + class RH_mak : Pistol_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=3.68; + }; + class RH_m1911 : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=5; + }; + class RH_kimber : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=5; + }; + class RH_m9 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.9; + }; + class RH_vz61 : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4.5; + }; + class RH_tec9 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=5; + }; + class RH_muzi : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=5; + }; + class RH_g18 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.49; + }; + class RH_g17 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.49; + }; + class RH_tt33 : Pistol_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=4.6; + }; + class RH_mk2 : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4; + }; + class RH_p226 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.4; + }; + class RH_g19 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4; + }; + class RH_gsh18 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.1; + }; + class RH_mateba : Pistol_Base_F + { + AB_barrelTwist=14; + AB_barrelLength=6; + }; + class RH_python : Pistol_Base_F + { + AB_barrelTwist=14; + AB_barrelLength=6; + }; + class RH_bull : Pistol_Base_F + { + AB_barrelTwist=24; + AB_barrelLength=6.5; + }; + class RH_ttracker : Pistol_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=4; + }; + class RH_mp412 : Pistol_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=6; + }; + class RH_fnp45 : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4.5; + }; + class RH_fn57 : Pistol_Base_F + { + AB_barrelTwist=9.1; + AB_barrelLength=4.8; + }; + class RH_vp70 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.6; + }; + class RH_cz75 : Pistol_Base_F + { + AB_barrelTwist=9.7; + AB_barrelLength=4.7; + }; + + class RH_PDW : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=10; + }; + + class RH_ar10 : Rifle_Base_F + { + AB_barrelTwist=11.25; + AB_barrelLength=20.8; + }; + class RH_m4 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class RH_M4sbr : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=9; + }; + class RH_M16a1 : Rifle_Base_F + { + AB_barrelTwist=14; + AB_barrelLength=20; + }; + class RH_M16A2 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class RH_M16A3 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class RH_M16A4 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class RH_Mk12mod1 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + }; + class RH_SAMR : Rifle_Base_F + { + AB_barrelTwist=7.7; + AB_barrelLength=20; + }; + + class hlc_rifle_ak74 : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.3; + }; + class hlc_rifle_aks74u : Rifle_Base_F + { + AB_barrelTwist=6.3; + AB_barrelLength=8.3; + }; + class hlc_rifle_ak47 : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=16.3; + }; + class hlc_rifle_akm : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.3; + }; + class hlc_rifle_rpk : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=23.2; + }; + class hlc_rifle_aek971 : Rifle_Base_F + { + AB_barrelTwist=9.5; + AB_barrelLength=17; + }; + class hlc_rifle_saiga12k : Rifle_Base_F + { + AB_barrelTwist=0; + cse_AB_twistDirection=0; + AB_barrelLength=16.9; + }; + class hlc_ar15_base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=11.5; + }; + class hlc_rifle_bcmjack : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class hlc_rifle_Bushmaster300 : Rifle_Base_F + { + AB_barrelTwist=8; + AB_barrelLength=16; + }; + class hlc_rifle_SAMR : Rifle_Base_F + { + AB_barrelTwist=9; + AB_barrelLength=16; + }; + class hlc_rifle_honeybase : Rifle_Base_F + { + AB_barrelTwist=8; + AB_barrelLength=6; + }; + class hlc_rifle_SLRchopmod : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + class hlc_rifle_LAR : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + class hlc_rifle_c1A1 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21.7; + }; + class hlc_rifle_FAL5061 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=18; + }; + class hlc_rifle_STG58F : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + class hlc_rifle_SLR : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21.7; + }; + class hlc_rifle_falosw : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=13; + }; + class hlc_rifle_psg1 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=25.6; + }; + class hlc_rifle_g3sg1 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=17.7; + }; + class hlc_rifle_hk51 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=8.31; + }; + class hlc_rifle_hk53 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=8.31; + }; + class hlc_rifle_g3a3 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=17.7; + }; + class hlc_M14_base : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22; + }; + class hlc_rifle_m14sopmod : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=18; + }; + class hlc_lmg_M60E4 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=17; + }; + class hlc_lmg_m60 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22; + }; + + class hlc_smg_mp5k_PDW : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=4.5; + }; + class hlc_smg_mp5a2 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + class hlc_smg_mp5a4 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + class hlc_smg_mp5n : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + class hlc_smg_mp5sd5 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=5.7; + }; + class hlc_smg_mp5sd6 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=5.7; + }; + class hlc_smg_9mmar : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + class hlc_smg_mp510 : Rifle_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=8.9; + }; + class hlc_smg_mp5a3 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + + class hgun_mas_usp_F: Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4.41; + }; + class hgun_mas_m23_F: Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=5.87; + }; + class hgun_mas_acp_F: Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=5.03; + }; + class hgun_mas_m9_F: Pistol_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=4.9; + }; + class hgun_mas_bhp_F: Pistol_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=4.7; + }; + class hgun_mas_glock_F: Pistol_Base_F + { + AB_barrelTwist=9.84; + AB_barrelLength=4.48; + }; + class hgun_mas_glocksf_F: Pistol_Base_F + { + AB_barrelTwist=15.75; + AB_barrelLength=4.60; + }; + class hgun_mas_grach_F: Pistol_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=4.4; + }; + class hgun_mas_mak_F: Pistol_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=3.68; + }; + class hgun_mas_sa61_F: Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4.5; + }; + class hgun_mas_uzi_F: Pistol_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=5.28; + }; + class arifle_mas_mk16 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=13.8; + }; + class arifle_mas_mk16_l : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + }; + class arifle_mas_mk17 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=16; + }; + class srifle_mas_m110 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=20; + magazines[]= + { + "20Rnd_mas_762x51_M118LR_Stanag", + "20Rnd_mas_762x51_Stanag", + "20Rnd_mas_762x51_T_Stanag", + "20Rnd_762x51_Mag" + }; + }; + class arifle_mas_ak_74m : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.34; + }; + class arifle_mas_ak_74m_gl : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.34; + }; + class srifle_mas_svd : Rifle_Base_F + { + AB_barrelTwist=9.4; + AB_barrelLength=24.4; + }; + class srifle_mas_m91 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=29; + }; + class srifle_mas_ksvk : Rifle_Base_F + { + AB_barrelTwist=18; + AB_barrelLength=39.37; + }; + class LMG_mas_rpk_F : Rifle_Base_F + { + AB_barrelTwist=7.68; + AB_barrelLength=23.2; + }; + class LMG_mas_pkm_F : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=25.4; + }; + class arifle_mas_aks74u : Rifle_Base_F + { + AB_barrelTwist=6.3; + AB_barrelLength=8.3; + }; + class arifle_mas_bizon : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=9.1; + }; + class arifle_mas_saiga : Rifle_Base_F + { + AB_barrelTwist=0; + cse_AB_twistDirection=0; + AB_barrelLength=16.93; + }; + class arifle_mas_hk416 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class arifle_mas_hk416_gl : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class arifle_mas_hk416c : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=9.0; + }; + class arifle_mas_hk416_m203c : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=9.0; + }; + class arifle_mas_hk417c : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=13; + }; + class arifle_mas_m4 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class arifle_mas_m4c : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=10.3; + }; + class arifle_mas_l119 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=16; + }; + class arifle_mas_l119_gl : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=16; + }; + class arifle_mas_l119_m203 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=16; + }; + class arifle_mas_m16 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class arifle_mas_m16_gl : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class srifle_mas_hk417 : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=16.5; + }; + class srifle_mas_sr25 : Rifle_Base_F + { + AB_barrelTwist=11.25; + AB_barrelLength=24; + magazines[]= + { + "20Rnd_mas_762x51_M118LR_Stanag", + "20Rnd_mas_762x51_Stanag", + "20Rnd_mas_762x51_T_Stanag", + "20Rnd_762x51_Mag" + }; + }; + class srifle_mas_ebr : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=18; + magazines[]= + { + "20Rnd_mas_762x51_M118LR_Stanag", + "20Rnd_mas_762x51_Stanag", + "20Rnd_mas_762x51_T_Stanag", + "20Rnd_762x51_Mag" + }; + }; + class srifle_mas_m24 : Rifle_Base_F + { + AB_barrelTwist=11.25; + AB_barrelLength=24; + magazines[]= + { + "5Rnd_mas_762x51_M118LR_Stanag", + "5Rnd_mas_762x51_Stanag", + "5Rnd_mas_762x51_T_Stanag" + }; + }; + class arifle_mas_mp5 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + class arifle_mas_mp5sd : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=5.7; + }; + class srifle_mas_m107 : Rifle_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + class LMG_mas_M249_F : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=16.3; + }; + class LMG_mas_M249a_F : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + }; + class LMG_mas_mk48_F : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=19.75; + }; + class LMG_mas_m240_F : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24.8; + }; + class LMG_mas_mg3_F : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22.2; + }; + class arifle_mas_g3 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=17.7; + }; + class arifle_mas_g3_m203 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=17.7; + }; + class arifle_mas_fal : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + class arifle_mas_fal_m203 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + class arifle_mas_m1014 : Rifle_Base_F + { + AB_barrelTwist=0; + cse_AB_twistDirection=0; + AB_barrelLength=18.5; + }; + + class BWA3_P8 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.25; + }; + class BWA3_MP7 : Pistol_Base_F + { + AB_barrelTwist=6.3; + AB_barrelLength=7.1; + }; + class BWA3_G36 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18.9; + }; + class BWA3_G36K : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class BWA3_G28_Standard : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=16.5; + }; + class BWA3_G27 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=16; + }; + class BWA3_MG4 : Rifle_Long_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18.9; + }; + class BWA3_MG5 : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21.6; + }; + class BWA3_G82 : Rifle_Long_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + + class Trixie_L131A1 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.5; + }; + class Trixie_XM8_Carbine : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class Trixie_XM8_Compact : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=9; + }; + class Trixie_XM8_SAW : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class Trixie_XM8_SAW_NB : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class Trixie_XM8_DMR : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class Trixie_XM8_DMR_NB : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class L129A1_base : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=16; + }; + class Trixie_Enfield : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=25.2; + }; + class Trixie_CZ550_Rail : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=23.622; + }; + class Trixie_FNFAL_Rail : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + + class Trixie_M110 : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=20; + magazines[]= + { + "Trixie_20x762_M118LR_Mag", + "Trixie_20x762_Mag", + "Trixie_10x762_M118LR_Mag", + "Trixie_10x762_Mag" + }; + }; + class Trixie_MK12 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + magazines[]= + { + "Trixie_30x556_Mk262_Mag", + "30Rnd_556x45_Stanag", + "30Rnd_556x45_Stanag_Tracer_Red" + }; + }; + class Trixie_LM308MWS : Rifle_Base_F + { + AB_barrelTwist=11.25; + AB_barrelLength=16; + magazines[]= + { + "Trixie_20x762_M118LR_Mag", + "Trixie_20x762_Mag", + "Trixie_10x762_M118LR_Mag", + "Trixie_10x762_Mag" + }; + }; + class Trixie_M14DMR : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22; + magazines[]= + { + "Trixie_20x762_M118LR_Mag", + "Trixie_20x762_Mag" + }; + }; + class Trixie_M14DMR_NG_Black_Short : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=18; + }; + class Trixie_M14DMR_NG_Short : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=18; + }; + class Trixie_M14 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22; + }; + class Trixie_M40A3 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24; + magazines[]= + { + "Trixie_5x762_M118LR_Mag", + "Trixie_5x762_Mag" + }; + }; + class Trixie_CZ750 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=26; + magazines[]= + { + "Trixie_10x762_M118LR_Mag", + "Trixie_10x762_Mag" + }; + }; + class Trixie_M24 : Rifle_Base_F + { + AB_barrelTwist=11.25; + AB_barrelLength=24; + magazines[]= + { + "Trixie_5x762_M118LR_Mag", + "Trixie_5x762_Mag" + }; + }; + class Trixie_AWM338 : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=27; + }; + class Trixie_M107 : Rifle_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + class Trixie_AS50 : Rifle_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + class L110A1_base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=13.7; + }; + class Trixie_L86A2_base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=25.4; + }; + class Trixie_l85a2_base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20.4; + }; + class L7A2_base : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24.8; + }; + + class rhs_weap_pya : Pistol_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=4.4; + }; + class rhs_weap_pkp : Rifle_Long_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=25.9; + }; + class rhs_weap_pkm : Rifle_Long_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=25.4; + }; + class rhs_weap_rpk74m : Rifle_Long_Base_F + { + AB_barrelTwist=7.68; + AB_barrelLength=23.2; + }; + class rhs_weap_rpk74 : Rifle_Long_Base_F + { + AB_barrelTwist=7.68; + AB_barrelLength=23.2; + }; + class rhs_weap_ak74m : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.3; + }; + class rhs_weap_aks74u : Rifle_Base_F + { + AB_barrelTwist=6.3; + AB_barrelLength=8.3; + }; + class rhs_weap_akm : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.3; + }; + class rhs_weap_svd : Rifle_Base_F + { + AB_barrelTwist=9.4; + AB_barrelLength=24.4; + }; + class rhs_weap_svds : Rifle_Base_F + { + AB_barrelTwist=9.4; + AB_barrelLength=22.2; + }; + class rhs_weap_m4_Base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class rhs_weap_m16a4 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class rhs_weap_m16a4_carryhandle : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class rhs_weap_m16a4_grip : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class rhs_weap_m240B : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24.8; + }; + class rhs_weap_m249_pip : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=16.3; + }; + + class R3F_PAMAS : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.9; + }; + class R3F_Famas_F1: Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=19.2; + }; + class R3F_Famas_surb: Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=15.9; + }; + class R3F_Minimi: Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=13.7; + }; + class R3F_Minimi_762: Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=19.8; + }; + class R3F_FRF2: Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=25.59; + }; + class R3F_PGM_Hecate_II: Rifle_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=27.6; + }; + class R3F_HK417S_HG : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=12; + }; + class R3F_HK417M : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=16; + }; + class R3F_HK417L : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=20; + }; + class R3F_M107 : Rifle_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + class R3F_HK416M : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14; + }; + class R3F_MP5SD : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=5.7; + }; + + class CUP_hgun_Colt1911 : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=5; + }; + class CUP_sgun_AA12 : Rifle_Base_F + { + AB_barrelTwist=0; + AB_twistDirection=0; + AB_barrelLength=18; + }; + class CUP_arifle_AK_Base : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=16.3; + }; + class CUP_arifle_AK107_Base : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.3; + }; + class CUP_arifle_AKS_Base : Rifle_Base_F + { + AB_barrelTwist=7.87; + AB_barrelLength=16.3; + }; + class CUP_arifle_AKS74U : Rifle_Base_F + { + AB_barrelTwist=6.3; + AB_barrelLength=8.3; + }; + class CUP_arifle_RPK74 : Rifle_Long_Base_F + { + AB_barrelTwist=7.68; + AB_barrelLength=23.2; + }; + class CUP_srifle_AS50 : Rifle_Long_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + class CUP_srifle_AWM_Base : Rifle_Long_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=27; + }; + class CUP_smg_bizon : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=9.1; + }; + class CUP_hgun_Compact : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=3.74; + }; + class CUP_srifle_CZ750 : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=26; + }; + class CUP_arifle_CZ805_Base : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=14; + }; + class CUP_arifle_CZ805_A1 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=14; + }; + class CUP_arifle_CZ805_A2 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=10.9; + }; + class CUP_srifle_DMR : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22; + }; + class CUP_hgun_Duty : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=3.74; + }; + class CUP_arifle_FNFAL : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=21; + }; + class CUP_arifle_G36A : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18.9; + }; + class CUP_arifle_G36K : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class CUP_arifle_G36C : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=9; + }; + class CUP_arifle_MG36 : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18.9; + }; + class CUP_hgun_Glock17 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.49; + }; + class CUP_srifle_CZ550 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=23.622; + }; + class CUP_srifle_ksvk : Rifle_Long_Base_F + { + AB_barrelTwist=18; + AB_barrelLength=39.37; + }; + class CUP_lmg_L7A2 : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24.8; + }; + class CUP_arifle_L85A2_Base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20.4; + }; + class CUP_lmg_L110A1 : Rifle_Long_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=13.7; + }; + class CUP_srifle_LeeEnfield : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=25.2; + }; + class CUP_hgun_M9 : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=4.9; + }; + class CUP_srifle_M14 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=22; + }; + class CUP_arifle_M16_Base : Rifle_Base_F + { + AB_barrelTwist=14; + AB_barrelLength=20; + }; + class CUP_arifle_M4_Base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14.5; + }; + class CUP_srifle_Mk12SPR : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + }; + class CUP_srifle_M24_des : Rifle_Base_F + { + AB_barrelTwist=11.25; + AB_barrelLength=24; + }; + class CUP_lmg_M60A4 : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=17; + }; + class CUP_srifle_M107_Base : Rifle_Long_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=29; + }; + class CUP_srifle_M110 : Rifle_Base_F + { + AB_barrelTwist=11; + AB_barrelLength=20; + }; + class CUP_lmg_M240 : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24.8; + }; + class CUP_lmg_M249_para : Rifle_Long_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=16.3; + }; + class CUP_lmg_M249 : Rifle_Long_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + }; + class CUP_sgun_M1014 : Rifle_Base_F + { + AB_twistDirection=0; + AB_barrelTwist=0; + AB_barrelLength=18.5; + }; + class CUP_hgun_Makarov : Pistol_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=3.68; + }; + class CUP_hgun_MicroUzi : Pistol_Base_F + { + AB_barrelTwist=9.8; + AB_barrelLength=5; + }; + class CUP_lmg_Mk48_Base : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=19.75; + }; + class CUP_smg_MP5SD6 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=5.7; + }; + class CUP_smg_MP5A5 : Rifle_Base_F + { + AB_barrelTwist=10; + AB_barrelLength=8.9; + }; + class CUP_hgun_PB6P9 : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=4.1; + }; + class CUP_hgun_Phantom : Rifle_Base_F + { + AB_barrelTwist=9.7; + AB_barrelLength=4.7; + }; + class CUP_lmg_PKM : Rifle_Long_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=25.4; + }; + class CUP_lmg_Pecheneg : Rifle_Long_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=25.9; + }; + class CUP_hgun_TaurusTracker455 : Pistol_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=4; + }; + class CUP_arifle_Sa58P : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=15.4; + }; + class CUP_arifle_Sa58V : Rifle_Base_F + { + AB_barrelTwist=9.45; + AB_barrelLength=15.4; + }; + class CUP_hgun_SA61 : Pistol_Base_F + { + AB_barrelTwist=16; + AB_barrelLength=4.5; + }; + class CUP_sgun_Saiga12K: Rifle_Base_F + { + AB_barrelTwist=0; + AB_twistDirection=0; + AB_barrelLength=16.9; + } + class CUP_arifle_Mk16_CQC : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=10; + }; + class CUP_arifle_Mk16_STD : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=14; + }; + class CUP_arifle_Mk16_SV : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=18; + }; + class CUP_arifle_Mk17_CQC : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=13; + }; + class CUP_arifle_Mk17_STD : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=16; + }; + class CUP_arifle_Mk20 : Rifle_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=20; + }; + class CUP_srifle_SVD : Rifle_Base_F + { + AB_barrelTwist=9.4; + AB_barrelLength=24.4; + }; + class CUP_lmg_UK59 : Rifle_Long_Base_F + { + AB_barrelTwist=15; + AB_barrelLength=21.7; + }; + class CUP_DSHKM_W : MGun + { + AB_barrelTwist=15; + AB_barrelLength=42.1; + }; + class CUP_KPVT_W : MGun + { + AB_barrelTwist=17.91; + AB_barrelLength=53; + }; + class CUP_KPVB_W : MGun + { + AB_barrelTwist=17.91; + AB_barrelLength=53; + }; + class CUP_M134 : MGunCore + { + AB_barrelTwist=12; + AB_barrelLength=22; + }; + class CUP_M240_veh_W : Rifle_Long_Base_F + { + AB_barrelTwist=12; + AB_barrelLength=24.8; + }; + class CUP_PKT_W : MGun + { + AB_barrelTwist=9.45; + AB_barrelLength=28.43; + }; + class CUP_srifle_VSSVintorez : Rifle_Base_F + { + AB_barrelTwist=8.3; + AB_barrelLength=7.9; + }; + class CUP_arifle_XM8_Base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class CUP_arifle_XM8_Carbine : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class CUP_arifle_xm8_sharpshooter : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class CUP_arifle_xm8_SAW : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=20; + }; + class CUP_arifle_XM8_Compact : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=9; + }; + class CUP_arifle_XM8_Railed_Base : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; + class CUP_arifle_XM8_Carbine_FG : Rifle_Base_F + { + AB_barrelTwist=7; + AB_barrelLength=12.5; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..aa5753b490 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/Combat_Space_Enhancement.h @@ -0,0 +1,16 @@ +class Combat_Space_Enhancement { + class cfgModules { + class cse_AB_moduleAdvancedBallistics { + init = "call compile preprocessFile 'cse\cse_sys_ballistics\advancedballistics\init.sqf';"; + name = "Advanced Ballistics"; + class EventHandlers { + class AllVehicles { + fired = "call cse_ab_ballistics_fnc_advanced_ballistics; false"; + }; + class CAManBase { + take = "call cse_ab_ballistics_fnc_synchronize_scope_zero; false"; + }; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/UI.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/UI.h new file mode 100644 index 0000000000..11255d108c --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/UI.h @@ -0,0 +1 @@ +#include "ui\rscTitles.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/config.cpp b/TO_MERGE/cse/sys_ballistics/advancedballistics/config.cpp new file mode 100644 index 0000000000..cdc4523906 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/config.cpp @@ -0,0 +1,44 @@ +#define ST_LEFT 0 +#define ST_RIGHT 1 +#define ST_CENTER 2 + +class CfgPatches +{ + class cse_ab_advancedballistics + { + units[]={}; + weapons[]={}; + requiredVersion=1.26; + requiredAddons[]= + { + + }; + version="2.7"; + author[]= + { + "Ruthberg" + }; + }; +}; +class CfgAddons +{ + class PreloadAddons + { + class cse_ab_advancedballistics + { + list[]= + { + "cse_ab_advancedballistics" + }; + }; + }; +}; + +#include "CfgAmmo.h" +#include "CfgMagazines.h" +#include "CfgWeapons.h" +#include "CfgSounds.h" +#include "CfgVehicles.h" +#include "CfgFunctions.h" +#include "Combat_Space_Enhancement.h" +#include "UI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/protractor.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/protractor.paa new file mode 100644 index 0000000000..1114b41826 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/protractor.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/protractor_marker.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/protractor_marker.paa new file mode 100644 index 0000000000..a97be42a73 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/protractor_marker.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind0.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind0.paa new file mode 100644 index 0000000000..c049caf47e Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind0.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind1.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind1.paa new file mode 100644 index 0000000000..47d996fe67 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind1.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind10.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind10.paa new file mode 100644 index 0000000000..a9bcd49c1b Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind10.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind11.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind11.paa new file mode 100644 index 0000000000..469cdedada Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind11.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind12.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind12.paa new file mode 100644 index 0000000000..11e19553ff Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind12.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind2.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind2.paa new file mode 100644 index 0000000000..585944af45 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind2.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind3.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind3.paa new file mode 100644 index 0000000000..16b823a9f3 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind3.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind4.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind4.paa new file mode 100644 index 0000000000..a5bd119889 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind4.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind5.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind5.paa new file mode 100644 index 0000000000..43398e2960 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind5.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind6.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind6.paa new file mode 100644 index 0000000000..3bd9a9c676 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind6.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind7.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind7.paa new file mode 100644 index 0000000000..a7bb1d5942 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind7.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind8.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind8.paa new file mode 100644 index 0000000000..e51ad530c5 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind8.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind9.paa b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind9.paa new file mode 100644 index 0000000000..016ca49f7c Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/data/wind9.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/defines.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/defines.h new file mode 100644 index 0000000000..1b472bcb3b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/defines.h @@ -0,0 +1,11 @@ +#define GRAVITY 9.80665 +#define ABSOLUTE_ZERO_IN_CELSIUS -273.15 +#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS) +#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS) +#define UNIVERSAL_GAS_CONSTANT 8.314 +#define WATER_VAPOR_MOLAR_MASS 0.018016 +#define DRY_AIR_MOLAR_MASS 0.028964 +#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058 +#define STD_AIR_DENSITY_ICAO 1.22498 +#define STD_AIR_DENSITY_ASM 1.20885 +#define GET_TEMPERATURE_AT_HEIGHT(h) (cse_AB_Temperature - 0.0065 * (h)) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_adjust_parallax.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_adjust_parallax.sqf new file mode 100644 index 0000000000..6c6daca94b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_adjust_parallax.sqf @@ -0,0 +1,72 @@ +/** + * fn_adjust_parralax.sqf + * @Descr: N/A + * @Author: Ruthberg + * + * @Arguments: [] + * @Return: [] + * @PublicAPI: false + */ + + +#include "defines.h" + +#define __dsp (uiNamespace getVariable "RscTurretDial") +#define __ctrl (__dsp displayCtrl 132949) + +private ["_direction", "_opticsName", "_opticType", "_parallax"]; +_direction = _this; +_opticsName = currentWeapon player; +_opticType = 0; + +if (!cse_AB_MirageEnabled) exitWith { false }; +if (!(weaponLowered player) && currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then { + _opticsName = (primaryWeaponItems player) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); +}; +if (_opticType != 2 && !(currentWeapon player in ["Binocular", "Rangefinder", "Laserdesignator"])) exitWith { false }; + +_parallax = player getVariable [format["cse_AB_Parallax:%1", _opticsName], 0]; + +switch (_direction) do +{ + case 0: + { + if (_parallax > 0) then { + _parallax = _parallax + 100; + }; + if (_parallax > 1000) then { + _parallax = 0; + }; + }; + case 1: + { + if (_parallax > 100) then { + _parallax = _parallax - 100; + }; + if (_parallax == 0) then { + _parallax = 1000; + }; + }; +}; + +cse_AB_WindInfo = false; +0 cutText ["", "PLAIN"]; +cse_AB_Protractor = false; +1 cutText ["", "PLAIN"]; + +2 cutRsc ["RscTurretDial", "PLAIN"]; + +if (_parallax > 0) then { + __ctrl ctrlSetText format["%1 m", round(_parallax)]; +} else { + __ctrl ctrlSetText "infinity"; +}; +__ctrl ctrlSetTextColor [0.8, 0.0, 0.0, 1.0]; + +if (_parallax != player getVariable [format["cse_AB_Parallax:%1", _opticsName], 0]) then { + player setVariable [format["cse_AB_Parallax:%1", _opticsName], _parallax, false]; + PlaySound "cse_AB_scope_click"; +}; + +true diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_adjust_turret.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_adjust_turret.sqf new file mode 100644 index 0000000000..613a266f72 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_adjust_turret.sqf @@ -0,0 +1,91 @@ +#include "defines.h" + +#define __dsp (uiNamespace getVariable "RscTurretDial") +#define __ctrl (__dsp displayCtrl 132949) + +private ["_opticsName", "_opticType", "_scopeStep", "_turretAndDirection", "_majorStep", "_elevation", "_windage", "_zero"]; +_turretAndDirection = _this select 0; +_majorStep = _this select 1; + +if (!cse_AB_MilTurretsEnabled) exitWith { false }; +if (weaponLowered player) exitWith { false }; +if (vehicle player != player) exitWith { false }; +if (currentWeapon player != primaryWeapon player) exitWith { false }; +if (count primaryWeaponItems player < 3) exitWith { false }; + +_opticsName = (primaryWeaponItems player) select 2; +_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + +if (_opticType != 2) exitWith { false }; + +_elevation = player getVariable [format["cse_AB_Elevation:%1", _opticsName], 0]; +_windage = player getVariable [format["cse_AB_Windage:%1", _opticsName], 0]; +_zero = player getVariable [format["cse_AB_Zero:%1", _opticsName], profileNamespace getVariable [format["cse_AB_Zero:%1", _opticsName], 0]]; + +_scopeStep = 0.1; + +switch (_turretAndDirection) do +{ + case 0: { _elevation = _elevation + _scopeStep }; + case 1: { _elevation = _elevation - _scopeStep }; + case 2: { _windage = _windage - _scopeStep }; + case 3: { _windage = _windage + _scopeStep }; + case 4: { _zero = _zero + _scopeStep }; + case 5: { _zero = _zero - _scopeStep }; +}; + +if (_majorStep) then { + switch (_turretAndDirection) do + { + case 0: { _elevation = ceil(_elevation) }; + case 1: { _elevation = floor(_elevation) }; + case 2: { _windage = floor(_windage) }; + case 3: { _windage = ceil(_windage) }; + }; +}; + +_zero = -4 max _zero min 30; +_elevation = (-4 - _zero) max _elevation min (30 - _zero); +_windage = -20 max _windage min 20; + +cse_AB_WindInfo = false; +0 cutText ["", "PLAIN"]; +cse_AB_Protractor = false; +1 cutText ["", "PLAIN"]; + +2 cutRsc ["RscTurretDial", "PLAIN"]; + +switch (_turretAndDirection) do +{ + case 0; + case 1: { + __ctrl ctrlSetText format["%1 Mil", round(_elevation * 10) / 10]; + __ctrl ctrlSetTextColor [1.0, 1.0, 0.5, 1.0]; + }; + case 2; + case 3: { + __ctrl ctrlSetText format["%1 Mil", round(_windage * 10) / 10]; + __ctrl ctrlSetTextColor [0.8, 0.8, 1.0, 1.0]; + }; + case 4; + case 5: { + __ctrl ctrlSetText format["%1 Mil", round(_zero * 10) / 10]; + __ctrl ctrlSetTextColor [0, 0.5, 0.0, 1.0]; + }; +}; + +if (_elevation != player getVariable [format["cse_AB_Elevation:%1", _opticsName], 0]) then { + player setVariable [format["cse_AB_Elevation:%1", _opticsName], _elevation, true]; + PlaySound "cse_AB_scope_click"; +}; +if (_windage != player getVariable [format["cse_AB_Windage:%1", _opticsName], 0]) then { + player setVariable [format["cse_AB_Windage:%1", _opticsName], _windage, true]; + PlaySound "cse_AB_scope_click"; +}; +if (_zero != player getVariable [format["cse_AB_Zero:%1", _opticsName], 0]) then { + profileNamespace setVariable [format["cse_AB_Zero:%1", _opticsName], _zero]; + player setVariable [format["cse_AB_Zero:%1", _opticsName], _zero, true]; + PlaySound "cse_AB_scope_click"; +}; + +true diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_advanced_ballistics.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_advanced_ballistics.sqf new file mode 100644 index 0000000000..701e22eb5d --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_advanced_ballistics.sqf @@ -0,0 +1,345 @@ +#include "defines.h" + +private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_cse_AB_Elevation", "_cse_AB_Windage", "_ID"]; +_unit = _this select 0; +_weapon = _this select 1; +_mode = _this select 3; +_ammo = _this select 4; +_bullet = _this select 5; +_magazine = _this select 6; + +if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { + _bullet = _this select 6; + _magazine = _this select 5; +}; + +if (isDedicated) exitWith {}; +if (!alive _bullet) exitWith {}; +if (!(isPlayer _unit)) exitWith {}; +if (underwater _unit) exitWith {}; +if (!(_ammo isKindOf "BulletBase")) exitWith {}; +if (_unit distanceSqr player > 9000000) exitWith {}; +if (cse_AB_OnlyActiveForLocalPlayer && !(local _unit)) exitWith {}; +if (cse_AB_OnlyActiveForPlayerGroup && (group _unit != group player)) exitWith {}; +if (!cse_AB_VehicleGunnerEnabled && !(_unit isKindOf "Man")) exitWith {}; +if (cse_AB_DisabledInFullAutoMode && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) exitWith {}; +if (!isServer && !((gunner _unit) getVariable ["cse_enabled_AdvancedBallistics", false])) exitWith {}; + +_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction"); +_muzzleVelocity = getNumber(configFile >> "cfgMagazines" >> _magazine >> "initSpeed"); + +_muzzleAccessory = (primaryWeaponItems _unit) select 0; +if (_muzzleAccessory != "" && isNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed")) then { + _initSpeedCoef = getNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed"); + _muzzleVelocity = _muzzleVelocity * _initSpeedCoef; +}; + +if (cse_AB_BarrelLengthInfluenceEnabled) then { + _muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call cse_ab_ballistics_fnc_barrel_length_muzzle_velocity; + if (_muzzleVelocityShift != 0) then { + _bulletVelocity = velocity _bullet; + _bulletSpeed = vectorMagnitude _bulletVelocity; + _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity))); + _bullet setVelocity _bulletVelocity; + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; + }; +}; + +if (cse_AB_AmmoTemperatureEnabled) then { + _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); + _muzzleVelocityShift = [_ammo, _temperature] call cse_ab_ballistics_fnc_ammo_temperature_muzzle_velocity; + if (_muzzleVelocityShift != 0) then { + _bulletVelocity = velocity _bullet; + _bulletSpeed = vectorMagnitude _bulletVelocity; + _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity))); + _bullet setVelocity _bulletVelocity; + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; + }; +}; + +_bulletTraceVisible = false; +if (cse_AB_BulletTraceEnabled && currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then { + _opticsName = (primaryWeaponItems player) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _bulletTraceVisible = (_opticType == 2 || currentWeapon player in ["Binocular", "Rangefinder", "Laserdesignator"]) && cameraView == "GUNNER"; +}; + +if (cse_AB_MilTurretsEnabled) then { + [_bullet, _unit] call cse_ab_ballistics_fnc_apply_turret_adjustments; +}; + +_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_caliber"); +_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletLength"); +_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletMass"); +_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_barrelTwist"); +_stabilityFactor = 1.5; + +if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { + _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); + _barometricPressure = 1013.25 * exp(-(cse_AB_Altitude + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast; + _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call cse_ab_ballistics_fnc_calculate_stability_factor; +}; + +_twistDirection = 1; +if (isNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection")) then { + _twistDirection = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection"); + if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { + _twistDirection = 1; + }; +}; + +_transonicStabilityCoef = 0.5; +if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef")) then { + _transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef"); +}; + +_dragModel = 1; +_ballisticCoefficients = []; +_velocityBoundaries = []; +_atmosphereModel = "ICAO"; +if (cse_AB_AdvancedAirDragEnabled) then { + if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel")) then { + _dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel"); + if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { + _dragModel = 1; + }; + }; + if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients")) then { + _ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients"); + }; + if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries")) then { + _velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries"); + }; + if (isText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere")) then { + _atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere"); + }; +}; + +_index = count cse_AB_bulletDatabase; +if (count cse_AB_bulletDatabaseFreeIndices > 0) then { + _index = cse_AB_bulletDatabaseFreeIndices select 0; + cse_AB_bulletDatabaseFreeIndices = cse_AB_bulletDatabaseFreeIndices - [_index]; +}; + +cse_AB_bulletDatabase set[_index, [_bullet, _caliber, _airFriction, _muzzleVelocity, _stabilityFactor, _transonicStabilityCoef, _twistDirection, _unit, _bulletTraceVisible, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _index]]; +cse_AB_bulletDatabaseStartTime set[_index, time]; +cse_AB_bulletDatabaseSpeed set[_index, 0]; +cse_AB_bulletDatabaseFrames set[_index, 1]; +cse_AB_bulletDatabaseLastFrame set[_index, time]; +cse_AB_bulletDatabaseHDeflect set[_index, 0]; +cse_AB_bulletDatabaseSpinDrift set[_index, 0]; + +if ((cse_AB_bulletDatabaseOccupiedIndices pushBack _index) == 0) then { + ["AdvancedBallistics", "onEachFrame", { + private ["_bulletDatabaseEntry", "_bullet", "_caliber", "_muzzleVelocity", "_frames", "_speed", "_airFriction", "_airFrictionRef", "_dragModel", "_atmosphereModel", "_ballisticCoefficient", "_ballisticCoefficients", "_velocityBoundaries", "_airDensity", "_stabilityFactor", "_transonicStabilityCoef", "_twistDirection", "_unit", "_bulletTraceVisible", "_index", "_temperature", "_humidity", "_deltaT", "_TOF", "_bulletPosition", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_bulletSpeedAvg", "_wind", "_drag", "_dragRef", "_vect", "_accel", "_accelRef", "_centripetalAccel", "_pressure", "_pressureDeviation", "_windSourceObstacle", "_windSourceTerrain", "_height", "_roughnessLength"]; + + { + _bullet = (cse_AB_bulletDatabase select _x) select 0; + _index = (cse_AB_bulletDatabase select _x) select 13; + if (!alive _bullet) then { + cse_AB_bulletDatabaseOccupiedIndices = cse_AB_bulletDatabaseOccupiedIndices - [_index]; + cse_AB_bulletDatabaseFreeIndices pushBack _index; + }; + true + } count cse_AB_bulletDatabaseOccupiedIndices; + + if (count cse_AB_bulletDatabaseOccupiedIndices == 0) exitWith { + cse_AB_bulletDatabase = []; + cse_AB_bulletDatabaseStartTime = []; + cse_AB_bulletDatabaseSpeed = []; + cse_AB_bulletDatabaseFrames = []; + cse_AB_bulletDatabaseLastFrame = []; + cse_AB_bulletDatabaseHDeflect = []; + cse_AB_bulletDatabaseSpinDrift = []; + cse_AB_bulletDatabaseOccupiedIndices = []; + cse_AB_bulletDatabaseFreeIndices = []; + ["AdvancedBallistics", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; + + { + _bulletDatabaseEntry = (cse_AB_bulletDatabase select _x); + _bullet = _bulletDatabaseEntry select 0; + _caliber = _bulletDatabaseEntry select 1; + _airFriction = _bulletDatabaseEntry select 2; + _muzzleVelocity = _bulletDatabaseEntry select 3; + _stabilityFactor = _bulletDatabaseEntry select 4; + _transonicStabilityCoef = _bulletDatabaseEntry select 5; + _twistDirection = _bulletDatabaseEntry select 6; + _unit = _bulletDatabaseEntry select 7; + _bulletTraceVisible = _bulletDatabaseEntry select 8; + _ballisticCoefficients = _bulletDatabaseEntry select 9; + _velocityBoundaries = _bulletDatabaseEntry select 10; + _atmosphereModel = _bulletDatabaseEntry select 11; + _dragModel = _bulletDatabaseEntry select 12; + _index = _bulletDatabaseEntry select 13; + + _TOF = time - (cse_AB_bulletDatabaseStartTime select _index); + + _bulletVelocity = velocity _bullet; + _bulletPosition = getPosASL _bullet; + + _bulletSpeed = vectorMagnitude _bulletVelocity; + _bulletDir = (_bulletVelocity select 0) atan2 (_bulletVelocity select 1); + + _speed = (cse_AB_bulletDatabaseSpeed select _index); + cse_AB_bulletDatabaseSpeed set[_index, _speed + _bulletSpeed]; + + _frames = (cse_AB_bulletDatabaseFrames select _index); + cse_AB_bulletDatabaseFrames set[_index, _frames + 1]; + + _bulletSpeedAvg = (_speed / _frames); + + if ((cse_AB_Precision < 2) || {_frames % cse_AB_Precision == _index % cse_AB_Precision}) then { + _deltaT = time - (cse_AB_bulletDatabaseLastFrame select _index); + cse_AB_bulletDatabaseLastFrame set[_index, time]; + + _trueVelocity = _bulletVelocity; + _trueSpeed = _bulletSpeed; + _wind = [0, 0, 0]; + if (cse_AB_WindEnabled && (vectorMagnitude wind) > 0) then { + _windSourceObstacle = _bulletPosition vectorDiff ((vectorNormalized wind) vectorMultiply 10); + _windSourceTerrain = _bulletPosition vectorDiff ((vectorNormalized wind) vectorMultiply 100); + + if (!(lineIntersects [_bulletPosition, _windSourceObstacle]) && !(terrainIntersectASL [_bulletPosition, _windSourceTerrain])) then { + _wind = wind; + _height = ASLToATL(_bulletPosition) select 2; + _height = 0 max _height min 20; + if (_height < 20) then { + _roughnessLength = _bulletPosition call cse_ab_ballistics_fnc_calculate_roughness_length; + _wind = _wind vectorMultiply (ln(_height / _roughnessLength) / ln(20 / _roughnessLength)); + }; + + _trueVelocity = _bulletVelocity vectorDiff _wind; + _trueSpeed = vectorMagnitude _trueVelocity; + }; + }; + + _airFrictionRef = _airFriction; + if (cse_AB_AdvancedAirDragEnabled && (count _ballisticCoefficients) == (count _velocityBoundaries) + 1) then { + _dragRef = _deltaT * _airFrictionRef * _bulletSpeed * _bulletSpeed; + _accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef); + _bulletVelocity = _bulletVelocity vectorDiff _accelRef; + + _ballisticCoefficient = (_ballisticCoefficients select 0); + for "_i" from (count _velocityBoundaries) - 1 to 0 step -1 do { + if (_bulletSpeed < (_velocityBoundaries select _i)) exitWith { + _ballisticCoefficient = (_ballisticCoefficients select (_i + 1)); + }; + }; + + if (cse_AB_AtmosphericDensitySimulationEnabled) then { + _pressure = 1013.25 * exp(-(cse_AB_Altitude + (_bulletPosition select 2)) / 7990) - 10 * overcast; + _temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2); + _humidity = cse_AB_Humidity; + if (cse_AB_Humidity < 1 && fog > 0) then { + private ["_fogValue", "_fogDecay", "_fogBase"]; + _fogValue = fogParams select 0; + _fogDecay = fogParams select 1; + _fogBase = fogParams select 2; + _fogDensity = 1 - 0.05 * (_fogDecay / _fogValue * (_height - _fogBase))^2; + if (_fogDensity > 0) then { + _humidity = 1; + } else { + _humidity = cse_AB_Humidity + (1 - cse_AB_Humidity) * (0 max (1 + _fogDensity)); + }; + }; + _airDensity = STD_AIR_DENSITY_ICAO; + if (_humidity > 0) then { + private ["_pSat", "_vaporPressure", "_partialPressure"]; + // Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm + _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); + _vaporPressure = _humidity * _pSat; + _partialPressure = (_pressure * 100)- _vaporPressure; + + _airDensity = (_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature)); + } else { + _airDensity = (_pressure * 100) / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature)); + }; + + if (_atmosphereModel == "ICAO") then { + _ballisticCoefficient = (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient; + } else { + _ballisticCoefficient = (STD_AIR_DENSITY_ASM / _airDensity) * _ballisticCoefficient; + }; + }; + + _drag = _deltaT * ([_dragModel, _ballisticCoefficient, _trueSpeed] call cse_ab_ballistics_fnc_calculate_retardation); + _accel = (vectorNormalized _trueVelocity) vectorMultiply (_drag); + _bulletVelocity = _bulletVelocity vectorDiff _accel; + } else { + if (cse_AB_AtmosphericDensitySimulationEnabled) then { + _pressureDeviation = 1013.25 * exp(-(cse_AB_Altitude + (_bulletPosition select 2)) / 7990) - 1013.25 - 10 * overcast; + _temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2); + _humidity = cse_AB_Humidity; + if (cse_AB_Humidity < 1 && fog > 0) then { + private ["_fogValue", "_fogDecay", "_fogBase"]; + + _fogValue = fogParams select 0; + _fogDecay = fogParams select 1; + _fogBase = fogParams select 2; + _fogDensity = 1 - 0.05 * (_fogDecay / _fogValue * (_height - _fogBase))^2; + if (_fogDensity > 0) then { + _humidity = 1; + } else { + _humidity = cse_AB_Humidity + (1 - cse_AB_Humidity) * (0 max (1 + _fogDensity)); + }; + }; + _airFriction = _airFriction + ((_temperature - 15) * 0.0000015 + _humidity * 0.0000040 + _pressureDeviation * -0.0000009); + }; + + if (_airFriction != _airFrictionRef || vectorMagnitude _wind > 0) then { + _dragRef = _deltaT * _airFrictionRef * _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; + }; + }; + + if (cse_AB_CoriolisEnabled && _bulletSpeedAvg > 0) then { + _horizontalDeflection = 0.0000729 * (_unit distanceSqr _bullet) * sin(cse_AB_Latitude) / _bulletSpeedAvg; + _horizontalDeflectionPartial = _horizontalDeflection - (cse_AB_bulletDatabaseHDeflect select _index); + cse_AB_bulletDatabaseHDeflect set[_index, _horizontalDeflection]; + _vect = [sin(_bulletDir + 90) * _horizontalDeflectionPartial, cos(_bulletDir + 90) * _horizontalDeflectionPartial, 0]; + + _bulletPosition = _bulletPosition vectorAdd _vect; + }; + + if (cse_AB_EoetvoesEnabled) then { + _centripetalAccel = 2 * 0.0000729 * (_muzzleVelocity / -32.2) * cos(cse_AB_Latitude) * sin(_bulletDir); + _accel = [0, 0, -(_centripetalAccel * _deltaT)]; + + _bulletVelocity = _bulletVelocity vectorAdd _accel; + }; + + if (cse_AB_SpinDriftEnabled) then { + _spinDrift = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83; + _spinDriftPartial = _spinDrift - (cse_AB_bulletDatabaseSpinDrift select _index); + cse_AB_bulletDatabaseSpinDrift set[_index, _spinDrift]; + _vect = [sin(_bulletDir + 90) * _spinDriftPartial, cos(_bulletDir + 90) * _spinDriftPartial, 0]; + + _bulletPosition = _bulletPosition vectorAdd _vect; + }; + }; + + if (cse_AB_TransonicRegionEnabled && _transonicStabilityCoef < 1) then { + if (_bulletSpeed < 345 && _bulletSpeedAvg > 340 && _bulletSpeed > 335) then { + _accel = [(random 0.8) - 0.4, (random 0.8) - 0.4, (random 0.8) - 0.4]; + _accel = _accel vectorMultiply (1 - _transonicStabilityCoef); + _bulletVelocity = _bulletVelocity vectorAdd _accel; + }; + }; + + if (_bulletTraceVisible && _bulletSpeed > 600 && _bullet distanceSqr _unit > 400) then { + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""]; + }; + + _bullet setVelocity _bulletVelocity; + _bullet setPosASL _bulletPosition; + true + } count cse_AB_bulletDatabaseOccupiedIndices; + + }] call BIS_fnc_addStackedEventHandler; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_advanced_ballistics_extension.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_advanced_ballistics_extension.sqf new file mode 100644 index 0000000000..7d544d15e0 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_advanced_ballistics_extension.sqf @@ -0,0 +1,171 @@ +#include "defines.h" + +private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_cse_AB_Elevation", "_cse_AB_Windage", "_ID"]; +_unit = _this select 0; +_weapon = _this select 1; +_mode = _this select 3; +_ammo = _this select 4; +_bullet = _this select 5; +_magazine = _this select 6; + +if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then { + _bullet = _this select 6; + _magazine = _this select 5; +}; + +if (isDedicated) exitWith {}; +if (!alive _bullet) exitWith {}; +if (!(isPlayer _unit)) exitWith {}; +if (underwater _unit) exitWith {}; +if (!(_ammo isKindOf "BulletBase")) exitWith {}; +if (_unit distanceSqr player > 9000000) exitWith {}; +if (cse_AB_OnlyActiveForLocalPlayer && !(local _unit)) exitWith {}; +if (cse_AB_OnlyActiveForPlayerGroup && (group _unit != group player)) exitWith {}; +if (!cse_AB_VehicleGunnerEnabled && !(_unit isKindOf "Man")) exitWith {}; +if (cse_AB_DisabledInFullAutoMode && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) exitWith {}; +if (!isServer && !((gunner _unit) getVariable ["cse_enabled_AdvancedBallistics", false])) exitWith {}; + +_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction"); +_muzzleVelocity = getNumber(configFile >> "cfgMagazines" >> _magazine >> "initSpeed"); + +_muzzleAccessory = (primaryWeaponItems _unit) select 0; +if (_muzzleAccessory != "" && isNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed")) then { + _initSpeedCoef = getNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed"); + _muzzleVelocity = _muzzleVelocity * _initSpeedCoef; +}; + +if (cse_AB_BarrelLengthInfluenceEnabled) then { + _muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call cse_ab_ballistics_fnc_barrel_length_muzzle_velocity; + if (_muzzleVelocityShift != 0) then { + _bulletVelocity = velocity _bullet; + _bulletSpeed = vectorMagnitude _bulletVelocity; + _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity))); + _bullet setVelocity _bulletVelocity; + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; + }; +}; + +if (cse_AB_AmmoTemperatureEnabled) then { + _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); + _muzzleVelocityShift = [_ammo, _temperature] call cse_ab_ballistics_fnc_ammo_temperature_muzzle_velocity; + if (_muzzleVelocityShift != 0) then { + _bulletVelocity = velocity _bullet; + _bulletSpeed = vectorMagnitude _bulletVelocity; + _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity))); + _bullet setVelocity _bulletVelocity; + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; + }; +}; + +_opticsName = ""; +_opticType = 0; +if (currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then { + _opticsName = (primaryWeaponItems player) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); +}; + +_bulletTraceVisible = (_opticType == 2 || currentWeapon player in ["Binocular", "Rangefinder", "Laserdesignator"]) && cameraView == "GUNNER"; + +if (cse_AB_MilTurretsEnabled) then { + [_bullet, _unit] call cse_ab_ballistics_fnc_apply_turret_adjustments; +}; + +_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_caliber"); +_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletLength"); +_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletMass"); +_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_barrelTwist"); +_stabilityFactor = 1.5; + +if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { + _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); + _barometricPressure = 1013.25 * exp(-(cse_AB_Altitude + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast; + _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call cse_ab_ballistics_fnc_calculate_stability_factor; +}; + +_twistDirection = 1; +if (isNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection")) then { + _twistDirection = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection"); + if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { + _twistDirection = 1; + }; +}; + +_transonicStabilityCoef = 0.5; +if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef")) then { + _transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef"); +}; + +_dragModel = 1; +_ballisticCoefficients = []; +_velocityBoundaries = []; +_atmosphereModel = "ICAO"; +if (cse_AB_AdvancedAirDragEnabled) then { + if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel")) then { + _dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel"); + if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { + _dragModel = 1; + }; + }; + if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients")) then { + _ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients"); + }; + if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries")) then { + _velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries"); + }; + if (isText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere")) then { + _atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere"); + }; +}; + +_index = count cse_AB_bulletDatabase; +if (count cse_AB_bulletDatabaseFreeIndices > 0) then { + _index = cse_AB_bulletDatabaseFreeIndices select 0; + cse_AB_bulletDatabaseFreeIndices = cse_AB_bulletDatabaseFreeIndices - [_index]; +}; + +"AdvancedBallistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", _index, _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, cse_AB_Latitude, cse_AB_Temperature, cse_AB_Altitude, cse_AB_Humidity, overcast, floor(time), time - floor(time)]; +cse_AB_bulletDatabase set[_index, [_bullet, _caliber, _bulletTraceVisible, _index]]; + +if ((cse_AB_bulletDatabaseOccupiedIndices pushBack _index) == 0) then { + ["AdvancedBallistics", "onEachFrame", { + private ["_bulletDatabaseEntry", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition", "_bulletVelocityShift", "_bulletPositionShift"]; + + { + _bulletDatabaseEntry = (cse_AB_bulletDatabase select _x); + _bullet = _bulletDatabaseEntry select 0; + _index = _bulletDatabaseEntry select 3; + if (!alive _bullet) then { + cse_AB_bulletDatabaseOccupiedIndices = cse_AB_bulletDatabaseOccupiedIndices - [_index]; + cse_AB_bulletDatabaseFreeIndices pushBack _index; + }; + true + } count cse_AB_bulletDatabaseOccupiedIndices; + + if (count cse_AB_bulletDatabaseOccupiedIndices == 0) exitWith { + cse_AB_bulletDatabase = []; + cse_AB_bulletDatabaseOccupiedIndices = []; + cse_AB_bulletDatabaseFreeIndices = []; + ["AdvancedBallistics", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; + + { + _bulletDatabaseEntry = (cse_AB_bulletDatabase select _x); + _bullet = _bulletDatabaseEntry select 0; + _caliber = _bulletDatabaseEntry select 1; + _bulletTraceVisible = _bulletDatabaseEntry select 2; + _index = _bulletDatabaseEntry select 3; + + _bulletVelocity = velocity _bullet; + _bulletPosition = getPosASL _bullet; + + if (_bulletTraceVisible && vectorMagnitude _bulletVelocity > 600) then { + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""]; + }; + + call compile ("AdvancedBallistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, wind, ASLToATL(_bulletPosition) select 2, floor(time), time - floor(time)]); + + true + } count cse_AB_bulletDatabaseOccupiedIndices; + + }] call BIS_fnc_addStackedEventHandler; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_ammo_temperature_muzzle_velocity.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_ammo_temperature_muzzle_velocity.sqf new file mode 100644 index 0000000000..3158c82526 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_ammo_temperature_muzzle_velocity.sqf @@ -0,0 +1,38 @@ +/** + * fn_ammo_temperature_muzzle_velocity.sqf + * @Descr: ? + * @Author: Ruthberg + * + * @Arguments: [Ammo Class Name, Temperature in C] + * @Return: [Muzzle Velocity Shift in m/s] + * @PublicAPI: true + */ + + +#include "defines.h" + +private ["_ammo", "_temperature", "_muzzleVelocityTable", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; +_ammo = _this select 0; +_temperature = _this select 1; + +_muzzleVelocityTable = []; + +if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ammoTempMuzzleVelocityShifts")) then { + _muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ammoTempMuzzleVelocityShifts"); +}; + +if (count _muzzleVelocityTable != 11) exitWith { 0 }; + +_temperatureIndexA = floor((_temperature + 15) / 5); +_temperatureIndexA = 0 max _temperatureIndexA; +_temperatureIndexA = _temperatureIndexA min 10; + +_temperatureIndexB = ceil((_temperature + 15) / 5); +_temperatureIndexB = 0 max _temperatureIndexB; +_temperatureIndexB = _temperatureIndexB min 10; + +_temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5); + +_muzzleVelocityShift = (_muzzleVelocityTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityTable select _temperatureIndexB) * _temperatureRatio; + +_muzzleVelocityShift diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_apply_turret_adjustments.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_apply_turret_adjustments.sqf new file mode 100644 index 0000000000..147e5668e7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_apply_turret_adjustments.sqf @@ -0,0 +1,37 @@ +#include "defines.h" + +private ["_bullet", "_unit", "_opticsName", "_opticType", "_windage", "_elevation", "_zero", "_bulletVelocity", "_dir", "_elev", "_mag3D", "_mag2D"]; +_bullet = _this select 0; +_unit = _this select 1; + +_opticsName = ""; +_opticType = 0; +if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { + _opticsName = (primaryWeaponItems _unit) select 2; + _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); +}; + +if (_opticType == 2) then { + _windage = _unit getVariable [format["cse_AB_Windage:%1", _opticsName], 0]; + _elevation = _unit getVariable [format["cse_AB_Elevation:%1", _opticsName], 0]; + _zero = _unit getVariable [format["cse_AB_Zero:%1", _opticsName], 0]; + + _elevation = _elevation + _zero; + + if (_windage != 0 || _elevation != 0) then { + _windage = _windage * 3.47 / 60; + _elevation = _elevation * 3.47 / 60; + + _bulletVelocity = (velocity _bullet); + _mag3D = vectorMagnitude _bulletVelocity; + _dir = (_bulletVelocity select 0) atan2 (_bulletVelocity select 1); + _elev = asin((_bulletVelocity select 2) / _mag3D); + + _dir = _dir + _windage; + _elev = _elev + _elevation; + + _mag2D = _mag3D * cos(_elev); + + _bullet setVelocity [_mag2D * sin(_dir), _mag2D * cos(_dir), _mag3D * sin(_elev)]; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_barrel_length_muzzle_velocity.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_barrel_length_muzzle_velocity.sqf new file mode 100644 index 0000000000..54ad0b1e31 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_barrel_length_muzzle_velocity.sqf @@ -0,0 +1,61 @@ +/** + * fn_barrel_length_muzzle_velocity.sqf + * @Descr: ? + * @Author: Ruthberg + * + * @Arguments: [Ammo Class Name, Weapon Class Name, Muzzle Velocity in m/s] + * @Return: [Muzzle Velocity in m/s] + * @PublicAPI: true + */ + + +#include "defines.h" + +private ["_ammo", "_weapon", "_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; +_ammo = _this select 0; +_weapon = _this select 1; +_muzzleVelocity = _this select 2; + +_barrelLength = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_barrelLength"); + +if (_barrelLength == 0) exitWith { 0 }; + +_muzzleVelocityTable = []; +_barrelLengthTable = []; + +if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_muzzleVelocities")) then { + _muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_muzzleVelocities"); +}; +if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_barrelLengths")) then { + _barrelLengthTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_barrelLengths"); +}; + +if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 }; +if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 }; +if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; + +_lowerIndex = 0; +_upperIndex = (count _barrelLengthTable) - 1; + +if (_barrelLength <= (_barrelLengthTable select _lowerIndex)) exitWith { (_muzzleVelocityTable select _lowerIndex) - _muzzleVelocity }; +if (_barrelLength >= (_barrelLengthTable select _upperIndex)) exitWith { (_muzzleVelocityTable select _upperIndex) - _muzzleVelocity }; + +for "_i" from 0 to (count _barrelLengthTable) - 1 do { + if (_barrelLength >= _barrelLengthTable select _i) then { + _lowerIndex = _i; + }; +}; +for "_i" from (count _barrelLengthTable) - 1 to 0 step -1 do { + if (_barrelLength <= _barrelLengthTable select _i) then { + _upperIndex = _i; + }; +}; + +_barrelLengthRatio = 0; +if ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex) > 0) then { + _barrelLengthRatio = ((_barrelLengthTable select _upperIndex) - _barrelLength) / ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex)); +}; + +_muzzleVelocityNew = (_muzzleVelocityTable select _lowerIndex) + ((_muzzleVelocityTable select _upperIndex) - (_muzzleVelocityTable select _lowerIndex)) * (1 - _barrelLengthRatio); + +_muzzleVelocityNew - _muzzleVelocity diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_air_density.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_air_density.sqf new file mode 100644 index 0000000000..5cc23ad6ab --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_air_density.sqf @@ -0,0 +1,31 @@ +/** + * fn_calculate_air_density.sqf + * @Descr: Calculates air density based on atmospheric pressure, temperature and rel.humidity + * @Author: Ruthberg + * + * @Arguments: [Temperature in C, Pressure in hPa, Relative Humidity as ratio 0.0-1.0] + * @Return: [Air Density in kg/m^3] + * @PublicAPI: true + */ + + +#include "defines.h" + +private ["_temperature", "_pressure", "_relativeHumidity"]; +_temperature = _this select 0; // in C +_pressure = _this select 1; // in hPa +_relativeHumidity = _this select 2; // as ratio 0-1 + +_pressure = _pressure * 100; + +if (_relativeHumidity > 0) then { + private ["_pSat", "_vaporPressure", "_partialPressure"]; + // Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm + _pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3)); + _vaporPressure = _relativeHumidity * _pSat; + _partialPressure = _pressure - _vaporPressure; + + (_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature)) +} else { + _pressure / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature)) +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_atmospheric_correction.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_atmospheric_correction.sqf new file mode 100644 index 0000000000..bf47dec263 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_atmospheric_correction.sqf @@ -0,0 +1,27 @@ +/** + * fn_calculate_atmospheric_correction.sqf + * @Descr: ? + * @Author: Ruthberg + * + * @Arguments: [Ballistic Coefficient, Temperature in C, Pressure in hPa, Relative Humidity as ratio in 0.0-1.0, Atm.Model = "ICAO" || "ASM"] + * @Return: [Corrected Ballistic Coefficient] + * @PublicAPI: true + */ + + +#include "defines.h" + +private ["_ballisticCoefficient", "_temperature", "_pressure", "_relativeHumidity", "_atmosphereModel", "_airDensity"]; +_ballisticCoefficient = _this select 0; +_temperature = _this select 1; // in C +_pressure = _this select 2; // in hPa +_relativeHumidity = _this select 3; // as ratio 0-1 +_atmosphereModel = _this select 4; // "ICAO" or "ASM" + +_airDensity = [_temperature, _pressure, _relativeHumidity] call cse_ab_ballistics_fnc_calculate_air_density; + +if (_atmosphereModel == "ICAO") then { + (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient +} else { + (STD_AIR_DENSITY_ASM / _airDensity) * _ballisticCoefficient +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_hellmann_exponent.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_hellmann_exponent.sqf new file mode 100644 index 0000000000..371718089c --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_hellmann_exponent.sqf @@ -0,0 +1,38 @@ +/** + * fn_calculate_hellmann_exponent.sqf + * @Descr: Wikipedia: The Hellmann exponent depends upon the coastal location and the shape of the terrain on the ground, and the stability of the air. + * @Author: Ruthberg + * + * @Arguments: [position in ASL format] + * @Return: [Hellmann Exponent] + * @PublicAPI: true + */ + +#include "defines.h" + +private ["_hellmann_exponents", "_hellmann_index", "_windSource", "_nearObjects", "_isWater"]; + +// Source: https://en.wikipedia.org/wiki/Wind_gradient +// Entries 0-2 -> open water surface; Entries 3-5 -> flat open coast; Entries 6-8 -> human inhabited areas +// Sorting: open water surface/flat open coast/human inhabited areas & stable air/neutral air/unstable air +_hellmann_exponents = [0.27, 0.10, 0.06, 0.40, 0.16, 0.11, 0.60, 0.34, 0.27]; +_hellmann_exponent = 0.14; + +_windSource = _this vectorDiff ((vectorNormalized wind) vectorMultiply 25); + +_nearObjects = count (_windSource nearObjects ["Building", 50]); +_isWater = surfaceIsWater _this; + +_hellmann_index = 0 max floor(overcast * 3) min 2; + +if (_nearObjects >= 5) then { + _hellmann_exponent = _hellmann_exponents select (_hellmann_index + 6); +}; +if (_nearObjects < 5) then { + _hellmann_exponent = _hellmann_exponents select (_hellmann_index + 3); +}; +if (_nearObjects == 0 && _isWater) then { + _hellmann_exponent = _hellmann_exponents select (_hellmann_index + 0); +}; + +_hellmann_exponent diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_retardation.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_retardation.sqf new file mode 100644 index 0000000000..3fcb3bc856 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_retardation.sqf @@ -0,0 +1,129 @@ +#include "defines.h" + +// Source: GNU Exterior Ballistics + +private ["_dragModel", "_dragCoefficient", "_velocity", "_A", "_M", "_result"]; +_dragModel = _this select 0; +_dragCoefficient = _this select 1; +_velocity = (_this select 2) * 3.2808399; + +_A = -1; +_M = -1; +_result = 0; + +switch _dragModel do { + case 1: + { + switch true do { + case (_velocity > 4230) : { _A = 0.0001477404177730177; _M = 1.9565; }; + case (_velocity > 3680) : { _A = 0.0001920339268755614; _M = 1.925 ; }; + case (_velocity > 3450) : { _A = 0.0002894751026819746; _M = 1.875 ; }; + case (_velocity > 3295) : { _A = 0.0004349905111115636; _M = 1.825 ; }; + case (_velocity > 3130) : { _A = 0.0006520421871892662; _M = 1.775 ; }; + case (_velocity > 2960) : { _A = 0.0009748073694078696; _M = 1.725 ; }; + case (_velocity > 2830) : { _A = 0.001453721560187286; _M = 1.675 ; }; + case (_velocity > 2680) : { _A = 0.002162887202930376; _M = 1.625 ; }; + case (_velocity > 2460) : { _A = 0.003209559783129881; _M = 1.575 ; }; + case (_velocity > 2225) : { _A = 0.003904368218691249; _M = 1.55 ; }; + case (_velocity > 2015) : { _A = 0.003222942271262336; _M = 1.575 ; }; + case (_velocity > 1890) : { _A = 0.002203329542297809; _M = 1.625 ; }; + case (_velocity > 1810) : { _A = 0.001511001028891904; _M = 1.675 ; }; + case (_velocity > 1730) : { _A = 0.0008609957592468259; _M = 1.75 ; }; + case (_velocity > 1595) : { _A = 0.0004086146797305117; _M = 1.85 ; }; + case (_velocity > 1520) : { _A = 0.0001954473210037398; _M = 1.95 ; }; + case (_velocity > 1420) : { _A = 0.00005431896266462351; _M = 2.125 ; }; + case (_velocity > 1360) : { _A = 0.000008847742581674416; _M = 2.375 ; }; + case (_velocity > 1315) : { _A = 0.000001456922328720298; _M = 2.625 ; }; + case (_velocity > 1280) : { _A = 0.0000002419485191895565; _M = 2.875 ; }; + case (_velocity > 1220) : { _A = 0.00000001657956321067612; _M = 3.25 ; }; + case (_velocity > 1185) : { _A = 0.0000000004745469537157371; _M = 3.75 ; }; + case (_velocity > 1150) : { _A = 0.00000000001379746590025088; _M = 4.25 ; }; + case (_velocity > 1100) : { _A = 0.0000000000004070157961147882; _M = 4.75 ; }; + case (_velocity > 1060) : { _A = 0.00000000000002938236954847331; _M = 5.125 ; }; + case (_velocity > 1025) : { _A = 0.00000000000001228597370774746; _M = 5.25 ; }; + case (_velocity > 980) : { _A = 0.00000000000002916938264100495; _M = 5.125 ; }; + case (_velocity > 945) : { _A = 0.0000000000003855099424807451; _M = 4.75 ; }; + case (_velocity > 905) : { _A = 0.00000000001185097045689854; _M = 4.25 ; }; + case (_velocity > 860) : { _A = 0.0000000003566129470974951; _M = 3.75 ; }; + case (_velocity > 810) : { _A = 0.00000001045513263966272; _M = 3.25 ; }; + case (_velocity > 780) : { _A = 0.0000001291159200846216; _M = 2.875 ; }; + case (_velocity > 750) : { _A = 0.0000006824429329105383; _M = 2.625 ; }; + case (_velocity > 700) : { _A = 0.000003569169672385163; _M = 2.375 ; }; + case (_velocity > 640) : { _A = 0.00001839015095899579; _M = 2.125 ; }; + case (_velocity > 600) : { _A = 0.00005711174688734240; _M = 1.950 ; }; + case (_velocity > 550) : { _A = 0.00009226557091973427; _M = 1.875 ; }; + case (_velocity > 250) : { _A = 0.00009337991957131389; _M = 1.875 ; }; + case (_velocity > 100) : { _A = 0.00007225247327590413; _M = 1.925 ; }; + case (_velocity > 65) : { _A = 0.00005792684957074546; _M = 1.975 ; }; + case (_velocity > 0) : { _A = 0.00005206214107320588; _M = 2.000 ; }; + }; + }; + case 2: + { + switch true do { + case (_velocity > 1674) : { _A = 0.0079470052136733; _M = 1.36999902851493; }; + case (_velocity > 1172) : { _A = 0.00100419763721974; _M = 1.65392237010294; }; + case (_velocity > 1060) : { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; }; + case (_velocity > 949) : { _A = 0.000000000139589807205091; _M = 3.81439537623717; }; + case (_velocity > 670) : { _A = 0.000234364342818625; _M = 1.71869536324748; }; + case (_velocity > 335) : { _A = 0.000177962438921838; _M = 1.76877550388679; }; + case (_velocity > 0) : { _A = 0.0000518033561289704; _M = 1.98160270524632; }; + }; + }; + case 5: + { + switch true do { + case (_velocity > 1730) : { _A = 0.00724854775171929; _M = 1.41538574492812; }; + case (_velocity > 1228) : { _A = 0.0000350563361516117; _M = 2.13077307854948; }; + case (_velocity > 1116) : { _A = 0.000000000000184029481181151; _M = 4.81927320350395; }; + case (_velocity > 1004) : { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422 ; }; + case (_velocity > 837) : { _A = 0.000000103965974081168; _M = 2.84204791809926; }; + case (_velocity > 335) : { _A = 0.0001093015938698234; _M = 1.81096361579504; }; + case (_velocity > 0) : { _A = 0.0000351963178524273; _M = 2.00477856801111; }; + }; + }; + case 6: + { + switch true do { + case (_velocity > 3236) : { _A = 0.0455384883480781; _M = 1.15997674041274; }; + case (_velocity > 2065) : { _A = 0.07167261849653769; _M = 1.10704436538885; }; + case (_velocity > 1311) : { _A = 0.00166676386084348; _M = 1.60085100195952; }; + case (_velocity > 1144) : { _A = 0.000000101482730119215; _M = 2.9569674731838 ; }; + case (_velocity > 1004) : { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; }; + case (_velocity > 670) : { _A = 0.0000204835650496866; _M = 2.11688446325998; }; + case (_velocity > 0) : { _A = 0.0000750912466084823; _M = 1.92031057847052; }; + }; + }; + case 7: + { + switch true do { + case (_velocity > 4200) : { _A = 0.00000000129081656775919; _M = 3.24121295355962; }; + case (_velocity > 3000) : { _A = 0.0171422231434847; _M = 1.27907168025204; }; + case (_velocity > 1470) : { _A = 0.00233355948302505; _M = 1.52693913274526; }; + case (_velocity > 1260) : { _A = 0.000797592111627665; _M = 1.67688974440324; }; + case (_velocity > 1110) : { _A = 0.00000000000571086414289273; _M = 4.3212826264889 ; }; + case (_velocity > 960) : { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; }; + case (_velocity > 670) : { _A = 0.00000752285155782535; _M = 2.1738019851075 ; }; + case (_velocity > 540) : { _A = 0.0000131766281225189; _M = 2.08774690257991; }; + case (_velocity > 0) : { _A = 0.0000134504843776525; _M = 2.08702306738884; }; + }; + }; + case 8: + { + switch true do { + case (_velocity > 3571) : { _A = 0.0112263766252305; _M = 1.33207346655961; }; + case (_velocity > 1841) : { _A = 0.0167252613732636; _M = 1.28662041261785; }; + case (_velocity > 1120) : { _A = 0.00220172456619625; _M = 1.55636358091189; }; + case (_velocity > 1088) : { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; }; + case (_velocity > 976) : { _A = 0.00000000000592182174254121; _M = 4.29275576134191; }; + case (_velocity > 0) : { _A = 0.000043917343795117; _M = 1.99978116283334; }; + }; + }; +}; + +if (_A != -1 && _M != -1 && _velocity > 0 && _velocity < 10000) then { + _result = _A * (_velocity ^ _M) / _dragCoefficient; + _result = _result / 3.2808399; +}; + +_result diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_roughness_length.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_roughness_length.sqf new file mode 100644 index 0000000000..285f8e4dea --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_roughness_length.sqf @@ -0,0 +1,21 @@ +#include "defines.h" + +private ["_roughness_lengths", "_windSource", "_nearBuildings", "_isWater"]; + +// Source: http://es.ucsc.edu/~jnoble/wind/extrap/index.html +_roughness_lengths = [0.0002, 0.0005, 0.0024, 0.03, 0.055, 0.1, 0.2, 0.4, 0.8, 1.6]; + +_windSource = _this vectorDiff ((vectorNormalized wind) vectorMultiply 25); + +_nearBuildings = count (_windSource nearObjects ["Building", 50]); +_isWater = surfaceIsWater _windSource; + +if (_nearBuildings == 0 && _isWater) exitWith { + 0.0005 +}; + +if (_nearBuildings >= 10) exitWith { + 1.6 +}; + +_roughness_lengths select (2 + (_nearBuildings min 6)) diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_stability_factor.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_stability_factor.sqf new file mode 100644 index 0000000000..c1a9f66bbd --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_stability_factor.sqf @@ -0,0 +1,27 @@ +#include "defines.h" + +private ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure", "_l", "_t", "_stabilityFactor"]; +_caliber = _this select 0; +_bulletLength = _this select 1; +_bulletMass = _this select 2; +_barrelTwist = _this select 3; +_muzzleVelocity = _this select 4; +_temperature = _this select 5; +_barometricPressure = _this select 6; + +// Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf +_t = _barrelTwist / _caliber; +_l = _bulletLength / _caliber; + +_stabilityFactor = 30 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2)); + +_muzzleVelocity = _muzzleVelocity * 3.2808399; +if (_muzzleVelocity > 1120) then { + _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 2800) ^ (1/3); +} else { + _stabilityFactor = _stabilityFactor * (_muzzleVelocity / 1120) ^ (1/3); +}; + +_stabilityFactor = _stabilityFactor * (_temperature + 273) / (15 + 273) * 1013.25 / _barometricPressure; + +_stabilityFactor diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_wind_speed.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_wind_speed.sqf new file mode 100644 index 0000000000..51221f9057 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_calculate_wind_speed.sqf @@ -0,0 +1,65 @@ +#include "defines.h" + +private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; + +fnc_polar2vect = { + private ["_mag2D"]; + _mag2D = (_this select 0) * cos((_this select 2)); + [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; +}; + +_windSpeed = vectorMagnitude wind; +_windDir = (wind select 0) atan2 (wind select 1); + +// Wind gradient +if (_windSpeed > 0.05) then { + _height = (ASLToATL _this) select 2; + _height = 0 max _height min 20; + if (_height < 20) then { + _roughnessLength = _this call cse_ab_ballistics_fnc_calculate_roughness_length; + _windSpeed = _windSpeed * ln(_height / _roughnessLength) / ln(20 / _roughnessLength); + }; +}; + +// Terrain effect on wind +if (_windSpeed > 0.05) then { + _newWindSpeed = 0; + { + _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; + if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; + if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; + if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + _windSpeed = _newWindSpeed; +}; + +// Obstacle effect on wind +if (_windSpeed > 0.05) then { + _newWindSpeed = 0; + { + _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; + if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; + if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; + if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; + _windSpeed = _newWindSpeed; +}; +_windSpeed = 0 max _windSpeed; + +_windSpeed diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_climate_simulation.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_climate_simulation.sqf new file mode 100644 index 0000000000..4e13f01706 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_climate_simulation.sqf @@ -0,0 +1,117 @@ +#include "defines.h" + +private ["_time", "_timeRatio", "_month", "_avgTemperature", "_pS1", "_pS2", "_cse_AB_Day_Temperature", "_cse_AB_Night_Temperature", "_cse_AB_Humidity"]; +_cse_AB_Day_Temperature = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; +_cse_AB_Night_Temperature = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; +_cse_AB_Humidity = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; + +// Climate graphs +if (toLower worldName in ["chernarus", "bootcamp_acr", "woodland_acr", "utes"]) then { + // Source: http://www.iten-online.ch/klima/europa/tschechien/prag.htm + _cse_AB_Day_Temperature = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; + _cse_AB_Night_Temperature = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Prague,Czech-Republic + _cse_AB_Humidity = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; +}; + +if (toLower worldName in ["altis", "stratis"]) then { + // Source: http://www.iten-online.ch/klima/europa/griechenland/limnos.htm + _cse_AB_Day_Temperature = [10, 10, 12, 16, 21, 26, 29, 28, 25, 20, 15, 11]; + _cse_AB_Night_Temperature = [4, 4, 6, 8, 13, 17, 20, 20, 16, 12, 8, 6]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Limnos,Greece + _cse_AB_Humidity = [78, 77, 78, 74, 71, 60, 59, 61, 65, 72, 79, 80]; +}; + +if (toLower worldName in ["takistan", "zargabad", "mountains_acr", "shapur_baf", "provinggrounds_pmc"]) then { + // Source: http://www.iten-online.ch/klima/asien/afghanistan/kabul.htm + _cse_AB_Day_Temperature = [4.5, 5.5, 12.5, 19.2, 24.4, 30.2, 32.1, 32, 28.5, 22.4, 15, 8.3]; + _cse_AB_Night_Temperature = [-7.1, -5.7, 0.7, 6, 8.8, 12.4, 15.3, 14.3, 9.4, 3.9, -1.2, -4.7]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Kabul,Afghanistan + _cse_AB_Humidity = [68, 69, 62, 60, 49, 37, 38, 39, 40, 41, 56, 61]; +}; + +if (toLower worldName in ["fallujah"]) then { + // Source: http://www.iten-online.ch/klima/asien/irak/bagdad.htm + _cse_AB_Day_Temperature = [16, 19, 23, 29, 36, 41, 43, 43, 40, 33, 24, 17]; + _cse_AB_Night_Temperature = [4, 6, 10, 15, 20, 23, 25, 25, 21, 16, 10, 5]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Bagdad,Iraq + _cse_AB_Humidity = [69, 60, 55, 50, 36, 23, 21, 22, 29, 38, 58, 68]; +}; + +if (toLower worldName in ["fata", "Abbottabad"]) then { + // Source: http://www.iten-online.ch/klima/asien/pakistan/zhob.htm + _cse_AB_Day_Temperature = [12.4, 15.8, 20.8, 26.9, 32.8, 37, 36.8, 35.9, 33.8, 28.2, 22.2, 16.2]; + _cse_AB_Night_Temperature = [-0.6, 2.4, 7.4, 13.1, 18.2, 22.8, 23.8, 22.9, 19.2, 12, 5.6, 1.2]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Zhob,Pakistan + _cse_AB_Humidity = [50, 40, 42, 40, 30, 30, 50, 49, 40, 32, 38, 41]; +}; + +if (worldName in ["sfp_wamako"]) then { + // Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm + _cse_AB_Day_Temperature = [33.4, 35, 38.4, 41.5, 41.4, 40, 35.6, 32.9, 35.8, 38.2, 36.4, 33.1]; + _cse_AB_Night_Temperature = [14.9, 16.3, 20.4, 23.7, 25.8, 24.8, 23.1, 22, 22.6, 21.6, 18.6, 15.3]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Tahoua,Niger + _cse_AB_Humidity = [68, 60, 57, 50, 32, 22, 20, 21, 25, 38, 58, 69]; +}; + +if (worldName in ["sfp_sturko"]) then { + // Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm + _cse_AB_Day_Temperature = [2.2, 2.4, 5.1, 10.2, 16.1, 20.1, 21.1, 20.9, 17.2, 12.7, 7.4, 3.9]; + _cse_AB_Night_Temperature = [-2, -2.3, -0.7, 2.6, 7.1, 11.4, 13.1, 12.7, 10, 6.9, 3.1, -0.1]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,karlskrona,Sweden + _cse_AB_Humidity = [86, 85, 80, 72, 68, 69, 74, 77, 79, 81, 86, 88]; +}; + +if (worldName in ["Bornholm"]) then { + // Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm + _cse_AB_Day_Temperature = [1.9, 1.7, 3.8, 8.1, 14, 18.1, 19.6, 19.8, 16.2, 11.9, 7.3, 3.9]; + _cse_AB_Night_Temperature = [-1.6, -2.1, -0.7, 1.7, 6.2, 10.7, 13, 13.1, 10.6, 7.2, 3.5, 0.1]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,allinge,Denmark + _cse_AB_Humidity = [85, 84, 80, 76, 69, 69, 76, 77, 79, 81, 86, 86]; +}; +if (worldName in ["Imrali"]) then { + // Source: http://www.iten-online.ch/klima/europa/tuerkei/bursa.htm + _cse_AB_Day_Temperature = [9.3, 10.7, 13.6, 18.8, 23.5, 28.2, 30.3, 30.2, 27, 21.4, 16.5, 11.8]; + _cse_AB_Night_Temperature = [1.4, 2.4, 3.7, 7.1, 10.9, 14.3, 16.5, 16.3, 13, 9.5, 6, 3.8]; + + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Bursa,Turkey + _cse_AB_Humidity = [78, 75, 70, 70, 71, 61, 58, 59, 63, 69, 77, 76]; +}; + +while {true} do +{ + _time = daytime; + _month = date select 1; + + // Temperature + _timeRatio = abs(_time - 12) / 12; + + cse_AB_Temperature = (_cse_AB_Day_Temperature select (_month - 1)) * (1 - _timeRatio) + (_cse_AB_Night_Temperature select (_month - 1)) * _timeRatio; + cse_AB_Temperature = cse_AB_Temperature + cse_AB_temperatureShift - cse_AB_badWeatherShift * overcast; + cse_AB_Temperature = round(cse_AB_Temperature * 10) / 10; + + // Humidity + cse_AB_Humidity = (_cse_AB_Humidity select _month) / 100; + cse_AB_Humidity = cse_AB_Humidity + cse_AB_humidityShift; + + if (rain > 0 && overcast > 0.7) then { + cse_AB_Humidity = 1; + } else { + _avgTemperature = ((_cse_AB_Day_Temperature select (_month - 1)) + (_cse_AB_Night_Temperature select (_month - 1))) / 2; + _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); + _PS2 = 6.112 * exp((17.62 * cse_AB_Temperature) / (243.12 + cse_AB_Temperature)); + cse_AB_Humidity = cse_AB_Humidity * _PS1 / _PS2; + }; + + cse_AB_Humidity = 0 max cse_AB_Humidity min 1; + + sleep 60; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_display_protractor.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_display_protractor.sqf new file mode 100644 index 0000000000..e8212cf6ba --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_display_protractor.sqf @@ -0,0 +1,50 @@ +#include "defines.h" + +#define __dsp (uiNamespace getVariable "RscProtractor") +#define __ctrl1 (__dsp displayCtrl 132950) +#define __ctrl2 (__dsp displayCtrl 132951) + +private ["_inclinationAngle", "_refPosition"]; + +if (cse_AB_Protractor) exitWith { + cse_AB_Protractor = false; + 1 cutText ["", "PLAIN"]; + true +}; +if (weaponLowered player) exitWith { true }; +if (vehicle player != player) exitWith { true }; +if (currentWeapon player != primaryWeapon player) exitWith { true }; + +[] spawn { + 2 cutText ["", "PLAIN"]; + cse_AB_WindInfo = false; + 0 cutText ["", "PLAIN"]; + cse_AB_Protractor = true; + + while {cse_AB_Protractor && !(weaponLowered player) && currentWeapon player == primaryWeapon player} do { + _refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3]; + + _inclinationAngle = asin((player weaponDirection currentWeapon player) select 2); + _inclinationAngle = -58 max _inclinationAngle min 58; + + 1 cutRsc ["RscProtractor", "PLAIN", 1, false]; + + __ctrl1 ctrlSetScale 0.75; + __ctrl1 ctrlCommit 0; + __ctrl1 ctrlSetText "cse\cse_sys_ballistics\advancedballistics\data\protractor.paa"; + __ctrl1 ctrlSetTextColor [1, 1, 1, 1]; + + __ctrl2 ctrlSetScale 0.75; + __ctrl2 ctrlSetPosition [(_refPosition select 0), (_refPosition select 1) - 0.0012 * _inclinationAngle, (_refPosition select 2), (_refPosition select 3)]; + __ctrl2 ctrlCommit 0; + __ctrl2 ctrlSetText "cse\cse_sys_ballistics\advancedballistics\data\protractor_marker.paa"; + __ctrl2 ctrlSetTextColor [1, 1, 1, 1]; + + sleep 0.1; + }; + + cse_AB_Protractor = false; + 1 cutText ["", "PLAIN"]; +}; + +true diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_display_wind_info.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_display_wind_info.sqf new file mode 100644 index 0000000000..373621fde7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_display_wind_info.sqf @@ -0,0 +1,64 @@ +#include "defines.h" + +#define __dsp (uiNamespace getVariable "RscWindIntuitive") +#define __ctrl (__dsp displayCtrl 132948) + +private ["_windSpeed", "_windDir", "_playerDir", "_windIndex", "_windColor", "_newWindSpeed", "_windSource", "_height"]; + +if (cse_AB_WindInfo) exitWith { + cse_AB_WindInfo = false; + 0 cutText ["", "PLAIN"]; + true +}; +if (underwater player) exitWith { true }; +if (vehicle player != player) exitWith { true }; + +[] spawn { + 2 cutText ["", "PLAIN"]; + cse_AB_Protractor = false; + 1 cutText ["", "PLAIN"]; + cse_AB_WindInfo = true; + + while {cse_AB_WindInfo && !(underwater player) && vehicle player == player} do { + _windIndex = 12; + _windColor = [1, 1, 1, 1]; + + _windSpeed = (eyePos player) call cse_ab_ballistics_fnc_calculate_wind_speed; + + if (_windSpeed > 0.2) then { + _playerDir = getDir player; + _windDir = (wind select 0) atan2 (wind select 1); + _windIndex = round(((_playerDir - _windDir + 360) % 360) / 30); + _windIndex = _windIndex % 12; + }; + + // Color Codes from https://en.wikipedia.org/wiki/Beaufort_scale#Modern_scale + if (_windSpeed > 0.3) then { _windColor = [0.796, 1, 1, 1]; }; + if (_windSpeed > 1.5) then { _windColor = [0.596, 0.996, 0.796, 1]; }; + if (_windSpeed > 3.3) then { _windColor = [0.596, 0.996, 0.596, 1]; }; + if (_windSpeed > 5.4) then { _windColor = [0.6, 0.996, 0.4, 1]; }; + if (_windSpeed > 7.9) then { _windColor = [0.6, 0.996, 0.047, 1]; }; + if (_windSpeed > 10.7) then { _windColor = [0.8, 0.996, 0.059, 1]; }; + if (_windSpeed > 13.8) then { _windColor = [1, 0.996, 0.067, 1]; }; + if (_windSpeed > 17.1) then { _windColor = [1, 0.796, 0.051, 1]; }; + if (_windSpeed > 20.7) then { _windColor = [1, 0.596, 0.039, 1]; }; + if (_windSpeed > 24.4) then { _windColor = [1, 0.404, 0.031, 1]; }; + if (_windSpeed > 28.4) then { _windColor = [1, 0.22, 0.027, 1]; }; + if (_windSpeed > 32.6) then { _windColor = [1, 0.078, 0.027, 1]; }; + + 0 cutRsc ["RscWindIntuitive", "PLAIN", 1, false]; + + __ctrl ctrlSetScale 0.75; + __ctrl ctrlCommit 0; + + __ctrl ctrlSetText format["cse\cse_sys_ballistics\advancedballistics\data\wind%1.paa", _windIndex]; + __ctrl ctrlSetTextColor _windColor; + + sleep 0.5; + }; + + cse_AB_WindInfo = false; + 0 cutText ["", "PLAIN"]; +}; + +true diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_get_humidity_at_height.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_get_humidity_at_height.sqf new file mode 100644 index 0000000000..76d6903cdf --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_get_humidity_at_height.sqf @@ -0,0 +1,17 @@ +#include "defines.h" + +private ["_fogValue", "_fogDecay", "_fogBase"]; + +if (cse_AB_Humidity < 1 && fog > 0) then { + _fogValue = fogParams select 0; + _fogDecay = fogParams select 1; + _fogBase = fogParams select 2; + _fogDensity = 1 - 0.05 * (_fogDecay / _fogValue * (_this - _fogBase))^2; + if (_fogDensity > 0) then { + 1 + } else { + cse_AB_Humidity + (1 - cse_AB_Humidity) * (0 max (1 + _fogDensity)) + }; +} else { + cse_AB_Humidity +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_get_temperature_at_height.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_get_temperature_at_height.sqf new file mode 100644 index 0000000000..b9c3207518 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_get_temperature_at_height.sqf @@ -0,0 +1,3 @@ +#include "defines.h" + +GET_TEMPERATURE_AT_HEIGHT(_this) diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_initialize_terrain_extension.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_initialize_terrain_extension.sqf new file mode 100644 index 0000000000..014de5c4ac --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_initialize_terrain_extension.sqf @@ -0,0 +1,31 @@ +if (!cse_AB_UseDLL) exitWith {}; + +[] spawn { + private ["_initStartTime", "_mapSize", "_mapGrids", "_gridCenter", "_gridHeight", "_gridNumObjects", "_gridSurfaceIsWater"]; + + _initStartTime = time; + _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); + + if (("AdvancedBallistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { + if (cse_AB_InitMessageEnabled) then { + systemChat "AdvancedBallistics: Terrain already initialized"; + }; + }; + + _mapGrids = ceil(_mapSize / 50); + + for "_x" from 0 to _mapGrids * 50 step 50 do { + for "_y" from 0 to _mapGrids * 50 step 50 do { + _gridCenter = [_x + 25, _y + 25]; + _gridHeight = round(getTerrainHeightASL _gridCenter); + _gridNumObjects = count (_gridCenter nearObjects ["Building", 50]); + _gridSurfaceIsWater = if (surfaceIsWater _gridCenter) then {1} else {0}; + "AdvancedBallistics" callExtension format["set:%1:%2:%3", _gridHeight, _gridNumObjects, _gridSurfaceIsWater]; + }; + sleep 0.001; + }; + + if (cse_AB_InitMessageEnabled) then { + systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(time - _initStartTime)]; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_mirage_simulation.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_mirage_simulation.sqf new file mode 100644 index 0000000000..3c7c01464d --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_mirage_simulation.sqf @@ -0,0 +1,45 @@ +#include "defines.h" + +private ["_opticsName", "_parallax", "_playerDirection", "_vectorToFocalPoint", "_focusLength", "_focalPoint", "_roughnessLength", "_distCoef", "_focalPlaneAngle", "_windSpeedRef", "_windSpeed", + "_particleSize", "_particleMoveVelocityRef", "_particleMoveVelocity", "_pASL", "_pATL", "_height"]; + +while {cse_AB_MirageEnabled} do { + _opticsName = currentWeapon player; + if (currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then { + _opticsName = (primaryWeaponItems player) select 2; + }; + _parallax = player getVariable [format["cse_AB_Parallax:%1", _opticsName], 0]; + + while {sunOrMoon == 1 && cameraView == "GUNNER" && _parallax > 0} do { + _vectorToFocalPoint = (ATLToASL(screenToWorld [0.5,0.5])) vectorDiff (getPosASL player); + _focusLength = vectorMagnitude _vectorToFocalPoint; + if (_focusLength > 0) then { + _vectorToFocalPoint = _vectorToFocalPoint vectorMultiply (_parallax / _focusLength); + }; + _focusLength = vectorMagnitude _vectorToFocalPoint; + _focalPoint = (getPosASL player) vectorAdd _vectorToFocalPoint; + + _roughnessLength = _focalPoint call cse_ab_ballistics_fnc_calculate_roughness_length; + _distCoef = (1 max (_focusLength / 100)) ^ 0.5; + _focalPlaneAngle = (getDir player) + 90; + _windSpeedRef = vectorMagnitude wind; + _particleSize = 0.5 * _distCoef; + _particleMoveVelocityRef = [0, 0, 0.01] vectorAdd ((vectorNormalized wind) vectorMultiply (0.1)); + for "_j" from -10 to 10 do { + for "_i" from -10 to 10 do { + _pASL = [(_focalPoint select 0) + _j / 2 * _distCoef * sin(_focalPlaneAngle), (_focalPoint select 1) + _j / 2 * _distCoef * cos(_focalPlaneAngle), (_focalPoint select 2) + _i / 2 * _distCoef]; + _pATL = ASLToATL _pASL; + _windSpeed = _windSpeedRef; + _height = _pATL select 2; + if (_height < 20) then { + _windSpeed = _windSpeed * ln(_height / _roughnessLength) / ln(20 / _roughnessLength); + }; + _particleMoveVelocity = _particleMoveVelocityRef vectorMultiply _windSpeed; + drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,8,_pATL,_particleMoveVelocity,0,1.275,1,0,[_particleSize,_particleSize],[[0,0,0,0.3],[0,0,0,0.15]],[1,0],0,0,"","",""]; + }; + }; + _parallax = player getVariable [format["cse_AB_Parallax:%1", _opticsName], 0]; + sleep 1; + }; + sleep 1; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_synchronize_scope_zero.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_synchronize_scope_zero.sqf new file mode 100644 index 0000000000..13a8fb950a --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/functions/fn_synchronize_scope_zero.sqf @@ -0,0 +1,14 @@ +#include "defines.h" + +private ["_opticsName", "_zeroPlayer", "_zeroProfileNamespace"]; + +if (count primaryWeaponItems player > 2) then +{ + _opticsName = (primaryWeaponItems player) select 2; + _zeroPlayer = player getVariable [format["cse_AB_Zero:%1", _opticsName], 0]; + _zeroProfileNamespace = profileNamespace getVariable [format["cse_AB_Zero:%1", _opticsName], 0]; + + if (_zeroProfileNamespace != 0 && _zeroPlayer != _zeroProfileNamespace) then { + player setVariable [format["cse_AB_Zero:%1", _opticsName], _zeroProfileNamespace, true]; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/init.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/init.sqf new file mode 100644 index 0000000000..9fd1de801f --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/init.sqf @@ -0,0 +1,36 @@ +private ["_args"]; +_args = _this; +{ + _varName = "cse_ab_"+(_x select 0); + missionNamespace setvariable[_varName, _x select 1]; +}foreach _args; + +cse_ab_AdvancedBallistics = true; + +if (isNil "cse_AB_WindEnabled") then { cse_AB_WindEnabled = cse_AB_WIND_ENABLED }; +if (isNil "cse_AB_SpinDriftEnabled") then { cse_AB_SpinDriftEnabled = cse_AB_SPIN_DRIFT_ENABLED }; +if (isNil "cse_AB_CoriolisEnabled") then { cse_AB_CoriolisEnabled = cse_AB_CORIOLIS_ENABLED }; +if (isNil "cse_AB_EoetvoesEnabled") then { cse_AB_EoetvoesEnabled = cse_AB_EOETVOES_ENABLED }; +if (isNil "cse_AB_AdvancedAirDragEnabled") then { cse_AB_AdvancedAirDragEnabled = cse_AB_ADVANCED_AIR_DRAG_ENABLED }; +if (isNil "cse_AB_TransonicRegionEnabled") then { cse_AB_TransonicRegionEnabled = cse_AB_TRANSONIC_REGION_ENABLED }; +if (isNil "cse_AB_MilTurretsEnabled") then { cse_AB_MilTurretsEnabled = cse_AB_MIL_TURRETS_ENABLED }; +if (isNil "cse_AB_AmmoTemperatureEnabled") then { cse_AB_AmmoTemperatureEnabled = cse_AB_AMMO_TEMPERATURE_ENABLED }; +if (isNil "cse_AB_BulletTraceEnabled") then { cse_AB_BulletTraceEnabled = cse_AB_BULLET_TRACE_ENABLED }; +if (isNil "cse_AB_MirageEnabled") then { cse_AB_MirageEnabled = cse_AB_MIRAGE_ENABLED }; +if (isNil "cse_AB_AtmosphericDensitySimulationEnabled") then { cse_AB_AtmosphericDensitySimulationEnabled = cse_AB_ATMOSPHERIC_DENSITY_SIMULATION_ENABLED }; +if (isNil "cse_AB_BarrelLengthInfluenceEnabled") then { cse_AB_BarrelLengthInfluenceEnabled = cse_AB_BARREL_LENGTH_INFLUENCE }; +if (isNil "cse_AB_VehicleGunnerEnabled") then { cse_AB_VehicleGunnerEnabled = cse_AB_VEHICLE_GUNNER_ENABLED }; +if (isNil "cse_AB_ExtensionsEnabled") then { cse_AB_ExtensionsEnabled = cse_AB_EXTENSIONS_ENABLED }; +if (isNil "cse_AB_InitMessageEnabled") then { cse_AB_InitMessageEnabled = cse_AB_INIT_MESSAGE_ENABLED }; +if (isNil "cse_AB_OnlyActiveForLocalPlayer") then { cse_AB_OnlyActiveForLocalPlayer = cse_AB_ONLY_ACTIVE_FOR_LOCAL_PLAYER }; +if (isNil "cse_AB_OnlyActiveForPlayerGroup") then { cse_AB_OnlyActiveForPlayerGroup = cse_AB_ONLY_ACTIVE_FOR_PLAYER_GROUP }; +if (isNil "cse_AB_Precision") then { cse_AB_Precision = cse_AB_PRECISION }; +if (isNil "cse_AB_DisabledByDefault") then { cse_AB_DisabledByDefault = cse_AB_DISABLED_BY_DEFAULT in [true, 1] }; + +if (isNil "cse_AB_temperatureShift") then { cse_AB_temperatureShift = (random 3) - (random 3); publicVariable "cse_AB_temperatureShift"; }; +if (isNil "cse_AB_badWeatherShift") then { cse_AB_badWeatherShift = (random 1)^2 * 10; publicVariable "cse_AB_badWeatherShift"; }; +if (isNil "cse_AB_humidityShift") then { cse_AB_humidityShift = ((random 5) - (random 5)) / 100; publicVariable "cse_AB_humidityShift"; }; + +if (hasInterface) then { + call compile preprocessFileLineNumbers "cse\cse_sys_ballistics\advancedballistics\initClient.sqf"; +}; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/initClient.sqf b/TO_MERGE/cse/sys_ballistics/advancedballistics/initClient.sqf new file mode 100644 index 0000000000..b2f41b8a16 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/initClient.sqf @@ -0,0 +1,169 @@ +if (isNil "cse_AB_OnlyActiveForLocalPlayer") then { cse_AB_OnlyActiveForLocalPlayer = false; }; +if (isNil "cse_AB_DisabledInFullAutoMode") then { cse_AB_DisabledInFullAutoMode = false; }; +if (isNil "cse_AB_UseDLL") then { cse_AB_UseDLL = false; }; + +if (cse_AB_ExtensionsEnabled && ("AdvancedBallistics" callExtension "version") == "1.0") then { + cse_AB_UseDLL = true; + cse_ab_ballistics_fnc_advanced_ballistics = cse_ab_ballistics_fnc_advanced_ballistics_extension; +}; + +cse_AB_bulletDatabase = []; +cse_AB_bulletDatabaseStartTime = []; +cse_AB_bulletDatabaseSpeed = []; +cse_AB_bulletDatabaseFrames = []; +cse_AB_bulletDatabaseLastFrame = []; +cse_AB_bulletDatabaseHDeflect = []; +cse_AB_bulletDatabaseSpinDrift = []; +cse_AB_bulletDatabaseOccupiedIndices = []; +cse_AB_bulletDatabaseFreeIndices = []; + +cse_AB_WindInfo = false; +cse_AB_WindInfoStart = time; + +cse_AB_Protractor = false; +cse_AB_ProtractorStart = time; + +cse_AB_Altitude = 0; +cse_AB_Latitude = 50; + +cse_AB_Temperature = 15; +cse_AB_Humidity = 50; + +if (worldName in ["Chernarus", "Bootcamp_ACR", "Woodland_ACR", "utes"]) then { cse_AB_Latitude = 50; cse_AB_Altitude = 0; }; +if (worldName in ["Altis", "Stratis"]) then { cse_AB_Latitude = 40; cse_AB_Altitude = 0; }; +if (worldName in ["Takistan", "Zargabad", "Mountains_ACR"]) then { cse_AB_Latitude = 35; cse_AB_Altitude = 2000; }; +if (worldName in ["Shapur_BAF", "ProvingGrounds_PMC"]) then { cse_AB_Latitude = 35; cse_AB_Altitude = 100; }; +if (worldName in ["fallujah"]) then { cse_AB_Latitude = 33; cse_AB_Altitude = 0; }; +if (worldName in ["fata", "Abbottabad"]) then { cse_AB_Latitude = 30; cse_AB_Altitude = 1000; }; +if (worldName in ["sfp_wamako"]) then { cse_AB_Latitude = 14; cse_AB_Altitude = 0; }; +if (worldName in ["sfp_sturko"]) then { cse_AB_Latitude = 56; cse_AB_Altitude = 0; }; +if (worldName in ["Bornholm"]) then { cse_AB_Latitude = 55; cse_AB_Altitude = 0; }; +if (worldName in ["Imrali"]) then { cse_AB_Latitude = 40; cse_AB_Altitude = 0; }; +if (worldName in ["Caribou"]) then { cse_AB_Latitude = 68; cse_AB_Altitude = 0; }; +if (worldName in ["Namalsk"]) then { cse_AB_Latitude = 65; cse_AB_Altitude = 0; }; +if (worldName in ["MCN_Aliabad"]) then { cse_AB_Latitude = 36; cse_AB_Altitude = 0; }; +if (worldName in ["Clafghan"]) then { cse_AB_Latitude = 34; cse_AB_Altitude = 640; }; +if (worldName in ["Sangin", "hellskitchen"]) then { cse_AB_Latitude = 32; cse_AB_Altitude = 0; }; +if (worldName in ["Sara"]) then { cse_AB_Latitude = 40; cse_AB_Altitude = 0; }; +if (worldName in ["reshmaan"]) then { cse_AB_Latitude = 35; cse_AB_Altitude = 2000; }; +if (worldName in ["Thirsk"]) then { cse_AB_Latitude = 65; cse_AB_Altitude = 0; }; +if (worldName in ["lingor"]) then { cse_AB_Latitude = -4; cse_AB_Altitude = 0; }; + +waitUntil {!isNil "cse_gui"}; +waitUntil {!isNull player}; + +if (isNil {player getVariable "cse_enabled_AdvancedBallistics"}) then { + player setVariable ["cse_enabled_AdvancedBallistics", !cse_AB_DisabledByDefault, true]; +}; + +if (cse_AB_MilTurretsEnabled) then { + // Elevation minor step up + ["cse_sys_ballistics_AB_Adjustment_Up", (["cse_sys_ballistics_AB_Adjustment_Up","action",[200, 0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [0, false] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Up","action", "Minor adjustment up", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Elevation minor step down + ["cse_sys_ballistics_AB_Adjustment_Down", (["cse_sys_ballistics_AB_Adjustment_Down","action",[208, 0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [1, false] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Down","action", "Minor adjustment Down", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Windage minor step left + ["cse_sys_ballistics_AB_Adjustment_Left", (["cse_sys_ballistics_AB_Adjustment_Left","action",[203, 0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [2, false] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Left","action", "Minor adjustment Left", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Windage minor step right + ["cse_sys_ballistics_AB_Adjustment_Right", (["cse_sys_ballistics_AB_Adjustment_Right","action",[205, 0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [3, false] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Right","action", "Minor adjustment Right", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Elevation major step up + ["cse_sys_ballistics_AB_Adjustment_Up_major", (["cse_sys_ballistics_AB_Adjustment_Up_major","action",[200, 1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [0, true] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Up_major","action", "Major adjustment up", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Elevation major step down + ["cse_sys_ballistics_AB_Adjustment_Down_major", (["cse_sys_ballistics_AB_Adjustment_Down_major","action",[208, 1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [1, true] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Down_major","action", "Major adjustment Down", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Windage major step left + ["cse_sys_ballistics_AB_Adjustment_Left_major", (["cse_sys_ballistics_AB_Adjustment_Left_major","action",[203, 1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [2, true] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Left_major","action", "Major adjustment Left_major", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Windage major step right + ["cse_sys_ballistics_AB_Adjustment_Right_major", (["cse_sys_ballistics_AB_Adjustment_Right_major","action",[205, 1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [3, true] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + + ["cse_sys_ballistics_AB_Adjustment_Right_major","action", "Major adjustment Right", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + // Scope zero adjustment + ["cse_sys_ballistics_AB_Adjustment_Zero_Up", (["cse_sys_ballistics_AB_Adjustment_Zero_Up","action",[200, 1,1,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [4, false] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + ["cse_sys_ballistics_AB_Adjustment_Zero_Up","action", "Zero adjustment up", "Zero adjustment up"] call cse_fnc_settingsDefineDetails_F; + + ["cse_sys_ballistics_AB_Adjustment_Zero_Down", (["cse_sys_ballistics_AB_Adjustment_Zero_Down","action",[208, 1,1,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + [5, false] call cse_ab_ballistics_fnc_adjust_turret; + }] call cse_fnc_addKeyBindingForAction_F; + ["cse_sys_ballistics_AB_Adjustment_Zero_Down","action", "Zero adjustment down", "Zero adjustment down"] call cse_fnc_settingsDefineDetails_F; +}; + +// Parallax Adjustment +if (cse_AB_MirageEnabled) then { + ["cse_sys_ballistics_AB_Adjustment_Parallax_Up", (["cse_sys_ballistics_AB_Adjustment_Parallax_Up","action",[200, 0,1,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + 0 call cse_ab_ballistics_fnc_adjust_parallax; + }] call cse_fnc_addKeyBindingForAction_F; + ["cse_sys_ballistics_AB_Adjustment_Parallax_Up","action", "Parallax adjustment up", "Parallax adjustment up"] call cse_fnc_settingsDefineDetails_F; + + ["cse_sys_ballistics_AB_Adjustment_Parallax_Down", (["cse_sys_ballistics_AB_Adjustment_Parallax_Down","action",[208, 0,1,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + 1 call cse_ab_ballistics_fnc_adjust_parallax; + }] call cse_fnc_addKeyBindingForAction_F; + ["cse_sys_ballistics_AB_Adjustment_Parallax_Down","action", "Parallax adjustment down", "Parallax adjustment down"] call cse_fnc_settingsDefineDetails_F; +}; + +// Show wind Info +["cse_sys_ballistics_AB_Display_Wind_Info", (["cse_sys_ballistics_AB_Display_Wind_Info","action",[37,1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + _this call cse_ab_ballistics_fnc_display_wind_info; + }] call cse_fnc_addKeyBindingForAction_F; +["cse_sys_ballistics_AB_Display_Wind_Info","action", "Show wind info", "Show wind info"] call cse_fnc_settingsDefineDetails_F; + +// Show protractor +["cse_sys_ballistics_AB_Display_Protractor", (["cse_sys_ballistics_AB_Display_Protractor","action",[37,1,1,0]] call cse_fnc_getKeyBindingFromProfile_F), + { + _this call cse_ab_ballistics_fnc_display_protractor; + }] call cse_fnc_addKeyBindingForAction_F; +["cse_sys_ballistics_AB_Display_Protractor","action", "Show protractor", "Show protractor"] call cse_fnc_settingsDefineDetails_F; + +_handle = _this spawn cse_ab_ballistics_fnc_climate_simulation; +_handle = _this spawn cse_ab_ballistics_fnc_mirage_simulation; +_handle = _this spawn cse_ab_ballistics_fnc_initialize_terrain_extension; diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/license.txt b/TO_MERGE/cse/sys_ballistics/advancedballistics/license.txt new file mode 100644 index 0000000000..eb925e129b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/license.txt @@ -0,0 +1,19 @@ +Copyright (c) <2014> + +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. \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/sound/scope_click.wav b/TO_MERGE/cse/sys_ballistics/advancedballistics/sound/scope_click.wav new file mode 100644 index 0000000000..fada577045 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/advancedballistics/sound/scope_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/advancedballistics/ui/rscTitles.h b/TO_MERGE/cse/sys_ballistics/advancedballistics/ui/rscTitles.h new file mode 100644 index 0000000000..4d6ab56696 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/advancedballistics/ui/rscTitles.h @@ -0,0 +1,92 @@ +class RscTitles +{ + class RscWindIntuitive + { + idd=-1; + onLoad="with uiNameSpace do { RscWindIntuitive = _this select 0 };"; + movingEnable=0; + duration=60; + fadeIn="false"; + fadeOut="false"; + class controls + { + class RscWindIntuitive + { + idc=132948; + type=0; + style=48; + font="TahomaB"; + colorBackground[]={0,0,0,0}; + colorText[]={0,0,0,0}; + x="SafeZoneX + 0.001"; + y="SafeZoneY + 0.001"; + w=0.2; + h=0.2*4/3; + size=0.034; + sizeEx=0.027; + text=""; + }; + }; + }; + + class RscTurretDial + { + idd=-1; + onLoad="with uiNameSpace do { RscTurretDial = _this select 0 };"; + movingEnable=0; + duration=5; + fadeIn="false"; + fadeOut="false"; + class controls + { + class RscTurretDial + { + idc=132949; + type=0; + style=128; + font="TahomaB"; + colorBackground[]={0,0,0,0.8}; + colorText[]={1,1,1,1}; + x="SafeZoneX + 0.0025"; + y="SafeZoneY + 0.0025"; + w=0.10; + h=0.05; + sizeEx=0.03; + text=""; + }; + }; + }; + + class RscProtractor + { + idd=-1; + onLoad="with uiNameSpace do { RscProtractor = _this select 0 };"; + movingEnable=0; + duration=60; + fadeIn="false"; + fadeOut="false"; + class controls + { + class RscProtractorBase + { + idc=132950; + type=0; + style=48; + font="TahomaB"; + colorBackground[]={0,0,0,0}; + colorText[]={1,1,1,1}; + x="SafeZoneX + 0.001"; + y="SafeZoneY + 0.001"; + w=0.2; + h=0.2*4/3; + size=0.034; + sizeEx=0.027; + text=""; + }; + class RscProtractorMarker : RscProtractorBase + { + idc=132951; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/CfgFunctions.h b/TO_MERGE/cse/sys_ballistics/atragmx/CfgFunctions.h new file mode 100644 index 0000000000..965add7ff7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/CfgFunctions.h @@ -0,0 +1,48 @@ +class cfgFunctions { + class CSE_ab_atragmx + { + class Atragmx { + file = "cse\cse_sys_ballistics\atragmx\functions"; + class add_new_gun { recompile = 1; }; + class calculate_range_card { recompile = 1; }; + class calculate_scope_base_angle { recompile = 1; }; + class calculate_solution { recompile = 1; }; + class calculate_target_range_assist { recompile = 1; }; + class calculate_target_solution { recompile = 1; }; + class calculate_target_speed_assist { recompile = 1; }; + class change_gun { recompile = 1; }; + class create_dialog { recompile = 1; }; + class cycle_range_card_columns { recompile = 1; }; + class cycle_scope_unit { recompile = 1; }; + class delete_gun { recompile = 1; }; + class parse_input { recompile = 1; }; + class reset_relative_click_memory { recompile = 1; }; + class save_gun { recompile = 1; }; + class show_add_new_gun { recompile = 1; }; + class show_gun_list { recompile = 1; }; + class show_main_page { recompile = 1; }; + class show_range_card { recompile = 1; }; + class show_range_card_setup { recompile = 1; }; + class show_target_range_assist { recompile = 1; }; + class show_target_speed_assist { recompile = 1; }; + class show_target_speed_assist_timer { recompile = 1; }; + class sord { recompile = 1; }; + class target_speed_assist_timer { recompile = 1; }; + class toggle_gun_list { recompile = 1; }; + class toggle_range_card { recompile = 1; }; + class toggle_range_card_setup { recompile = 1; }; + class toggle_target_range_assist { recompile = 1; }; + class toggle_target_speed_assist { recompile = 1; }; + class update_atmosphere { recompile = 1; }; + class update_gun { recompile = 1; }; + class update_range_card { recompile = 1; }; + class update_relative_click_memory { recompile = 1; }; + class update_result { recompile = 1; }; + class update_scope_unit { recompile = 1; }; + class update_target { recompile = 1; }; + class update_target_selection { recompile = 1; }; + class update_unit_selection { recompile = 1; }; + class update_zero_range { recompile = 1; }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/CfgVehicles.h b/TO_MERGE/cse/sys_ballistics/atragmx/CfgVehicles.h new file mode 100644 index 0000000000..f7e32ea91b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/CfgVehicles.h @@ -0,0 +1,38 @@ +class CfgVehicles +{ + class Item_Base_F; + class cse_ab_Item_ATragMX: Item_Base_F + { + scope=2; + scopeCurator=2; + displayName="ATragMX"; + author="Ruthberg"; + vehicleClass="Items"; + class TransportItems + { + class cse_ab_ATragMX + { + name="cse_ab_ATragMX"; + count=1; + }; + }; + }; + + + class NATO_Box_Base; + class cse_ballisticsItemsCrate: NATO_Box_Base + { + scope = 2; + displayName = "Ballistic Items [CSE]"; + author = "Combat Space Enhancement"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + class TransportWeapons + { + class _xx_cse_ab_ATragMX + { + weapon="cse_ab_ATragMX"; + count=5; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/CfgWeapons.h b/TO_MERGE/cse/sys_ballistics/atragmx/CfgWeapons.h new file mode 100644 index 0000000000..e0f74507cb --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/CfgWeapons.h @@ -0,0 +1,20 @@ +class CfgWeapons +{ + class ItemCore; + class InventoryItem_Base_F; + class cse_ab_ATragMX: ItemCore + { + scope=2; + value = 1; + count = 1; + type = 16; + displayName="ATragMX"; + picture="\cse\cse_sys_ballistics\atragmx\data\ATrag_Icon.paa"; + descriptionShort="Rugged PDA with ATragMX"; + class ItemInfo: InventoryItem_Base_F + { + mass=4; + type=201; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/Combat_Space_Enhancement.h b/TO_MERGE/cse/sys_ballistics/atragmx/Combat_Space_Enhancement.h new file mode 100644 index 0000000000..3561558d2e --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/Combat_Space_Enhancement.h @@ -0,0 +1,11 @@ +class Combat_Space_Enhancement { + class EventHandlers { + class PostInit_EventHandlers { + class cse_ab_atragmx { + init = "call compile preprocessFile 'cse\cse_sys_ballistics\atragmx\XEH_postClientInit.sqf';"; + name = "ATragMX"; + author = "Ruthberg"; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/UI.h b/TO_MERGE/cse/sys_ballistics/atragmx/UI.h new file mode 100644 index 0000000000..3b76303baf --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/UI.h @@ -0,0 +1,2 @@ +#include "ui\defines.h" +#include "ui\display.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/XEH_postClientInit.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/XEH_postClientInit.sqf new file mode 100644 index 0000000000..0ed32ddbc4 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/XEH_postClientInit.sqf @@ -0,0 +1,32 @@ +if (!hasInterface) exitwith{}; + +if (count (profileNamespace getVariable ["cse_ab_ATragMX_gunList", []]) > 0) then { + cse_ab_ATragMX_gunList = profileNamespace getVariable "cse_ab_ATragMX_gunList"; +} else { + // Profile Name, Muzzle Velocity, Zero Range, Scope Base Angle, AirFriction, Bore Height, Scope Unit, Elevation Scope Step, Windage Scope Step, Maximum Elevation, Dialed Elevation, Dialed Windage, Mass, Ammo Class Name, Magazine Class Name, BC, Drag Model, Atmosphere Model + cse_ab_ATragMX_gunList = [["12.7x108mm" , 820, 500, 0.255, -0.0005600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 48.28, "B_127x108_Ball" , "5Rnd_127x108_Mag" , 0.700, 1, "ASM" ], + ["12.7x99mm" , 880, 500, 0.202, -0.0005600, 3.81, 0, 0.338, 0.338, 120, 0, 0, 41.92, "B_127x99_Ball" , "5Rnd_mas_127x99_Stanag" , 0.670, 1, "ASM" ], + ["10.4x77mm" , 910, 500, 0.200, -0.0004800, 3.81, 0, 0.338, 0.338, 120, 0, 0, 27.15, "B_408_Ball" , "7Rnd_408_Mag" , 0.970, 1, "ASM" ], + ["7.62x51mm" , 850, 500, 0.280, -0.0010000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.460, "B_762x51_Ball" , "20Rnd_762x51_Mag" , 0.393, 1, "ICAO"], + ["6.5x39mm" , 800, 500, 0.304, -0.0009000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 7.776, "B_65x39_Caseless", "30Rnd_65x39_caseless_mag", 0.263, 1, "ICAO"], + ["5.56x45mm" , 920, 500, 0.259, -0.0012000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.000, "B_556x45_Ball" , "30Rnd_556x45_Stanag" , 0.304, 1, "ASM" ], + ["5.56x45mm Mk262" , 850, 500, 0.294, -0.0011250, 3.81, 0, 0.338, 0.338, 120, 0, 0, 4.990, "RH_556x45_Mk262" , "RH_30Rnd_556x45_Mk262" , 0.361, 1, "ASM" ]]; + + profileNamespace setVariable ["cse_ab_ATragMX_gunList", cse_ab_ATragMX_gunList]; +}; + +call compile preprocessFile ("cse\cse_sys_ballistics\atragmx\init.sqf"); +//call compile preprocessFile ("\atragmx\fnc_sord.sqf"); + + +[] spawn { + waituntil {!isnil "cse_gui"}; + // TODO seperate config entry for this, outside module space. + ["cse_sys_ballistics_ATragMX_open", (["cse_sys_ballistics_ATragMX_open","menu",[197, 0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { _this call cse_ab_ATragMX_fnc_create_dialog; }, 0] call cse_fnc_addKeyBindingForMenu_F; + ["cse_sys_ballistics_ATragMX_open","menu", "Open ATragMX", "Opens the ATragMX dialog"] call cse_fnc_settingsDefineDetails_F; + + _entries = [ + ["ATragMX", {([player, 'cse_ab_ATragMX'] call cse_fnc_hasItem_CC)}, "cse\cse_sys_ballistics\atragmx\data\ATRAG_Icon.paa", { closeDialog 0; call cse_ab_ATragMX_fnc_create_dialog; }, "Use ATragMX"] + ]; + ["ActionMenu", "equipment", _entries] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/config.cpp b/TO_MERGE/cse/sys_ballistics/atragmx/config.cpp new file mode 100644 index 0000000000..e17c52e8db --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/config.cpp @@ -0,0 +1,35 @@ +#define ST_LEFT 0 +#define ST_RIGHT 1 +#define ST_CENTER 2 + +class CfgPatches +{ + class cse_ab_atragmx + { + units[]={}; + weapons[]= {"cse_ab_ATragMX"}; + requiredVersion=1.26; + requiredAddons[]= {"cse_f_modules", "cse_main", "cse_f_configuration"}; + version="1.0"; + author[]= {"Ruthberg"}; + }; +}; +class CfgAddons +{ + class PreloadAddons + { + class cse_ab_atragmx + { + list[]= + { + "cse_ab_atragmx" + }; + }; + }; +}; + +#include "Combat_Space_Enhancement.h" +#include "CfgFunctions.h" +#include "CfgWeapons.h" +#include "CfgVehicles.h" +#include "UI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/data/ATRAG.paa b/TO_MERGE/cse/sys_ballistics/atragmx/data/ATRAG.paa new file mode 100644 index 0000000000..5708a35786 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/atragmx/data/ATRAG.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/data/ATRAG_Icon.paa b/TO_MERGE/cse/sys_ballistics/atragmx/data/ATRAG_Icon.paa new file mode 100644 index 0000000000..e233e510ef Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/atragmx/data/ATRAG_Icon.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_add_new_gun.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_add_new_gun.sqf new file mode 100644 index 0000000000..7c4d01c261 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_add_new_gun.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +private ["_gunName", "_gunProfileEntry"]; + +_gunName = ctrlText 11001; +if (_gunName != "") then { + _gunProfileEntry = [_gunName, 850, 500, 0.280, -0.0010000, 3.81, 0, 0.338, 0.338, 120, 0, 0, 9.460, "", "", 0.393, 1, "ICAO"]; + + cse_ab_ATragMX_gunList = cse_ab_ATragMX_gunList + [_gunProfileEntry]; + + lbAdd [6000, _gunProfileEntry select 0]; + + profileNamespace setVariable ["cse_ab_ATragMX_gunList", cse_ab_ATragMX_gunList]; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_range_card.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_range_card.sqf new file mode 100644 index 0000000000..2ad0cd836a --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_range_card.sqf @@ -0,0 +1,48 @@ +#include "script_component.hpp" + +call cse_ab_ATragMX_fnc_parse_input; + +private ["_scopeBaseAngle"]; +_scopeBaseAngle = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 3); + +private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; +_bulletMass = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 12; +_boreHeight = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 5; +_airFriction = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 4; +_muzzleVelocity = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 1; +_bc = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 15; +_dragModel = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 16; +_atmosphereModel = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 17; + +private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +_temperature = (cse_ab_ATragMX_temperature select cse_ab_ATragMX_currentTarget); +_barometricPressure = (cse_ab_ATragMX_barometricPressure select cse_ab_ATragMX_currentTarget); +_relativeHumidity = (cse_ab_ATragMX_relativeHumidity select cse_ab_ATragMX_currentTarget); +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _temperature = (_temperature - 32) / 1.8; + _barometricPressure = _barometricPressure * 33.8638866667; +}; + +private ["_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; +_windSpeed = (cse_ab_ATragMX_windSpeed select cse_ab_ATragMX_currentTarget); +_windDirection = (cse_ab_ATragMX_windDirection select cse_ab_ATragMX_currentTarget); +_inclinationAngle = (cse_ab_ATragMX_inclinationAngle select cse_ab_ATragMX_currentTarget); +_targetSpeed = (cse_ab_ATragMX_targetSpeed select cse_ab_ATragMX_currentTarget); +_targetRange = cse_ab_ATragMX_rangeCardEndRange; +if (cse_ab_ATragMX_currentUnit != 2) then +{ + _targetRange = _targetRange / 1.0936133; +}; +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _windSpeed = _windSpeed / 2.23693629; + _targetSpeed = _targetSpeed / 2.23693629; +}; + +cse_ab_ATragMX_rangeCardData = []; + +private ["_result"]; +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, + _windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, true] call cse_ab_ATragMX_fnc_calculate_solution; + diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_scope_base_angle.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_scope_base_angle.sqf new file mode 100644 index 0000000000..3e39d9a478 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_scope_base_angle.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_zeroRange"]; +_bulletMass = _this select 0; +_boreHeight = _this select 1; +_airFriction = _this select 2; +_muzzleVelocity = _this select 3; +_zeroRange = _this select 4; + +private ["_scopeBaseAngle"]; +_scopeBaseAngle = 0; + +private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +_temperature = 15; +_barometricPressure = 1013.25; +_relativeHumidity = 0; + +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _airFriction, 1, "ICAO", false] call cse_ab_ATragMX_fnc_calculate_solution; + +_scopeBaseAngle + (_result select 0) / 60 diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_solution.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_solution.sqf new file mode 100644 index 0000000000..89b380cc17 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_solution.sqf @@ -0,0 +1,123 @@ +#include "script_component.hpp" + +private ["_scopeBaseAngle", "_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_temperature", "_barometricPressure", "_relativeHumidity", "_simSteps", "_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange", "_bc", "_dragModel", "_atmosphereModel", "_storeRangeCardData"]; +_scopeBaseAngle = _this select 0; +_bulletMass = _this select 1; +_boreHeight = _this select 2; +_airFriction = _this select 3; +_muzzleVelocity = _this select 4; +_temperature = _this select 5; +_barometricPressure = _this select 6; +_relativeHumidity = _this select 7; +_simSteps = _this select 8; +_windSpeed = _this select 9; +_windDirection = _this select 10; +_inclinationAngle = _this select 11; +_targetSpeed = _this select 12; +_targetRange = _this select 13; +_bc = _this select 14; +_dragModel = _this select 15; +_atmosphereModel = _this select 16; +_storeRangeCardData = _this select 17; + +private ["_bulletPos", "_bulletVelocity", "_bulletAccel", "_gravity", "_deltaT"]; +_bulletPos = [0, 0, 0]; +_bulletVelocity = [0, 0, 0]; +_bulletAccel = [0, 0, 0]; +_gravity = [0, sin(_scopeBaseAngle + _inclinationAngle) * -9.80665, cos(_scopeBaseAngle + _inclinationAngle) * -9.80665]; +_deltaT = 1 / _simSteps; + +private ["_elevation", "_windage", "_lead", "_TOF", "_bulletSpeed", "_kineticEnergy"]; +_elevation = 0; +_windage = 0; +_lead = 0; +_TOF = 0; +_bulletSpeed = 0; + +private ["_n", "_range", "_rangeFactor"]; +_n = 0; +_range = 0; +_rangeFactor = 1; +if (_storeRangeCardData) then { + if (cse_ab_ATragMX_currentUnit != 2) then { + _rangeFactor = 1.0936133; + }; + cse_ab_ATragMX_rangeCardData = []; +}; + +private ["_wind"]; +if (["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) then { + _wind = [cos(270 - _windDirection * 30) * _windSpeed, sin(270 - _windDirection * 30) * _windSpeed, 0]; + if (cse_AB_AdvancedAirDragEnabled) then { + _bc = [_bc, _temperature, _barometricPressure, _relativeHumidity, _atmosphereModel] call cse_ab_ballistics_fnc_calculate_Atmospheric_Correction; + }; +}; + +_TOF = 0; + +_bulletPos set [0, 0]; +_bulletPos set [1, 0]; +_bulletPos set [2, -(_boreHeight / 100)]; + +_bulletVelocity set [0, 0]; +_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity]; +_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity]; + +while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do +{ + _bulletSpeed = vectorMagnitude _bulletVelocity; + + if (["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) then { + private ["_trueVelocity", "_trueSpeed", "_drag"]; + _trueVelocity = _bulletVelocity vectorDiff _wind; + _trueSpeed = vectorMagnitude _trueVelocity; + + if (cse_AB_AdvancedAirDragEnabled) then { + _drag = -1 * ([_dragModel, _bc, _trueSpeed] call cse_ab_ballistics_fnc_calculate_Retardation); + } else { + _bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction); + }; + _bulletAccel = (vectorNormalized _trueVelocity) vectorMultiply (_drag); + } else { + _bulletAccel = _bulletVelocity vectorMultiply (_bulletSpeed * _airFriction); + }; + + _bulletAccel = _bulletAccel vectorAdd _gravity; + + _bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT); + _bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply _deltaT); + + _TOF = _TOF + _deltaT; + + if (_storeRangeCardData) then { + _range = cse_ab_ATragMX_rangeCardStartRange + _n * cse_ab_ATragMX_rangeCardIncrement; + if ((_bulletPos select 1) * _rangeFactor >= _range && _range <= cse_ab_ATragMX_rangeCardEndRange) then { + if ((_bulletPos select 1) > 0) then { + _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); + _windage = - atan((_bulletPos select 0) / (_bulletPos select 1)); + }; + if (_range != 0) then { + _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _range); + }; + _kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); + _kineticEnergy = _kineticEnergy * 0.737562149; + + cse_ab_ATragMX_rangeCardData set [_n, [_range, _elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy]]; + _n = _n + 1; + }; + }; +}; + +if ((_bulletPos select 1) > 0) then { + _elevation = - atan((_bulletPos select 2) / (_bulletPos select 1)); + _windage = - atan((_bulletPos select 0) / (_bulletPos select 1)); +}; + +if (_targetRange != 0) then { + _lead = (_targetSpeed * _TOF) / (Tan(3.38 / 60) * _targetRange); +}; + +_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2)); +_kineticEnergy = _kineticEnergy * 0.737562149; + +[_elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy] diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_range_assist.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_range_assist.sqf new file mode 100644 index 0000000000..76adcc77da --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_range_assist.sqf @@ -0,0 +1,105 @@ +#include "script_component.hpp" + +private ["_targetSize", "_imageSize", "_angle", "_estRange"]; + +_angle = parseNumber(ctrlText 7012); +_targetSize = parseNumber(ctrlText 7010); +if (cse_ab_ATragMX_rangeAssistUseTargetHeight) then +{ + _targetSize = _targetSize * cos(_angle); +}; +switch (cse_ab_ATragMX_rangeAssistTargetSizeUnit) do +{ + case 0: + { + _targetSize = _targetSize * 0.0254; + }; + case 1: + { + _targetSize = _targetSize * 0.3048; + }; + case 2: + { + _targetSize = _targetSize * 0.01; + }; +}; +_imageSize = parseNumber(ctrlText 7011); +switch (cse_ab_ATragMX_rangeAssistImageSizeUnit) do +{ + case 0: + { + _imageSize = _imageSize / 6400 * 360; + }; + case 1: + { + _imageSize = _imageSize / 60; + }; + case 2: + { + _imageSize = _imageSize / 60 / 1.047; + }; +}; +_estRange = parseNumber(ctrlText 7013); +if (cse_ab_ATragMX_currentUnit != 2) then +{ + _estRange = _estRange / 1.0936133; +}; + +switch (_this) do +{ + case 0: + { + _targetSize = tan(_imageSize) * _estRange; + + if (cse_ab_ATragMX_rangeAssistUseTargetHeight) then + { + _targetSize = _targetSize / cos(_angle); + }; + + switch (cse_ab_ATragMX_rangeAssistTargetSizeUnit) do + { + case 0: + { + _targetSize = _targetSize / 0.0254; + }; + case 1: + { + _targetSize = _targetSize / 0.3048; + }; + case 2: + { + _targetSize = _targetSize / 0.01; + }; + }; + + ctrlSetText [7010, Str(Round(_targetSize * 100) / 100)]; + }; + case 1: + { + _imageSize = atan(_targetSize / _estRange); + + switch (cse_ab_ATragMX_rangeAssistImageSizeUnit) do + { + case 0: + { + _imageSize = _imageSize * 6400 / 360; + }; + case 1: + { + _imageSize = _imageSize * 60; + }; + case 2: + { + _imageSize = _imageSize * 60 * 1.047; + }; + }; + + ctrlSetText [7011, Str(Round(_imageSize * 100) / 100)]; + }; + case 2: + { + _estRange = _targetSize / tan(_imageSize); + + ctrlSetText [7013, Str(Round(_estRange))]; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_solution.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_solution.sqf new file mode 100644 index 0000000000..2b30a882fd --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_solution.sqf @@ -0,0 +1,52 @@ +#include "script_component.hpp" + +call cse_ab_ATragMX_fnc_parse_input; + +private ["_scopeBaseAngle"]; +_scopeBaseAngle = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 3); + +private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; +_bulletMass = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 12; +_boreHeight = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 5; +_airFriction = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 4; +_muzzleVelocity = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 1; +_bc = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 15; +_dragModel = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 16; +_atmosphereModel = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 17; + +private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +_temperature = (cse_ab_ATragMX_temperature select cse_ab_ATragMX_currentTarget); +_barometricPressure = (cse_ab_ATragMX_barometricPressure select cse_ab_ATragMX_currentTarget); +_relativeHumidity = (cse_ab_ATragMX_relativeHumidity select cse_ab_ATragMX_currentTarget); +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _temperature = (_temperature - 32) / 1.8; + _barometricPressure = _barometricPressure * 33.8638866667; +}; + +private ["_windSpeed", "_windDirection", "_inclinationAngle", "_targetSpeed", "_targetRange"]; +_windSpeed = (cse_ab_ATragMX_windSpeed select cse_ab_ATragMX_currentTarget); +_windDirection = (cse_ab_ATragMX_windDirection select cse_ab_ATragMX_currentTarget); +_inclinationAngle = (cse_ab_ATragMX_inclinationAngle select cse_ab_ATragMX_currentTarget); +_targetSpeed = (cse_ab_ATragMX_targetSpeed select cse_ab_ATragMX_currentTarget); +_targetRange = (cse_ab_ATragMX_targetRange select cse_ab_ATragMX_currentTarget); +if (cse_ab_ATragMX_currentUnit != 2) then +{ + _targetRange = _targetRange / 1.0936133; +}; +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _windSpeed = _windSpeed / 2.23693629; + _targetSpeed = _targetSpeed / 2.23693629; +}; + +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, + _windSpeed, _windDirection, _inclinationAngle, _targetSpeed, _targetRange, _bc, _dragModel, _atmosphereModel, false] call cse_ab_ATragMX_fnc_calculate_solution; + +cse_ab_ATragMX_elevationOutput set [cse_ab_ATragMX_currentTarget, _result select 0]; +cse_ab_ATragMX_windageOutput set [cse_ab_ATragMX_currentTarget, _result select 1]; +cse_ab_ATragMX_leadOutput set [cse_ab_ATragMX_currentTarget, _result select 2]; +cse_ab_ATragMX_tofOutput set [cse_ab_ATragMX_currentTarget, _result select 3]; +cse_ab_ATragMX_velocityOutput set [cse_ab_ATragMX_currentTarget, _result select 4]; + +call cse_ab_ATragMX_fnc_update_result; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_speed_assist.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_speed_assist.sqf new file mode 100644 index 0000000000..1228db754a --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_calculate_target_speed_assist.sqf @@ -0,0 +1,41 @@ +#include "script_component.hpp" + +private ["_targetRange", "_numTicks", "_timeSecs", "_estSpeed"]; + +_targetRange = parseNumber(ctrlText 8004); +_numTicks = parseNumber(ctrlText 8005); +_timeSecs = parseNumber(ctrlText 8006); +_estSpeed = 0; + +if (cse_ab_ATragMX_currentUnit != 2) then +{ + _targetRange = _targetRange / 1.0936133; +}; + +switch (cse_ab_ATragMX_rangeAssistImageSizeUnit) do +{ + case 0: + { + _numTicks = _numTicks / 6400 * 360; + }; + case 1: + { + _numTicks = _numTicks / 60; + }; + case 2: + { + _numTicks = _numTicks / 60 / 1.047; + }; +}; + +if (_timeSecs > 0) then +{ + _estSpeed = tan(_numTicks) * _targetRange / _timeSecs; +}; + +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _estSpeed = _estSpeed * 2.23693629; +}; + +ctrlSetText [8007, Str(Round(_estSpeed * 10) / 10)]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_change_gun.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_change_gun.sqf new file mode 100644 index 0000000000..11c7403da9 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_change_gun.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +if (_this < 0 || _this > (count cse_ab_ATragMX_gunList) - 1) exitWith {}; + +cse_ab_ATragMX_workingMemory set [cse_ab_ATragMX_currentTarget, +(cse_ab_ATragMX_gunList select _this)]; +cse_ab_ATragMX_currentGun set [cse_ab_ATragMX_currentTarget, _this]; + +lbSetCurSel [6000, (cse_ab_ATragMX_currentGun select cse_ab_ATragMX_currentTarget)]; + +if ((cse_ab_ATragMX_scopeUnits select (cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget)) != "Clicks") then +{ + cse_ab_ATragMX_currentScopeUnit set [cse_ab_ATragMX_currentTarget, (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 6]; +}; + +call cse_ab_ATragMX_fnc_update_gun; + +cse_ab_ATragMX_elevationOutput set [cse_ab_ATragMX_currentTarget, 0]; +cse_ab_ATragMX_windageOutput set [cse_ab_ATragMX_currentTarget, 0]; +cse_ab_ATragMX_leadOutput set [cse_ab_ATragMX_currentTarget, 0]; +cse_ab_ATragMX_tofOutput set [cse_ab_ATragMX_currentTarget, 0]; +cse_ab_ATragMX_velocityOutput set [cse_ab_ATragMX_currentTarget, 0]; + +call cse_ab_ATragMX_fnc_update_result; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_create_dialog.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_create_dialog.sqf new file mode 100644 index 0000000000..431c2d786f --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_create_dialog.sqf @@ -0,0 +1,24 @@ +#include "script_component.hpp" + +if (underwater player) exitWith { false }; +if (!([player, "cse_ab_ATragMX"] call cse_fnc_hasItem_CC)) exitWith { false }; + +execVM "cse\cse_sys_ballistics\atragmx\functions\fn_update_target_selection.sqf"; + +createDialog 'cse_ab_ATragMX_Display'; + +true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_add_new_gun.sqf"; +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_gun_list.sqf"; +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card.sqf"; +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card_setup.sqf"; +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_range_assist.sqf"; +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist.sqf"; +false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist_timer.sqf"; + +{ + lbAdd [6000, _x select 0]; +} forEach cse_ab_ATragMX_gunList; + +true diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_cycle_range_card_columns.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_cycle_range_card_columns.sqf new file mode 100644 index 0000000000..88208ceeb0 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_cycle_range_card_columns.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +cse_ab_ATragMX_rangeCardCurrentColumn = (cse_ab_ATragMX_rangeCardCurrentColumn + 1) % (count cse_ab_ATragMX_rangeCardLastColumns); + +ctrlSetText [5006, (cse_ab_ATragMX_rangeCardLastColumns select cse_ab_ATragMX_rangeCardCurrentColumn)]; + +call cse_ab_ATragMX_fnc_update_range_card; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_cycle_scope_unit.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_cycle_scope_unit.sqf new file mode 100644 index 0000000000..ce1030e417 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_cycle_scope_unit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +call cse_ab_ATragMX_fnc_parse_input; + +cse_ab_ATragMX_currentScopeUnit set [cse_ab_ATragMX_currentTarget, ((cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget) + 1) % (count cse_ab_ATragMX_scopeUnits)]; + +call cse_ab_ATragMX_fnc_update_scope_unit; +call cse_ab_ATragMX_fnc_update_result; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_delete_gun.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_delete_gun.sqf new file mode 100644 index 0000000000..ba3c10a121 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_delete_gun.sqf @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +private ["_index"]; +_index = lbCurSel 6000; + +if (_index == -1) exitWith {}; + +for "_i" from 0 to (count cse_ab_ATragMX_currentGun) - 1 do { + if ((cse_ab_ATragMX_currentGun select _i) > _index) then { + cse_ab_ATragMX_currentGun set [_i, (cse_ab_ATragMX_currentGun select _i) - 1]; + }; +}; + +cse_ab_ATragMX_gunList set [_index, 0]; +cse_ab_ATragMX_gunList = cse_ab_ATragMX_gunList - [0]; + +lbDelete [6000, _index]; + +profileNamespace setVariable ["cse_ab_ATragMX_gunList", cse_ab_ATragMX_gunList]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_parse_input.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_parse_input.sqf new file mode 100644 index 0000000000..eb8230f844 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_parse_input.sqf @@ -0,0 +1,74 @@ +#include "script_component.hpp" + +cse_ab_ATragMX_temperature set [cse_ab_ATragMX_currentTarget, parseNumber(ctrlText 200)]; +cse_ab_ATragMX_barometricPressure set [cse_ab_ATragMX_currentTarget, 0 max parseNumber(ctrlText 210)]; +cse_ab_ATragMX_relativeHumidity set [cse_ab_ATragMX_currentTarget, (0 max parseNumber(ctrlText 220) min 100) / 100]; + +cse_ab_ATragMX_windSpeed set [cse_ab_ATragMX_currentTarget, 0 max abs(parseNumber(ctrlText 300)) min 50]; +cse_ab_ATragMX_windDirection set [cse_ab_ATragMX_currentTarget, 1 max Round(parseNumber(ctrlText 310)) min 12]; +cse_ab_ATragMX_inclinationAngle set [cse_ab_ATragMX_currentTarget, -60 max parseNumber(ctrlText 320) min 60]; +cse_ab_ATragMX_targetSpeed set [cse_ab_ATragMX_currentTarget, 0 max abs(parseNumber(ctrlText 330)) min 50]; +cse_ab_ATragMX_targetRange set [cse_ab_ATragMX_currentTarget, 0 max abs(parseNumber(ctrlText 340)) min 4000]; + +private ["_boreHeight", "_bulletMass", "_airFriction", "_muzzleVelocity"]; +_boreHeight = parseNumber(ctrlText 100); +_bulletMass = parseNumber(ctrlText 110); +if ((["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) && cse_AB_AdvancedAirDragEnabled) then { + _airFriction = 0.1 max parseNumber(ctrlText 120) min 2; +} else { + _airFriction = parseNumber(ctrlText 120) / -1000; +}; +_muzzleVelocity = parseNumber(ctrlText 130); +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _boreHeight = _boreHeight * 2.54; + _bulletMass = _bulletMass * 0.06479891; + _muzzleVelocity = _muzzleVelocity / 3.2808399; +}; +_boreHeight = 0.1 max _boreHeight min 10; +_bulletMass = 1 max _bulletMass min 100; +_muzzleVelocity = 100 max _muzzleVelocity min 1400; + +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [5, _boreHeight]; +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [12, _bulletMass]; +if ((["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) && cse_AB_AdvancedAirDragEnabled) then { + (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [15, _airFriction]; +} else { + (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [4, _airFriction]; +}; +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [1, _muzzleVelocity]; + +private ["_elevationCur", "_elevationCur", "_elevationScopeStep", "_windageScopeStep"]; +_elevationCur = parseNumber(ctrlText 402); +_windageCur = parseNumber(ctrlText 412); + +switch ((cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget)) do +{ + case 0: + { + _elevationCur = _elevationCur * 3.38; + _windageCur = _windageCur * 3.38; + }; + + case 2: + { + _elevationCur = _elevationCur / 1.047; + _windageCur = _windageCur / 1.047; + }; + + case 3: + { + _elevationScopeStep = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 7); + _windageScopeStep = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 8); + + _elevationCur = _elevationCur * _elevationScopeStep; + _windageCur = _windageCur * _windageScopeStep; + }; +}; + +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [10, _elevationCur]; +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [11, _windageCur]; + +call cse_ab_ATragMX_fnc_update_gun; +call cse_ab_ATragMX_fnc_update_atmosphere; +call cse_ab_ATragMX_fnc_update_target; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_reset_relative_click_memory.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_reset_relative_click_memory.sqf new file mode 100644 index 0000000000..ac2f5d8120 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_reset_relative_click_memory.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [10, 0]; +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [11, 0]; + +call cse_ab_ATragMX_fnc_update_result; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_save_gun.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_save_gun.sqf new file mode 100644 index 0000000000..7db8f0dc1e --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_save_gun.sqf @@ -0,0 +1,13 @@ +#include "script_component.hpp" + +private ["_index"]; +_index = 0 max (lbCurSel 6000); + +cse_ab_ATragMX_gunList set [_index, +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget)]; + +lbClear 6000; +{ + lbAdd [6000, _x select 0]; +} forEach cse_ab_ATragMX_gunList; + +profileNamespace setVariable ["cse_ab_ATragMX_gunList", cse_ab_ATragMX_gunList]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_add_new_gun.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_add_new_gun.sqf new file mode 100644 index 0000000000..a3172e3b30 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_add_new_gun.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [11000, 11001, 11002, 11003]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_gun_list.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_gun_list.sqf new file mode 100644 index 0000000000..c44cbe03fe --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_gun_list.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_main_page.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_main_page.sqf new file mode 100644 index 0000000000..d1f15db484 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_main_page.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [10, 100, 11, 110, 12, 120, 13, 130, 14, 140, 20, 200, 21, 210, 22, 220, 30, 300, 31, 310, 32, 320, 33, 330, 34, 340, 40, 400, 401, 402, 403, 41, 410, 411, 412, 42, 420, + 500, 501, 502, 503, 600, 601, 602, 603, 1000, 2000, 3000, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_range_card.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_range_card.sqf new file mode 100644 index 0000000000..a49d9a04c1 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_range_card.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [5000, 5001, 5002, 5003, 5004, 5005, 5006, 5007]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_range_card_setup.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_range_card_setup.sqf new file mode 100644 index 0000000000..8325418451 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_range_card_setup.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [10000, 10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_range_assist.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_range_assist.sqf new file mode 100644 index 0000000000..72a88b953a --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_range_assist.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [7000, 7001, 7002, 7003, 7004, 7005, 7006, 7007, 7008, 7009, 7010, 7011, 7012, 7013, 7014, 7015, 7016, 7017, 7018, 7019, 7020]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_speed_assist.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_speed_assist.sqf new file mode 100644 index 0000000000..37911e8a7f --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_speed_assist.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [8000, 8001, 8002, 8003, 8004, 8005, 8006, 8007, 8008, 8009, 8010, 8011, 8012, 8013, 8014, 8015]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_speed_assist_timer.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_speed_assist_timer.sqf new file mode 100644 index 0000000000..bddaf3ddb6 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_show_target_speed_assist_timer.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +{ctrlShow [_x, _this]} forEach [9000, 9001, 9002]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_sord.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_sord.sqf new file mode 100644 index 0000000000..d888076798 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_sord.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +cse_ab_ATragMX_COMPAT_LRF = ["Rangefinder", "Laserdesignator"]; + +private ["_fnc_atragmx"]; + +_fnc_atragmx = { + private ["_target", "_position", "_range", "_inclinationAngle"]; + + if ((local player) && (currentWeapon player) in cse_ab_ATragMX_COMPAT_LRF && (!isNull (_this select 0))) then { + _target = getPosATL (_this select 0); + _position = getPosATL player; + + _inclinationAngle = asin((player weaponDirection currentWeapon player) select 2); + _range = _position distance _target; + + cse_ab_ATragMX_inclinationAngle set [cse_ab_ATragMX_currentTarget, _inclinationAngle]; + cse_ab_ATragMX_targetRange set [cse_ab_ATragMX_currentTarget, _range]; + }; +}; + +//["ace_sys_rangefinder_Lazing", _fnc_atragmx] call CBA_fnc_addEventHandler; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_target_speed_assist_timer.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_target_speed_assist_timer.sqf new file mode 100644 index 0000000000..2e1311161b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_target_speed_assist_timer.sqf @@ -0,0 +1,30 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +if !(ctrlVisible 9000) then +{ + private ["_startTime"]; + + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist_timer.sqf"; + + ctrlSetFocus (_dsp displayCtrl 9002); + + _startTime = time; + + while {cse_ab_ATragMX_speedAssistTimer} do + { + sleep 0.1; + ctrlSetText [9001, Str(Round((time - _startTime) * 10) / 10)]; + }; + + cse_ab_ATragMX_speedAssistTimer = true; + + ctrlSetText [8006, Str(Round((time - _startTime) * 10) / 10)]; + + call cse_ab_ATragMX_fnc_calculate_target_speed_assist; + + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist_timer.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist.sqf"; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_gun_list.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_gun_list.sqf new file mode 100644 index 0000000000..dcd777e978 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_gun_list.sqf @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +if (ctrlVisible 6000) then +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_gun_list.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + + if (_this) then { + (lbCurSel 6000) call cse_ab_ATragMX_fnc_change_gun; + }; +} else +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_gun_list.sqf"; + + ctrlSetFocus (_dsp displayCtrl 6002); + + lbSetCurSel [6000, (cse_ab_ATragMX_currentGun select cse_ab_ATragMX_currentTarget)]; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_range_card.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_range_card.sqf new file mode 100644 index 0000000000..8d66b43f4a --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_range_card.sqf @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +if (ctrlVisible 5006) then +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; +} else +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card.sqf"; + + ctrlSetFocus (_dsp displayCtrl 5001); + + call cse_ab_ATragMX_fnc_calculate_range_card; + call cse_ab_ATragMX_fnc_update_range_card; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_range_card_setup.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_range_card_setup.sqf new file mode 100644 index 0000000000..72787248a4 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_range_card_setup.sqf @@ -0,0 +1,29 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +if (ctrlVisible 10000) then +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card_setup.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card.sqf"; + + if (_this == 1) then + { + cse_ab_ATragMX_rangeCardStartRange = 0 max Round(parseNumber(ctrlText 10003)) min 3000; + cse_ab_ATragMX_rangeCardEndRange = 0 max Round(parseNumber(ctrlText 10004)) min 3000; + cse_ab_ATragMX_rangeCardIncrement = 1 max Round(parseNumber(ctrlText 10005)) min 3000; + + call cse_ab_ATragMX_fnc_calculate_range_card; + call cse_ab_ATragMX_fnc_update_range_card; + }; +} else +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_range_card_setup.sqf"; + + ctrlSetFocus (_dsp displayCtrl 10006); + + ctrlSetText [10003, Str(Round(cse_ab_ATragMX_rangeCardStartRange))]; + ctrlSetText [10004, Str(Round(cse_ab_ATragMX_rangeCardEndRange))]; + ctrlSetText [10005, Str(Round(cse_ab_ATragMX_rangeCardIncrement))]; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_target_range_assist.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_target_range_assist.sqf new file mode 100644 index 0000000000..fdaaadea2c --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_target_range_assist.sqf @@ -0,0 +1,32 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +if (ctrlVisible 7000) then +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_range_assist.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + + if (_this == 1) then + { + ctrlSetText [320, Str(parseNumber(ctrlText 7012))]; + ctrlSetText [340, Str(parseNumber(ctrlText 7013))]; + }; +} else +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_range_assist.sqf"; + + ctrlSetFocus (_dsp displayCtrl 7018); + + ctrlSetText [7012, Str(parseNumber(ctrlText 320))]; + ctrlSetText [7013, Str(parseNumber(ctrlText 340))]; + + if (cse_ab_ATragMX_currentUnit != 2) then + { + ctrlSetText [7016, "Yards"]; + } else + { + ctrlSetText [7016, "Meters"]; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_target_speed_assist.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_target_speed_assist.sqf new file mode 100644 index 0000000000..f9efe70e40 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_toggle_target_speed_assist.sqf @@ -0,0 +1,39 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +if (ctrlVisible 8000) then +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + + if (_this == 1) then + { + call cse_ab_ATragMX_fnc_calculate_target_speed_assist; + ctrlSetText [330, Str(parseNumber(ctrlText 8007))]; + }; +} else +{ + false execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_main_page.sqf"; + true execVM "cse\cse_sys_ballistics\atragmx\functions\fn_show_target_speed_assist.sqf"; + + ctrlSetFocus (_dsp displayCtrl 8012); + + ctrlSetText [8004, Str(Round((cse_ab_ATragMX_targetRange select cse_ab_ATragMX_currentTarget)))]; + + if (cse_ab_ATragMX_currentUnit != 2) then + { + ctrlSetText [8008, "Yards"]; + } else + { + ctrlSetText [8008, "Meters"]; + }; + + if (cse_ab_ATragMX_currentUnit != 1) then + { + ctrlSetText [8011, "m/s"]; + } else + { + ctrlSetText [8011, "mph"]; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_atmosphere.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_atmosphere.sqf new file mode 100644 index 0000000000..32672abc7b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_atmosphere.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +ctrlSetText [200, Str(Round((cse_ab_ATragMX_temperature select cse_ab_ATragMX_currentTarget) * 10) / 10)]; +if (cse_ab_ATragMX_currentUnit == 1) then { + ctrlSetText [210, Str(Round((cse_ab_ATragMX_barometricPressure select cse_ab_ATragMX_currentTarget) * 100) / 100)]; +} else { + ctrlSetText [210, Str(Round(cse_ab_ATragMX_barometricPressure select cse_ab_ATragMX_currentTarget))]; +}; +ctrlSetText [220, Str(Round((cse_ab_ATragMX_relativeHumidity select cse_ab_ATragMX_currentTarget) * 100 * 10) / 10)]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_gun.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_gun.sqf new file mode 100644 index 0000000000..8d8dc295b9 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_gun.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +ctrlSetText [1000, (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 0]; +if (cse_ab_ATragMX_currentUnit == 1) then +{ + ctrlSetText [ 100, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 5) / 2.54 * 100) / 100)]; +} else +{ + ctrlSetText [ 100, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 5) * 100) / 100)]; +}; +if (cse_ab_ATragMX_currentUnit == 1) then +{ + ctrlSetText [ 110, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 12) * 15.4323584))]; +} else +{ + ctrlSetText [ 110, Str(Round((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 12))]; +}; +if ((["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_F) && cse_AB_AdvancedAirDragEnabled) then { + ctrlSetText [ 120, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 15) * 1000) / 1000)]; +} else { + ctrlSetText [ 120, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 4) * -1000 * 1000) / 1000)]; +}; +if (cse_ab_ATragMX_currentUnit == 1) then +{ + ctrlSetText [130, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 1) * 3.2808399))]; +} else +{ + ctrlSetText [130, Str(Round((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 1))]; +}; +if (cse_ab_ATragMX_currentUnit == 2) then +{ + ctrlSetText [140, Str(Round((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 2))]; +} else +{ + ctrlSetText [140, Str(Round(((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 2) * 1.0936133))]; +}; + +call cse_ab_ATragMX_fnc_update_scope_unit; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_range_card.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_range_card.sqf new file mode 100644 index 0000000000..13a0ddb1bf --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_range_card.sqf @@ -0,0 +1,89 @@ +#include "script_component.hpp" + +private ["_range", "_elevation", "_windage", "_lead", "_TOF", "_velocity", "_kineticEnergy", "_rangeOutput", "_elevationOutput", "_windageOutput", "_lastColumnOutput"]; +_lastColumnOutput = ""; + +ctrlSetText [5006, (cse_ab_ATragMX_rangeCardLastColumns select cse_ab_ATragMX_rangeCardCurrentColumn)]; + +if (cse_ab_ATragMX_currentUnit != 2) then +{ + ctrlSetText [5003, "Yards"]; +} else +{ + ctrlSetText [5003, "Meters"]; +}; + +lnbClear 5007; + +{ + _range = _x select 0; + _elevation = _x select 1; + _windage = _x select 2; + _lead = _x select 3; + _TOF = _x select 4; + _velocity = _x select 5; + _kineticEnergy = _x select 6; + + switch ((cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget)) do + { + case 0: + { + _elevation = _elevation / 3.38; + _windage = _windage / 3.38; + }; + + case 2: + { + _elevation = _elevation * 1.047; + _windage = _windage * 1.047; + }; + + case 3: + { + _elevationScopeStep = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 7); + _windageScopeStep = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 8); + + _elevation = Round(_elevation / _elevationScopeStep); + _windage = Round(_windage / _windageScopeStep); + }; + }; + + _elevationOutput = Str(Round(_elevation * 100) / 100); + _windageOutput = Str(Round(_windage * 100) / 100); + + _rangeOutput = Str(_range); + if (_velocity < 340.29) then + { + _rangeOutput = _rangeOutput + "*"; + }; + + if (cse_ab_ATragMX_currentUnit == 1) then + { + _velocity = _velocity * 3.2808399; + }; + + switch (cse_ab_ATragMX_rangeCardCurrentColumn) do + { + case 0: + { + _lastColumnOutput = Str(Round(_lead * 100) / 100); + }; + + case 1: + { + _lastColumnOutput = Str(Round(_velocity)); + }; + + case 2: + { + _lastColumnOutput = Str(Round(_kineticEnergy)); + }; + + case 3: + { + _lastColumnOutput = Str(Round(_TOF * 100) / 100); + } + }; + + lnbAddRow [5007, [_rangeOutput, _elevationOutput, _windageOutput, _lastColumnOutput]]; +} forEach cse_ab_ATragMX_rangeCardData; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_relative_click_memory.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_relative_click_memory.sqf new file mode 100644 index 0000000000..ece99704d5 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_relative_click_memory.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [10, (cse_ab_ATragMX_elevationOutput select cse_ab_ATragMX_currentTarget)]; +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [11, (cse_ab_ATragMX_windageOutput select cse_ab_ATragMX_currentTarget)]; + +call cse_ab_ATragMX_fnc_update_result; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_result.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_result.sqf new file mode 100644 index 0000000000..df130e90ad --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_result.sqf @@ -0,0 +1,65 @@ +#include "script_component.hpp" + +private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_lead", "_elevationScopeStep", "_windageScopeStep"]; +_elevationAbs = (cse_ab_ATragMX_elevationOutput select cse_ab_ATragMX_currentTarget); +_windageAbs = (cse_ab_ATragMX_windageOutput select cse_ab_ATragMX_currentTarget); + +_elevationCur = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 10; +_windageCur = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 11; + +_elevationRel = _elevationAbs - _elevationCur; +_windageRel = _windageAbs - _windageCur; + +_lead = (cse_ab_ATragMX_leadOutput select cse_ab_ATragMX_currentTarget); + +switch ((cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget)) do +{ + case 0: + { + _elevationAbs = _elevationAbs / 3.38; + _windageAbs = _windageAbs / 3.38; + + _elevationRel = _elevationRel / 3.38; + _windageRel = _windageRel / 3.38; + + _elevationCur = _elevationCur / 3.38; + _windageCur = _windageCur / 3.38; + }; + + case 2: + { + _elevationAbs = _elevationAbs * 1.047; + _windageAbs = _windageAbs * 1.047; + + _elevationRel = _elevationRel * 1.047; + _windageRel = _windageRel * 1.047; + + _elevationCur = _elevationCur * 1.047; + _windageCur = _windageCur * 1.047; + }; + + case 3: + { + _elevationScopeStep = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 7); + _windageScopeStep = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 8); + + _elevationAbs = Round(_elevationAbs / _elevationScopeStep); + _windageAbs = Round(_windageAbs / _windageScopeStep); + + _elevationRel = Round(_elevationRel / _elevationScopeStep); + _windageRel = Round(_windageRel / _windageScopeStep); + + _elevationCur = Round(_elevationCur / _elevationScopeStep); + _windageCur = Round(_windageCur / _windageScopeStep); + }; +}; + +ctrlSetText [400, Str(Round(_elevationAbs * 100) / 100)]; +ctrlSetText [401, Str(Round(_elevationRel * 100) / 100)]; +ctrlSetText [402, Str(Round(_elevationCur * 100) / 100)]; + +ctrlSetText [410, Str(Round(_windageAbs * 100) / 100)]; +ctrlSetText [411, Str(Round(_windageRel * 100) / 100)]; +ctrlSetText [412, Str(Round(_windageCur * 100) / 100)]; + +ctrlSetText [420, Str(Round(_lead * 100) / 100)]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_scope_unit.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_scope_unit.sqf new file mode 100644 index 0000000000..563d646a21 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_scope_unit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +ctrlSetText [2000, cse_ab_ATragMX_scopeUnits select (cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget)]; +ctrlSetText [5000, cse_ab_ATragMX_scopeUnits select (cse_ab_ATragMX_currentScopeUnit select cse_ab_ATragMX_currentTarget)]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_target.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_target.sqf new file mode 100644 index 0000000000..945599bcb8 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_target.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +if (!isNil ("cse_ab_ATragMX_windSpeed")) then +{ + ctrlSetText [300, Str(Round((cse_ab_ATragMX_windSpeed select cse_ab_ATragMX_currentTarget) * 100) / 100)]; +}; +if (!isNil ("cse_ab_ATragMX_windDirection")) then +{ + ctrlSetText [310, Str(Round((cse_ab_ATragMX_windDirection select cse_ab_ATragMX_currentTarget)))]; +}; +if (!isNil ("cse_ab_ATragMX_inclinationAngle")) then +{ + ctrlSetText [320, Str(Round((cse_ab_ATragMX_inclinationAngle select cse_ab_ATragMX_currentTarget)))]; +}; +if (!isNil ("cse_ab_ATragMX_targetSpeed")) then +{ + ctrlSetText [330, Str(Round((cse_ab_ATragMX_targetSpeed select cse_ab_ATragMX_currentTarget) * 100) / 100)]; +}; +if (!isNil ("cse_ab_ATragMX_targetRange")) then +{ + ctrlSetText [340, Str(Round((cse_ab_ATragMX_targetRange select cse_ab_ATragMX_currentTarget)))]; +}; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_target_selection.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_target_selection.sqf new file mode 100644 index 0000000000..7f477f6281 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_target_selection.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +(_dsp displayCtrl 500) ctrlEnable true; +(_dsp displayCtrl 501) ctrlEnable true; +(_dsp displayCtrl 502) ctrlEnable true; +(_dsp displayCtrl 503) ctrlEnable true; + +(_dsp displayCtrl 500 + cse_ab_ATragMX_currentTarget) ctrlEnable false; + +ctrlSetFocus (_dsp displayCtrl 3000); + +call cse_ab_ATragMX_fnc_update_unit_selection; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_unit_selection.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_unit_selection.sqf new file mode 100644 index 0000000000..cfb2ed6758 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_unit_selection.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" + +#define _dsp (uiNamespace getVariable "cse_ab_ATragMX_Display") + +(_dsp displayCtrl 600) ctrlEnable true; +(_dsp displayCtrl 601) ctrlEnable true; +(_dsp displayCtrl 602) ctrlEnable true; + +(_dsp displayCtrl 600 + cse_ab_ATragMX_currentUnit) ctrlEnable false; + +call cse_ab_ATragMX_fnc_update_gun; +call cse_ab_ATragMX_fnc_update_atmosphere; +call cse_ab_ATragMX_fnc_update_target; +call cse_ab_ATragMX_fnc_update_result; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_zero_range.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_zero_range.sqf new file mode 100644 index 0000000000..bdeffbc3f2 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/functions/fn_update_zero_range.sqf @@ -0,0 +1,36 @@ +#include "script_component.hpp" + +private ["_scopeBaseAngle"]; +_scopeBaseAngle = ((cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 3); + +private ["_bulletMass", "_boreHeight", "_airFriction", "_muzzleVelocity", "_bc", "_dragModel", "_atmosphereModel"]; +_bulletMass = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 12; +_boreHeight = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 5; +_airFriction = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 4; +_muzzleVelocity = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 1; +_bc = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 15; +_dragModel = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 16; +_atmosphereModel = (cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) select 17; + +private ["_zeroRange"]; +_zeroRange = Round(parseNumber(ctrlText 140)); +if (cse_ab_ATragMX_currentUnit != 2) then +{ + _zeroRange = _zeroRange / 1.0936133; +}; + +private ["_temperature", "_barometricPressure", "_relativeHumidity"]; +_temperature = (cse_ab_ATragMX_temperature select cse_ab_ATragMX_currentTarget); +_barometricPressure = (cse_ab_ATragMX_barometricPressure select cse_ab_ATragMX_currentTarget); +_relativeHumidity = (cse_ab_ATragMX_relativeHumidity select cse_ab_ATragMX_currentTarget); +if (cse_ab_ATragMX_currentUnit == 1) then +{ + _temperature = (_temperature - 32) / 1.8; + _barometricPressure = _barometricPressure * 33.8638866667; +}; + +private ["_result"]; +_result = [_scopeBaseAngle, _bulletMass, _boreHeight, _airFriction, _muzzleVelocity, _temperature, _barometricPressure, _relativeHumidity, 1000, 0, 0, 0, 0, _zeroRange, _bc, _dragModel, _atmosphereModel, false] call cse_ab_ATragMX_fnc_calculate_solution; + +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [2, _zeroRange]; +(cse_ab_ATragMX_workingMemory select cse_ab_ATragMX_currentTarget) set [3, _scopeBaseAngle + (_result select 0) / 60]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/functions/script_component.hpp b/TO_MERGE/cse/sys_ballistics/atragmx/functions/script_component.hpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/init.sqf b/TO_MERGE/cse/sys_ballistics/atragmx/init.sqf new file mode 100644 index 0000000000..0e5b2060e8 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/init.sqf @@ -0,0 +1,41 @@ +cse_ab_ATragMX_workingMemory = [+(cse_ab_ATragMX_gunList select 0), +(cse_ab_ATragMX_gunList select 0), +(cse_ab_ATragMX_gunList select 0), +(cse_ab_ATragMX_gunList select 0)]; + +cse_ab_ATragMX_scopeUnits = ["MILs", "TMOA", "SMOA", "Clicks"]; + +cse_ab_ATragMX_rangeCardStartRange = 200; +cse_ab_ATragMX_rangeCardEndRange = 2000; +cse_ab_ATragMX_rangeCardIncrement = 50; +cse_ab_ATragMX_rangeCardLastColumns = ["Lead", "RemV", "RemE", "TmFlt"]; +cse_ab_ATragMX_rangeCardCurrentColumn = 3; +cse_ab_ATragMX_rangeCardData = []; + +cse_ab_ATragMX_rangeAssistTargetSizeUnits = ["in", "ft", "cm", "m"]; +cse_ab_ATragMX_rangeAssistTargetSizeUnit = 2; +cse_ab_ATragMX_rangeAssistImageSizeUnits = ["MIL", "TMOA", "IOA"]; +cse_ab_ATragMX_rangeAssistImageSizeUnit = 0; +cse_ab_ATragMX_rangeAssistUseTargetHeight = true; + +cse_ab_ATragMX_speedAssistNumTicksUnits = ["MIL", "TMOA", "IOA"]; +cse_ab_ATragMX_speedAssistNumTicksUnit = 0; +cse_ab_ATragMX_speedAssistTimer = true; + +cse_ab_ATragMX_currentUnit = 2; +cse_ab_ATragMX_currentGun = [0, 0, 0, 0]; +cse_ab_ATragMX_currentTarget = 0; +cse_ab_ATragMX_currentScopeUnit = [0, 0, 0, 0]; + +cse_ab_ATragMX_temperature = [15, 15, 15, 15]; +cse_ab_ATragMX_barometricPressure = [1013.25, 1013.25, 1013.25, 1013.25]; +cse_ab_ATragMX_relativeHumidity = [0.5, 0.5, 0.5, 0.5]; + +cse_ab_ATragMX_windSpeed = [0, 0, 0, 0]; +cse_ab_ATragMX_windDirection = [12, 12, 12, 12]; +cse_ab_ATragMX_inclinationAngle = [0, 0, 0, 0]; +cse_ab_ATragMX_targetSpeed = [0, 0, 0, 0]; +cse_ab_ATragMX_targetRange = [0, 0, 0, 0]; + +cse_ab_ATragMX_elevationOutput = [0, 0, 0, 0]; +cse_ab_ATragMX_windageOutput = [0, 0, 0, 0]; +cse_ab_ATragMX_leadOutput = [0, 0, 0, 0]; +cse_ab_ATragMX_tofOutput = [0, 0, 0, 0]; +cse_ab_ATragMX_velocityOutput = [0, 0, 0, 0]; diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/license.txt b/TO_MERGE/cse/sys_ballistics/atragmx/license.txt new file mode 100644 index 0000000000..eb925e129b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/license.txt @@ -0,0 +1,19 @@ +Copyright (c) <2014> + +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. \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/ui/defines.h b/TO_MERGE/cse/sys_ballistics/atragmx/ui/defines.h new file mode 100644 index 0000000000..6a457f68bf --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/ui/defines.h @@ -0,0 +1,182 @@ +class cse_ab_ATragMX_RscText +{ + idc=-1; + type=0; + style=256; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={0,0,0,0}; + colorText[]={0,0,0,1}; + text=""; + x=0; + y=0; + h=0.037; + w=0.30; + font="TahomaB"; + SizeEx=0.03; + shadow=0; +}; +class cse_ab_ATragMX_RscButton +{ + text=""; + colorText[]={0,0,0,1}; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={0,0,0,0}; + colorBackgroundDisabled[]={0,0,0,0}; + colorBackgroundActive[]={0,0,0,0}; + colorFocused[]={0,0,0,0}; + colorShadow[]={0,0,0,0}; + colorBorder[]={0,0,0,1}; + soundEnter[]={"",0,1}; + soundPush[]={"",0,1}; + soundClick[]={"",0,1}; + soundEscape[]={"",0,1}; + type=1; + style="0x02+0x100"; + x=0; + y=0; + w=0.03; + h=0.03; + font="TahomaB"; + SizeEx=0.025; + offsetX=0.003; + offsetY=0.003; + offsetPressedX=0.0020; + offsetPressedY=0.0020; + borderSize=0; + shadow=0; +}; +class cse_ab_ATragMX_RscEdit +{ + access=0; + type=2; + style=ST_RIGHT; + x=0; + y=0; + w=0.05; + h=0.03; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={0,0,0,0}; + colorText[]={0,0,0,1}; + colorSelection[]={0,0,0,0.25}; + font="TahomaB"; + sizeEx=0.025; + text=""; + size=0.2; + autocomplete=""; + shadow=0; +}; +class cse_ab_ATragMX_RscToolbox +{ + type=6; + style=ST_LEFT; + x=0; + y=0; + w=0.2; + h=0.03; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={1,1,1,1}; + colorText[]={0,0,0,1}; + color[]={0,0,0,0}; + colorTextSelect[]={0.8,0.8,0.8,1}; + colorSelect[]={0,0,0,1}; + colorSelectedBg[]={0,0,0,1}; + colorTextDisable[]={0.4,0.4,0.4,1}; + colorDisable[]={0.4,0.4,0.4,1}; + font="TahomaB"; + sizeEx=0.027; + rows=1; + columns=2; + strings[]={"Entry 1","Entry 2"}; + values[]={1,0}; + onToolBoxSelChanged=""; +}; +class cse_ab_ATragMX_RscListBox +{ + idc=-1; + type=5; + style=0; + font="TahomaB"; + sizeEx=0.028; + rowHeight=0.03; + colorDisabled[]={0,0,0,0.0}; + colorBackground[]={1,1,1,1}; + colorText[]={0,0,0,1}; + colorScrollbar[]={0.95,0.95,0.95,1}; + colorSelect[]={0,0,0,1}; + colorSelect2[]={0,0,0,1}; + colorSelectBackground[]={0.925,0.925,0.925,1}; + colorSelectBackground2[]={0.925,0.925,0.925,1}; + period=0; + maxHistoryDelay=1.0; + autoScrollSpeed=-1; + autoScrollDelay=5; + autoScrollRewind=0; + soundSelect[]={"",0.09,1}; + + class ScrollBar { + color[]={1,1,1,0.6}; + colorActive[]={1,1,1,1}; + colorDisabled[]={1,1,1,0.3}; + thumb="\ca\ui\data\igui_scrollbar_thumb_ca.paa"; + arrowFull="\ca\ui\data\igui_arrow_top_active_ca.paa"; + arrowEmpty="\ca\ui\data\igui_arrow_top_ca.paa"; + border="\ca\ui\data\igui_border_scroll_ca.paa"; + }; + + class ListScrollBar : ScrollBar { + }; +}; +class cse_ab_ATragMX_RscListNBox: cse_ab_ATragMX_RscListBox +{ + idc=-1; + type=102; + columns[]={0.0, 0.225, 0.475, 0.725}; + drawSideArrows=0; + idcLeft=-1; + idcRight=-1; +}; +class cse_ab_ATragMX_RscControlsGroup +{ + type=15; + idc=-1; + style=16; + x=0; + y=0; + w=1; + h=1; + shadow=0; + class VScrollbar + { + color[]={1,1,1,0.6}; + width=0.021; + autoScrollSpeed=-1; + autoScrollDelay=5; + autoScrollRewind=0; + shadow=0; + }; + class HScrollbar + { + color[]={1,1,1,0.6}; + height=0.028; + shadow=0; + }; + class ScrollBar + { + 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)"; + 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)"; + }; + class Controls + { + }; +}; +class cse_ab_ATragMX_RscLineBreak +{ + idc=-1; + type=98; + shadow=0; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/atragmx/ui/display.h b/TO_MERGE/cse/sys_ballistics/atragmx/ui/display.h new file mode 100644 index 0000000000..d82e6fb514 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/atragmx/ui/display.h @@ -0,0 +1,1015 @@ +class cse_ab_ATragMX_Display +{ + name="cse_ab_ATragMX_Display"; + idd=-1; + onLoad="uiNamespace setVariable ['cse_ab_ATragMX_Display', (_this select 0)]"; + movingEnable=1; + controlsBackground[]={}; + objects[]={}; + class controls + { + class BACKGROUND + { + moving=1; + type=0; + font="TahomaB"; + SizeEX=0.025; + idc=-1; + style=48; + x=0.55*safezoneW+safezoneX-0.256; + y=0.265*safezoneH+safezoneY-0.1; + w=1.024; + h=1.024*4/3; + colorBackground[]={1,1,1,1}; + colorText[]={1,1,1,1}; + text="cse\cse_sys_ballistics\atragmx\data\atrag.paa"; + }; + class POWER: cse_ab_ATragMX_RscButton + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.145; + y=0.265*safezoneH+safezoneY+0.94; + w=0.045; + h=0.045*4/3; + colorBackground[]={0,0,0,0.0}; + action="closeDialog 0"; + }; + class BACK: POWER + { + idc=-1; + w=0.06; + x=0.55*safezoneW+safezoneX+0.3122; + action="call compile preprocessFile 'cse\cse_sys_ballistics\atragmx\init.sqf'; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + class WINDOWS: cse_ab_ATragMX_RscButton + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.130; + y=0.265*safezoneH+safezoneY+0.88; + w=0.035; + h=0.035*4/3; + colorBackground[]={0,0,0,0.0}; + }; + class OK: WINDOWS + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.347; + y=0.265*safezoneH+safezoneY+0.878; + }; + class TOP: cse_ab_ATragMX_RscButton + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.242; + y=0.265*safezoneH+safezoneY+0.85; + w=0.03; + h=0.03; + colorBackground[]={0,0,0,0.0}; + action="((cse_ab_ATragMX_currentGun select cse_ab_ATragMX_currentTarget) + (count cse_ab_ATragMX_gunList) - 1) % (count cse_ab_ATragMX_gunList) call cse_ab_ATragMX_fnc_change_gun"; + }; + class BOTTOM: TOP + { + idc=-1; + y=0.265*safezoneH+safezoneY+0.955; + action="((cse_ab_ATragMX_currentGun select cse_ab_ATragMX_currentTarget) + (count cse_ab_ATragMX_gunList) + 1) % (count cse_ab_ATragMX_gunList) call cse_ab_ATragMX_fnc_change_gun"; + }; + class LEFT: cse_ab_ATragMX_RscButton + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.1925; + y=0.265*safezoneH+safezoneY+0.9; + w=0.05; + h=0.03; + colorBackground[]={0,0,0,0}; + action="call cse_ab_ATragMX_fnc_parse_input; cse_ab_ATragMX_currentTarget = (4 + cse_ab_ATragMX_currentTarget - 1) % 4; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + class RIGHT: LEFT + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.2725; + action="call cse_ab_ATragMX_fnc_parse_input; cse_ab_ATragMX_currentTarget = (4 + cse_ab_ATragMX_currentTarget + 1) % 4; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + class TOP_LEFT: cse_ab_ATragMX_RscButton + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.162; + y=0.265*safezoneH+safezoneY+0.82; + w=0.031; + h=0.031*4/3; + colorBackground[]={0,0,0,0.0}; + }; + class TOP_RIGHT: TOP_LEFT + { + idc=-1; + x=0.55*safezoneW+safezoneX+0.315; + }; + + class TEXT_GUN_PROFILE: cse_ab_ATragMX_RscText + { + idc=1000; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.20; + w=0.18; + h=0.03; + style=ST_LEFT; + sizeEx=0.025; + text=""; + }; + class TEXT_D: cse_ab_ATragMX_RscButton + { + idc=600; + w=0.0231; + x=0.550*safezoneW+safezoneX+0.29; + y=0.265*safezoneH+safezoneY+0.20; + colorText[]={0,0,0,1}; + colorDisabled[]={0.8,0.8,0.8,1}; + colorBackgroundDisabled[]={0,0,0,1}; + colorBackgroundActive[]={0,0,0,0}; + text="D"; + action="cse_ab_ATragMX_currentUnit=0; call cse_ab_ATragMX_fnc_update_unit_selection"; + }; + class TEXT_E: TEXT_D + { + idc=601; + x=0.550*safezoneW+safezoneX+0.3131; + text="E"; + action="cse_ab_ATragMX_currentUnit=1; call cse_ab_ATragMX_fnc_update_unit_selection"; + }; + class TEXT_M: TEXT_E + { + idc=602; + x=0.550*safezoneW+safezoneX+0.3362; + text="M"; + action="cse_ab_ATragMX_currentUnit=2; call cse_ab_ATragMX_fnc_update_unit_selection"; + }; + class TEXT_RANGE_CARD: TEXT_D + { + idc=603; + w=0.03; + x=0.550*safezoneW+safezoneX+0.36; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="RC"; + action="call cse_ab_ATragMX_fnc_toggle_range_card"; + }; + + class TEXT_GUN: cse_ab_ATragMX_RscButton + { + idc=4000; + w=0.0925; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.25; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="Gun"; + }; + class TEXT_BORE_HEIGHT: TEXT_GUN_PROFILE + { + idc=10; + style=ST_LEFT; + y=0.265*safezoneH+safezoneY+0.285; + text="BH"; + }; + class TEXT_BORE_HEIGHT_INPUT: cse_ab_ATragMX_RscEdit + { + idc=100; + w=0.058; + x=0.550*safezoneW+safezoneX+0.145; + y=0.265*safezoneH+safezoneY+0.285; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_calculate_target_solution}"; + }; + class TEXT_BULLET_MASS: TEXT_BORE_HEIGHT + { + idc=11; + style=ST_LEFT; + y=0.265*safezoneH+safezoneY+0.320; + text="BW"; + }; + class TEXT_BULLET_MASS_INPUT: TEXT_BORE_HEIGHT_INPUT + { + idc=110; + y=0.265*safezoneH+safezoneY+0.320; + }; + class TEXT_AIR_FRICTION: TEXT_BORE_HEIGHT + { + idc=12; + y=0.265*safezoneH+safezoneY+0.355; + text="C1"; + }; + class TEXT_AIR_FRICTION_INPUT: TEXT_BORE_HEIGHT_INPUT + { + idc=120; + y=0.265*safezoneH+safezoneY+0.355; + }; + class TEXT_MUZZLE_VELOCITY: cse_ab_ATragMX_RscButton + { + idc=13; + style=0; + w=0.03; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.390; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="MV"; + }; + class TEXT_MUZZLE_VELOCITY_INPUT: TEXT_BORE_HEIGHT_INPUT + { + idc=130; + y=0.265*safezoneH+safezoneY+0.390; + }; + class TEXT_ZERO_RANGE: TEXT_BORE_HEIGHT + { + idc=14; + y=0.265*safezoneH+safezoneY+0.425; + text="ZR"; + }; + class TEXT_ZERO_RANGE_INPUT: TEXT_BORE_HEIGHT_INPUT + { + idc=140; + y=0.265*safezoneH+safezoneY+0.425; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_update_zero_range}"; + }; + class TEXT_ATMOSPHERE: TEXT_GUN + { + idc=4001; + x=0.550*safezoneW+safezoneX+0.205; + text="Atmsphr"; + }; + class TEXT_TEMPERATURE: TEXT_BULLET_MASS + { + idc=20; + x=0.550*safezoneW+safezoneX+0.20; + text="Tmp"; + }; + class TEXT_TEMPERATURE_INPUT: cse_ab_ATragMX_RscEdit + { + idc=200; + w=0.050; + x=0.550*safezoneW+safezoneX+0.245; + y=0.265*safezoneH+safezoneY+0.320; + text=""; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_calculate_target_solution}"; + }; + class TEXT_BAROMETRIC_PRESSURE: TEXT_AIR_FRICTION + { + idc=21; + x=0.550*safezoneW+safezoneX+0.20; + text="BP"; + }; + class TEXT_BAROMETRIC_PRESSURE_INPUT: TEXT_TEMPERATURE_INPUT + { + idc=210; + y=0.265*safezoneH+safezoneY+0.355; + }; + class TEXT_RELATIVE_HUMIDITY: TEXT_AIR_FRICTION + { + idc=22; + x=0.550*safezoneW+safezoneX+0.20; + y=0.265*safezoneH+safezoneY+0.390; + text="RH"; + }; + class TEXT_RELATIVE_HUMIDITY_INPUT: TEXT_TEMPERATURE_INPUT + { + idc=220; + y=0.265*safezoneH+safezoneY+0.390; + }; + class TEXT_TARGET_A: cse_ab_ATragMX_RscButton + { + idc=500; + w=0.0231; + x=0.550*safezoneW+safezoneX+0.205; + y=0.265*safezoneH+safezoneY+0.425; + colorText[]={0,0,0,1}; + colorDisabled[]={0.8,0.8,0.8,1}; + colorBackgroundDisabled[]={0,0,0,1}; + colorBackgroundActive[]={0,0,0,0}; + text="A"; + action="call cse_ab_ATragMX_fnc_parse_input; cse_ab_ATragMX_currentTarget=0; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + class TEXT_TARGET_B: TEXT_TARGET_A + { + idc=501; + x=0.550*safezoneW+safezoneX+0.2281; + text="B"; + action="call cse_ab_ATragMX_fnc_parse_input; cse_ab_ATragMX_currentTarget=1; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + class TEXT_TARGET_C: TEXT_TARGET_B + { + idc=502; + x=0.550*safezoneW+safezoneX+0.2512; + text="C"; + action="call cse_ab_ATragMX_fnc_parse_input; cse_ab_ATragMX_currentTarget=2; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + class TEXT_TARGET_D: TEXT_TARGET_B + { + idc=503; + x=0.550*safezoneW+safezoneX+0.2743; + text="D"; + action="call cse_ab_ATragMX_fnc_parse_input; cse_ab_ATragMX_currentTarget=3; call cse_ab_ATragMX_fnc_update_target_selection"; + }; + + class TEXT_TARGET: TEXT_GUN + { + idc=4002; + x=0.550*safezoneW+safezoneX+0.3; + text="Target"; + }; + class TEXT_WIND_SPEED: TEXT_BORE_HEIGHT + { + idc=30; + x=0.550*safezoneW+safezoneX+0.3; + text="WS"; + }; + class TEXT_WIND_SPEED_INPUT: cse_ab_ATragMX_RscEdit + { + idc=300; + w=0.058; + x=0.550*safezoneW+safezoneX+0.335; + y=0.265*safezoneH+safezoneY+0.285; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_calculate_target_solution}"; + text="0"; + }; + class TEXT_WIND_DIRECTION: TEXT_BULLET_MASS + { + idc=31; + x=0.550*safezoneW+safezoneX+0.3; + text="WD"; + }; + class TEXT_WIND_DIRECTION_INPUT: TEXT_WIND_SPEED_INPUT + { + idc=310; + y=0.265*safezoneH+safezoneY+0.32; + }; + class TEXT_INCLINATION_ANGLE: TEXT_AIR_FRICTION + { + idc=32; + x=0.550*safezoneW+safezoneX+0.3; + text="IA"; + }; + class TEXT_INCLINATION_ANGLE_INPUT: TEXT_WIND_SPEED_INPUT + { + idc=320; + y=0.265*safezoneH+safezoneY+0.355; + }; + class TEXT_TARGET_SPEED: TEXT_MUZZLE_VELOCITY + { + idc=33; + x=0.550*safezoneW+safezoneX+0.3; + text="TS"; + action="call cse_ab_ATragMX_fnc_toggle_target_speed_assist"; + }; + class TEXT_TARGET_SPEED_INPUT: TEXT_WIND_SPEED_INPUT + { + idc=330; + y=0.265*safezoneH+safezoneY+0.39; + }; + class TEXT_TARGET_RANGE: TEXT_TARGET_SPEED + { + idc=34; + y=0.265*safezoneH+safezoneY+0.425; + text="TR"; + action="0 call cse_ab_ATragMX_fnc_toggle_target_range_assist"; + }; + class TEXT_TARGET_RANGE_INPUT: TEXT_WIND_SPEED_INPUT + { + idc=340; + y=0.265*safezoneH+safezoneY+0.425; + }; + + class TEXT_ELEVATION: TEXT_GUN_PROFILE + { + idc=40; + w=0.05; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.50; + text="Elev"; + }; + class TEXT_ABSOLUTE: TEXT_GUN_PROFILE + { + idc=4003; + w=0.07; + style=ST_CENTER; + x=0.550*safezoneW+safezoneX+0.17; + y=0.265*safezoneH+safezoneY+0.47; + text="Abs"; + }; + class TEXT_RELATIVE: TEXT_ABSOLUTE + { + idc=4004; + x=0.550*safezoneW+safezoneX+0.245; + text="Rel"; + }; + class TEXT_CURRENT: TEXT_ABSOLUTE + { + idc=4005; + x=0.550*safezoneW+safezoneX+0.32; + text="Cur"; + }; + class TEXT_ELEVATION_OUTPUT_ABSOLUTE: cse_ab_ATragMX_RscEdit + { + idc=400; + w=0.07; + x=0.550*safezoneW+safezoneX+0.17; + y=0.265*safezoneH+safezoneY+0.50; + text=""; + }; + class TEXT_ELEVATION_OUTPUT_RELATIVE: TEXT_ELEVATION_OUTPUT_ABSOLUTE + { + idc=401; + x=0.550*safezoneW+safezoneX+0.2465; + }; + class TEXT_ELEVATION_INPUT_CURRENT: TEXT_ELEVATION_OUTPUT_ABSOLUTE + { + idc=402; + x=0.550*safezoneW+safezoneX+0.323; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_parse_input; call cse_ab_ATragMX_fnc_update_result}"; + }; + class TEXT_WINDAGE: TEXT_ELEVATION + { + idc=41; + y=0.265*safezoneH+safezoneY+0.535; + text="Wind"; + }; + class TEXT_WINDAGE_OUTPUT_ABSOLUTE: TEXT_ELEVATION_OUTPUT_ABSOLUTE + { + idc=410; + y=0.265*safezoneH+safezoneY+0.535; + }; + class TEXT_WINDAGE_OUTPUT_RELATIVE: TEXT_WINDAGE_OUTPUT_ABSOLUTE + { + idc=411; + x=0.550*safezoneW+safezoneX+0.2465; + }; + class TEXT_WINDAGE_INPUT_CURRENT: TEXT_WINDAGE_OUTPUT_ABSOLUTE + { + idc=412; + x=0.550*safezoneW+safezoneX+0.323; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_parse_input; call cse_ab_ATragMX_fnc_update_result}"; + }; + class TEXT_LEAD: TEXT_GUN + { + idc=42; + w=0.05; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.57; + text="Lead"; + }; + class TEXT_LEAD_OUTPUT: TEXT_ELEVATION_OUTPUT_ABSOLUTE + { + idc=420; + y=0.265*safezoneH+safezoneY+0.57; + }; + class TEXT_RESET_SCOPE_ZERO: TEXT_GUN + { + idc=4006; + w=0.07; + style=ST_CENTER; + colorBackground[]={0,0,0,0}; + x=0.550*safezoneW+safezoneX+0.2465; + y=0.265*safezoneH+safezoneY+0.57; + text="Reset"; + action="call cse_ab_ATragMX_fnc_reset_relative_click_memory"; + }; + class TEXT_UPDATE_SCOPE_ZERO: TEXT_RESET_SCOPE_ZERO + { + idc=4007; + x=0.550*safezoneW+safezoneX+0.323; + text="Update"; + action="call cse_ab_ATragMX_fnc_update_relative_click_memory"; + }; + class TEXT_GUN_LIST: TEXT_GUN + { + idc=4008; + style=ST_LEFT; + y=0.265*safezoneH+safezoneY+0.65; + text="GunList"; + action="call cse_ab_ATragMX_fnc_toggle_gun_list"; + }; + class TEXT_SCOPE_UNIT: TEXT_GUN_LIST + { + idc=2000; + style=ST_CENTER; + x=0.550*safezoneW+safezoneX+0.205; + colorBackground[]={0,0,0,0}; + text="TMOA"; + action="call cse_ab_ATragMX_fnc_cycle_scope_unit"; + }; + class TEXT_CALCULATE: TEXT_SCOPE_UNIT + { + idc=3000; + style=ST_RIGHT; + x=0.550*safezoneW+safezoneX+0.3; + text="Calc"; + action="call cse_ab_ATragMX_fnc_calculate_target_solution"; + }; + + class TEXT_RANGE_CARD_SCOPE_UNIT: TEXT_GUN_PROFILE + { + idc=5000; + text=""; + }; + class TEXT_RANGE_CARD_SETUP: cse_ab_ATragMX_RscButton + { + idc=5001; + w=0.055675; + x=0.550*safezoneW+safezoneX+0.28; + y=0.265*safezoneH+safezoneY+0.20; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="Setup"; + action="call cse_ab_ATragMX_fnc_toggle_range_card_setup"; + }; + class TEXT_RANGE_CARD_DONE: TEXT_RANGE_CARD_SETUP + { + idc=5002; + x=0.550*safezoneW+safezoneX+0.3362; + text="Done"; + action="call cse_ab_ATragMX_fnc_toggle_range_card"; + }; + class TEXT_RANGE_CARD_COLUMN_1_CAPTION: cse_ab_ATragMX_RscButton + { + idc=5003; + style=ST_LEFT; + w=0.07; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.24; + colorBackground[]={0.15,0.21,0.23,0.3}; + text="Meters"; + }; + class TEXT_RANGE_CARD_COLUMN_2_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION + { + idc=5004; + x=0.550*safezoneW+safezoneX+0.180625; + text="Elev"; + }; + class TEXT_RANGE_CARD_COLUMN_3_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION + { + idc=5005; + x=0.550*safezoneW+safezoneX+0.25125; + text="Wind"; + }; + class TEXT_RANGE_CARD_COLUMN_4_CAPTION: TEXT_RANGE_CARD_COLUMN_1_CAPTION + { + idc=5006; + x=0.550*safezoneW+safezoneX+0.321875; + text="TmFlt"; + action="call cse_ab_ATragMX_fnc_cycle_range_card_columns"; + }; + class TEXT_RANGE_CARD_OUTPUT: cse_ab_ATragMX_RscListNBox + { + idc=5007; + idcLeft=50061; + idcRight=50062; + w=0.285; + h=0.42; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.27; + }; + + class TEXT_GUN_LIST_OUTPUT: cse_ab_ATragMX_RscListBox + { + idc=6000; + w=0.16; + h=0.45; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.24; + colorSelectBackground[]={0.15,0.21,0.23,0.3}; + colorSelectBackground2[]={0.15,0.21,0.23,0.3}; + onMouseButtonDblClick="true call cse_ab_ATragMX_fnc_toggle_gun_list"; + }; + class TEXT_GUN_LIST_COLUMN_CAPTION: TEXT_GUN_PROFILE + { + idc=6001; + w=0.16; + colorBackground[]={0.15,0.21,0.23,0.3}; + text="AtragGun.gun"; + }; + class TEXT_GUN_LIST_OPEN_GUN: cse_ab_ATragMX_RscButton + { + idc=6002; + style=ST_RIGHT; + w=0.115; + x=0.550*safezoneW+safezoneX+0.28; + y=0.265*safezoneH+safezoneY+0.20; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + sizeEx=0.024; + text="Open Gun"; + action="true call cse_ab_ATragMX_fnc_toggle_gun_list"; + }; + class TEXT_GUN_LIST_SAVE_GUN: TEXT_GUN_LIST_OPEN_GUN + { + idc=6003; + y=0.265*safezoneH+safezoneY+0.24; + text="Save Gun"; + action="call cse_ab_ATragMX_fnc_save_gun"; + }; + class TEXT_GUN_LIST_ADD_NEW_GUN: TEXT_GUN_LIST_OPEN_GUN + { + idc=6004; + y=0.265*safezoneH+safezoneY+0.28; + text="Add New Gun"; + action="false call cse_ab_ATragMX_fnc_show_gun_list; true call cse_ab_ATragMX_fnc_show_add_new_gun"; + }; + class TEXT_GUN_LIST_DELETE_GUN: TEXT_GUN_LIST_OPEN_GUN + { + idc=6005; + y=0.265*safezoneH+safezoneY+0.34; + text="Delete Gun"; + action="call cse_ab_ATragMX_fnc_delete_gun"; + }; + class TEXT_GUN_LIST_NOTE: TEXT_GUN_LIST_OPEN_GUN + { + idc=6006; + y=0.265*safezoneH+safezoneY+0.40; + text="Note"; + }; + class TEXT_GUN_LIST_DONE: TEXT_GUN_LIST_OPEN_GUN + { + idc=6007; + y=0.265*safezoneH+safezoneY+0.65; + text="Done"; + action="false call cse_ab_ATragMX_fnc_toggle_gun_list"; + }; + + class TEXT_TARGET_RANGE_ASSIST_CAPTION: cse_ab_ATragMX_RscText + { + idc=7000; + style=16+0x200; + lineSpacing=1.0; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.24; + w=0.29; + h=0.10; + sizeEx=0.022; + text="When using WIDTH to size a target, UP/Down Angle does not effect range calculation but will effect bullet drop."; + }; + class TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD: TEXT_TARGET_RANGE_ASSIST_CAPTION + { + idc=7001; + style=ST_LEFT; + x=0.550*safezoneW+safezoneX+0.115; + y=0.265*safezoneH+safezoneY+0.35; + w=0.12; + h=0.03; + sizeEx=0.027; + text="Using Target:"; + }; + class TEXT_TARGET_RANGE_ASSIST_WIDTH_HEIGHT: cse_ab_ATragMX_RscToolbox + { + idc=7002; + w=0.14; + x=0.550*safezoneW+safezoneX+0.24; + y=0.265*safezoneH+safezoneY+0.35; + strings[]={"Height","Width"}; + values[]={1,0}; + onToolBoxSelChanged="cse_ab_ATragMX_rangeAssistUseTargetHeight=((_this select 1)==0)"; + }; + class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE: TEXT_TARGET_RANGE_ASSIST_MEASUREMENT_METHOD + { + idc=7003; + style=ST_RIGHT; + x=0.550*safezoneW+safezoneX+0.10; + y=0.265*safezoneH+safezoneY+0.4; + text="Target Size"; + }; + class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE + { + idc=7004; + y=0.265*safezoneH+safezoneY+0.45; + text="Image Size"; + }; + class TEXT_TARGET_RANGE_ASSIST_ANGLE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE + { + idc=7005; + y=0.265*safezoneH+safezoneY+0.5; + text="Angle"; + }; + class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE + { + idc=7006; + y=0.265*safezoneH+safezoneY+0.55; + text="Est Range"; + }; + class TEXT_TARGET_RANGE_ASSIST_CALC_1: TEXT_MUZZLE_VELOCITY + { + idc=7007; + w=0.0231; + x=0.550*safezoneW+safezoneX+0.22; + y=0.265*safezoneH+safezoneY+0.4; + sizeEx=0.03; + text="!"; + action="0 call cse_ab_ATragMX_fnc_calculate_target_range_assist"; + }; + class TEXT_TARGET_RANGE_ASSIST_CALC_2: TEXT_TARGET_RANGE_ASSIST_CALC_1 + { + idc=7008; + y=0.265*safezoneH+safezoneY+0.45; + action="1 call cse_ab_ATragMX_fnc_calculate_target_range_assist"; + }; + class TEXT_TARGET_RANGE_ASSIST_CALC_3: TEXT_TARGET_RANGE_ASSIST_CALC_1 + { + idc=7009; + y=0.265*safezoneH+safezoneY+0.55; + action="2 call cse_ab_ATragMX_fnc_calculate_target_range_assist"; + }; + class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT: cse_ab_ATragMX_RscEdit + { + idc=7010; + w=0.065; + x=0.550*safezoneW+safezoneX+0.2475; + y=0.265*safezoneH+safezoneY+0.4; + }; + class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT + { + idc=7011; + y=0.265*safezoneH+safezoneY+0.45; + }; + class TEXT_TARGET_RANGE_ASSIST_ANGLE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT + { + idc=7012; + y=0.265*safezoneH+safezoneY+0.5; + }; + class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT + { + idc=7013; + y=0.265*safezoneH+safezoneY+0.55; + }; + class TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_CALC_1 + { + idc=7014; + w=0.07; + x=0.550*safezoneW+safezoneX+0.32; + text="cm"; + action="cse_ab_ATragMX_rangeAssistTargetSizeUnit=(cse_ab_ATragMX_rangeAssistTargetSizeUnit+1) % (count cse_ab_ATragMX_rangeAssistTargetSizeUnits); ctrlSetText [7014, cse_ab_ATragMX_rangeAssistTargetSizeUnits select cse_ab_ATragMX_rangeAssistTargetSizeUnit]"; + }; + class TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_UNIT + { + idc=7015; + y=0.265*safezoneH+safezoneY+0.45; + text="MIL"; + action="cse_ab_ATragMX_rangeAssistImageSizeUnit=(cse_ab_ATragMX_rangeAssistImageSizeUnit+1) % (count cse_ab_ATragMX_rangeAssistImageSizeUnits); ctrlSetText [7015, cse_ab_ATragMX_rangeAssistImageSizeUnits select cse_ab_ATragMX_rangeAssistImageSizeUnit]"; + }; + class TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE + { + idc=7016; + style=ST_LEFT; + w=0.07; + x=0.550*safezoneW+safezoneX+0.32; + text="Meters"; + }; + class TEXT_TARGET_RANGE_ASSIST_DONE: cse_ab_ATragMX_RscButton + { + idc=7017; + style=ST_CENTER; + w=0.07; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.60; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="Done"; + action="1 call cse_ab_ATragMX_fnc_toggle_target_range_assist"; + }; + class TEXT_TARGET_RANGE_ASSIST_CANCEL: TEXT_TARGET_RANGE_ASSIST_DONE + { + idc=7018; + x=0.550*safezoneW+safezoneX+0.180625; + text="Cancel"; + action="0 call cse_ab_ATragMX_fnc_toggle_target_range_assist"; + }; + class TEXT_TARGET_RANGE_ASSIST_PREV: TEXT_TARGET_RANGE_ASSIST_DONE + { + idc=7019; + x=0.550*safezoneW+safezoneX+0.25125; + text="Prev"; + action=""; + }; + class TEXT_TARGET_RANGE_ASSIST_NEXT: TEXT_TARGET_RANGE_ASSIST_DONE + { + idc=7020; + x=0.550*safezoneW+safezoneX+0.321875; + text="Next"; + action=""; + }; + + class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE + { + idc=8000; + x=0.550*safezoneW+safezoneX+0.12; + text="Target Range"; + }; + class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE + { + idc=8001; + x=0.550*safezoneW+safezoneX+0.12; + text="Num Ticks"; + }; + class TEXT_TARGET_SPEED_ASSIST_TIME: TEXT_TARGET_RANGE_ASSIST_ANGLE + { + idc=8002; + x=0.550*safezoneW+safezoneX+0.12; + text="Time (secs)"; + }; + class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE + { + idc=8003; + x=0.550*safezoneW+safezoneX+0.12; + text="Est Speed"; + }; + class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT + { + idc=8004; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_calculate_target_speed_assist}"; + }; + class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS_INPUT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_INPUT + { + idc=8005; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_calculate_target_speed_assist}"; + }; + class TEXT_TARGET_SPEED_ASSIST_TIME_INPUT: TEXT_TARGET_RANGE_ASSIST_ANGLE_INPUT + { + idc=8006; + onKeyUp="if (_this select 1 == 28) then {call cse_ab_ATragMX_fnc_calculate_target_speed_assist}"; + }; + class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED_OUTPUT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE + { + idc=8007; + w=0.065; + x=0.550*safezoneW+safezoneX+0.2475; + y=0.265*safezoneH+safezoneY+0.55; + colorBackground[]={0.15,0.21,0.23,0.3}; + text="0"; + }; + class TEXT_TARGET_SPEED_ASSIST_TARGET_RANGE_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT + { + idc=8008; + y=0.265*safezoneH+safezoneY+0.4; + text="Meters"; + }; + class TEXT_TARGET_SPEED_ASSIST_NUM_TICKS_UNIT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT + { + idc=8009; + text="MIL"; + action="cse_ab_ATragMX_speedAssistNumTicksUnit=(cse_ab_ATragMX_speedAssistNumTicksUnit+1) % (count cse_ab_ATragMX_speedAssistNumTicksUnits); ctrlSetText [8009, cse_ab_ATragMX_speedAssistNumTicksUnits select cse_ab_ATragMX_speedAssistNumTicksUnit]; call cse_ab_ATragMX_fnc_calculate_target_speed_assist"; + }; + class TEXT_TARGET_SPEED_ASSIST_TIMER_START: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_UNIT + { + idc=8010; + y=0.265*safezoneH+safezoneY+0.5; + text="Start"; + action="execVM '\atragmx\functions\fnc_target_speed_assist_timer.sqf'"; + }; + class TEXT_TARGET_SPEED_ASSIST_TARGET_ESTIMATED_SPEED_UNIT: TEXT_TARGET_RANGE_ASSIST_ESTIMATED_RANGE_UNIT + { + idc=8011; + text="m/s"; + }; + class TEXT_TARGET_SPEED_ASSIST_DONE: TEXT_TARGET_RANGE_ASSIST_DONE + { + idc=8012; + action="1 call cse_ab_ATragMX_fnc_toggle_target_speed_assist"; + }; + class TEXT_TARGET_SPEED_ASSIST_CANCEL: TEXT_TARGET_RANGE_ASSIST_CANCEL + { + idc=8013; + action="0 call cse_ab_ATragMX_fnc_toggle_target_speed_assist"; + }; + class TEXT_TARGET_SPEED_ASSIST_PREV: TEXT_TARGET_RANGE_ASSIST_PREV + { + idc=8014; + }; + class TEXT_TARGET_SPEED_ASSIST_NEXT: TEXT_TARGET_RANGE_ASSIST_NEXT + { + idc=8015; + }; + + class TEXT_TARGET_SPEED_ASSIST_TIMER_STOP_BACKGROUND: cse_ab_ATragMX_RscButton + { + idc=9000; + w=0.285; + h=0.49; + x=0.550*safezoneW+safezoneX+0.11; + y=0.265*safezoneH+safezoneY+0.2; + colorBackground[]={0,0,0,0}; + colorBackgroundActive[]={0,0,0,0}; + action="cse_ab_ATragMX_speedAssistTimer=false"; + } + class TEXT_TARGET_SPEED_ASSIST_TIME_OUTPUT: cse_ab_ATragMX_RscText + { + idc=9001; + x=0.550*safezoneW+safezoneX+0.22; + y=0.265*safezoneH+safezoneY+0.51; + w=0.08; + h=0.09; + style=ST_CENTER; + sizeEx=0.05; + text="0.0"; + }; + class TEXT_TARGET_SPEED_ASSIST_TIMER_STOP: cse_ab_ATragMX_RscButton + { + idc=9002; + style=ST_CENTER; + w=0.07; + h=0.04; + x=0.550*safezoneW+safezoneX+0.225; + y=0.265*safezoneH+safezoneY+0.60; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="Stop"; + action="cse_ab_ATragMX_speedAssistTimer=false"; + }; + + class TEXT_RANGE_CARD_SETUP_START_RANGE: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE + { + idc=10000; + x=0.550*safezoneW+safezoneX+0.12; + text="Start Range"; + }; + class TEXT_RANGE_CARD_SETUP_END_RANGE: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE + { + idc=10001; + x=0.550*safezoneW+safezoneX+0.12; + text="End Range"; + }; + class TEXT_RANGE_CARD_SETUP_INCREMENT: TEXT_TARGET_RANGE_ASSIST_ANGLE + { + idc=10002; + x=0.550*safezoneW+safezoneX+0.12; + text="Increment"; + }; + class TEXT_RANGE_CARD_SETUP_START_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_TARGET_SIZE_INPUT + { + idc=10003; + onKeyUp="if (_this select 1 == 28) then {1 call cse_ab_ATragMX_fnc_toggle_range_card_setup}"; + }; + class TEXT_RANGE_CARD_SETUP_END_RANGE_INPUT: TEXT_TARGET_RANGE_ASSIST_IMAGE_SIZE_INPUT + { + idc=10004; + onKeyUp="if (_this select 1 == 28) then {1 call cse_ab_ATragMX_fnc_toggle_range_card_setup}"; + }; + class TEXT_RANGE_CARD_SETUP_INCREMENT_INPUT: TEXT_TARGET_RANGE_ASSIST_ANGLE_INPUT + { + idc=10005; + onKeyUp="if (_this select 1 == 28) then {1 call cse_ab_ATragMX_fnc_toggle_range_card_setup}"; + }; + class TEXT_RANGE_CARD_SETUP_DONE: TEXT_TARGET_SPEED_ASSIST_DONE + { + idc=10006; + action="1 call cse_ab_ATragMX_fnc_toggle_range_card_setup"; + }; + class TEXT_RANGE_CARD_SETUP_CANCEL: TEXT_TARGET_SPEED_ASSIST_CANCEL + { + idc=10007; + action="0 call cse_ab_ATragMX_fnc_toggle_range_card_setup"; + }; + class TEXT_RANGE_CARD_SETUP_PREV: TEXT_TARGET_SPEED_ASSIST_PREV + { + idc=10008; + }; + class TEXT_RANGE_CARD_SETUP_NEXT: TEXT_TARGET_SPEED_ASSIST_NEXT + { + idc=10009; + }; + + class TEXT_ADD_NEW_GUN_CAPTION: cse_ab_ATragMX_RscText + { + idc=11000; + style=ST_LEFT; + w=0.25; + h=0.04; + x=0.550*safezoneW+safezoneX+0.12; + y=0.265*safezoneH+safezoneY+0.24; + sizeEx=0.025; + text="New Gun Name"; + }; + class TEXT_ADD_NEW_GUN_GUN_NAME_INPUT: cse_ab_ATragMX_RscEdit + { + idc=11001; + style=ST_LEFT; + w=0.225; + h=0.04; + x=0.550*safezoneW+safezoneX+0.12; + y=0.265*safezoneH+safezoneY+0.28; + text=""; + }; + class TEXT_ADD_NEW_GUN_OK: cse_ab_ATragMX_RscButton + { + idc=11002; + style=ST_CENTER; + w=0.1; + h=0.04; + x=0.550*safezoneW+safezoneX+0.12; + y=0.265*safezoneH+safezoneY+0.33; + colorBackground[]={0.15,0.21,0.23,0.3}; + colorFocused[]={0.15,0.21,0.23,0.2}; + text="OK"; + action="call cse_ab_ATragMX_fnc_add_new_gun; false call cse_ab_ATragMX_fnc_show_add_new_gun; true call cse_ab_ATragMX_fnc_show_gun_list"; + }; + class TEXT_ADD_NEW_GUN_CANCEL: TEXT_ADD_NEW_GUN_OK + { + idc=11003; + x=0.550*safezoneW+safezoneX+0.245; + text="Cancel"; + action="false call cse_ab_ATragMX_fnc_show_add_new_gun; true call cse_ab_ATragMX_fnc_show_gun_list"; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgFunctions.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgFunctions.h new file mode 100644 index 0000000000..961697ae3b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgFunctions.h @@ -0,0 +1,16 @@ +class cfgFunctions { + class CSE_ab_kestrel4500 + { + class Kestrel { + file = "cse\cse_sys_ballistics\kestrel4500\functions"; + class button_pressed { recompile = 1; }; + class collect_data { recompile = 1; }; + class create_dialog { recompile = 1; }; + class display_kestrel { recompile = 1; }; + class generate_output_data { recompile = 1; }; + class update_display { recompile = 1; }; + class kestrel_mainLoop { recompile = 1; }; + class hasAdvancedBallisticsEnabled { recompile = 1; }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgSounds.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgSounds.h new file mode 100644 index 0000000000..5c6ac6de09 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgSounds.h @@ -0,0 +1,39 @@ +class CfgSounds +{ + class cse_ab_kestrel4500_center_button_click + { + name="kestrel4500_center_button_click"; + sound[]={"cse\cse_sys_ballistics\kestrel4500\sound\kestrel_center_button_click.wav",1,1}; + titles[]={}; + }; + class cse_ab_kestrel4500_top_button_click + { + name="kestrel4500_top_button_click"; + sound[]={"cse\cse_sys_ballistics\kestrel4500\sound\kestrel_top_button_click.wav",1,1}; + titles[]={}; + }; + class cse_ab_kestrel4500_right_button_click + { + name="kestrel4500_right_button_click"; + sound[]={"cse\cse_sys_ballistics\kestrel4500\sound\kestrel_right_button_click.wav",1,1}; + titles[]={}; + }; + class cse_ab_kestrel4500_bottom_button_click + { + name="kestrel4500_bottom_button_click"; + sound[]={"cse\cse_sys_ballistics\kestrel4500\sound\kestrel_bottom_button_click.wav",1,1}; + titles[]={}; + }; + class cse_ab_kestrel4500_left_button_click + { + name="kestrel4500_left_button_click"; + sound[]={"cse\cse_sys_ballistics\kestrel4500\sound\kestrel_left_button_click.wav",1,1}; + titles[]={}; + }; + class cse_ab_kestrel4500_exit_button_click + { + name="kestrel4500_exit_button_click"; + sound[]={"cse\cse_sys_ballistics\kestrel4500\sound\kestrel_exit_button_click.wav",1,1}; + titles[]={}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgVehicles.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgVehicles.h new file mode 100644 index 0000000000..a77b370e9c --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/CfgVehicles.h @@ -0,0 +1,37 @@ +class CfgVehicles +{ + class Item_Base_F; + class cse_ab_Item_Kestrel4500: Item_Base_F + { + scope=2; + scopeCurator=2; + displayName="Kestrel4500"; + author="Ruthberg"; + vehicleClass="Items"; + class TransportItems + { + class cse_ab_Kestrel4500 + { + name="cse_ab_Kestrel4500"; + count=1; + }; + }; + }; + + class NATO_Box_Base; + class cse_ballisticsItemsCrate: NATO_Box_Base + { + scope = 2; + displayName = "Ballistic Items [CSE]"; + author = "Combat Space Enhancement"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + class TransportWeapons + { + class _xx_cse_ab_Kestrel4500 + { + weapon="cse_ab_Kestrel4500"; + count=5; + }; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/Combat_space_enhancement.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/Combat_space_enhancement.h new file mode 100644 index 0000000000..e52dee03d7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/Combat_space_enhancement.h @@ -0,0 +1,11 @@ +class Combat_Space_Enhancement { + class EventHandlers { + class PostInit_EventHandlers { + class cse_ab_kestrel4500 { + init = "call compile preprocessFile 'cse\cse_sys_ballistics\kestrel4500\XEH_postClientInit.sqf';"; + name = "Kestrel 4500"; + author = "Ruthberg"; + }; + }; + }; +}; diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/XEH_postClientInit.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/XEH_postClientInit.sqf new file mode 100644 index 0000000000..fc5b82e664 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/XEH_postClientInit.sqf @@ -0,0 +1,19 @@ +if (!hasInterface) exitwith{}; + +call compile preprocessFile "cse\cse_sys_ballistics\kestrel4500\init.sqf"; + + +[] spawn { + waituntil {!isnil "cse_gui"}; + // TODO seperate config entry for this, outside module space. + ["cse_sys_ballistics_Kestrel4500_open", (["cse_sys_ballistics_Kestrel4500_open","menu",[70, 0,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { _this call cse_ab_kestrel4500_fnc_create_dialog; }, 790542] call cse_fnc_addKeyBindingForMenu_F; + ["cse_sys_ballistics_Kestrel4500_open","menu", "Open Kestrel4500", "Opens the Kestrel4500 dialog"] call cse_fnc_settingsDefineDetails_F; + + ["cse_sys_ballistics_Kestrel4500_show", (["cse_sys_ballistics_Kestrel4500_show","action",[70, 1,0,0]] call cse_fnc_getKeyBindingFromProfile_F), { _this call cse_ab_kestrel4500_fnc_display_kestrel; }] call cse_fnc_addKeyBindingForAction_F; + ["cse_sys_ballistics_Kestrel4500_show","action", "Show Kestrel4500", "Show the Kestrel4500 without mouse."] call cse_fnc_settingsDefineDetails_F; + + _entries = [ + ["Kestrel 4500", {([player, 'cse_ab_Kestrel4500'] call cse_fnc_hasItem_CC)}, "cse\cse_sys_ballistics\kestrel4500\data\Kestrel4500_Icon.paa", { closeDialog 0; call cse_ab_Kestrel4500_fnc_create_dialog; }, "Use Kestrel 4500"] + ]; + ["ActionMenu", "equipment", _entries] call cse_fnc_addMultipleEntriesToRadialCategory_F; +}; diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/cfgWeapons.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/cfgWeapons.h new file mode 100644 index 0000000000..c0350297f3 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/cfgWeapons.h @@ -0,0 +1,20 @@ +class CfgWeapons +{ + class ItemCore; + class InventoryItem_Base_F; + class cse_ab_Kestrel4500: ItemCore + { + scope=2; + value = 1; + count = 1; + type = 16; + displayName="Kestrel4500"; + picture= "\cse\cse_sys_ballistics\kestrel4500\data\Kestrel4500_Icon.paa"; + descriptionShort="Kestrel 4500 Pocket Weather Tracker"; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/config.cpp b/TO_MERGE/cse/sys_ballistics/kestrel4500/config.cpp new file mode 100644 index 0000000000..9f83f3df62 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/config.cpp @@ -0,0 +1,36 @@ +#define ST_LEFT 0 +#define ST_RIGHT 1 +#define ST_CENTER 2 + +class CfgPatches +{ + class cse_ab_kestrel4500 + { + units[]={}; + weapons[]= {"cse_ab_Kestrel4500"}; + requiredVersion=1.26; + requiredAddons[]= {"cse_f_modules", "cse_main", "cse_f_configuration"}; + version="1.3"; + author[]= {"Ruthberg"}; + }; +}; +class CfgAddons +{ + class PreloadAddons + { + class cse_ab_kestrel4500 + { + list[]= + { + "cse_ab_kestrel4500" + }; + }; + }; +}; + +#include "combat_space_enhancement.h" +#include "CfgWeapons.h" +#include "CfgVehicles.h" +#include "CfgFunctions.h" +#include "CfgSounds.h" +#include "UI.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/data/Kestrel4500.paa b/TO_MERGE/cse/sys_ballistics/kestrel4500/data/Kestrel4500.paa new file mode 100644 index 0000000000..4fafe55cb2 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/data/Kestrel4500.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/data/Kestrel4500_Icon.paa b/TO_MERGE/cse/sys_ballistics/kestrel4500/data/Kestrel4500_Icon.paa new file mode 100644 index 0000000000..062282115a Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/data/Kestrel4500_Icon.paa differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_button_pressed.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_button_pressed.sqf new file mode 100644 index 0000000000..6d0bfa7390 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_button_pressed.sqf @@ -0,0 +1,40 @@ +#include "script_component.hpp" + +switch (_this) do { + case 0: { // Enter + if (!cse_ab_Kestrel4500_MinAvgMax && (cse_ab_Kestrel4500_Menu == 2 || cse_ab_Kestrel4500_Menu == 3)) then { + cse_ab_Kestrel4500_RefHeading = getDir player; + }; + if (cse_ab_Kestrel4500_MinAvgMax && cse_ab_Kestrel4500_Menu > 0 && cse_ab_Kestrel4500_Menu < 4) then { + if (cse_ab_Kestrel4500_MinAvgMaxMode != 1) then { + { + cse_ab_Kestrel4500_MIN set [_x, 0]; + cse_ab_Kestrel4500_MAX set [_x, 0]; + cse_ab_Kestrel4500_TOTAL set [_x, 0]; + cse_ab_Kestrel4500_ENTRIES set [_x, 0]; + } forEach [1, 2, 3]; + }; + cse_ab_Kestrel4500_MinAvgMaxMode = (cse_ab_Kestrel4500_MinAvgMaxMode + 1) % 3; + }; + }; + case 1: { // Top + cse_ab_Kestrel4500_Menu = (cse_ab_Kestrel4500_Menu - 1 + (count cse_ab_Kestrel4500_Menus)) % (count cse_ab_Kestrel4500_Menus); + }; + case 2: { // Bottom + cse_ab_Kestrel4500_Menu = (cse_ab_Kestrel4500_Menu + 1 + (count cse_ab_Kestrel4500_Menus)) % (count cse_ab_Kestrel4500_Menus); + }; + case 3: { // Left + cse_ab_Kestrel4500_MinAvgMAx = !cse_ab_Kestrel4500_MinAvgMAx; + }; + case 4: { // Right + cse_ab_Kestrel4500_MinAvgMAx = !cse_ab_Kestrel4500_MinAvgMAx; + }; + case 5: { // Memory + }; + case 6: { // Backlight + }; +}; + +_null = _this spawn cse_ab_Kestrel4500_fnc_update_display; + +nil; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_collect_data.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_collect_data.sqf new file mode 100644 index 0000000000..c172855533 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_collect_data.sqf @@ -0,0 +1,90 @@ +#include "script_component.hpp" + +private ["_playerDir", "_windSpeed", "_windDir", "_crosswind", "_headwind", "_humidity", "_temperature", "_humidity", "_barometricPressure", "_altitude"]; + +if (isNil "cse_AB_Altitude") then {AB_Altitude = 0}; +if (isNil "cse_AB_Temperature") then {AB_Temperature = 0}; + +if (isNil "cse_ab_Kestrel4500_MIN" || isNil "cse_ab_Kestrel4500_MAX") then { + _temperature = 15; + _humidity = humidity; + if ((["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_f)) then { + _temperature = ((getPosASL player) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; + _humidity = ((getPosASL player) select 2) call cse_ab_ballistics_fnc_get_humidity_at_height; + }; + _barometricPressure = 1013.25 * exp(-(AB_Altitude + ((getPosASL player) select 2)) / 7990) - 10 * overcast; + _altitude = AB_Altitude + ((getPosASL player) select 2); + cse_ab_Kestrel4500_MIN = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; + cse_ab_Kestrel4500_MAX = [0, 0, 0, 0, _temperature, _humidity, _barometricPressure, _altitude]; +}; + +{ + cse_ab_Kestrel4500_ENTRIES set [_x, (cse_ab_Kestrel4500_ENTRIES select _x) + 1]; +} forEach [0, 4, 5, 6 ,7]; + +// Direction +_playerDir = getDir player; +cse_ab_Kestrel4500_MIN set [0, (cse_ab_Kestrel4500_MIN select 0) min _playerDir]; +cse_ab_Kestrel4500_MAX set [0, _playerDir max (cse_ab_Kestrel4500_MAX select 0)]; +cse_ab_Kestrel4500_TOTAL set [0, (cse_ab_Kestrel4500_TOTAL select 0) + _playerDir]; + +if (cse_ab_Kestrel4500_MinAvgMaxMode == 1) then { + { + cse_ab_Kestrel4500_ENTRIES set [_x, (cse_ab_Kestrel4500_ENTRIES select _x) + 1]; + } forEach [1, 2, 3]; + + // Wind SPD + _windSpeed = vectorMagnitude wind; + _windDir = (wind select 0) atan2 (wind select 1); + + if (call cse_ab_Kestrel4500_fnc_hasAdvancedBallisticsEnabled) then { + _windSpeed = (eyePos player) call cse_ab_ballistics_fnc_calculate_wind_speed; + }; + + _windSpeed = cos(_playerDir - _windDir) * _windSpeed; + cse_ab_Kestrel4500_MIN set [1, (cse_ab_Kestrel4500_MIN select 1) min abs(_windSpeed)]; + cse_ab_Kestrel4500_MAX set [1, abs(_windSpeed) max (cse_ab_Kestrel4500_MAX select 1)]; + cse_ab_Kestrel4500_TOTAL set [1, (cse_ab_Kestrel4500_TOTAL select 1) + abs(_windSpeed)]; + + // CROSSWIND + _crosswind = abs(sin(cse_ab_Kestrel4500_RefHeading - _playerDir) * _windSpeed); + cse_ab_Kestrel4500_MIN set [2, (cse_ab_Kestrel4500_MIN select 2) min _crosswind]; + cse_ab_Kestrel4500_MAX set [2, _crosswind max (cse_ab_Kestrel4500_MAX select 2)]; + cse_ab_Kestrel4500_TOTAL set [2, (cse_ab_Kestrel4500_TOTAL select 2) + _crosswind]; + + // HEADWIND + _headwind = abs(cos(cse_ab_Kestrel4500_RefHeading - _playerDir) * _windSpeed); + cse_ab_Kestrel4500_MIN set [3, (cse_ab_Kestrel4500_MIN select 3) min _headwind]; + cse_ab_Kestrel4500_MAX set [3, _headwind max (cse_ab_Kestrel4500_MAX select 3)]; + cse_ab_Kestrel4500_TOTAL set [3, (cse_ab_Kestrel4500_TOTAL select 3) + _headwind]; +}; + +// TEMP +_temperature = 15; +if ((["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_f)) then { + _temperature = ((getPosASL player) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; +}; +cse_ab_Kestrel4500_MIN set [4, (cse_ab_Kestrel4500_MIN select 4) min _temperature]; +cse_ab_Kestrel4500_MAX set [4, _temperature max (cse_ab_Kestrel4500_MAX select 4)]; +cse_ab_Kestrel4500_TOTAL set [4, (cse_ab_Kestrel4500_TOTAL select 4) + _temperature]; + +// HUMIDITY +_humidity = humidity; +if ((["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_f)) then { + _humidity = ((getPosASL player) select 2) call cse_ab_ballistics_fnc_get_humidity_at_height; +}; +cse_ab_Kestrel4500_MIN set [5, (cse_ab_Kestrel4500_MIN select 5) min _humidity]; +cse_ab_Kestrel4500_MAX set [5, _humidity max (cse_ab_Kestrel4500_MAX select 5)]; +cse_ab_Kestrel4500_TOTAL set [5, (cse_ab_Kestrel4500_TOTAL select 5) + _humidity]; + +// BARO +_barometricPressure = 1013.25 * exp(-(AB_Altitude + ((getPosASL player) select 2)) / 7990) - 10 * overcast; +cse_ab_Kestrel4500_MIN set [6, (cse_ab_Kestrel4500_MIN select 6) min _barometricPressure]; +cse_ab_Kestrel4500_MAX set [6, _barometricPressure max (cse_ab_Kestrel4500_MAX select 6)]; +cse_ab_Kestrel4500_TOTAL set [6, (cse_ab_Kestrel4500_TOTAL select 6) + _barometricPressure]; + +// ALTITUDE +_altitude = AB_Altitude + ((getPosASL player) select 2); +cse_ab_Kestrel4500_MIN set [7, (cse_ab_Kestrel4500_MIN select 7) min _altitude]; +cse_ab_Kestrel4500_MAX set [7, _altitude max (cse_ab_Kestrel4500_MAX select 7)]; +cse_ab_Kestrel4500_TOTAL set [7, (cse_ab_Kestrel4500_TOTAL select 7) + _altitude]; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_create_dialog.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_create_dialog.sqf new file mode 100644 index 0000000000..0290c730f0 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_create_dialog.sqf @@ -0,0 +1,13 @@ +#include "script_component.hpp" + +if (underwater player) exitWith { false }; +if (!([player] call cse_fnc_canInteract) || {!([player, "cse_ab_Kestrel4500"] call cse_fnc_hasItem_CC)}) exitwith {false}; + +cse_ab_Kestrel4500_Overlay = false; +3 cutText ["", "PLAIN"]; + +cse_ab_Kestrel4500 = true; +createDialog 'cse_ab_Kestrel4500_Display'; +[] spawn cse_ab_Kestrel4500_fnc_kestrel_mainLoop; + +true diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_display_kestrel.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_display_kestrel.sqf new file mode 100644 index 0000000000..a2812d6ed3 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_display_kestrel.sqf @@ -0,0 +1,63 @@ +#include "script_component.hpp" + +#define __dsp (uiNamespace getVariable "cse_ab_RscKestrel4500") +#define __ctrlcse_ab_Kestrel4500 (__dsp displayCtrl 75000) +#define __ctrlTop (__dsp displayCtrl 75100) +#define __ctrlCenterBig (__dsp displayCtrl 75200) +#define __ctrlCenterLine1Left (__dsp displayCtrl 75300) +#define __ctrlCenterLine2Left (__dsp displayCtrl 75301) +#define __ctrlCenterLine3Left (__dsp displayCtrl 75302) +#define __ctrlCenterLine1Right (__dsp displayCtrl 75303) +#define __ctrlCenterLine2Right (__dsp displayCtrl 75304) +#define __ctrlCenterLine3Right (__dsp displayCtrl 75305) +#define __ctrlInfoLine1 (__dsp displayCtrl 75400) +#define __ctrlInfoLine2 (__dsp displayCtrl 75401) + +if (cse_ab_Kestrel4500_Overlay) exitWith { + cse_ab_Kestrel4500_Overlay = false; + 3 cutText ["", "PLAIN"]; + true +}; +if (underwater player) exitWith { true }; +if (!([player, "cse_ab_Kestrel4500"] call cse_fnc_hasItem_CC)) exitWith { true }; + +if (cse_ab_Kestrel4500 && dialog) then { + cse_ab_Kestrel4500 = false; + closeDialog 0; +}; + +[] spawn { + private ["_outputData"]; + + cse_ab_Kestrel4500_Overlay = true; + + while {cse_ab_Kestrel4500_Overlay && (("cse_ab_Kestrel4500" in (uniformItems player)) || ("cse_ab_Kestrel4500" in (vestItems player)))} do { + _outputData = call cse_ab_Kestrel4500_fnc_generate_output_data; + + 3 cutRsc ["cse_ab_RscKestrel4500", "PLAIN", 1, false]; + + __ctrlTop ctrlSetText (_outputData select 0); + __ctrlCenterBig ctrlSetText (_outputData select 1); + + __ctrlTop ctrlSetText (_outputData select 0); + __ctrlCenterBig ctrlSetText (_outputData select 1); + + __ctrlCenterLine1Left ctrlSetText (_outputData select 2); + __ctrlCenterLine2Left ctrlSetText (_outputData select 3); + __ctrlCenterLine3Left ctrlSetText (_outputData select 4); + + __ctrlCenterLine1Right ctrlSetText (_outputData select 5); + __ctrlCenterLine2Right ctrlSetText (_outputData select 6); + __ctrlCenterLine3Right ctrlSetText (_outputData select 7); + + __ctrlInfoLine1 ctrlSetText (_outputData select 8); + __ctrlInfoLine2 ctrlSetText (_outputData select 9); + + sleep 1; + }; + + cse_ab_Kestrel4500_Overlay = false; + 3 cutText ["", "PLAIN"]; +}; + +true diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_generate_output_data.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_generate_output_data.sqf new file mode 100644 index 0000000000..38627a7dfc --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_generate_output_data.sqf @@ -0,0 +1,203 @@ +#include "script_component.hpp" + +private ["_playerDir", "_textTop", "_textCenterBig", "_textCenterLine1Left", "_textCenterLine2Left", "_textCenterLine3Left", "_textCenterLine1Right", "_textCenterLine2Right", "_textCenterLine3Right", "_textInfoLine1", "_textInfoLine2", "_temperature", "_humidity", "_windSpeed", "_windDir", "_newWindSpeed", "_windSource", "_height"]; + +if (isNil "cse_AB_Altitude") then {AB_Altitude = 0}; +if (isNil "cse_AB_Temperature") then {AB_Temperature = 0}; + +call cse_ab_Kestrel4500_fnc_collect_data; + +_textTop = cse_ab_Kestrel4500_Menus select cse_ab_Kestrel4500_Menu; +_textCenterBig = ""; + +_textCenterLine1Left = ""; +_textCenterLine2Left = ""; +_textCenterLine3Left = ""; +_textCenterLine1Right = ""; +_textCenterLine2Right = ""; +_textCenterLine3Right = ""; + +_textInfoLine1 = ""; +_textInfoLine2 = ""; + +_windSpeed = vectorMagnitude wind; +_windDir = (wind select 0) atan2 (wind select 1); + +_temperature = 15; +_humidity = humidity; + +if (call cse_ab_Kestrel4500_fnc_hasAdvancedBallisticsEnabled) then { + _windSpeed = (eyePos player) call cse_ab_ballistics_fnc_calculate_wind_speed; + _temperature = ((getPosASL player) select 2) call cse_ab_ballistics_fnc_get_temperature_at_height; + _humidity = ((getPosASL player) select 2) call cse_ab_ballistics_fnc_get_humidity_at_height; +}; + +_playerDir = getDir player; +_windSpeed = cos(_playerDir - _windDir) * _windSpeed; + +cse_ab_Kestrel4500_Direction = 4 * floor(_playerDir / 90); +if (_playerDir % 90 > 10) then { cse_ab_Kestrel4500_Direction = cse_ab_Kestrel4500_Direction + 1}; +if (_playerDir % 90 > 35) then { cse_ab_Kestrel4500_Direction = cse_ab_Kestrel4500_Direction + 1}; +if (_playerDir % 90 > 55) then { cse_ab_Kestrel4500_Direction = cse_ab_Kestrel4500_Direction + 1}; +if (_playerDir % 90 > 80) then { cse_ab_Kestrel4500_Direction = cse_ab_Kestrel4500_Direction + 1}; +cse_ab_Kestrel4500_Direction = cse_ab_Kestrel4500_Direction % 16; + +switch (cse_ab_Kestrel4500_Menu) do { + case 0: { // Direction + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = format["%1", format["%1 %2", cse_ab_Kestrel4500_Directions select cse_ab_Kestrel4500_Direction, round(_playerDir)]]; + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = "N/A"; + _textCenterLine2Right = "N/A"; + _textCenterLine3Right = "N/A"; + }; + }; + case 1: { // Wind SPD + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round(abs(_windSpeed) * 10) / 10); + } else { + _textCenterLine1Left = "Max"; + _textCenterLine2Left = "Avg"; + switch (cse_ab_Kestrel4500_MinAvgMaxMode) do { + case 0: { + _textCenterLine1Right = "--. -"; + _textCenterLine2Right = "--. -"; + _textInfoLine2 = "- average"; + }; + case 1: { + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MAX select 1) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 1) / (cse_ab_Kestrel4500_ENTRIES select 1) * 10) / 10); + _textInfoLine2 = "- stop"; + }; + case 2: { + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MAX select 1) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 1) / (cse_ab_Kestrel4500_ENTRIES select 1) * 10) / 10); + _textInfoLine2 = "- clear"; + }; + }; + }; + }; + case 2: { // CROSSWIND + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round(abs(sin(cse_ab_Kestrel4500_RefHeading - _playerDir) * _windSpeed) * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine2 = "- set heading"; + } else { + _textCenterLine1Left = "Max"; + _textCenterLine2Left = "Avg"; + switch (cse_ab_Kestrel4500_MinAvgMaxMode) do { + case 0: { + _textCenterLine1Right = "--. -"; + _textCenterLine2Right = "--. -"; + _textInfoLine2 = "- average"; + }; + case 1: { + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MAX select 2) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 2) / (cse_ab_Kestrel4500_ENTRIES select 2) * 10) / 10); + _textInfoLine2 = "- stop"; + }; + case 2: { + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MAX select 2) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 2) / (cse_ab_Kestrel4500_ENTRIES select 2) * 10) / 10); + _textInfoLine2 = "- clear"; + }; + }; + }; + }; + case 3: { // HEADWIND + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round(abs(cos(cse_ab_Kestrel4500_RefHeading - _playerDir) * _windSpeed) * 10) / 10); + _textInfoLine1 = format["%1 m/s @ %2", round((cos(_playerDir - _windDir) * _windSpeed) * 10) / 10, round(_playerDir)]; + _textInfoLine2 = "- set heading"; + } else { + _textCenterLine1Left = "Max"; + _textCenterLine2Left = "Avg"; + switch (cse_ab_Kestrel4500_MinAvgMaxMode) do { + case 0: { + _textCenterLine1Right = "--. -"; + _textCenterLine2Right = "--. -"; + _textInfoLine2 = "- average"; + }; + case 1: { + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MAX select 3) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 3) / (cse_ab_Kestrel4500_ENTRIES select 3) * 10) / 10); + _textInfoLine2 = "- stop"; + }; + case 2: { + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MAX select 3) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 3) / (cse_ab_Kestrel4500_ENTRIES select 3) * 10) / 10); + _textInfoLine2 = "- clear"; + }; + }; + }; + }; + case 4: { // TEMP + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round(_temperature * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MIN select 4) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 4) / (cse_ab_Kestrel4500_ENTRIES select 4) * 10) / 10); + _textCenterLine3Right = Str(round((cse_ab_Kestrel4500_MAX select 4) * 10) / 10); + }; + }; + case 5: { // HUMIDITY + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round(_humidity * 100 * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MIN select 5) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 5) / (cse_ab_Kestrel4500_ENTRIES select 5) * 10) / 10); + _textCenterLine3Right = Str(round((cse_ab_Kestrel4500_MAX select 5) * 10) / 10); + }; + }; + case 6: { // BARO + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round((1013.25 * exp(-(AB_Altitude + ((getPosASL player) select 2)) / 7990) - 10 * overcast) * 10) / 10); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round((cse_ab_Kestrel4500_MIN select 6) * 10) / 10); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 6) / (cse_ab_Kestrel4500_ENTRIES select 6) * 10) / 10); + _textCenterLine3Right = Str(round((cse_ab_Kestrel4500_MAX select 6) * 10) / 10); + }; + }; + case 7: { // ALTITUDE + if (!cse_ab_Kestrel4500_MinAvgMax) then { + _textCenterBig = Str(round(AB_Altitude + ((getPosASL player) select 2))); + } else { + _textCenterLine1Left = "Min"; + _textCenterLine2Left = "Avg"; + _textCenterLine3Left = "Max"; + _textCenterLine1Right = Str(round(cse_ab_Kestrel4500_MIN select 7)); + _textCenterLine2Right = Str(round((cse_ab_Kestrel4500_TOTAL select 7) / (cse_ab_Kestrel4500_ENTRIES select 7))); + _textCenterLine3Right = Str(round(cse_ab_Kestrel4500_MAX select 7)); + }; + }; + case 8: { // User Screen 1 + _textCenterLine1Left = Str(round(_playerDir)); + _textCenterLine2Left = Str(round(AB_Altitude + ((getPosASL player) select 2))); + _textCenterLine3Left = Str(round(abs(_windSpeed) * 10) / 10); + _textCenterLine1Right = cse_ab_Kestrel4500_Directions select cse_ab_Kestrel4500_Direction; + _textCenterLine2Right = "m"; + _textCenterLine3Right = "m/s"; + }; + case 9: { // User Screen 2 + _textCenterLine1Left = Str(round(_temperature * 10) / 10); + _textCenterLine2Left = Str(round(_humidity * 100 * 10) / 10); + _textCenterLine3Left = Str(round((1013.25 * exp(-(AB_Altitude + ((getPosASL player) select 2)) / 7990) - 10 * overcast) * 10) / 10); + _textCenterLine1Right = "C"; + _textCenterLine2Right = "%"; + _textCenterLine3Right = "hPA"; + }; +}; + +[_textTop, _textCenterBig, _textCenterLine1Left, _textCenterLine2Left, _textCenterLine3Left, _textCenterLine1Right, _textCenterLine2Right, _textCenterLine3Right, _textInfoLine1, _textInfoLine2] diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_hasAdvancedBallisticsEnabled.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_hasAdvancedBallisticsEnabled.sqf new file mode 100644 index 0000000000..bff36a159c --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_hasAdvancedBallisticsEnabled.sqf @@ -0,0 +1 @@ +(["cse_AB_moduleAdvancedBallistics"] call cse_fnc_isModuleEnabled_f) \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_kestrel_mainLoop.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_kestrel_mainLoop.sqf new file mode 100644 index 0000000000..d5a141b6c7 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_kestrel_mainLoop.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +while {dialog} do { + _null = _this spawn cse_ab_Kestrel4500_fnc_update_display; + sleep 1; +}; + +cse_ab_Kestrel4500 = false; diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_update_display.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_update_display.sqf new file mode 100644 index 0000000000..4923db22d3 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/fn_update_display.sqf @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +private ["_outputData"]; + +_outputData = call cse_ab_Kestrel4500_fnc_generate_output_data; + +ctrlSetText [74100, _outputData select 0]; +ctrlSetText [74200, _outputData select 1]; + +ctrlSetText [74300, _outputData select 2]; +ctrlSetText [74301, _outputData select 3]; +ctrlSetText [74302, _outputData select 4]; + +ctrlSetText [74303, _outputData select 5]; +ctrlSetText [74304, _outputData select 6]; +ctrlSetText [74305, _outputData select 7]; + +ctrlSetText [74400, _outputData select 8]; +ctrlSetText [74401, _outputData select 9]; diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/script_component.hpp b/TO_MERGE/cse/sys_ballistics/kestrel4500/functions/script_component.hpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/init.sqf b/TO_MERGE/cse/sys_ballistics/kestrel4500/init.sqf new file mode 100644 index 0000000000..bda593a908 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/init.sqf @@ -0,0 +1,19 @@ +private ["_temperature", "_barometricPressure", "_altitude"]; + +cse_ab_Kestrel4500_Menus = ["Direction", "Wind SPD m/s", "CROSSWIND m/s", "HEADWIND m/s", "TEMP °C", "HUMIDITY %", "BARO hPA", "ALTITUDE m", "User Screen 1", "User Screen 2"]; + +cse_ab_Kestrel4500_TOTAL = [0, 0, 0, 0, 0, 0, 0, 0]; +cse_ab_Kestrel4500_ENTRIES = [0, 0, 0, 0, 0, 0, 0, 0]; + +cse_ab_Kestrel4500_MinAvgMax = false; +cse_ab_Kestrel4500_MinAvgMaxMode = 0; + +cse_ab_Kestrel4500_Menu = 1; +cse_ab_Kestrel4500_Directions = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]; +cse_ab_Kestrel4500_Direction = 0; + +cse_ab_Kestrel4500_RefHeading = 0; + +cse_ab_Kestrel4500 = false; +cse_ab_Kestrel4500_Overlay = false; +cse_ab_Kestrel4500_OverlayStart = diag_tickTime; diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/license.txt b/TO_MERGE/cse/sys_ballistics/kestrel4500/license.txt new file mode 100644 index 0000000000..eb925e129b --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/license.txt @@ -0,0 +1,19 @@ +Copyright (c) <2014> + +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. \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_bottom_button_click.wav b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_bottom_button_click.wav new file mode 100644 index 0000000000..1f5a2ddeb1 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_bottom_button_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_center_button_click.wav b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_center_button_click.wav new file mode 100644 index 0000000000..ce34a645c3 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_center_button_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_exit_button_click.wav b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_exit_button_click.wav new file mode 100644 index 0000000000..1f5a2ddeb1 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_exit_button_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_left_button_click.wav b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_left_button_click.wav new file mode 100644 index 0000000000..a880e76dc1 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_left_button_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_right_button_click.wav b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_right_button_click.wav new file mode 100644 index 0000000000..14ff2e0689 Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_right_button_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_top_button_click.wav b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_top_button_click.wav new file mode 100644 index 0000000000..e4ef1df50d Binary files /dev/null and b/TO_MERGE/cse/sys_ballistics/kestrel4500/sound/kestrel_top_button_click.wav differ diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/ui.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui.h new file mode 100644 index 0000000000..ce5f794555 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui.h @@ -0,0 +1,3 @@ +#include "ui\defines.h" +#include "ui\display.h" +#include "ui\rscTitles.h" \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/defines.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/defines.h new file mode 100644 index 0000000000..88e19da70f --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/defines.h @@ -0,0 +1,56 @@ +#define ST_LEFT 0 +#define ST_RIGHT 1 +#define ST_CENTER 2 + +#ifndef CSE_KESTREL_DEFINES_H_ +#define CSE_KESTREL_DEFINES_H_ + +class Kestrel4500_RscText +{ + idc=-1; + type=0; + style=ST_CENTER; + colorDisabled[]={0,0,0,0}; + colorBackground[]={0,0,0,0}; + colorText[]={0,0,0,1}; + text=""; + x=0; + y=0; + w=0.1; + h=0.03; + font="TahomaB"; + sizeEx=0.04; + shadow=0; +}; +class Kestrel4500_RscButton +{ + text=""; + colorText[]={0,0,0,1}; + colorDisabled[]={0,0,0,0}; + colorBackground[]={0,0,0,0}; + colorBackgroundDisabled[]={0,0,0,0}; + colorBackgroundActive[]={0,0,0,0}; + colorFocused[]={0,0,0,0}; + colorShadow[]={0,0,0,0}; + colorBorder[]={0,0,0,1}; + soundEnter[]={"",0,1}; + soundPush[]={"",0,1}; + soundClick[]={"",0,1}; + soundEscape[]={"",0,1}; + type=1; + style="0x02+0x100"; + x=0; + y=0; + w=0.10; + h=0.03; + font="TahomaB"; + SizeEx=0.025; + offsetX=0.003; + offsetY=0.003; + offsetPressedX=0.0020; + offsetPressedY=0.0020; + borderSize=0; + shadow=0; +}; + +#endif \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/display.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/display.h new file mode 100644 index 0000000000..bce6030cd8 --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/display.h @@ -0,0 +1,162 @@ +class cse_ab_Kestrel4500_Display { + name="cse_ab_Kestrel4500_Display"; + idd=790542; + onLoad="uiNamespace setVariable ['cse_ab_Kestrel4500_Display', (_this select 0)]"; + movingEnable=1; + controlsBackground[]={}; + objects[]={}; + class controls + { + class BACKGROUND + { + moving=1; + type=0; + font="TahomaB"; + SizeEX=0.025; + idc=-1; + style=48; + x=safezoneX; + y=safezoneY; + w=1.024; + h=1.024*4/3; + colorBackground[]={1,1,1,1}; + colorText[]={1,1,1,1}; + text="cse\cse_sys_ballistics\kestrel4500\data\kestrel4500.paa"; + + }; + class POWER: Kestrel4500_RscButton + { + idc=-1; + x=safezoneX+0.385; + y=safezoneY+1.125; + w=0.042; + h=0.042*4/3; + action="closeDialog 0"; + onMouseButtonDown = "playSound 'cse_ab_kestrel4500_exit_button_click'"; + }; + class ENTER: POWER + { + idc=-1; + x=safezoneX+0.46; + y=safezoneY+1.0; + w=0.1; + action="0 call CSE_ab_kestrel4500_fnc_button_pressed;"; + onMouseButtonDown = "playSound 'cse_ab_kestrel4500_center_button_click'"; + }; + class TOP: Kestrel4500_RscButton + { + idc=-1; + x=safezoneX+0.46; + y=safezoneY+0.93; + w=0.1; + h=0.03; + action="1 call CSE_ab_kestrel4500_fnc_button_pressed;"; + onMouseButtonDown = "playSound 'cse_ab_kestrel4500_top_button_click'"; + }; + class BOTTOM: TOP + { + idc=-1; + y=safezoneY+1.1; + action="2 call CSE_ab_kestrel4500_fnc_button_pressed;"; + onMouseButtonDown = "playSound 'cse_ab_kestrel4500_bottom_button_click'"; + }; + class LEFT: Kestrel4500_RscButton + { + idc=-1; + x=safezoneX+0.4; + y=safezoneY+0.97; + w=0.046; + h=0.11; + action="3 call CSE_ab_kestrel4500_fnc_button_pressed;"; + onMouseButtonDown = "playSound 'cse_ab_kestrel4500_left_button_click'"; + }; + class RIGHT: LEFT + { + idc=-1; + x=safezoneX+0.58; + action="4 call CSE_ab_kestrel4500_fnc_button_pressed;"; + onMouseButtonDown = "playSound 'cse_ab_kestrel4500_right_button_click'"; + }; + class MEMORY: Kestrel4500_RscButton + { + idc=-1; + x=safezoneX+0.395; + y=safezoneY+0.87; + w=0.05; + h=0.045*4/3; + action="5 call CSE_ab_kestrel4500_fnc_button_pressed;"; + }; + class BACKLIGHT: MEMORY + { + idc=-1; + x=safezoneX+0.585; + action="6 call CSE_ab_kestrel4500_fnc_button_pressed;"; + }; + + class TEXT_TOP: Kestrel4500_RscText + { + idc=74100; + x=safezoneX+0.40; + y=safezoneY+0.58; + w=0.22; + h=0.04; + text=""; + }; + class TEXT_CENTER_BIG: TEXT_TOP + { + idc=74200; + y=safezoneY+0.61; + h=0.10; + SizeEx=0.06; + text=""; + }; + class TEXT_CENTER_LINE_1_LEFT: TEXT_TOP + { + idc=74300; + y=safezoneY+0.60; + style=ST_LEFT; + h=0.10; + SizeEx=0.05; + text=""; + }; + class TEXT_CENTER_LINE2_LEFT: TEXT_CENTER_LINE_1_LEFT + { + idc=74301; + y=safezoneY+0.64; + text=""; + }; + class TEXT_CENTER_LINE_3_LEFT: TEXT_CENTER_LINE2_LEFT + { + idc=74302; + y=safezoneY+0.68; + text=""; + }; + class TEXT_CENTER_LINE_1_RIGHT: TEXT_CENTER_LINE_1_LEFT + { + idc=74303; + style=ST_RIGHT; + }; + class TEXT_CENTER_LINE2_RIGHT: TEXT_CENTER_LINE2_LEFT + { + idc=74304; + style=ST_RIGHT; + }; + class TEXT_CENTER_LINE_3_RIGHT: TEXT_CENTER_LINE_3_LEFT + { + idc=74305; + style=ST_RIGHT; + }; + class TEXT_INFO_LINE_1: TEXT_TOP + { + idc=74400; + y=safezoneY+0.69; + text=""; + }; + class TEXT_INFO_LINE_2: TEXT_TOP + { + idc=74401; + y=safezoneY+0.72; + text=""; + }; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/rscTitles.h b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/rscTitles.h new file mode 100644 index 0000000000..2f18667c2d --- /dev/null +++ b/TO_MERGE/cse/sys_ballistics/kestrel4500/ui/rscTitles.h @@ -0,0 +1,98 @@ +class RscTitles +{ + class cse_ab_RscKestrel4500 + { + idd=-1; + onLoad="with uiNameSpace do { cse_ab_RscKestrel4500 = _this select 0 };"; + movingEnable=0; + duration=60; + fadeIn="false"; + fadeOut="false"; + class controls + { + class cse_ab_RscKestrel4500 + { + idc=75000; + moving=0; + type=0; + font="TahomaB"; + SizeEX=0.025*0.75; + style=48; + x=safezoneX-0.05; + y=safezoneY+0.7; + w=1.024*0.75; + h=1.024*4/3*0.75; + colorBackground[]={1,1,1,1}; + colorText[]={1,1,1,1}; + text="cse\cse_sys_ballistics\kestrel4500\data\kestrel4500.paa"; + + }; + class RscTextTop: Kestrel4500_RscText + { + idc=75100; + x=safezoneX-0.05+0.40*0.75; + y=safezoneY+0.7+0.58*0.75; + w=0.22*0.75; + h=0.04*0.75; + SizeEx=0.04*0.75; + text=""; + }; + class RscTextCenterBig: RscTextTop + { + idc=75200; + y=safezoneY+0.7+0.61*0.75; + h=0.10*0.75; + SizeEx=0.06*0.75; + text=""; + }; + class RscTextCenterLine1Left: RscTextTop + { + idc=75300; + y=safezoneY+0.7+0.60*0.75; + style=ST_LEFT; + h=0.10*0.75; + SizeEx=0.05*0.75; + text=""; + }; + class RscTextCenterLine2Left: RscTextCenterLine1Left + { + idc=75301; + y=safezoneY+0.7+0.64*0.75; + text=""; + }; + class RscTextCenterLine3Left: RscTextCenterLine2Left + { + idc=75302; + y=safezoneY+0.7+0.68*0.75; + text=""; + }; + class RscTextCenterLine1Right: RscTextCenterLine1Left + { + idc=75303; + style=ST_RIGHT; + }; + class RscTextCenterLine2Right: RscTextCenterLine2Left + { + idc=75304; + style=ST_RIGHT; + }; + class RscTextCenterLine3Right: RscTextCenterLine3Left + { + idc=75305; + style=ST_RIGHT; + }; + class RscTextInfoLine1: RscTextTop + { + idc=75400; + y=safezoneY+0.7+0.69*0.75; + text=""; + }; + class RscTextInfoLine2: RscTextTop + { + idc=75401; + y=safezoneY+0.7+0.72*0.75; + text=""; + }; + }; + }; +}; diff --git a/addons/ai/README.md b/addons/ai/README.md new file mode 100644 index 0000000000..40b4e776a4 --- /dev/null +++ b/addons/ai/README.md @@ -0,0 +1,12 @@ +ace_ai +====== + +Minor changes of AI skill and overhaul of AI firing modes of vanilla weapons, encouraging the AI to use full-auto and bursts more often. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/aircraft/README.md b/addons/aircraft/README.md new file mode 100644 index 0000000000..b212d311b9 --- /dev/null +++ b/addons/aircraft/README.md @@ -0,0 +1,12 @@ +ace_aircraft +============ + +Changes to air weaponry, flightmodels and HUDs. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/attach/README.md b/addons/attach/README.md new file mode 100644 index 0000000000..7ac36f109d --- /dev/null +++ b/addons/attach/README.md @@ -0,0 +1,13 @@ +ace_attach +========== + +Introducing the ability to attach various throwables to yourself to mark your position and assist in IFF. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [esteldunedain](https://github.com/esteldunedain) +- [bux578](https://github.com/bux578) +- [KoffeinFlummi](https://github.com/KoffeinFlummi) diff --git a/addons/attach/XEH_preInit.sqf b/addons/attach/XEH_preInit.sqf index 5efadc1f68..bcbd7e543c 100644 --- a/addons/attach/XEH_preInit.sqf +++ b/addons/attach/XEH_preInit.sqf @@ -4,5 +4,4 @@ PREP(attach); PREP(canAttach); PREP(canDetach); PREP(detach); -PREP(detachDelayFix); PREP(openAttachUI); \ No newline at end of file diff --git a/addons/attach/functions/fnc_detach.sqf b/addons/attach/functions/fnc_detach.sqf index b55d6e1b70..3ecac44d62 100644 --- a/addons/attach/functions/fnc_detach.sqf +++ b/addons/attach/functions/fnc_detach.sqf @@ -12,7 +12,7 @@ Return Value: none */ -private ["_unit", "_itemName", "_count", "_attachedItem"]; +private ["_unit", "_itemName", "_count", "_attachedItem", "_fnc_detachDelay"]; _unit = _this select 0; _itemName = _unit getVariable [QGVAR(ItemName), ""]; @@ -33,7 +33,10 @@ if (_itemName == "B_IR_Grenade" or _itemName == "O_IR_Grenade" or _itemName == " 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; + _fnc_detachDelay = { + deleteVehicle (_this select 0); + }; + [_fnc_detachDelay, [_attachedItem], 0.5, 0] call EFUNC(common,waitAndExecute); } else { // Delete attached item deleteVehicle _attachedItem; diff --git a/addons/attach/functions/fnc_detachDelayFix.sqf b/addons/attach/functions/fnc_detachDelayFix.sqf deleted file mode 100644 index ac4ef0b276..0000000000 --- a/addons/attach/functions/fnc_detachDelayFix.sqf +++ /dev/null @@ -1,20 +0,0 @@ -/* - 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/backblast/README.md b/addons/backblast/README.md new file mode 100644 index 0000000000..857776693a --- /dev/null +++ b/addons/backblast/README.md @@ -0,0 +1,12 @@ +ace_backblast +============= + +Adds backblast to AT launchers and overpressure zones to tank cannons. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [KoffeinFlummi](https://github.com/KoffeinFlummi) diff --git a/addons/ballistics/CfgAmmo.hpp b/addons/ballistics/CfgAmmo.hpp index 4e2aa6cb9e..6e11038924 100644 --- a/addons/ballistics/CfgAmmo.hpp +++ b/addons/ballistics/CfgAmmo.hpp @@ -9,50 +9,6 @@ class CfgAmmo { airFriction = -0.000915; }; - // IR Dim - class B_65x39_Caseless_yellow; - class ACE_B_65x39_Caseless_Tracer_Dim: B_65x39_Caseless_yellow { - nvgOnly = 1; - }; - - class B_65x39_Case_yellow; - class ACE_B_65x39_Case_Tracer_Dim: B_65x39_Case_yellow { - nvgOnly = 1; - }; - - // sub sonic - class ACE_B_65x39_Caseless_SD: B_65x39_Caseless { - airFriction = -0.00054; - hit = 8.75; - supersonicCrackFar[] = {}; - supersonicCrackNear[] = {}; - typicalSpeed = 320; - audibleFire = 0.8; - visibleFire = 2.5; - }; - - class B_65x39_Case; - class ACE_B_65x39_Case_SD: B_65x39_Case { - airFriction = -0.00054; - hit = 8.75; - supersonicCrackFar[] = {}; - supersonicCrackNear[] = {}; - typicalSpeed = 320; - audibleFire = 0.8; - visibleFire = 2.5; - }; - - // armor piercing - class ACE_B_65x39_Caseless_AP: B_65x39_Caseless { - caliber = 1.8; - hit = 10.5; - }; - - class ACE_B_65x39_Case_AP: B_65x39_Case { - caliber = 1.8; - hit = 10.5; - }; - /* 5.56x45mm NATO */ @@ -61,29 +17,6 @@ class CfgAmmo { airFriction = -0.001335; }; - // IR Dim - class B_556x45_Ball_Tracer_Red; - class ACE_B_556x45_Ball_Tracer_Dim: B_556x45_Ball_Tracer_Red { - nvgOnly = 1; - }; - - // sub sonic - class ACE_B_556x45_Ball_SD: B_556x45_Ball { - airFriction = -0.0006; - hit = 7; - supersonicCrackFar[] = {}; - supersonicCrackNear[] = {}; - typicalSpeed = 320; - audibleFire = 0.6; - visibleFire = 2.0; - }; - - // armor piercing - class ACE_B_556x45_Ball_AP: B_556x45_Ball { - caliber = 1.4; - hit = 8.4; - }; - /* 7.62x51mm NATO */ @@ -92,35 +25,6 @@ class CfgAmmo { //airfriction = }; - // IR Dim - class B_762x51_Tracer_Red; - class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Red { - nvgOnly = 1; - }; - - // sub sonic - class ACE_B_762x51_Ball_SD: B_762x51_Ball { - airFriction = -0.00048; - hit = 10.5; - supersonicCrackFar[] = {}; - supersonicCrackNear[] = {}; - typicalSpeed = 320; - audibleFire = 0.9; - visibleFire = 3.0; - }; - - // armor piercing - class ACE_B_762x51_Ball_AP: B_762x51_Ball { - caliber = 2.4; - hit = 12.6; - }; - - // M118 LR - class ACE_B_762x51_M118LR: B_762x51_Ball { - typicalspeed = 792; - airfriction = -0.0008577; - }; - /* Other */ diff --git a/addons/ballistics/CfgMagazines.hpp b/addons/ballistics/CfgMagazines.hpp index d64e04ad08..1c5dabacd8 100644 --- a/addons/ballistics/CfgMagazines.hpp +++ b/addons/ballistics/CfgMagazines.hpp @@ -12,34 +12,6 @@ class CfgMagazines { initSpeed = 724; }; - class 30Rnd_65x39_caseless_mag_Tracer; - class ACE_30Rnd_65x39_caseless_mag_Tracer_Dim: 30Rnd_65x39_caseless_mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_Tracer_Dim"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_yellow_CA.paa"; - }; - - class ACE_30Rnd_65x39_caseless_mag_SD: 30Rnd_65x39_caseless_mag { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_SD"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_SDName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa"; - initSpeed = 320; - }; - - class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_AP"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_APName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_APNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_APDescription"; - }; - /* 6.5x39mm Grendel - Katiba */ @@ -51,32 +23,6 @@ class CfgMagazines { initSpeed = 691; }; - class 30Rnd_65x39_caseless_green_mag_Tracer; - class ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim: 30Rnd_65x39_caseless_green_mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_Tracer_Dim"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimDescription"; - }; - - class ACE_30Rnd_65x39_caseless_green_mag_SD: 30Rnd_65x39_caseless_green { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_SD"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription"; - initSpeed = 320; - }; - - class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_65x39_Caseless_AP"; - displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_APName"; - displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_APNameShort"; - descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_APDescription"; - }; - /* 5.56x45mm NATO */ @@ -84,41 +30,11 @@ class CfgMagazines { initSpeed = 911; }; - class 30Rnd_556x45_Stanag_Tracer_Red; //picture = "\A3\weapons_f\data\ui\m_30stanag_red_ca.paa"; - class ACE_30Rnd_556x45_Stanag_Tracer_Dim: 30Rnd_556x45_Stanag_Tracer_Red { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_556x45_Ball_Tracer_Dim"; - displayName = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimDescription"; - picture = "\A3\weapons_f\data\ui\m_30stanag_yellow_ca.paa"; - }; - - class ACE_30Rnd_556x45_Stanag_SD: 30Rnd_556x45_Stanag { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_556x45_Ball_SD"; - displayName = "$STR_ACE_30Rnd_556x45_mag_SDName"; - displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription"; - initSpeed = 320; - picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa"; - }; - - class ACE_30Rnd_556x45_Stanag_AP: 30Rnd_556x45_Stanag { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_556x45_Ball_AP"; - displayName = "$STR_ACE_30Rnd_556x45_mag_APName"; - displayNameShort = "$STR_ACE_30Rnd_556x45_mag_APNameShort"; - descriptionShort = "$STR_ACE_30Rnd_556x45_mag_APDescription"; - }; - /* 7.62x51mm NATO */ class 20Rnd_762x51_Mag: CA_Magazine { - descriptionshort = "$STR_ACE_Ballistics_20Rnd_762x51_Mag_Description"; initSpeed = 792; // 18" M14 EBR barrel - ammo = "ACE_B_762x51_M118LR"; // Use M118LR }; class 150Rnd_762x51_Box: CA_Magazine { @@ -126,40 +42,6 @@ class CfgMagazines { initSpeed = 853; // Typical MV for M240 }; - class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { //@todo Green tracers for opfor and yellow tracers for independent - author = "$STR_ACE_Common_ACETeam"; - ammo = "B_762x51_Tracer_Red"; - displayName = "$STR_ACE_20Rnd_762x51_mag_TracerName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_TracerNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_TracerDescription"; - tracersEvery = 1; - }; - - class ACE_20Rnd_762x51_Mag_Tracer_Dim: ACE_20Rnd_762x51_Mag_Tracer { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_762x51_Tracer_Dim"; - displayName = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimDescription"; - }; - - class ACE_20Rnd_762x51_Mag_SD: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_762x51_Ball_SD"; - displayName = "$STR_ACE_20Rnd_762x51_mag_SDName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription"; - initSpeed = 320; - }; - - class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag { - author = "$STR_ACE_Common_ACETeam"; - ammo = "ACE_B_762x51_Ball_AP"; - displayName = "$STR_ACE_20Rnd_762x51_mag_APName"; - displayNameShort = "$STR_ACE_20Rnd_762x51_mag_APNameShort"; - descriptionShort = "$STR_ACE_20Rnd_762x51_mag_APDescription"; - }; - /* Other */ diff --git a/addons/ballistics/CfgVehicles.hpp b/addons/ballistics/CfgVehicles.hpp index cdc73dcd99..efd2132d95 100644 --- a/addons/ballistics/CfgVehicles.hpp +++ b/addons/ballistics/CfgVehicles.hpp @@ -1,203 +1,9 @@ -#define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) class _xx_##MAGAZINE { \ - magazine = #MAGAZINE; \ - count = COUNT; \ -} - -#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ -} - class CfgVehicles { - #include - #include - - class NATO_Box_Base; - class Box_NATO_Wps_F: NATO_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); - }; - }; - - class Box_NATO_WpsSpecial_F: NATO_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); - }; - }; - - class Box_NATO_Ammo_F: NATO_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,2); - }; - }; - - class Box_NATO_Support_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_muzzle_mzls_H,5); - MACRO_ADDITEM(ACE_muzzle_mzls_B,5); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,5); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,5); - }; - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,6); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,3); - }; - }; - - class ReammoBox_F; - class B_supplyCrate_F: ReammoBox_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,2); - }; - }; - - class EAST_Box_Base; - class Box_East_Wps_F: EAST_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); - }; - }; - - class Box_East_WpsSpecial_F: EAST_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); - }; - }; - - class Box_East_Ammo_F: EAST_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); - }; - }; - - class Box_East_Support_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_muzzle_mzls_H,5); - MACRO_ADDITEM(ACE_muzzle_mzls_B,5); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,5); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,5); - }; - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,6); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,3); - }; - }; - - class O_supplyCrate_F: B_supplyCrate_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); - }; - }; - - class IND_Box_Base; - class Box_IND_Wps_F: IND_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - }; - }; - - class Box_IND_WpsSpecial_F: IND_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,2); - }; - }; - - class Box_IND_Ammo_F: IND_Box_Base { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); - }; - }; - - class Box_IND_Support_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_muzzle_mzls_H,1); - MACRO_ADDITEM(ACE_muzzle_mzls_B,5); - MACRO_ADDITEM(ACE_muzzle_mzls_L,5); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,5); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,5); - }; - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,6); - }; - }; - - class FIA_Box_Base_F; - class Box_FIA_Wps_F: FIA_Box_Base_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - }; - }; - - class Box_FIA_Ammo_F: FIA_Box_Base_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); - }; - }; - - class Box_FIA_Support_F: FIA_Box_Base_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,6); - }; - }; - - class I_supplyCrate_F: B_supplyCrate_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); - }; - }; - - class IG_supplyCrate_F: ReammoBox_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); - }; - }; - - class C_supplyCrate_F: ReammoBox_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); - }; - }; - - class ACE_Box_Misc: Box_NATO_Support_F { - class TransportMagazines { - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); - MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); - /*MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer,2); - MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,2); - MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,2); - MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_AP,2);*/ - }; - class TransportItems { - MACRO_ADDITEM(ACE_muzzle_mzls_H,2); - MACRO_ADDITEM(ACE_muzzle_mzls_B,2); - MACRO_ADDITEM(ACE_muzzle_mzls_L,2); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,2); - MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,2); - }; - }; - class Sign_F; class ACE_TargetWall: Sign_F { author = "$STR_ACE_Common_ACETeam"; + scope = 0; class Eventhandlers { init = QUOTE(_this call COMPILE_FILE(scripts\initTargetWall)); //hitPart = "systemChat str _this"; diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index a8a449e9dc..2319f8279b 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -1,26 +1,13 @@ class Mode_SemiAuto; class Mode_FullAuto; -class SlotInfo; class CfgWeapons { /* MX */ - class Rifle; - class Rifle_Base_F: Rifle { - class WeaponSlotsInfo; - }; - + class Rifle_Base_F; class arifle_MX_Base_F: Rifle_Base_F { - magazines[] += { - "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim", - "ACE_30Rnd_65x39_caseless_mag_SD", - "ACE_30Rnd_65x39_caseless_mag_AP", - "100Rnd_65x39_caseless_mag", - "100Rnd_65x39_caseless_mag_Tracer" - }; - class Single: Mode_SemiAuto { dispersion = 0.000800; // radians. Equal to 2.75 MOA. // Based on widely cited 2 MOA figure for new 5.56 ACR. @@ -29,20 +16,9 @@ class CfgWeapons { class FullAuto: Mode_FullAuto { dispersion = 0.00147; // radians. Equal to 5.1 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_H"}; - }; - }; }; class arifle_MX_SW_F: arifle_MX_Base_F { - magazines[] += { - "30Rnd_65x39_caseless_mag", - "30Rnd_65x39_caseless_mag_Tracer" - }; - class Single: Mode_SemiAuto { dispersion = 0.000800; // radians. Equal to 2.75 MOA. // Based on widely cited 2 MOA figure for new 5.56 ACR. @@ -51,22 +27,9 @@ class CfgWeapons { class manual: FullAuto { dispersion = 0.00147; // radians. Equal to 5.1 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: MuzzleSlot { - // Shit is broken again - //compatibleItems[] += {"ACE_muzzle_mzls_H"}; - compatibleItems[] = {"muzzle_snds_H","muzzle_snds_H_SW","ACE_muzzle_mzls_H"}; - }; - }; }; class arifle_MXM_F: arifle_MX_Base_F { - magazines[] += { - "30Rnd_65x39_caseless_mag", - "30Rnd_65x39_caseless_mag_Tracer" - }; - class Single: Single { dispersion = 0.00029; // radians. Equal to 1 MOA. // 6.5mm is easily capable of this in a half-tuned rifle. @@ -81,12 +44,6 @@ class CfgWeapons { /* Katiba */ class arifle_katiba_Base_F: Rifle_Base_F { - magazines[] += { - "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim", - "ACE_30Rnd_65x39_caseless_green_mag_SD", - "ACE_30Rnd_65x39_caseless_green_mag_AP" - }; - class Single: Mode_SemiAuto { dispersion = 0.000800; // radians. Equal to 2.75 MOA. // Based on widely cited 2 MOA figure for new 5.56 ACR? @@ -96,37 +53,12 @@ class CfgWeapons { class FullAuto: Mode_FullAuto { dispersion = 0.00147; // radians. Equal to 5.1 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_H"}; - }; - }; }; /* Other */ - class Rifle_Long_Base_F: Rifle_Base_F { - class WeaponSlotsInfo; - }; - - class EBR_base_F: Rifle_Long_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_B"}; - }; - }; - }; - - class DMR_01_base_F: Rifle_Long_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_B"}; - }; - }; - }; - + class Rifle_Long_Base_F: Rifle_Base_F {}; class LMG_Mk200_F: Rifle_Long_Base_F { class manual: Mode_FullAuto { dispersion = 0.00175; // radians. Equal to 6 MOA. @@ -135,12 +67,6 @@ class CfgWeapons { class Single: manual { dispersion = 0.00175; // radians. Equal to 6 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_H"}; - }; - }; }; class LMG_Zafir_F: Rifle_Long_Base_F { @@ -151,24 +77,12 @@ class CfgWeapons { class Single: Mode_SemiAuto { dispersion = 0.00175; // radians. Equal to 6 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_B"}; - }; - }; }; /* Assault Rifles */ class Tavor_base_F: Rifle_Base_F { - magazines[] += { - "ACE_30Rnd_556x45_Stanag_Tracer_Dim", - "ACE_30Rnd_556x45_Stanag_SD", - "ACE_30Rnd_556x45_Stanag_AP" - }; - class Single: Mode_SemiAuto { dispersion = 0.000727; // radians. Equal to 2.5 MOA, about the limit of mass-produced M855. // @@ -177,21 +91,9 @@ class CfgWeapons { class FullAuto: Mode_FullAuto { dispersion = 0.00147; // radians. Equal to 5.1 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_L"}; - }; - }; }; class mk20_base_F: Rifle_Base_F { - magazines[] += { - "ACE_30Rnd_556x45_Stanag_Tracer_Dim", - "ACE_30Rnd_556x45_Stanag_SD", - "ACE_30Rnd_556x45_Stanag_AP" - }; - class Single: Mode_SemiAuto { dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus // some extra for these worn out Greek Army service rifles. @@ -200,24 +102,12 @@ class CfgWeapons { class FullAuto: Mode_FullAuto { dispersion = 0.00147; // radians. Equal to 5.1 MOA. }; - - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_L"}; - }; - }; }; /* SMGs */ class SDAR_base_F: Rifle_Base_F { - magazines[] += { - "ACE_30Rnd_556x45_Stanag_Tracer_Dim", - "ACE_30Rnd_556x45_Stanag_SD", - "ACE_30Rnd_556x45_Stanag_AP" - }; - class Single: Mode_SemiAuto { dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus // some extra because Kel-Tec. @@ -227,561 +117,4 @@ class CfgWeapons { dispersion = 0.00147; // radians. Equal to 5.1 MOA. }; }; - - class pdw2000_base_F: Rifle_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; - }; - }; - }; - - class SMG_01_Base: Rifle_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; - }; - }; - }; - - class SMG_02_base_F: Rifle_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; - }; - }; - }; - - - /* Pistols */ - - class Pistol; - class Pistol_Base_F: Pistol { - class WeaponSlotsInfo; - }; - - class hgun_P07_F: Pistol_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; - compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; - }; - }; - }; - - class hgun_Rook40_F: Pistol_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; - compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; - }; - }; - }; - - class hgun_ACPC2_F: Pistol_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; - }; - }; - }; - - class hgun_Pistol_heavy_01_F: Pistol_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo { - compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; - }; - }; - }; - - /*class hgun_Pistol_heavy_02_F: Pistol_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot { - linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; - compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; - }; - }; - };*/ - - - /* Silencers */ - - class ItemCore; - class InventoryMuzzleItem_Base_F; - - class muzzle_snds_H: ItemCore { - class ItemInfo: InventoryMuzzleItem_Base_F { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - class muzzle_snds_L: muzzle_snds_H { - class ItemInfo: ItemInfo { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - class muzzle_snds_M: muzzle_snds_H { - class ItemInfo: ItemInfo { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - class muzzle_snds_B: muzzle_snds_H { - class ItemInfo: ItemInfo { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - class muzzle_snds_H_MG: muzzle_snds_H { - class ItemInfo: ItemInfo { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - class muzzle_snds_H_SW: muzzle_snds_H_MG { - class ItemInfo: ItemInfo { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - class muzzle_snds_acp: muzzle_snds_H { - class ItemInfo: ItemInfo { - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 0.9; - visibleFire = 0.5; - audibleFire = 0.1; - visibleFireTime = 0.5; - audibleFireTime = 0.5; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.8f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - }; - - - /* Flash suppressors */ - - class ACE_muzzle_mzls_H: ItemCore { - author = "$STR_ACE_Common_ACETeam"; - _generalMacro = "ACE_muzzle_mzls_H"; - htMin = 1; - htMax = 600; - afMax = 0; - mfMax = 0; - mFact = 1; - tBody = 100; - scope = 2; - displayName = "$STR_ACE_muzzle_mzls_H"; - picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; - model = "\A3\weapons_f\acc\acca_mzls_H_F"; - - class ItemInfo: InventoryMuzzleItem_Base_F { - mass = 8; - soundTypeIndex = 0; - muzzleEnd = "zaslehPoint"; - alternativeFire = "Zasleh2"; - - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 1.0; - visibleFire = 0.5; - audibleFire = 1.0; - visibleFireTime = 0.5; - audibleFireTime = 1.0; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.9f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - - inertia = 0.2; - }; - - class ACE_muzzle_mzls_B: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; - _generalMacro = "ACE_muzzle_mzls_B"; - displayName = "$STR_ACE_muzzle_mzls_B"; - picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; - model = "\A3\weapons_f\acc\acca_mzls_H_F"; - - class ItemInfo: ItemInfo { - mass = 6; - soundTypeIndex = 0; - muzzleEnd = "zaslehPoint"; - alternativeFire = "Zasleh2"; - - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 1.0; - visibleFire = 0.5; - audibleFire = 1.0; - visibleFireTime = 0.5; - audibleFireTime = 1.0; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.9f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - - inertia = 0.2; - }; - - class ACE_muzzle_mzls_L: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; - _generalMacro = "ACE_muzzle_mzls_L"; - displayName = "$STR_ACE_muzzle_mzls_L"; - picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; - model = "\A3\weapons_f\acc\acca_mzls_l_F"; - - class ItemInfo: ItemInfo { - mass = 6; - soundTypeIndex = 0; - muzzleEnd = "zaslehPoint"; - alternativeFire = "Zasleh2"; - - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 1.0; - visibleFire = 0.5; - audibleFire = 1.0; - visibleFireTime = 0.5; - audibleFireTime = 1.0; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.9f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - - inertia = 0.1; - }; - - class ACE_muzzle_mzls_smg_01: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; - _generalMacro = "ACE_muzzle_mzls_smg_01"; - displayName = "$STR_ACE_muzzle_mzls_smg_01"; - picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; - model = "\A3\weapons_f\acc\acca_mzls_H_F"; //"\A3\weapons_f\acc\acca_mzls_smg_01_F"; - - class ItemInfo: ItemInfo { - mass = 6; - soundTypeIndex = 0; - muzzleEnd = "zaslehPoint"; - alternativeFire = "Zasleh2"; - - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 1.0; - visibleFire = 0.5; - audibleFire = 1.0; - visibleFireTime = 0.5; - audibleFireTime = 1.0; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.9f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - - inertia = 0.1; - }; - - class ACE_muzzle_mzls_smg_02: ACE_muzzle_mzls_H { - author = "$STR_ACE_Common_ACETeam"; - _generalMacro = "ACE_muzzle_mzls_smg_02"; - displayName = "$STR_ACE_muzzle_mzls_smg_02"; - picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; - model = "\A3\weapons_f\acc\acca_mzls_H_F"; //"\A3\weapons_f\acc\acca_mzls_smg_01_F"; - - class ItemInfo: ItemInfo { - mass = 6; - soundTypeIndex = 0; - muzzleEnd = "zaslehPoint"; - alternativeFire = "Zasleh2"; - - class MagazineCoef { - initSpeed = 1.0; - }; - - class AmmoCoef { - hit = 1.0; - visibleFire = 0.5; - audibleFire = 1.0; - visibleFireTime = 0.5; - audibleFireTime = 1.0; - cost = 1.0; - typicalSpeed = 1.0; - airFriction = 1.0; - }; - - class MuzzleCoef { - dispersionCoef = "0.9f"; - artilleryDispersionCoef = "1.0f"; - fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; - minRangeCoef = "1.0f"; - minRangeProbabCoef = "1.0f"; - midRangeCoef = "1.0f"; - midRangeProbabCoef = "1.0f"; - maxRangeCoef = "1.0f"; - maxRangeProbabCoef = "1.0f"; - }; - }; - - inertia = 0.1; - }; - - - /* Vests */ - - #include }; diff --git a/addons/ballistics/README.md b/addons/ballistics/README.md new file mode 100644 index 0000000000..2bf158cebc --- /dev/null +++ b/addons/ballistics/README.md @@ -0,0 +1,12 @@ +ace_ballistics +============== + +Changes to weapon and ammunition values. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/ballistics/config.cpp b/addons/ballistics/config.cpp index 9e8614c3fb..e94c9f4efb 100644 --- a/addons/ballistics/config.cpp +++ b/addons/ballistics/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {"ACE_TargetWall"}; - weapons[] = {"ACE_muzzle_mzls_H","ACE_muzzle_mzls_B","ACE_muzzle_mzls_L","ACE_muzzle_mzls_smg_01","ACE_muzzle_mzls_smg_02"}; + weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"TaoSensai","commy2"}; diff --git a/addons/common/CfgEventHandlers.hpp b/addons/common/CfgEventHandlers.hpp index a96cf7af88..7ea3b1e1f9 100644 --- a/addons/common/CfgEventHandlers.hpp +++ b/addons/common/CfgEventHandlers.hpp @@ -43,3 +43,19 @@ class Extended_Respawn_EventHandlers { }; }; }; + +class Extended_Killed_EventHandlers { + class CAManBase { + class GVAR(dropObject) { + Killed = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};); + }; + }; +}; + +class Extended_GetIn_EventHandlers { + class CAManBase { + class GVAR(dropObject) { + GetIn = QUOTE(if (local (_this select 0)) then {[ARR_2(_this select 0, ObjNull)] call FUNC(carryObj)};); + }; + }; +}; diff --git a/addons/common/MenuConfig.hpp b/addons/common/MenuConfig.hpp deleted file mode 100644 index 370a62c30a..0000000000 --- a/addons/common/MenuConfig.hpp +++ /dev/null @@ -1,927 +0,0 @@ - -#define HSPACE 0.3 -#define VSPACE 0.3 -#define BORDER 0.1 - -class GVAR(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 GVAR(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 GVAR(OptionsMenu_Dialog) { - idd = -1; - movingEnable = true; - onLoad = QUOTE(_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 [ARR_2(QUOTE(QGVAR(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: GVAR(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: GVAR(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: GVAR(Interactive_Button_Base) { - action = QUOTE(GVAR(keySet) = -1; [0] spawn GVAR(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 = QUOTE(GVAR(keySet) = -1; [1] spawn GVAR(editKey)); - idc = 201; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button2: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [2] spawn GVAR(editKey)); - idc = 202; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button3: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [3] spawn GVAR(editKey)); - idc = 203; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button4: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [4] spawn GVAR(editKey)); - idc = 204; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button5: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [5] spawn GVAR(editKey)); - idc = 205; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button6: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [6] spawn GVAR(editKey)); - idc = 206; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button7: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [7] spawn GVAR(editKey)); - idc = 207; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button8: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [8] spawn GVAR(editKey)); - idc = 208; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button9: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [9] spawn GVAR(editKey)); - idc = 209; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button10: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [10] spawn GVAR(editKey)); - idc = 210; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button11: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [11] spawn GVAR(editKey)); - idc = 211; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button12: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [12] spawn GVAR(editKey)); - idc = 212; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button13: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [13] spawn GVAR(editKey)); - idc = 213; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button14: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [14] spawn GVAR(editKey)); - idc = 214; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button15: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [15] spawn GVAR(editKey)); - idc = 215; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button16: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [16] spawn GVAR(editKey)); - idc = 216; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button17: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [17] spawn GVAR(editKey)); - idc = 217; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button18: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [18] spawn GVAR(editKey)); - idc = 218; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_Button19: Interactive_Button0 { - action = QUOTE(GVAR(keySet) = -1; [19] spawn GVAR(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: GVAR(Interactive_Button_Base) { - action = QUOTE([0] call GVAR(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 = QUOTE([1] call GVAR(toggleState)); - idc = 501; - y = (VSPACE2 + 3 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton2: Interactive_CheckboxButton0 { - action = QUOTE([2] call GVAR(toggleState)); - idc = 502; - y = (VSPACE2 + 4 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton3: Interactive_CheckboxButton0 { - action = QUOTE([3] call GVAR(toggleState)); - idc = 503; - y = (VSPACE2 + 5 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton4: Interactive_CheckboxButton0 { - action = QUOTE([4] call GVAR(toggleState)); - idc = 504; - y = (VSPACE2 + 6 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton5: Interactive_CheckboxButton0 { - action = QUOTE([5] call GVAR(toggleState)); - idc = 505; - y = (VSPACE2 + 7 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton6: Interactive_CheckboxButton0 { - action = QUOTE([6] call GVAR(toggleState)); - idc = 506; - y = (VSPACE2 + 8 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton7: Interactive_CheckboxButton0 { - action = QUOTE([7] call GVAR(toggleState)); - idc = 507; - y = (VSPACE2 + 9 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton8: Interactive_CheckboxButton0 { - action = QUOTE([8] call GVAR(toggleState)); - idc = 508; - y = (VSPACE2 + 10 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton9: Interactive_CheckboxButton0 { - action = QUOTE([9] call GVAR(toggleState)); - idc = 509; - y = (VSPACE2 + 11 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton10: Interactive_CheckboxButton0 { - action = QUOTE([10] call GVAR(toggleState)); - idc = 510; - y = (VSPACE2 + 12 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton11: Interactive_CheckboxButton0 { - action = QUOTE([11] call GVAR(toggleState)); - idc = 511; - y = (VSPACE2 + 13 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton12: Interactive_CheckboxButton0 { - action = QUOTE([12] call GVAR(toggleState)); - idc = 512; - y = (VSPACE2 + 14 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton13: Interactive_CheckboxButton0 { - action = QUOTE([13] call GVAR(toggleState)); - idc = 513; - y = (VSPACE2 + 15 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton14: Interactive_CheckboxButton0 { - action = QUOTE([14] call GVAR(toggleState)); - idc = 514; - y = (VSPACE2 + 16 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton15: Interactive_CheckboxButton0 { - action = QUOTE([15] call GVAR(toggleState)); - idc = 515; - y = (VSPACE2 + 17 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton16: Interactive_CheckboxButton0 { - action = QUOTE([16] call GVAR(toggleState)); - idc = 516; - y = (VSPACE2 + 18 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton17: Interactive_CheckboxButton0 { - action = QUOTE([17] call GVAR(toggleState)); - idc = 517; - y = (VSPACE2 + 19 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton18: Interactive_CheckboxButton0 { - action = QUOTE([18] call GVAR(toggleState)); - idc = 518; - y = (VSPACE2 + 20 * 0.04) * safezoneH + safezoneY; - }; - - class Interactive_CheckboxButton19: Interactive_CheckboxButton0 { - action = QUOTE([19] call GVAR(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(42,[ARR_3(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(29,[ARR_3(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(56,[ARR_3(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(54,[ARR_3(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(157,[ARR_3(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(184,[ARR_3(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 = QUOTE(call GVAR(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 = QUOTE(GVAR(keyNewTemp) = [ARR_3(0,[ARR_3(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 = QUOTE(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 = QUOTE(GVAR(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 = QUOTE(GVAR(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 = QUOTE(GVAR(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: GVAR(Interactive_Button_Base) { - action = QUOTE(false call GVAR(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 = QUOTE(true call GVAR(nextKeys)); - text = "$STR_ACE_Common_Next"; - idc = 13; - x = (HSPACE2 + 3 * 0.1 + 2.0 / 16) * safezoneW + safezoneX; - }; - - class Interactive_ButtonC: GVAR(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/README.md b/addons/common/README.md new file mode 100644 index 0000000000..04f0eb04c4 --- /dev/null +++ b/addons/common/README.md @@ -0,0 +1,14 @@ +ace_common +========== + +Common functions and systems used by other components. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [NouberNou](https://github.com/NouberNou) +- [commy2](https://github.com/commy2) +- [walterpearce](https://github.com/walterpearce) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/common/UI/box_checked_ca.paa b/addons/common/UI/box_checked_ca.paa deleted file mode 100644 index 2b0d92b600..0000000000 Binary files a/addons/common/UI/box_checked_ca.paa and /dev/null differ diff --git a/addons/common/UI/box_unchecked_ca.paa b/addons/common/UI/box_unchecked_ca.paa deleted file mode 100644 index 9bbefd0419..0000000000 Binary files a/addons/common/UI/box_unchecked_ca.paa and /dev/null differ diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 91c586c43d..542c4277cf 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -1,6 +1,16 @@ // ACE - Common #include "script_component.hpp" +// hack to get PFH to work in briefing +[QGVAR(onBriefingPFH), "onEachFrame", { + if (time > 0) exitWith { + [QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler; + }; + + call cba_common_fnc_onFrame; +}] call BIS_fnc_addStackedEventHandler; +///// + QGVAR(remoteFnc) addPublicVariableEventHandler { (_this select 1) call FUNC(execRemoteFnc); }; @@ -27,38 +37,17 @@ 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); +call COMPILE_FILE(scripts\initCanInteractFunction); +call COMPILE_FILE(scripts\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 @@ -142,21 +131,6 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); }, 0, []] call cba_fnc_addPerFrameHandler; - -[QGVAR(reviveCounter_f), 0, false, QGVAR(ADDON)] call FUNC(defineVariable); -[QGVAR(inReviveState), false, true, QGVAR(ADDON)] call FUNC(defineVariable); -[QGVAR(isDead),false,true,QUOTE(ADDON)] call FUNC(defineVariable); -[QGVAR(isDeadPlayer), false, true, QUOTE(ADDON)] call FUNC(defineVariable); [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); -["ACE_isUnconscious",false,true,QUOTE(ADDON)] call FUNC(defineVariable); -[QGVAR(ENABLE_REVIVE_SETDEAD_F),0,false,QUOTE(ADDON)] call FUNC(defineVariable); [QGVAR(carriedBy),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable); - -if (isNil QGVAR(ENABLE_REVIVE_F)) then { - GVAR(ENABLE_REVIVE_F) = 0; -}; - - -[ - {((_this select 0) getvariable [QGVAR(inReviveState), false])} -] call EFUNC(common,registerUnconsciousCondition); \ No newline at end of file +[QGVAR(carriedObj),objNull,false,QUOTE(ADDON)] call FUNC(defineVariable); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index f33b3c47fe..aff02ad600 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -78,7 +78,6 @@ PREP(isAutoWind); PREP(isEngineer); PREP(isEOD); PREP(isInBuilding); -PREP(isMedic); PREP(isPlayer); PREP(isTurnedOut); PREP(letterToCode); @@ -108,7 +107,6 @@ PREP(sanitizeString); PREP(serverLog); PREP(setCaptivityStatus); PREP(setForceWalkStatus); -PREP(setKeyDefault); PREP(setName); PREP(setParameter); PREP(setPitchBankYaw); @@ -213,11 +211,10 @@ PREP(getCanInteract); PREP(canInteract); PREP(resetAllDefaults_f); PREP(broadcastSound3D_f); -PREP(setDead); + PREP(isAwake); PREP(setProne); -PREP(raiseScriptedEvent_f); PREP(setDisableUserInputStatus); PREP(dropWeapon_f); @@ -225,7 +222,6 @@ PREP(inWater_f); PREP(setVolume_f); PREP(closeAllDialogs_f); PREP(disableAI_f); -PREP(moduleBasicRevive); PREP(switchToGroupSide_f); PREP(getFirstObjectIntersection); PREP(getFirstTerrainIntersection); @@ -241,22 +237,18 @@ PREP(getCarriedObj); PREP(getCarriedBy); PREP(beingCarried); PREP(setCarriedBy); -PREP(setUnconsciousState); -PREP(isUnconscious); -PREP(getUnconsciousCondition); -PREP(registerUnconsciousCondition); -PREP(setCaptiveSwitch); + + PREP(moveToTempGroup); -PREP(canGoUnconsciousState); -PREP(setWeaponsCorrectUnconscious); + PREP(limitMovementSpeed); PREP(setArrestState); PREP(isArrested); PREP(loadPerson_F); PREP(loadPersonLocal_F); -PREP(makeCopyOfBody_F); PREP(unloadPerson_F); -PREP(cleanUpCopyOfBody_F); + + ADDON = true; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 158c4cbead..2be05e6b57 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {"ACE_Box_Misc"}; weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon"}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main", "ace_gui"}; + requiredAddons[] = {"ace_main"}; author[] = {"KoffeinFlummi"}; authorUrl = "https://github.com/KoffeinFlummi/"; VERSION_CONFIG; @@ -58,24 +58,14 @@ class ACE_canInteractConditions { }; class ACE_Options { - class enableNumberHotkeys { + class GVAR(enableNumberHotkeys) { displayName = "$STR_ACE_Common_EnableNumberHotkeys"; default = 1; }; }; -#include -#include #include #include - -/* -class RscControlsGroupNoScrollbars; -class RscAttributeInventory: RscControlsGroupNoScrollbars { - onSetFocus = QUOTE([ARR_3(_this,""RscAttributeInventory"",'CuratorCommon')] call (uinamespace getvariable ""BIS_fnc_initCuratorAttribute""); _this select 0 call DFUNC(addCuratorUnloadEventhandler);); -}; -*/ - #include #include #include diff --git a/addons/common/functions/fnc__handleNetEvent.sqf b/addons/common/functions/fnc__handleNetEvent.sqf index 40d5d84e5e..8babbbe098 100644 --- a/addons/common/functions/fnc__handleNetEvent.sqf +++ b/addons/common/functions/fnc__handleNetEvent.sqf @@ -34,6 +34,13 @@ if(_eventType == "ACEc") then { if(!IS_ARRAY(_eventTargets)) then { _eventTargets = [_eventTargets]; }; + + //If not multiplayer, and there are targets, then just run localy + if ((!isMultiplayer) && {(count _eventTargets) > 0}) exitWith { + ACEg = [_eventName, _eventArgs]; + ["ACEg", ACEg] call FUNC(_handleNetEvent); + }; + _serverFlagged = false; { _owner = _x; diff --git a/addons/common/functions/fnc_carryObj.sqf b/addons/common/functions/fnc_carryObj.sqf index a5cea92a9b..6d911029a2 100644 --- a/addons/common/functions/fnc_carryObj.sqf +++ b/addons/common/functions/fnc_carryObj.sqf @@ -36,12 +36,9 @@ if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) _to attachTo [_unit,(_this select 2)]; [format["fnc_carryObj - UNIT: %1 TO %2 - attachTo offset: %3",_unit,_to,(_this select 2)],2] call FUNC(debug); }; - } else { - [format["fnc_carryObj - UNIT: %1 TO %2 - Script expects external handling of attachTo Command. Exiting",_unit,_to],2] call FUNC(debug); }; - - [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); - + ["carryObject", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent); + // ["carryObject", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent; }; } else { if (!isNull ([_unit] call FUNC(getCarriedObj))) then { @@ -59,13 +56,14 @@ if (((typeName _to) == "OBJECT" && (isNull ([_unit] call FUNC(getCarriedObj)))) _positionUnit set [2, ((getPosASL _unit) select 2) + 0.1]; _carriedObj setPosASL _positionUnit; }; - [[_unit, _carriedObj],"carryObjectDropped"] call FUNC(raiseScriptedEvent_f); [[_unit] call FUNC(getCarriedObj), objNull] call FUNC(setCarriedBy); _unit setvariable [QGVAR(carriedObj),_to,true]; _return = true; - [[_unit, _to, _fallDown],"carryObject"] call FUNC(raiseScriptedEvent_f); + ["carryObjectDropped", [_unit], [_unit, _to, _fallDown]] call EFUNC(common,targetEvent); + // ["carryObjectDropped", [_unit, _to, _fallDown]] call ace_common_fnc_localEvent; + }; }; } else { diff --git a/addons/common/functions/fnc_debug.sqf b/addons/common/functions/fnc_debug.sqf index 65edb41094..c87772eb8a 100644 --- a/addons/common/functions/fnc_debug.sqf +++ b/addons/common/functions/fnc_debug.sqf @@ -16,21 +16,26 @@ private ["_msg", "_level", "_prefix", "_defaultLoglevel","_defaultLogDisplayLeve _msg = _this select 0; _level = if (count _this > 1) then {_this select 1} else { 2 }; +if (typeName _level != "NUMBER") then { + _level = 2; +}; + _defaultLoglevel = if (isNil QGVAR(LOGLEVEL)) then { DEFAULT_LOGGING_LEVEL; } else { GVAR(LOGLEVEL); }; +if (_defaultLoglevel < 0) exitwith { + false +}; + _defaultLogDisplayLevel = if (isnil QGVAR(LOGDISPLAY_LEVEL)) then { DEFAULT_TEXT_DISPLAY; } else { GVAR(LOGDISPLAY_LEVEL); }; -if (_defaultLoglevel < 0) exitwith { - false -}; if (_level <= _defaultLoglevel) then { _prefix = switch (_level) do { @@ -42,7 +47,7 @@ if (_level <= _defaultLoglevel) then { }; _message = format["[%1] %2",_prefix,_msg]; - if (_level >= _defaultLogDisplayLevel) then { + if (_level <= _defaultLogDisplayLevel) then { systemChat _message; }; diag_log _message; diff --git a/addons/common/functions/fnc_defineVariable.sqf b/addons/common/functions/fnc_defineVariable.sqf index 3085fc56fa..8796edc920 100644 --- a/addons/common/functions/fnc_defineVariable.sqf +++ b/addons/common/functions/fnc_defineVariable.sqf @@ -37,4 +37,3 @@ GVAR(OBJECT_VARIABLES_STORAGE) pushback [_name,_value,_defaultGlobal,_catagory,_ missionNamespace setvariable [QGVAR(OBJECT_VARIABLES_STORAGE_) + _name, [_name,_value,_defaultGlobal,_catagory,_code, _persistent]]; -[[_name,_value,_defaultGlobal,_catagory,_code, _persistent],"variableDefined"] call FUNC(raiseScriptedEvent_f); diff --git a/addons/common/functions/fnc_doAnimation.sqf b/addons/common/functions/fnc_doAnimation.sqf index 969a57fd6d..7bf2b93969 100644 --- a/addons/common/functions/fnc_doAnimation.sqf +++ b/addons/common/functions/fnc_doAnimation.sqf @@ -43,7 +43,7 @@ if (_unit getVariable ["ACE_isUnconscious", false] && {!_force}) exitWith { }; // don't go unconscious if the unit isn't unconscious -if (_animation == "Unconscious" && {!(_unit getVariable ["ACE_isUnconscious", false])}) exitWith {}; +if (_animation == "Unconscious" && {!((_unit getVariable ["ACE_isUnconscious", false]) || (_unit getVariable ["ACE_isDead", false]))}) exitWith {}; // switchMove "" no longer works in dev 1.37 if (_animation == "") then { diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf index 58c6ced4f3..e0dd49e86c 100644 --- a/addons/common/functions/fnc_execNextFrame.sqf +++ b/addons/common/functions/fnc_execNextFrame.sqf @@ -29,6 +29,6 @@ EXPLODE_2_PVT(_this,_func,_params); // Execute the function _funcParams call _func; }, - _interval, + 0, [_this, diag_frameno] ] call CBA_fnc_addPerFrameHandler diff --git a/addons/common/functions/fnc_isAwake.sqf b/addons/common/functions/fnc_isAwake.sqf index 462968efa4..10136c0369 100644 --- a/addons/common/functions/fnc_isAwake.sqf +++ b/addons/common/functions/fnc_isAwake.sqf @@ -12,4 +12,4 @@ private ["_unit","_return"]; _unit = _this select 0; -(!([_unit] call FUNC(isUnconscious))) && alive _unit && !(_unit getvariable [QGVAR(isDead),false]); +(!(_unit getvariable ["ACE_isUnconscious",false]) && alive _unit && !(_unit getvariable ["ACE_isDead",false])); diff --git a/addons/common/functions/fnc_isMedic.sqf b/addons/common/functions/fnc_isMedic.sqf deleted file mode 100644 index d4efdca5b6..0000000000 --- a/addons/common/functions/fnc_isMedic.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Checks if a unit is a medic. - * - * Arguments: - * 0: unit to be checked (object) - * - * Return Value: - * Bool: is unit medic? - */ -#include "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_raiseScriptedEvent_f.sqf b/addons/common/functions/fnc_raiseScriptedEvent_f.sqf deleted file mode 100644 index a4ea604f28..0000000000 --- a/addons/common/functions/fnc_raiseScriptedEvent_f.sqf +++ /dev/null @@ -1,64 +0,0 @@ -/** - * fn_raiseScriptedEvent_f.sqf - * @Descr: Execute a custom defined eventhandler. - * @Author: Glowbal - * - * @Arguments: [arguments ANY, handle STRING (The name of the eventhandler)] - * @Return: ARRAY Array containing the results of the called eventhandlers. - * @PublicAPI: true - */ - -#include "script_component.hpp" - -private ["_arguments","_handle","_ehCfg","_eventHandlerCollection","_eventHandlerName","_cfg","_code","_classType", "_return"]; -_arguments = _this select 0; -_handle = _this select 1; - -// TODO figure out how we want to handle custom eventhandlers - -_eventHandlerName = (QGVAR(f_custom_eventhandlers_) + _handle); -_eventHandlerCollection = missionNamespace getvariable _eventHandlerName; -if (isnil "_eventHandlerCollection") then { - _eventHandlerCollection = []; - [format["caching Custom Eventhandler: %1",_handle]] call FUNC(debug); - _cfg = (ConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - - for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { - //for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { - _ehCfg = _cfg select _EHiterator; - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _code = (compile getText(_ehCfg >> "onCall")); - _eventHandlerCollection pushback [_classType, _code]; - true; - }; - }; - }; - - _cfg = (MissionConfigFile >> "ACE_Eventhandlers" >> "CustomEventHandlers" >> _handle); - if (isClass _cfg) then { - _numberOfEH = count _cfg; - for "_EHiterator" from 0 to (_numberOfEH -1) /* step +1 */ do { - //for [{_EHiterator=0}, {(_EHiterator< _numberOfEH)}, {_EHiterator=_EHiterator+1}] do { - _ehCfg = _cfg select _EHiterator; - if (isClass _ehCfg) then { - _classType = (ConfigName _ehCfg); - _code = (compile getText(_ehCfg >> "onCall")); - _eventHandlerCollection pushback [_classType, _code]; - true; - }; - }; - }; - - missionNamespace setvariable [_eventHandlerName, _eventHandlerCollection]; - [format["Custom Eventhandler: %1 cache: %2",_handle, _eventHandlerCollection]] call FUNC(debug); -}; - -_return = []; -{ - _return pushback (_arguments call (_x select 1)); -}foreach _eventHandlerCollection; - -_return \ No newline at end of file diff --git a/addons/common/functions/fnc_resetAllDefaults_f.sqf b/addons/common/functions/fnc_resetAllDefaults_f.sqf index 571526dbf6..c415b5b32c 100644 --- a/addons/common/functions/fnc_resetAllDefaults_f.sqf +++ b/addons/common/functions/fnc_resetAllDefaults_f.sqf @@ -13,13 +13,15 @@ private ["_unit","_oldUnit","_sets"]; _unit = _this select 0; -_unit setvariable [QGVAR(isDead),nil,true]; +_unit setvariable ["ACE_isDead",nil,true]; _unit setvariable ["ACE_isUnconscious", nil, true]; if (isPlayer _unit) then { [true] call FUNC(setVolume_f); [false] call FUNC(disableKeyInput_f); - [false] call EFUNC(GUI,effectBlackOut); + if (["ace_medical"] call FUNC(isModLoader_f)) then { + [false] call EFUNC(medical,effectBlackOut); + }; if !(isnil QGVAR(DISABLE_USER_INPUT_COLLECTION_F)) then { // clear all disable user input @@ -35,4 +37,3 @@ if (isPlayer _unit) then { }; }foreach ([_unit] call FUNC(getAllDefinedSetVariables)); -[[_unit],"resetToDefaults"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_setArrestState.sqf b/addons/common/functions/fnc_setArrestState.sqf index d32ccc5098..7b4f3cd995 100644 --- a/addons/common/functions/fnc_setArrestState.sqf +++ b/addons/common/functions/fnc_setArrestState.sqf @@ -42,4 +42,3 @@ if (_setArrest) then { }; }; -[[_unit, _setArrest],"setArrestState"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_setKeyDefault.sqf b/addons/common/functions/fnc_setKeyDefault.sqf deleted file mode 100644 index 59c487de43..0000000000 --- a/addons/common/functions/fnc_setKeyDefault.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: commy2 - * - * Set all keys from the 'ACE_Default_Keys' base class that are missing in the current user profile. - * - * Argument: - * 1: Overwrite existing key binds? (Bool) - * - * Return value: - * None. - */ -#include "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 >> "ACE_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 >> "ACE_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_setVolume_f.sqf b/addons/common/functions/fnc_setVolume_f.sqf index 2eacb98ab0..91d66a00ec 100644 --- a/addons/common/functions/fnc_setVolume_f.sqf +++ b/addons/common/functions/fnc_setVolume_f.sqf @@ -44,5 +44,3 @@ if (_setVolume) then { player setVariable ["acre_sys_core_isDisabled", true, true]; }; - -[[_setVolume],"setVolume"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/functions/fnc_switchToGroupSide_f.sqf b/addons/common/functions/fnc_switchToGroupSide_f.sqf index b13da8e3ea..97b043adbe 100644 --- a/addons/common/functions/fnc_switchToGroupSide_f.sqf +++ b/addons/common/functions/fnc_switchToGroupSide_f.sqf @@ -62,5 +62,3 @@ if (_switch) then { reverse _previousGroupsList; // we have to reverse again, to ensure the list is in the right order. _unit setvariable [QGVAR(previousGroupSwitchTo_F), _previousGroupsList, true]; }; - -[[_unit, _switch, _id, _side],"switchToGroupSide"] call FUNC(raiseScriptedEvent_f); \ No newline at end of file diff --git a/addons/common/scripts/KeyInput/initKeys.sqf b/addons/common/scripts/KeyInput/initKeys.sqf deleted file mode 100644 index 5097cfd89e..0000000000 --- a/addons/common/scripts/KeyInput/initKeys.sqf +++ /dev/null @@ -1,72 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -_config = configFile >> "ACE_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 [QUOTE(%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/script_component.hpp b/addons/common/scripts/KeyInput/script_component.hpp deleted file mode 100644 index 23da62b05c..0000000000 --- a/addons/common/scripts/KeyInput/script_component.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "\z\ace\addons\common\script_component.hpp" \ No newline at end of file diff --git a/addons/common/scripts/closeMenu.sqf b/addons/common/scripts/closeMenu.sqf deleted file mode 100644 index 86206f2c93..0000000000 --- a/addons/common/scripts/closeMenu.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// by commy2 -#include "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 deleted file mode 100644 index a2335f3860..0000000000 --- a/addons/common/scripts/editKey.sqf +++ /dev/null @@ -1,115 +0,0 @@ -// by commy2 -#include "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 >> 'ACE_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 %2; - - %3 = [_key, [_shft, _ctrl, _alt], _keyCode];", - _action, - QFUNC(convertKeyCode), - QGVAR(keyNewTemp) -]; - -_description = ctrlText _ctrlMenuDialog; -//_ctrlMenuDialog ctrlSetText ".."; - -_ehid_keydown = _dlgMenuDialog displayAddEventHandler ["KeyDown", QUOTE( _this call GVAR(keyInput) )]; -_ehid_keyup = _dlgMenuDialog displayAddEventHandler ["KeyUp", QUOTE( _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/initCanInteractFunction.sqf b/addons/common/scripts/initCanInteractFunction.sqf similarity index 90% rename from addons/common/scripts/KeyInput/initCanInteractFunction.sqf rename to addons/common/scripts/initCanInteractFunction.sqf index d718be04fe..a0a6eb787f 100644 --- a/addons/common/scripts/KeyInput/initCanInteractFunction.sqf +++ b/addons/common/scripts/initCanInteractFunction.sqf @@ -5,7 +5,7 @@ private ["_function", "_configFile", "_count", "_index", "_config", "_configName _function = "private '_exceptions'; _exceptions = _this; alive ACE_player"; -_configFile = configFile >> QGVAR(canInteractConditions); +_configFile = configFile >> "ACE_canInteractConditions"; _count = count _configFile; for "_index" from 0 to (_count -1) do { diff --git a/addons/common/scripts/KeyInput/initScrollWheel.sqf b/addons/common/scripts/initScrollWheel.sqf similarity index 100% rename from addons/common/scripts/KeyInput/initScrollWheel.sqf rename to addons/common/scripts/initScrollWheel.sqf diff --git a/addons/common/scripts/keyInput.sqf b/addons/common/scripts/keyInput.sqf deleted file mode 100644 index 5e06d23bd5..0000000000 --- a/addons/common/scripts/keyInput.sqf +++ /dev/null @@ -1,26 +0,0 @@ -// by commy2 -#include "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 deleted file mode 100644 index d0d1b736a0..0000000000 --- a/addons/common/scripts/keyRelease.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by commy2 -#include "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 deleted file mode 100644 index 51c41b94b9..0000000000 --- a/addons/common/scripts/nextKeys.sqf +++ /dev/null @@ -1,123 +0,0 @@ -// by commy2 -#include "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 >> "ACE_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 >> "ACE_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 deleted file mode 100644 index b93119be5f..0000000000 --- a/addons/common/scripts/openMenu.sqf +++ /dev/null @@ -1,100 +0,0 @@ -// by commy2 -#include "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 >> "ACE_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/toggleState.sqf b/addons/common/scripts/toggleState.sqf deleted file mode 100644 index 58e59e851a..0000000000 --- a/addons/common/scripts/toggleState.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 -#include "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/common/stringtable.xml b/addons/common/stringtable.xml index dfb200dff8..f2d944eb7a 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -50,150 +50,6 @@ 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 @@ -399,30 +255,6 @@ 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 diff --git a/addons/difficulties/README.md b/addons/difficulties/README.md new file mode 100644 index 0000000000..4aefb4570a --- /dev/null +++ b/addons/difficulties/README.md @@ -0,0 +1,12 @@ +ace_difficulties +================ + +Changes the elite difficulty setting to more closely resemble Arma 2. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/disposable/README.md b/addons/disposable/README.md new file mode 100644 index 0000000000..7dd85fff32 --- /dev/null +++ b/addons/disposable/README.md @@ -0,0 +1,12 @@ +ace_disposable +============== + +Makes the NLAW a disposable one-way weapon. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/explosives/README.md b/addons/explosives/README.md new file mode 100644 index 0000000000..5e85f19427 --- /dev/null +++ b/addons/explosives/README.md @@ -0,0 +1,12 @@ +ace_explosives +============== + +Completely replaces the vanilla explosives system, allowing precise placement and different trigger types. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [CorruptedHeart](https://github.com/CorruptedHeart) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/fcs/README.md b/addons/fcs/README.md new file mode 100644 index 0000000000..dfe9b8d8e9 --- /dev/null +++ b/addons/fcs/README.md @@ -0,0 +1,12 @@ +ace_fcs +======= + +Adds a fire control system to armoured vehicles and helicoters, allowing the precise engagement of stationary and moving targets. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index 61b30f65ae..66720ae44a 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -16,7 +16,8 @@ GVAR(position) = [0,0,0]; // Statement [vehicle ACE_player] call FUNC(keyDown); - true + // Return false so it doesn't block the rest weapon action + false }, [15, [false, false, false]], false, @@ -34,7 +35,7 @@ GVAR(position) = [0,0,0]; // Statement [vehicle ACE_player] call FUNC(keyUp); - true + false }, [15, [false, false, false]], false, diff --git a/addons/fcs/XEH_preInit.sqf b/addons/fcs/XEH_preInit.sqf index ce6f5c99dd..18729ca54f 100644 --- a/addons/fcs/XEH_preInit.sqf +++ b/addons/fcs/XEH_preInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +ADDON = false; + PREP(adjustRange); PREP(canResetFCS); PREP(canUseFCS); @@ -11,3 +13,5 @@ PREP(keyDown); PREP(keyUp); PREP(reset); PREP(vehicleInit); + +ADDON = true; diff --git a/addons/fcs/functions/fnc_canResetFCS.sqf b/addons/fcs/functions/fnc_canResetFCS.sqf index 0aa281bd85..8760503cdb 100644 --- a/addons/fcs/functions/fnc_canResetFCS.sqf +++ b/addons/fcs/functions/fnc_canResetFCS.sqf @@ -12,5 +12,5 @@ #include "script_component.hpp" -_player == gunner _vehicle -&& (count (_vehicle getVariable [QGVAR(Magazines), []]) > 1) +ACE_player == gunner vehicle ACE_player +&& (count ((vehicle ACE_player) getVariable [QGVAR(Magazines), []]) > 1) diff --git a/addons/fcs/functions/fnc_canUseFCS.sqf b/addons/fcs/functions/fnc_canUseFCS.sqf index e75efd44cf..ef4a3f2814 100644 --- a/addons/fcs/functions/fnc_canUseFCS.sqf +++ b/addons/fcs/functions/fnc_canUseFCS.sqf @@ -12,6 +12,6 @@ #include "script_component.hpp" -_player == gunner _vehicle -&& {getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(Enabled)) == 1} +ACE_player == gunner vehicle ACE_player +&& {getNumber (configFile >> "CfgVehicles" >> typeOf (vehicle ACE_player) >> QGVAR(Enabled)) == 1} && {cameraView == "GUNNER"} diff --git a/addons/flashsuppressors/$PBOPREFIX$ b/addons/flashsuppressors/$PBOPREFIX$ new file mode 100644 index 0000000000..fce4d8c366 --- /dev/null +++ b/addons/flashsuppressors/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\flashsuppressors \ No newline at end of file diff --git a/addons/flashsuppressors/CfgVehicles.hpp b/addons/flashsuppressors/CfgVehicles.hpp new file mode 100644 index 0000000000..40dc505d64 --- /dev/null +++ b/addons/flashsuppressors/CfgVehicles.hpp @@ -0,0 +1,48 @@ + +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ +} + +class CfgVehicles { + class NATO_Box_Base; + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_muzzle_mzls_H,5); + MACRO_ADDITEM(ACE_muzzle_mzls_B,5); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,5); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,5); + }; + }; + + class EAST_Box_Base; + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_muzzle_mzls_H,5); + MACRO_ADDITEM(ACE_muzzle_mzls_B,5); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,5); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,5); + }; + }; + + class IND_Box_Base; + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_muzzle_mzls_H,1); + MACRO_ADDITEM(ACE_muzzle_mzls_B,5); + MACRO_ADDITEM(ACE_muzzle_mzls_L,5); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,5); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,5); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_muzzle_mzls_H,2); + MACRO_ADDITEM(ACE_muzzle_mzls_B,2); + MACRO_ADDITEM(ACE_muzzle_mzls_L,2); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_01,2); + MACRO_ADDITEM(ACE_muzzle_mzls_smg_02,2); + }; + }; +}; diff --git a/addons/flashsuppressors/CfgWeapons.hpp b/addons/flashsuppressors/CfgWeapons.hpp new file mode 100644 index 0000000000..973d438961 --- /dev/null +++ b/addons/flashsuppressors/CfgWeapons.hpp @@ -0,0 +1,242 @@ + +class CfgWeapons { + class ItemCore; + class InventoryMuzzleItem_Base_F; + + class ACE_muzzle_mzls_H: ItemCore { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_muzzle_mzls_H"; + htMin = 1; + htMax = 600; + afMax = 0; + mfMax = 0; + mFact = 1; + tBody = 100; + scope = 2; + displayName = "$STR_ACE_muzzle_mzls_H"; + picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; + model = "\A3\weapons_f\acc\acca_mzls_H_F"; + + class ItemInfo: InventoryMuzzleItem_Base_F { + mass = 8; + soundTypeIndex = 0; + muzzleEnd = "zaslehPoint"; + alternativeFire = "Zasleh2"; + + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 1.0; + visibleFire = 0.5; + audibleFire = 1.0; + visibleFireTime = 0.5; + audibleFireTime = 1.0; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.9f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + + inertia = 0.2; + }; + + class ACE_muzzle_mzls_B: ACE_muzzle_mzls_H { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_muzzle_mzls_B"; + displayName = "$STR_ACE_muzzle_mzls_B"; + picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_h_ca.paa"; + model = "\A3\weapons_f\acc\acca_mzls_H_F"; + + class ItemInfo: ItemInfo { + mass = 6; + soundTypeIndex = 0; + muzzleEnd = "zaslehPoint"; + alternativeFire = "Zasleh2"; + + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 1.0; + visibleFire = 0.5; + audibleFire = 1.0; + visibleFireTime = 0.5; + audibleFireTime = 1.0; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.9f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + + inertia = 0.2; + }; + + class ACE_muzzle_mzls_L: ACE_muzzle_mzls_H { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_muzzle_mzls_L"; + displayName = "$STR_ACE_muzzle_mzls_L"; + picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; + model = "\A3\weapons_f\acc\acca_mzls_l_F"; + + class ItemInfo: ItemInfo { + mass = 6; + soundTypeIndex = 0; + muzzleEnd = "zaslehPoint"; + alternativeFire = "Zasleh2"; + + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 1.0; + visibleFire = 0.5; + audibleFire = 1.0; + visibleFireTime = 0.5; + audibleFireTime = 1.0; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.9f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + + inertia = 0.1; + }; + + class ACE_muzzle_mzls_smg_01: ACE_muzzle_mzls_H { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_muzzle_mzls_smg_01"; + displayName = "$STR_ACE_muzzle_mzls_smg_01"; + picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; + model = "\A3\weapons_f\acc\acca_mzls_H_F"; //"\A3\weapons_f\acc\acca_mzls_smg_01_F"; + + class ItemInfo: ItemInfo { + mass = 6; + soundTypeIndex = 0; + muzzleEnd = "zaslehPoint"; + alternativeFire = "Zasleh2"; + + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 1.0; + visibleFire = 0.5; + audibleFire = 1.0; + visibleFireTime = 0.5; + audibleFireTime = 1.0; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.9f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + + inertia = 0.1; + }; + + class ACE_muzzle_mzls_smg_02: ACE_muzzle_mzls_H { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_muzzle_mzls_smg_02"; + displayName = "$STR_ACE_muzzle_mzls_smg_02"; + picture = "\A3\weapons_F\Data\UI\gear_acca_mzls_l_ca.paa"; + model = "\A3\weapons_f\acc\acca_mzls_H_F"; //"\A3\weapons_f\acc\acca_mzls_smg_01_F"; + + class ItemInfo: ItemInfo { + mass = 6; + soundTypeIndex = 0; + muzzleEnd = "zaslehPoint"; + alternativeFire = "Zasleh2"; + + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 1.0; + visibleFire = 0.5; + audibleFire = 1.0; + visibleFireTime = 0.5; + audibleFireTime = 1.0; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.9f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + + inertia = 0.1; + }; +}; diff --git a/addons/flashsuppressors/README.md b/addons/flashsuppressors/README.md new file mode 100644 index 0000000000..29b66420c5 --- /dev/null +++ b/addons/flashsuppressors/README.md @@ -0,0 +1,12 @@ +ace_flashsuppressors +==================== + +Allows the flash suppressors that are already in the game to be used. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/flashsuppressors/config.cpp b/addons/flashsuppressors/config.cpp new file mode 100644 index 0000000000..6f94efba1d --- /dev/null +++ b/addons/flashsuppressors/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_muzzle_mzls_H","ACE_muzzle_mzls_B","ACE_muzzle_mzls_L","ACE_muzzle_mzls_smg_01","ACE_muzzle_mzls_smg_02"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2"; + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/flashsuppressors/newclasses.txt b/addons/flashsuppressors/newclasses.txt new file mode 100644 index 0000000000..5e9543fa37 --- /dev/null +++ b/addons/flashsuppressors/newclasses.txt @@ -0,0 +1,6 @@ + +ACE_muzzle_mzls_H +ACE_muzzle_mzls_B +ACE_muzzle_mzls_L +ACE_muzzle_mzls_smg_01 +ACE_muzzle_mzls_smg_02 diff --git a/addons/flashsuppressors/script_component.hpp b/addons/flashsuppressors/script_component.hpp new file mode 100644 index 0000000000..bb1a7c8f0c --- /dev/null +++ b/addons/flashsuppressors/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT flashsuppressors +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_FLASHSUPPRESSORS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_FLASHSUPPRESSORS + #define DEBUG_SETTINGS DEBUG_ENABLED_FLASHSUPPRESSORS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/flashsuppressors/stringtable.xml b/addons/flashsuppressors/stringtable.xml new file mode 100644 index 0000000000..3f6cc7b0d2 --- /dev/null +++ b/addons/flashsuppressors/stringtable.xml @@ -0,0 +1,66 @@ + + + + + + Flash Suppressor (6.5 mm) + LángrejtÅ‘ (6,5 mm) + Mündungsfeuerdämpfer (6,5 mm) + Soppressore di fiamma (6.5mm) + Supressor de Clarão (6,5mm) + TÅ‚umik pÅ‚omieni (6,5 mm) + TlumiÄ záblesku (6,5 mm) + Cache-flamme (6,5 mm) + ПламегаÑитель (6,5 мм) + Supresor (6,5 mm) + + + Flash Suppressor (7.62 mm) + LángrejtÅ‘ (7,62 mm) + Mündungsfeuerdämpfer (7,62 mm) + Soppressore di fiamma (7.62mm) + Supressor de Clarão (7,62mm) + TÅ‚umik pÅ‚omieni (7,62 mm) + TlumiÄ záblesku (7,62 mm) + Cache-flamme (7,62 mm) + ПламегаÑитель (7,62 мм) + Supresor (7,62 mm) + + + Flash Suppressor (5.56 mm) + LángrejtÅ‘ (5,56 mm) + Mündungsfeuerdämpfer (5,56 mm) + Soppressore di fiamma (5.56mm) + Supressor de Clarão (5,56mm) + TÅ‚umik pÅ‚omieni (5,56 mm) + TlumiÄ záblesku (5,56 mm) + Cache-flamme (5,56 mm) + ПламегаÑитель (5,56 мм) + Supresor (5,56 mm) + + + Flash Suppressor (.45 ACP) + LángrejtÅ‘ (.45 ACP) + Mündungsfeuerdämpfer (.45 ACP) + Soppressore di fiamma (.45 ACP) + Supressor de Clarão (.45 ACP) + TÅ‚umik pÅ‚omieni (.45 ACP) + TlumiÄ záblesku (.45 ACP) + Cache-flamme (.45 ACP) + ПламегаÑитель (.45 ACP) + Supresor (.45 ACP) + + + Flash Suppressor (9 mm) + LángrejtÅ‘ (9 mm) + Mündungsfeuerdämpfer (9 mm) + Soppressore di fiamma (9 mm) + Supressor de Clarão (9mm) + TÅ‚umik pÅ‚omieni (9 mm) + TlumiÄ záblesku (9 mm) + Cache-flamme (9 mm) + ПламегаÑитель (9 мм) + Supresor (9 mm) + + + diff --git a/addons/frag/README.md b/addons/frag/README.md new file mode 100644 index 0000000000..2bcccda913 --- /dev/null +++ b/addons/frag/README.md @@ -0,0 +1,12 @@ +ace_frag +======== + +Shrapnel system for explosives. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [NouberNou](https://github.com/NouberNou) +- [walterpearce](https://github.com/walterpearce) diff --git a/addons/gforces/README.md b/addons/gforces/README.md new file mode 100644 index 0000000000..15aa7116aa --- /dev/null +++ b/addons/gforces/README.md @@ -0,0 +1,12 @@ +ace_gforces +=========== + +Adds G-force induced tunnel vision and unconsciousness. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/goggles/$PBOPREFIX$ b/addons/goggles/$PBOPREFIX$ new file mode 100644 index 0000000000..877aa261c5 --- /dev/null +++ b/addons/goggles/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\goggles diff --git a/addons/goggles/CfgEventHandlers.hpp b/addons/goggles/CfgEventHandlers.hpp new file mode 100644 index 0000000000..8c7edda20f --- /dev/null +++ b/addons/goggles/CfgEventHandlers.hpp @@ -0,0 +1,10 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/goggles/README.md b/addons/goggles/README.md new file mode 100644 index 0000000000..959459f58e --- /dev/null +++ b/addons/goggles/README.md @@ -0,0 +1,12 @@ +ace_goggles +=========== + +Adds various effects to different kinds of goggles and ambient effects like dirt thrown up by explosions. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [esteldunedain](https://github.com/esteldunedain) +- [CorruptedHeart](https://github.com/CorruptedHeart) diff --git a/TO_MERGE/agm/Goggles/RscTitles.hpp b/addons/goggles/RscTitles.hpp similarity index 50% rename from TO_MERGE/agm/Goggles/RscTitles.hpp rename to addons/goggles/RscTitles.hpp index 15a83a71ce..57975e052f 100644 --- a/TO_MERGE/agm/Goggles/RscTitles.hpp +++ b/addons/goggles/RscTitles.hpp @@ -1,21 +1,21 @@ class RscTitles{ #include "define.hpp" - class RscAGM_Goggles_BaseTitle{ + class RscACE_Goggles_BaseTitle{ idd = -1; - onLoad = "uiNamespace setVariable ['AGM_Goggles_Display', _this select 0]"; - onUnload = "uiNamespace setVariable ['AGM_Goggles_Display', displayNull]"; + onLoad = "uiNamespace setVariable ['ACE_Goggles_Display', _this select 0]"; + onUnload = "uiNamespace setVariable ['ACE_Goggles_Display', displayNull]"; fadeIn=0.5; fadeOut=0.5; movingEnable = false; duration = 10e10; - name = "RscAGM_Goggles_BaseTitle"; + name = "RscACE_Goggles_BaseTitle"; class controls; }; - class RscAGM_Goggles:RscAGM_Goggles_BaseTitle{ + class RscACE_Goggles:RscACE_Goggles_BaseTitle{ idd = 1044; - name = "RscAGM_Goggles"; + name = "RscACE_Goggles"; class controls{ class gogglesImage: RscPicture{ idc = 10650; @@ -23,11 +23,11 @@ class RscTitles{ }; }; - class RscAGM_GogglesEffects:RscAGM_Goggles_BaseTitle{ + class RscACE_GogglesEffects:RscACE_Goggles_BaseTitle{ idd = 1045; - onLoad = "uiNamespace setVariable ['AGM_Goggles_DisplayEffects', _this select 0]"; - onUnload = "uiNamespace setVariable ['AGM_Goggles_DisplayEffects', displayNull]"; - name = "RscAGM_GogglesEffects"; + onLoad = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', _this select 0]"; + onUnload = "uiNamespace setVariable ['ACE_Goggles_DisplayEffects', displayNull]"; + name = "RscACE_GogglesEffects"; fadeIn=0; fadeOut=0.5; class controls{ diff --git a/addons/goggles/XEH_postInit.sqf b/addons/goggles/XEH_postInit.sqf new file mode 100644 index 0000000000..941b2d85ea --- /dev/null +++ b/addons/goggles/XEH_postInit.sqf @@ -0,0 +1,125 @@ +/* + Name: XEH_postInit.sqf + + Author: Garth de Wet (LH) + + Description: + Sets up the glasses mod for usage. Initialises variables and event handlers. + Shouldn't be called by a user/modder ever. Done by the engine. + + Parameters: + Nothing + + Returns: + Nothing +*/ +#include "script_component.hpp" +if (!hasInterface) exitWith {}; + +["ACE3", localize "STR_ACE_Goggles_WipeGlasses", +{ + if (!(GETVAR(ace_player,ACE_isUnconscious,false))) exitWith { + call FUNC(clearGlasses); + true + }; + false +}, [20, true, true, false], false, "keydown"] call CALLSTACK(cba_fnc_registerKeybind); + +if isNil(QGVAR(UsePP)) then { + GVAR(UsePP) = true; +}; + +GVAR(PostProcess) = ppEffectCreate ["ColorCorrections", 1995]; +GVAR(PostProcessEyes) = ppEffectCreate ["ColorCorrections", 1992]; +GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; +GVAR(PostProcessEyes) ppEffectCommit 0; +GVAR(PostProcessEyes) ppEffectEnable false; +GVAR(EffectsActive) = false; +SETGLASSES(ace_player,GLASSESDEFAULT); +GVAR(Current) = "None"; +GVAR(EyesDamageScript) = -1; +GVAR(FrameEvent) = [false, [false,20]]; +GVAR(PostProcessEyes_Enabled) = false; +GVAR(DustHandler) = -1; +GVAR(RainDrops) = objNull; +GVAR(RainActive) = false; +GVAR(RainLastLevel) = 0; + +FUNC(CheckGlasses) = { + if (GVAR(Current) != (goggles ace_player)) then { + GVAR(Current) = (goggles ace_player); + ["GlassesChanged",[GVAR(Current)]] call EFUNC(common,localEvent); + }; +}; + +player addEventHandler ["Explosion", { + if (alive ace_player) then { + call FUNC(ApplyDirtEffect); + if (GETBROKEN) exitWith {}; + if (((_this select 1) call FUNC(GetExplosionIndex)) < getNumber(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Resistance")) exitWith {}; + if !(ace_player call FUNC(isGogglesVisible)) exitWith {["GlassesCracked",[ace_player]] call EFUNC(common,localEvent);}; + _effects = GETGLASSES(ace_player); + _effects set [BROKEN, true]; + SETGLASSES(ace_player,_effects); + if (getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked") != "" && {cameraOn == ace_player}) then { + if (call FUNC(ExternalCamera)) exitWith {}; + if (isNull(GLASSDISPLAY)) then { + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; + }; + (GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_OverlayCracked"); + }; + ["GlassesCracked",[ace_player]] call EFUNC(common,localEvent); + }; +}]; +player addEventHandler ["Killed",{ + GVAR(PostProcessEyes) ppEffectEnable false; + SETGLASSES(ace_player,GLASSESDEFAULT); + call FUNC(removeGlassesEffect); + GVAR(EffectsActive)=false; + ace_player setVariable ["ACE_EyesDamaged", false]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + if (GVAR(DustHandler) != -1) then { + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; +}]; +player addEventHandler ["Fired",{[_this select 0, _this select 1] call FUNC(dustHandler);}]; +player AddEventHandler ["Take",{call FUNC(checkGlasses);}]; +player AddEventHandler ["Put", {call FUNC(checkGlasses);}]; + +["GlassesChanged",{ + SETGLASSES(ace_player,GLASSESDEFAULT); + + if (call FUNC(ExternalCamera)) exitWith {call FUNC(RemoveGlassesEffect)}; + + if (ace_player call FUNC(isGogglesVisible)) then { + (_this select 0) call FUNC(applyGlassesEffect); + } else { + call FUNC(removeGlassesEffect); + }; +}] call EFUNC(common,addEventHandler); +["GlassesCracked",{ + if (_this select 0 != ace_player) exitWith {}; + ace_player setVariable ["ACE_EyesDamaged", true]; + if (GVAR(EyesDamageScript) != -1) then { + [GVAR(EyesDamageScript)] call CALLSTACK(cba_fnc_removePreFrameHandler); + }; + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0; + GVAR(PostProcessEyes) ppEffectEnable true; + GVAR(EyesDamageScript) = [{ + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 5; + GVAR(EyesDamageScript) = [{ + GVAR(PostProcessEyes) ppEffectEnable false; + ace_player setVariable ["ACE_EyesDamaged", false]; + GVAR(EyesDamageScript) = -1; + }, [], 5, 1] call EFUNC(common,waitAndExecute); + }, [], 25, 5] call EFUNC(common,waitAndExecute); +}] call EFUNC(common,addEventHandler); +call FUNC(checkGlasses); +[FUNC(CheckGoggles), 1, []] call CBA_fnc_addPerFrameHandler; +[FUNC(rainEffect), 0.5, []] call CBA_fnc_addPerFrameHandler; +[FUNC(onEachFrame), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/goggles/XEH_preInit.sqf b/addons/goggles/XEH_preInit.sqf new file mode 100644 index 0000000000..c2878f3721 --- /dev/null +++ b/addons/goggles/XEH_preInit.sqf @@ -0,0 +1,23 @@ +#include "script_component.hpp" + +PREP(applyDirtEffect); +PREP(applyDust); +PREP(applyGlassesEffect); + +PREP(checkGoggles); +PREP(clearGlasses); +PREP(dustHandler); +PREP(externalCamera); +PREP(getExplosionIndex); + +PREP(isDivingGoggles); +PREP(isGogglesVisible); +PREP(isInRotorWash); + +PREP(onEachFrame); +PREP(rainEffect); + +PREP(removeDirtEffect); +PREP(removeDustEffect); +PREP(removeGlassesEffect); +PREP(removeRainEffect); diff --git a/TO_MERGE/agm/Goggles/anim/WipeGlasses.rtm b/addons/goggles/anim/WipeGlasses.rtm similarity index 100% rename from TO_MERGE/agm/Goggles/anim/WipeGlasses.rtm rename to addons/goggles/anim/WipeGlasses.rtm diff --git a/TO_MERGE/agm/Goggles/anim/model.cfg b/addons/goggles/anim/model.cfg similarity index 100% rename from TO_MERGE/agm/Goggles/anim/model.cfg rename to addons/goggles/anim/model.cfg diff --git a/addons/goggles/config.cpp b/addons/goggles/config.cpp new file mode 100644 index 0000000000..f804be003e --- /dev/null +++ b/addons/goggles/config.cpp @@ -0,0 +1,279 @@ +#include "script_component.hpp" + +#define COLOUR 8.0 +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Garth 'L-H' de Wet"}; + authorUrl = "http://garth.snakebiteink.co.za/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +#define COMBAT_GOGGLES ACE_Overlay = QUOTE(PATHTOF(textures\HUD\CombatGoggles.paa)); \ + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\CombatGogglesCracked.paa)); \ + ACE_Resistance = 2; \ + ACE_Protection = 1; + +class CfgGlasses { + class None { + ACE_Color[] = {0,0,0}; + ACE_TintAmount=0; + ACE_Overlay = ""; + ACE_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa"; + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\Cracked.paa)); + ACE_Resistance = 0; + ACE_Protection = 0; + ACE_DustPath = QUOTE(PATHTOF(textures\fx\dust\%1.paa)); + }; + + class G_Combat:None { + COMBAT_GOGGLES + }; + + class G_Diving { + ACE_Overlay = QUOTE(PATHTOF(textures\HUD\DivingGoggles.paa)); + ACE_OverlayCracked = QUOTE(PATHTOF(textures\HUD\DivingGogglesCracked.paa)); + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Lowprofile:None { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Shades_Black:None { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; + + class G_Shades_Blue:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Shades_Green:None{ + ACE_Color[] = {0,1,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Shades_Red:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Spectacles:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Spectacles_Tinted:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; + + class G_Sport_Blackred:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Sport_BlackWhite:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Sport_Blackyellow:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; + + class G_Sport_Checkered:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; + + class G_Sport_Greenblack:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; + + class G_Sport_Red:None{ + ACE_TintAmount=COLOUR*2; + ACE_Color[] = {0,0,0}; + ACE_Resistance = 1; + }; + + class G_Squares:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Squares_Tinted:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Tactical_Black:None{ + ACE_TintAmount=COLOUR; + ACE_Color[] = {0,0,-1.5}; + ACE_Resistance = 1; + }; + + class G_Tactical_Clear:None{ + ACE_TintAmount=COLOUR; + ACE_Color[] = {0,0,-1}; + ACE_Resistance = 1; + }; + + class G_Aviator:None{ + ACE_Color[] = {0,0,-1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Lady_Blue:None{ + ACE_Color[] = {0,0,1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Lady_Red:None{ + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class G_Lady_Dark:None{ + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + }; + + class G_Lady_Mirror:None{ + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + }; + + class AV_ESS_blk:None{ + COMBAT_GOGGLES + }; + + class G_Balaclava_blk; + + class G_Balaclava_combat:G_Balaclava_blk { + COMBAT_GOGGLES + }; + + class G_Balaclava_lowprofile:G_Balaclava_blk { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 2; + ACE_Protection = 1; + }; + + class G_Bandanna_blk; + class G_Bandanna_shades:G_Bandanna_blk { + ACE_TintAmount=COLOUR*2; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_sport:G_Bandanna_blk { + ACE_Color[] = {1,0,0}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; + class G_Bandanna_aviator:G_Bandanna_blk { + ACE_Color[] = {0,0,-1}; + ACE_TintAmount=COLOUR; + ACE_Resistance = 1; + ACE_Protection = 1; + }; +}; + +#include "RscTitles.hpp" + +class CfgMovesBasic { + class ManActions { + GestureWipeFace[] = {"GestureWipeFace", "gesture"}; + }; +}; + +class CfgGesturesMale { + class States { + class GestureFreezeStand; + class GestureWipeFace: GestureFreezeStand { + file = QUOTE(PATHTOF(anim\WipeGlasses.rtm)); + canPullTrigger = 0; + }; + }; +}; + +class CfgWeapons { + class H_HelmetB; + + class H_CrewHelmetHeli_B:H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetHeli_B:H_HelmetB { + ACE_Protection = 1; + }; + class H_PilotHelmetFighter_B:H_HelmetB { + ACE_Protection = 1; + }; +}; + +class RifleAssaultCloud { + ACE_Goggles_BulletCount = 4; +}; +class MachineGunCloud { + ACE_Goggles_BulletCount = 3; +}; +class SniperCloud { + ACE_Goggles_BulletCount = 1; +}; + +class ACE_Options { + class GVAR(showInThirdPerson) { + displayName = $STR_ACE_Goggles_ShowInThirdPerson; + default = 0; + }; +}; + +class CfgCloudlets { + class Default; + class ACERainEffect:Default { + interval = 0.001; + particleShape = "\A3\data_f\ParticleEffects\Universal\Refract"; + particleFSNtieth = 1; + particleFSIndex = 0; + particleFSFrameCount = 1; + particleFSLoop = 1; + + particleType = "Billboard"; + lifeTime = 0.5; + rotationVelocity = 1; + weight = 100; + volume = 0.000; + rubbing = 1.7; + size[] = {0.1}; + color[] = {{1,1,1,1}}; + animationSpeed[] = {0,1}; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 1.2; + positionVar[] = {2, 2, 2.5}; + sizeVar = 0.01; + colorVar[] = {0, 0, 0, 0.1}; + destroyOnWaterSurface = 1; + }; +}; diff --git a/addons/goggles/define.hpp b/addons/goggles/define.hpp new file mode 100644 index 0000000000..34c207bd20 --- /dev/null +++ b/addons/goggles/define.hpp @@ -0,0 +1,26 @@ +// Control types +#define CT_STATIC 0 +#define ST_PICTURE 0x30 + +//////////////// +//Base Classes// +//////////////// + +class RscPicture { + access = 0; + idc = -1; + type = CT_STATIC; + style = ST_PICTURE; + colorBackground[] = {0,0,0,0}; + colorText[] = {1,1,1,1}; + font = "puristaMedium"; + sizeEx = 0; + lineSpacing = 0; + fixedWidth = 0; + shadow = 0; + text = ""; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; +}; diff --git a/addons/goggles/functions/fnc_applyDirtEffect.sqf b/addons/goggles/functions/fnc_applyDirtEffect.sqf new file mode 100644 index 0000000000..0cf784a528 --- /dev/null +++ b/addons/goggles/functions/fnc_applyDirtEffect.sqf @@ -0,0 +1,35 @@ +/* + ApplyDirtEffect + + Author: Garth de Wet (LH) + + Description: + Adds dirt effect to the glasses. + + Parameters: + Nothing + + Returns: + BOOLEAN - True if succeeded false if not + + Example: + call FUNC(ApplyDirtEffect); +*/ +#include "script_component.hpp" + +if (cameraOn != ace_player || {call FUNC(externalCamera)}) exitWith{false}; +private "_dirtImage"; +_effects = GETGLASSES(ace_player); +_effects set [DIRT, true]; +SETGLASSES(ace_player,_effects); + +if (ace_player call FUNC(isGogglesVisible)) then{ + _dirtImage = getText(ConfigFile >> "CfgGlasses" >> (goggles ace_player) >> "ACE_OverlayDirt"); + if (_dirtImage != "") then { + 100 cutRsc["RscACE_GogglesEffects", "PLAIN",0.1, false]; + + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText _dirtImage; + }; +}; + +true diff --git a/addons/goggles/functions/fnc_applyDust.sqf b/addons/goggles/functions/fnc_applyDust.sqf new file mode 100644 index 0000000000..53e75ba274 --- /dev/null +++ b/addons/goggles/functions/fnc_applyDust.sqf @@ -0,0 +1,61 @@ +/* + Name: fnc_applyDust.sqf + + Author: Garth de Wet (LH) + + Description: + Applies dust to screen. + + Parameters: + Nothing + + Returns: + Nothing + + Example 1: + call FUNC(ApplyDust); +*/ +#include "script_component.hpp" +if (call FUNC(ExternalCamera)) exitWith {}; +if (ace_player call FUNC(isGogglesVisible)) exitWith { + 100 cutRsc["RscACE_GogglesEffects", "PLAIN",2,false]; + (uiNamespace getVariable ["ACE_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_DustPath"), GETDUSTT(DAMOUNT)+1]; + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1)); + SETDUST(DBULLETS,0); +}; + +if (GETVAR(ace_player,ACE_EyesDamaged,false)) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);}; +SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2)); + +private "_amount"; +_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + +GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; +GVAR(PostProcessEyes) ppEffectCommit 1; +GVAR(PostProcessEyes) ppEffectEnable true; +SETDUST(DBULLETS,0); + +if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; +}; +GVAR(DustHandler) = [{ + if (diag_tickTime >= GETDUSTT(DTIME) + 3) then { + SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); + private "_amount"; + _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125); + if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + }; + if (GETDUSTT(DAMOUNT) <= 0) then { + GVAR(PostProcessEyes) ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + [{GVAR(PostProcessEyes) ppEffectEnable false;}, [], 2, 0.5] call EFUNC(common,waitAndExecute); + SETDUST(DACTIVE,false); + SETDUST(DBULLETS,0); + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + }; +},0,[]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/TO_MERGE/agm/Goggles/functions/fn_ApplyGlassesEffect.sqf b/addons/goggles/functions/fnc_applyGlassesEffect.sqf similarity index 51% rename from TO_MERGE/agm/Goggles/functions/fn_ApplyGlassesEffect.sqf rename to addons/goggles/functions/fnc_applyGlassesEffect.sqf index df535485d9..496f73d4b0 100644 --- a/TO_MERGE/agm/Goggles/functions/fn_ApplyGlassesEffect.sqf +++ b/addons/goggles/functions/fnc_applyGlassesEffect.sqf @@ -1,53 +1,56 @@ /* - Name: AGM_Goggles_fnc_ApplyGlassesEffect - + Name: fnc_ApplyGlassesEffect.sqf + Author: Garth de Wet (LH) - + Description: Sets screen tint for glasses. Sets screen overlay for glasses. (broken/fixed) Sets dirt/rain overlay for glasses. - - Parameters: + + Parameters: 0: STRING - Glasses class name to be applied. - + Returns: Nothing - + Example: - (goggles player) call AGM_Goggles_fnc_ApplyGlassesEffect; + (goggles ace_player) call FUNC(ApplyGlassesEffect); */ -#include "\AGM_Goggles\script.sqf" +#include "script_component.hpp" private["_postProcessColour", "_postProcessTintAmount", "_glassesClassname", "_glassImagePath"]; _glassesClassname = _this; -_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_Color"); -_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_TintAmount"); +_postProcessColour = getArray(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Color"); +_postProcessTintAmount = getNumber(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_TintAmount"); -call AGM_Goggles_fnc_RemoveGlassesEffect; -AGM_Goggles_EffectsActive = true; +call FUNC(removeGlassesEffect); +GVAR(EffectsActive) = true; -if (_postProcessTintAmount != 0 && {AGM_Goggles_UsePP}) then { +if (_postProcessTintAmount != 0 && {GVAR(UsePP)}) then { _postProcessColour set [3, _postProcessTintAmount/100]; - AGM_Goggles_PostProcess ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; - AGM_Goggles_PostProcess ppEffectCommit 0; - AGM_Goggles_PostProcess ppEffectEnable true; + GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; + GVAR(PostProcess) ppEffectCommit 0; + GVAR(PostProcess) ppEffectEnable true; + _postProcessColour set [3, _postProcessTintAmount/250]; + GVAR(PostProcess) ppEffectAdjust[0.9, 1.1, 0.004, _postProcessColour, [0,0,0,1],[0,0,0,0]]; + GVAR(PostProcess) ppEffectCommit 30; }; -_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_Overlay"); +_glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_Overlay"); if GETBROKEN then { - _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "AGM_OverlayCracked"); + _glassImagePath = getText(configFile >> "CfgGlasses" >> _glassesClassname >> "ACE_OverlayCracked"); }; if (_glassImagePath != "") then { - 150 cutRsc["RscAGM_Goggles", "PLAIN",1, false]; + 150 cutRsc["RscACE_Goggles", "PLAIN",1, false]; (GLASSDISPLAY displayCtrl 10650) ctrlSetText _glassImagePath; }; if GETDIRT then { - call AGM_Goggles_fnc_ApplyDirtEffect; + call FUNC(applyDirtEffect); }; if GETDUSTT(DACTIVE) then { SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2)); - call AGM_Goggles_fnc_ApplyDust; + call FUNC(applyDust); }; diff --git a/addons/goggles/functions/fnc_checkGoggles.sqf b/addons/goggles/functions/fnc_checkGoggles.sqf new file mode 100644 index 0000000000..a00b7371d8 --- /dev/null +++ b/addons/goggles/functions/fnc_checkGoggles.sqf @@ -0,0 +1,37 @@ +/* + Author: Garth de Wet (LH) + + Description: + Performs rain checks and checks to see whether glasses effects have been applied or not. + Checks for external camera and removes effects. +*/ +#include "script_component.hpp" +if (!alive ace_player) exitWith {}; +if (true) then { + // Detect if curator interface is open and disable effects + if (!isNull(findDisplay 312)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + call FUNC(checkGlasses); + if !(ace_player call FUNC(isGogglesVisible)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + if (call FUNC(externalCamera)) exitWith { + if (GVAR(EffectsActive)) then { + call FUNC(removeGlassesEffect); + }; + }; + if !(GVAR(EffectsActive)) then { + (goggles ace_player) call FUNC(applyGlassesEffect); + } else { + if ((goggles ace_player) call FUNC(isDivingGoggles) && {underwater ace_player}) then { + call FUNC(removeRainEffect); + call FUNC(removeDirtEffect); + call FUNC(removeDustEffect); + }; + }; +}; diff --git a/addons/goggles/functions/fnc_clearGlasses.sqf b/addons/goggles/functions/fnc_clearGlasses.sqf new file mode 100644 index 0000000000..4072e7c68a --- /dev/null +++ b/addons/goggles/functions/fnc_clearGlasses.sqf @@ -0,0 +1,38 @@ +/* + Name: fnc_clearGlasses.sqf + + Author: Garth de Wet (LH) + + Description: + Clears all dirt, rain, dust from glasses. + Removes glasses effect (PP, overlay) and then puts it back. + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(ClearGlasses); +*/ +#include "script_component.hpp" + +private "_broken"; +_broken = GETBROKEN; +_effects = GLASSESDEFAULT; +_effects set [BROKEN, _broken]; +SETGLASSES(ace_player,_effects); + +if ((stance ace_player) != "PRONE") then { + ace_player playActionNow "gestureWipeFace"; +}; +[{ + if (cameraView == "INTERNAL") then { + addCamShake [5, 1.75, 2]; + }; +}, [], 0.3, 0] call EFUNC(common,waitAndExecute); + +call FUNC(removeDirtEffect); +call FUNC(removeRainEffect); +call FUNC(removeDustEffect); diff --git a/TO_MERGE/agm/Goggles/functions/fn_DustHandler.sqf b/addons/goggles/functions/fnc_dustHandler.sqf similarity index 72% rename from TO_MERGE/agm/Goggles/functions/fn_DustHandler.sqf rename to addons/goggles/functions/fnc_dustHandler.sqf index a4457815e1..aae722d50f 100644 --- a/TO_MERGE/agm/Goggles/functions/fn_DustHandler.sqf +++ b/addons/goggles/functions/fnc_dustHandler.sqf @@ -1,29 +1,30 @@ /* - Name: AGM_Goggles_fnc_DustHandler - + fnc_DustHandler.sqf + Author: Garth de Wet (LH) - + Description: Determines whether to place dust on the goggles, based on calibre of weapon fired and other requirements. - - Parameters: + + Parameters: 0: Object - unit - eventhandler was attached to. (Used) 1: String - weapon - Weapon fired (Used) - + Returns: Nothing - + Example: - player addEventHandler ["Fired", {[_this select 0, _this select 1] call AGM_Goggles_fnc_DustHandler;}]; + ace_player addEventHandler ["Fired", {[_this select 0, _this select 1] call FUNC(DustHandler;}]; See http://community.bistudio.com/wiki/ArmA_3:_Event_Handlers#Fired */ -#include "\AGM_Goggles\script.sqf" - -private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType"]; -_weapon = _this select 1; +#include "script_component.hpp" +private ["_bullets", "_position", "_surface", "_found", "_weapon", "_cloudType", "_unit"]; +EXPLODE_2_PVT(_this,_unit,_weapon); +if (_unit != ace_player) exitWith {true}; _cloudType = ""; -if ((_this select 0) != player) exitWith {true}; +if (rain > 0.1) exitWith {true}; +if ((stance _unit) != "PRONE") exitWith {true}; if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect")) then { _cloudType = getText(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEffect" >> "effectName"); @@ -34,10 +35,8 @@ if (isClass(configFile >> "CfgWeapons" >> _weapon >> "GunParticles" >> "FirstEff }; if (_cloudType == "") exitWith {true}; -if (rain > 0.1) exitWith {true}; -if ((stance player) != "PRONE") exitWith {true}; -_position = getPosATL player; +_position = getPosATL _unit; if (surfaceIsWater _position) exitWith {}; if ((_position select 2) > 0.2) exitWith {}; @@ -52,24 +51,24 @@ if (!_found) exitWith {}; _bullets = GETDUSTT(DBULLETS); -if ((time - GETDUSTT(DTIME)) > 1) then { +if ((diag_tickTime - GETDUSTT(DTIME)) > 1) then { _bullets = 0; }; _bullets = _bullets + 1; SETDUST(DBULLETS,_bullets); -SETDUST(DTIME,time); +SETDUST(DTIME,diag_tickTime); if (GETDUSTT(DAMOUNT) < 2) then { private "_bulletsRequired"; _bulletsRequired = 100; - if (isNumber (ConfigFile >> _cloudType >> "AGM_Goggles_BulletCount")) then { - _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "AGM_Goggles_BulletCount"); + if (isNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount")) then { + _bulletsRequired = getNumber (ConfigFile >> _cloudType >> "ACE_Goggles_BulletCount"); }; if (_bulletsRequired <= _bullets) then { SETDUST(DACTIVE,true); - call AGM_Goggles_fnc_ApplyDust; + call FUNC(applyDust); }; }; true diff --git a/addons/goggles/functions/fnc_externalCamera.sqf b/addons/goggles/functions/fnc_externalCamera.sqf new file mode 100644 index 0000000000..35b94171a6 --- /dev/null +++ b/addons/goggles/functions/fnc_externalCamera.sqf @@ -0,0 +1,23 @@ +/* + fnc_ExternalCamera.sqf + + Author: Garth de Wet (LH) + + Description: + Returns if the camera is external or not. + + Parameters: + Nothing + + Returns: + Boolean - whether the camera is in external view or not. + If the "showInThirdPerson" option is checked, this will always return false. + + Example: + call FUNC(ExternalCamera); +*/ + +#include "script_component.hpp" + +if ((missionNameSpace getVariable [QGVAR(showInThirdPerson), 0]) == 1) exitWith { false }; +(cameraView == "External") diff --git a/addons/goggles/functions/fnc_getExplosionIndex.sqf b/addons/goggles/functions/fnc_getExplosionIndex.sqf new file mode 100644 index 0000000000..92d79f4992 --- /dev/null +++ b/addons/goggles/functions/fnc_getExplosionIndex.sqf @@ -0,0 +1,27 @@ +/* + fnc_getExplosionIndex.sqf + + Author: Garth de Wet (LH) + + Description: + Turns 0-1 damage into a rating system of 0-3 + + Parameters: + 0: NUMBER - The amount of damage + + Returns: + NUMBER (the rating) [0-3] + + Example: + _rating = 0.05 call FUNC(GetExplosionIndex); +*/ +private ["_effectIndex"]; + +_effectIndex = switch true do { + case (_this <= 0.04): {0}; + case (_this <= 0.06): {1}; + case (_this <= 0.09): {2}; + default {3}; +}; + +_effectIndex diff --git a/TO_MERGE/agm/Goggles/functions/fn_isDivingGoggles.sqf b/addons/goggles/functions/fnc_isDivingGoggles.sqf similarity index 79% rename from TO_MERGE/agm/Goggles/functions/fn_isDivingGoggles.sqf rename to addons/goggles/functions/fnc_isDivingGoggles.sqf index d4b73ff5b7..d6b97fb80a 100644 --- a/TO_MERGE/agm/Goggles/functions/fn_isDivingGoggles.sqf +++ b/addons/goggles/functions/fnc_isDivingGoggles.sqf @@ -1,20 +1,21 @@ /* - Name: AGM_Goggles_fnc_isDivingGoggles - + fnc_isDivingGoggles.sqf + Author: Garth de Wet (LH) - + Description: Determines whether current goggles worn by passed unit is diving goggles or a variant of them. - - Parameters: + + Parameters: 0: String - Glasses classname - + Returns: Boolean - whether diving goggles are worn - + Example: - (goggles player) call AGM_Goggles_fnc_isDivingGoggles; + (goggles ace_player) call FUNC(isDivingGoggles); */ +#include "script_component.hpp" private ["_result", "_glasses"]; _glasses = _this; _result = _glasses == "G_Diving"; diff --git a/TO_MERGE/agm/Goggles/functions/fn_isGogglesVisible.sqf b/addons/goggles/functions/fnc_isGogglesVisible.sqf similarity index 69% rename from TO_MERGE/agm/Goggles/functions/fn_isGogglesVisible.sqf rename to addons/goggles/functions/fnc_isGogglesVisible.sqf index d694d18c26..a663554b60 100644 --- a/TO_MERGE/agm/Goggles/functions/fn_isGogglesVisible.sqf +++ b/addons/goggles/functions/fnc_isGogglesVisible.sqf @@ -1,20 +1,21 @@ /* - Name: AGM_Goggles_fnc_isGogglesVisible - + fnc_isGogglesVisible.sqf + Author: Garth de Wet (LH) - + Description: Determines if goggles are visible on passed unit (Also checks if unit is in vehicle and cameraView is set to GUNNER) - - Parameters: + + Parameters: 0: Object - unit to check for visible goggles - + Returns: BOOL - Whether the goggles are visible or not. - + Example: - _visible = player call AGM_Goggles_fnc_isGogglesVisible; + _visible = ace_player call FUNC(isGogglesVisible); */ +#include "script_component.hpp" private ["_currentGlasses", "_result", "_unit"]; _unit = _this; @@ -26,12 +27,12 @@ if ((vehicle _unit) != _unit) exitWith {(cameraView != "GUNNER")}; if (_currentGlasses != "") then { _position =(getPosASLW _unit); if (surfaceIsWater _position && {((_position select 2) < 0.25)}) exitWith { - _result = (_currentGlasses call AGM_Goggles_fnc_isDivingGoggles); + _result = (_currentGlasses call FUNC(isDivingGoggles)); }; - if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "AGM_Resistance") == 0) exitWith { + if (getNumber (ConfigFile >> "CfgGlasses" >> _currentGlasses >> "ACE_Resistance") == 0) exitWith { _result = false; }; - _result = !(_currentGlasses call AGM_Goggles_fnc_isDivingGoggles); + _result = !(_currentGlasses call FUNC(isDivingGoggles)); }; -_result \ No newline at end of file +_result diff --git a/TO_MERGE/agm/Goggles/functions/fn_isInRotorWash.sqf b/addons/goggles/functions/fnc_isInRotorWash.sqf similarity index 78% rename from TO_MERGE/agm/Goggles/functions/fn_isInRotorWash.sqf rename to addons/goggles/functions/fnc_isInRotorWash.sqf index f1e69c9345..f8bad1a10f 100644 --- a/TO_MERGE/agm/Goggles/functions/fn_isInRotorWash.sqf +++ b/addons/goggles/functions/fnc_isInRotorWash.sqf @@ -1,24 +1,25 @@ /* - Name: AGM_Goggles_fnc_isInRotorWash - + fnc_isInRotorWash.sqf + Author: Garth de Wet (LH) - + Description: Checks for nearby helicopters (within 15m) - + Parameters: 0: Object - Unit 1: NUMBER - (optional) Radius to check for helicopter Default: 15 - + Returns: Array: 0 - boolean - If in rotorwash 1 - number - Amount of rotor wash. - + Example: - if (([player, 10] call AGM_Goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; - if (([player] call AGM_Goggles_fnc_isInRotorWash) select 0) then { hint "Rotor wash"; }; + if (([ace_player, 10] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; }; + if (([ace_player] call FUNC(isInRotorWash)) select 0) then { hint "Rotor wash"; }; */ +#include "script_component.hpp" private ["_heli", "_unit", "_result", "_radius"]; _unit = _this select 0; _radius = 15; @@ -41,6 +42,7 @@ _heli = (getPosATL _unit) nearEntities [["Helicopter"], _radius]; }; }; }; + false } count _heli; _result diff --git a/addons/goggles/functions/fnc_onEachFrame.sqf b/addons/goggles/functions/fnc_onEachFrame.sqf new file mode 100644 index 0000000000..cd361e38cf --- /dev/null +++ b/addons/goggles/functions/fnc_onEachFrame.sqf @@ -0,0 +1,80 @@ +/* + fnc_onEachFrame.sqf + + Author: Garth de Wet (LH) + + Description: + Runs every frame checking for helicopters. + + Parameters: + Nothing + + Returns: + Nothing + + Example: + ["ACE_Goggles_RotorWash", "OnEachFrame", "call FUNC(OnEachFrame);"] call BIS_fnc_addStackedEventHandler; +*/ +#include "script_component.hpp" +if (isNull(ace_player)) exitWith {}; +GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)]; +if (GVAR(FrameEvent) select 0) exitWith { + if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; }; + GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))]; +}; +private ["_rotorWash","_safe"]; +_rotorWash = GVAR(FrameEvent) select 1; +_safe = false; +if !(_rotorWash select 0) exitWith { + if (GVAR(PostProcessEyes_Enabled)) then { + GVAR(PostProcessEyes_Enabled) = false; + if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 2; + GVAR(DustHandler) = [{ + GVAR(PostProcessEyes) ppEffectEnable false; + GVAR(DustHandler) = -1; + }, [], 2, 0.5] call EFUNC(common,waitAndExecute); + }; +}; +if ((headgear ace_player) != "") then { + _safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear ace_player) >> "ACE_Protection") == 1); +}; +if !(_safe) then { + if !(ace_player call FUNC(isGogglesVisible)) exitWith{}; + if (GETDUSTT(DAMOUNT) < 2) then { + if (!GETDUSTT(DACTIVE)) then { + SETDUST(DACTIVE,true); + call FUNC(ApplyDust); + } else { + if ((_rotorWash select 1) > 0.5) then { + call FUNC(ApplyDust); + }; + }; + }; + _safe = (getNumber (ConfigFile >> "CfgGlasses" >> GVAR(Current) >> "ACE_Protection") == 1); +}; +if (_safe) exitWith {}; +if ((_rotorWash select 1) <= 15) then { + private "_scale"; + _scale = 0.7; + if ((_rotorWash select 1) != 0) then { + _scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3); + } else { + _scale = 0.1; + }; + _scale = 1 - _scale; + if (GVAR(DustHandler) != -1) then { // should be fixed in dev CBA + [GVAR(DustHandler)] call CALLSTACK(cba_fnc_removePerFrameHandler); + GVAR(DustHandler) = -1; + }; + if !(ace_player getVariable ["ACE_EyesDamaged", false]) then { + GVAR(PostProcessEyes_Enabled) = true; + GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]]; + GVAR(PostProcessEyes) ppEffectCommit 0.5; + GVAR(PostProcessEyes) ppEffectEnable true; + }; +}; diff --git a/addons/goggles/functions/fnc_rainEffect.sqf b/addons/goggles/functions/fnc_rainEffect.sqf new file mode 100644 index 0000000000..030e60c149 --- /dev/null +++ b/addons/goggles/functions/fnc_rainEffect.sqf @@ -0,0 +1,55 @@ +/* + fnc_rainEffect.sqf + + Author: Garth de Wet (LH) + + Description: + + + Parameters: + Nothing + + Returns: + Nothing + + Example: + [] call FUNC(RainEffect); +*/ +#include "script_component.hpp" +private ["_fnc_underCover"]; +if (isNull(ace_player) || {!(alive ace_player)}) exitWith {}; +_fnc_underCover = { + private ["_pos", "_unit"]; + _unit = (_this select 0); + if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true}; + _pos = eyePos _unit; + ((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])} +}; +if (!isNull(findDisplay 312)) exitWith { + if (GVAR(RainActive)) then { + call FUNC(RemoveRainEffect); + }; +}; +// Ignore if ace_player is under water +if (!GVAR(EffectsActive) || {underwater ace_player}) exitWith{call FUNC(RemoveRainEffect);}; +if (GVAR(RainLastLevel) != rain) then { + call FUNC(RemoveRainEffect); + GVAR(RainLastLevel) = rain; + // Rain is happening + if (GVAR(RainLastLevel) > 0.05 && {!([ace_player] call _fnc_underCover)}) then { + GVAR(RainActive) = true; + GVAR(RainDrops) = "#particlesource" createVehicleLocal GetPos ace_player; + GVAR(RainDrops) setParticleClass "ACERainEffect"; + GVAR(RainDrops) setDropInterval (0.07 * (1.1 - GVAR(RainLastLevel))); + GVAR(RainDrops) attachTo [vehicle ace_player,[0,0,0]]; + }; +}else{ + if (GVAR(RainLastLevel) > 0.05) then { + if (GVAR(RainActive) && {[ace_player] call _fnc_underCover}) exitWith { + call FUNC(RemoveRainEffect); + }; + if (!GVAR(RainActive)) then { + GVAR(RainLastLevel) = -1; + }; + }; +}; diff --git a/addons/goggles/functions/fnc_removeDirtEffect.sqf b/addons/goggles/functions/fnc_removeDirtEffect.sqf new file mode 100644 index 0000000000..5b58fad834 --- /dev/null +++ b/addons/goggles/functions/fnc_removeDirtEffect.sqf @@ -0,0 +1,21 @@ +/* + fnc_removeDirtEffect.sqf + + Author: Garth de Wet (LH) + + Description: + Removes dirt from the glasses. + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(RemoveDirtEffect); +*/ +#include "script_component.hpp" +if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10660) ctrlSetText ""; +}; diff --git a/addons/goggles/functions/fnc_removeDustEffect.sqf b/addons/goggles/functions/fnc_removeDustEffect.sqf new file mode 100644 index 0000000000..c937fe2bd1 --- /dev/null +++ b/addons/goggles/functions/fnc_removeDustEffect.sqf @@ -0,0 +1,21 @@ +/* + fnc_removeDustEffect.sqf + + Author: Garth de Wet (LH) + + Description: + Removes dust from the glasses. + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(RemoveDustEffect); +*/ +#include "script_component.hpp" +if (!isNull(GETUVAR(GVAR(DisplayEffects),displayNull))) then { + (GETUVAR(GVAR(DisplayEffects),displayNull) displayCtrl 10662) ctrlSetText ""; +}; diff --git a/addons/goggles/functions/fnc_removeGlassesEffect.sqf b/addons/goggles/functions/fnc_removeGlassesEffect.sqf new file mode 100644 index 0000000000..dc7bbee45e --- /dev/null +++ b/addons/goggles/functions/fnc_removeGlassesEffect.sqf @@ -0,0 +1,29 @@ +/* + RemoveGlassesEffect + + Author: Garth de Wet (LH) + + Description: + Removes the glasses effect from the screen, removes dirt effect, removes rain effect, + removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.) + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(RemoveGlassesEffect); +*/ +#include "script_component.hpp" +GVAR(EffectsActive) = false; +GVAR(PostProcess) ppEffectEnable false; + +if (!isNull(GLASSDISPLAY)) then { + GLASSDISPLAY closeDisplay 0; +}; + +call FUNC(removeDirtEffect); +call FUNC(removeRainEffect); +call FUNC(removeDustEffect); diff --git a/addons/goggles/functions/fnc_removeRainEffect.sqf b/addons/goggles/functions/fnc_removeRainEffect.sqf new file mode 100644 index 0000000000..bcef82dc81 --- /dev/null +++ b/addons/goggles/functions/fnc_removeRainEffect.sqf @@ -0,0 +1,23 @@ +/* + RemoveRainEffect + + Author: Garth de Wet (LH) + + Description: + Removes rain effects from the screen. Resets the rain array. + + Parameters: + Nothing + + Returns: + Nothing + + Example: + call FUNC(RemoveRainEffect); +*/ +#include "script_component.hpp" +if (!isNull (GVAR(RainDrops))) then { + deleteVehicle (GVAR(RainDrops)); +}; +GVAR(RainActive) = false; +GVAR(RainLastLevel) = 0; diff --git a/addons/goggles/functions/script_component.hpp b/addons/goggles/functions/script_component.hpp new file mode 100644 index 0000000000..d8624df3b2 --- /dev/null +++ b/addons/goggles/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\goggles\script_component.hpp" diff --git a/addons/goggles/script_component.hpp b/addons/goggles/script_component.hpp new file mode 100644 index 0000000000..711a314160 --- /dev/null +++ b/addons/goggles/script_component.hpp @@ -0,0 +1,37 @@ +#define COMPONENT goggles +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_GOGGLES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_GOGGLES + #define DEBUG_SETTINGS DEBUG_SETTINGS_GOGGLES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +// MACROS +#define GLASSESDEFAULT [false,[false,0,0,0],false] +#define GETGLASSES(unit) GETVAR(unit,GVAR(Condition),GLASSESDEFAULT) +#define SETGLASSES(unit,value) SETVAR(unit,GVAR(Condition),value) + +#define DIRT 0 +#define DUST 1 +#define BROKEN 2 + +#define GETDIRT (GETGLASSES(ace_player) select DIRT) +#define GETDUST (GETGLASSES(ace_player) select DUST) +#define GETBROKEN (GETGLASSES(ace_player) select BROKEN) +#define GETDUSTT(type) ((GETGLASSES(ace_player) select DUST) select type) + +#define SETDUST(type,value) (GETGLASSES(ace_player) select DUST) set [type,value] + +#define DACTIVE 0 +#define DTIME 1 +#define DBULLETS 2 +#define DAMOUNT 3 + +#define GLASSDISPLAY (GETUVAR(GVAR(Display),displayNull)) + +#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) diff --git a/TO_MERGE/agm/Goggles/stringtable.xml b/addons/goggles/stringtable.xml similarity index 91% rename from TO_MERGE/agm/Goggles/stringtable.xml rename to addons/goggles/stringtable.xml index 0d079a4063..1756442176 100644 --- a/TO_MERGE/agm/Goggles/stringtable.xml +++ b/addons/goggles/stringtable.xml @@ -1,8 +1,8 @@  - + - + Show Goggle Effects in Third Person Brilleneffekt in dritter Person anzeigen Mostrar efectos de las gafas en tercera persona @@ -14,7 +14,7 @@ Mostrar efeitos de óculos em Terceira Pessoa Attiva l'effetto degli occhiali in terza persona - + Wipe Goggles Brille abwischen Limpiar gafas @@ -27,4 +27,4 @@ Pulisci gli occhiali - \ No newline at end of file + diff --git a/TO_MERGE/agm/Goggles/textures/HUD/CombatGoggles.paa b/addons/goggles/textures/HUD/CombatGoggles.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/HUD/CombatGoggles.paa rename to addons/goggles/textures/HUD/CombatGoggles.paa diff --git a/TO_MERGE/agm/Goggles/textures/HUD/CombatGogglesCracked.paa b/addons/goggles/textures/HUD/CombatGogglesCracked.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/HUD/CombatGogglesCracked.paa rename to addons/goggles/textures/HUD/CombatGogglesCracked.paa diff --git a/TO_MERGE/agm/Goggles/textures/HUD/Cracked.paa b/addons/goggles/textures/HUD/Cracked.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/HUD/Cracked.paa rename to addons/goggles/textures/HUD/Cracked.paa diff --git a/TO_MERGE/agm/Goggles/textures/HUD/DivingGoggles.paa b/addons/goggles/textures/HUD/DivingGoggles.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/HUD/DivingGoggles.paa rename to addons/goggles/textures/HUD/DivingGoggles.paa diff --git a/TO_MERGE/agm/Goggles/textures/HUD/DivingGogglesCracked.paa b/addons/goggles/textures/HUD/DivingGogglesCracked.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/HUD/DivingGogglesCracked.paa rename to addons/goggles/textures/HUD/DivingGogglesCracked.paa diff --git a/TO_MERGE/agm/Goggles/textures/fx/dust/1.paa b/addons/goggles/textures/fx/dust/1.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/fx/dust/1.paa rename to addons/goggles/textures/fx/dust/1.paa diff --git a/TO_MERGE/agm/Goggles/textures/fx/dust/2.paa b/addons/goggles/textures/fx/dust/2.paa similarity index 100% rename from TO_MERGE/agm/Goggles/textures/fx/dust/2.paa rename to addons/goggles/textures/fx/dust/2.paa diff --git a/addons/grenades/README.md b/addons/grenades/README.md new file mode 100644 index 0000000000..c58ac19683 --- /dev/null +++ b/addons/grenades/README.md @@ -0,0 +1,12 @@ +ace_grenades +============ + +Introduces different throwing modes for grenades, as well as a flashbang and hand flares. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/gui/README.md b/addons/gui/README.md new file mode 100644 index 0000000000..a6fe74f6c2 --- /dev/null +++ b/addons/gui/README.md @@ -0,0 +1,11 @@ +ace_gui +======= + +to be scrapped. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/gui/UI/RscTitles.hpp b/addons/gui/UI/RscTitles.hpp index 93f422bc9f..02e68e8d32 100644 --- a/addons/gui/UI/RscTitles.hpp +++ b/addons/gui/UI/RscTitles.hpp @@ -176,76 +176,4 @@ class RscTitles { }; }; - class GVAR(ScreenEffectsBlack) { - duration = 10e10; - idd = 1111; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsBlack))), _this select 0)]); - - class controlsBackground { - class blackScreen: ACE_gui_backgroundBase { - text = QUOTE(PATHTOF(data\black_out.paa)); - colorText[] = {0.0, 0.0, 0.0, 0.0}; - idc = 11112; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class GVAR(ScreenEffectsBleeding) { - duration = 1; - idd = 1111; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsBleeding))), _this select 0)]); - - class controlsBackground { - class bleedingScreen: ACE_gui_backgroundBase { - text = QUOTE(PATHTOF(data\bleeding.paa)); - colorText[] = {0.9, 0.2, 0.2, 0.6}; - idc = 11113; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class GVAR(ScreenEffectsHit) { - duration = 1.1; - idd = 1111; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsHit))), _this select 0)]); - - class controlsBackground { - class effectHit: ACE_gui_backgroundBase { - text = QUOTE(PATHTOF(data\hit.paa)); - colorText[] = {0.7, 0.2, 0.2, 0.4}; - idc = 11113; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; - class GVAR(ScreenEffectsPain) { - duration = 1; - idd = 1111; - movingenable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsPain))), _this select 0)]); - - class controlsBackground { - class painScreen: ACE_gui_backgroundBase { - text = QUOTE(PATHTOF(data\painScreen.paa)); - colorText[] = {1, 1, 1, 0.5}; - idc = 11115; - x = safezoneX; - y = safezoneY; - w = safezoneW; - h = safezoneH; - }; - }; - }; }; \ No newline at end of file diff --git a/addons/gui/XEH_preInit.sqf b/addons/gui/XEH_preInit.sqf index b3de51cd9b..9c2bcf0909 100644 --- a/addons/gui/XEH_preInit.sqf +++ b/addons/gui/XEH_preInit.sqf @@ -17,9 +17,6 @@ PREP(displayInformation); PREP(displayMessage); PREP(blurScreen); PREP(displayIcon); -PREP(effectPain); -PREP(effectBleeding); -PREP(effectBlackOut); PREP(sendHintTo); PREP(sendMessageTo); PREP(sendDisplayInformationTo); diff --git a/addons/hearing/README.md b/addons/hearing/README.md new file mode 100644 index 0000000000..711a522559 --- /dev/null +++ b/addons/hearing/README.md @@ -0,0 +1,13 @@ +ace_hearing +=========== + +Introduces combat deafness. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 84ae62a01b..708146a89b 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -23,7 +23,7 @@ class CfgPatches { #include "CfgAmmo.hpp" class ACE_Options { - class Hearing_DisableEarRinging { + class GVAR(Hearing_DisableEarRinging) { displayName = "$STR_ACE_Hearing_DisableEarRinging"; default = 0; }; diff --git a/addons/interaction/README.md b/addons/interaction/README.md new file mode 100644 index 0000000000..92401b2547 --- /dev/null +++ b/addons/interaction/README.md @@ -0,0 +1,13 @@ +ace_interaction +=============== + +Provides interaction options between units. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 2e762156eb..bcc3f47def 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -10,6 +10,170 @@ GVAR(isOpeningDoor) = false; // restore global fire teams for JIP { - _team = _x getVariable [QGVAR(assignedFireTeam), ""]; - if (_team != "") then {_x assignTeam _team}; + _team = _x getVariable [QGVAR(assignedFireTeam), ""]; + if (_team != "") then {_x assignTeam _team}; } forEach allUnits; + + +// Add keybinds +["ACE3", + localize "STR_ACE_Interaction_InteractionMenu", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(isNull (findDisplay 1713999)) exitWith {false}; + + // Statement + call FUNC(onButtonDown); + true + }, + [219, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_InteractionMenu", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!isNull (findDisplay 1713999) && {profileNamespace getVariable [QGVAR(AutoCloseMenu), 0] > 0}) exitWith {false}; + + // Statement + if (GVAR(MenuType) mod 2 == 0) then {call FUNC(onButtonUp)}; + true + }, + [219, [false, false, false]], + false, + "keyup" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_InteractionMenuSelf", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming", "ACE_Common_notOnMap"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(isNull (findDisplay 1713999)) exitWith {false}; + + // Statement + call FUNC(onButtonDownSelf); + true + }, + [219, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_InteractionMenuSelf", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging", "ACE_Medical_canTreat", "ACE_Interaction_isNotEscorting", "ACE_Interaction_isNotSwimming"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!isNull (findDisplay 1713999) && {profileNamespace getVariable [QGVAR(AutoCloseMenu), 0] > 0}) exitWith {false}; + + // Statement + if (GVAR(MenuType) mod 2 == 1) then {call FUNC(onButtonUp)}; + true + }, + [219, [false, true, false]], + false, + "keyup" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_OpenDoor", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!GVAR(isOpeningDoor) && + {[2] call FUNC(getDoor) select 1 != ''} + ) exitWith {false}; + + // Statement + call EFUNC(interaction,openDoor); + true + }, + [57, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_OpenDoor", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(GVAR(isOpeningDoor)) exitWith {false}; + + // Statement + GVAR(isOpeningDoor) = false; + true + }, + [57, [false, true, false]], + false, + "keyup" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_TapShoulder", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; + + // Statement + [ACE_player, cursorTarget] call FUNC(tapShoulder); + true + }, + [20, [true, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_ModifierKey", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + + // Statement + ACE_Modifier = 1; + // Return false so it doesn't block other actions + false + }, + [29, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Interaction_ModifierKey", + { + // Conditions: canInteract + _exceptions = ["ACE_Drag_isNotDragging"]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + + // Statement + ACE_Modifier = 0; + // Return false so it doesn't block other actions + false + }, + [29, [false, false, false]], + false, + "keyup" +] call cba_fnc_registerKeybind; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 3b82fc60f4..acb41d362f 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -18,65 +18,6 @@ class CfgPatches { #include -class ACE_Default_Keys { - class openInteractionMenuNew { - displayName = "$STR_ACE_Interaction_InteractionMenu"; - condition = "true"; - statement = QUOTE(call FUNC(onButtonDown)); - conditionUp = QUOTE(!isNull (findDisplay 1713999) && {profileNamespace getVariable [ARR_2(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_ACE_Interaction_InteractionMenuSelf"; - condition = "true"; - statement = QUOTE(call FUNC(onButtonDownSelf)); - conditionUp = QUOTE(!isNull (findDisplay 1713999) && {profileNamespace getVariable [ARR_2(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_Common_notOnMap"}; - key = 219; - shift = 0; - control = 1; - alt = 0; - }; - class openDoor { - 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; - }; - class 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_ACE_Interaction_ModifierKey"; - condition = ""; - statement = QUOTE(ACE_Modifier = 1;); - conditionUp = ""; - statementUp = QUOTE(ACE_Modifier = 0;); - exceptions[] = {"ACE_Drag_isNotDragging"}; - key = 29; - shift = 0; - control = 0; - alt = 0; - }; -}; - class ACE_Options { class Interaction_FlowMenu { displayName = "$STR_ACE_Interaction_FlowMenu"; @@ -98,15 +39,15 @@ class ACE_Parameters_Boolean { class ACE_canInteractConditions { class GVAR(isNotEscorting) { - condition = QUOTE( !(_player getVariable ['ACE_isEscorting', false]) ); + condition = QUOTE( !(ACE_player getVariable [ARR_2('ACE_isEscorting', false)]) ); }; class GVAR(isNotCaptive) { - condition = QUOTE( !(_player getVariable ['ACE_isCaptive', false]) ); + condition = QUOTE( !(ACE_player getVariable [ARR_2('ACE_isCaptive', false)]) ); }; class GVAR(isNotSurrendering) { - condition = QUOTE( !(_player getVariable ['ACE_isSurrender', false]) ); + condition = QUOTE( !(ACE_player getVariable [ARR_2('ACE_isSurrender', false)]) ); }; class GVAR(isNotSwimming) { - condition = QUOTE( !underwater _player ); + condition = QUOTE( !underwater ACE_player ); }; }; diff --git a/addons/interaction/functions/fnc_initialiseInteraction.sqf b/addons/interaction/functions/fnc_initialiseInteraction.sqf index f0ca6e85e6..2637d28bf9 100644 --- a/addons/interaction/functions/fnc_initialiseInteraction.sqf +++ b/addons/interaction/functions/fnc_initialiseInteraction.sqf @@ -59,8 +59,8 @@ if (_this select 2) then { (findDisplay 46) createDisplay QGVAR(Dialog); // Add eventhandlers - (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))]; - (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))]; + /*(findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call EGVAR(common,onKeyDown))]; + (findDisplay 1713999) displayAddEventHandler ["KeyUp", QUOTE(_this call EGVAR(common,onKeyUp))];*/ (findDisplay 1713999) displayAddEventHandler ["KeyDown", QUOTE(_this call FUNC(menuKeyInput))]; }; diff --git a/addons/inventory/README.md b/addons/inventory/README.md new file mode 100644 index 0000000000..1e41aa4a8b --- /dev/null +++ b/addons/inventory/README.md @@ -0,0 +1,12 @@ +ace_inventory +============= + +Increases the size of the inventory dialog. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/kestrel/$PBOPREFIX$ b/addons/kestrel/$PBOPREFIX$ new file mode 100644 index 0000000000..ca3fac2e96 --- /dev/null +++ b/addons/kestrel/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\kestrel \ No newline at end of file diff --git a/addons/kestrel/CfgEventHandlers.hpp b/addons/kestrel/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/kestrel/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/kestrel/CfgVehicles.hpp b/addons/kestrel/CfgVehicles.hpp new file mode 100644 index 0000000000..906e3a9e22 --- /dev/null +++ b/addons/kestrel/CfgVehicles.hpp @@ -0,0 +1,53 @@ + +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ +} + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_OpenKestrel { + displayName = "$STR_ACE_Wind_OpenKestrel"; + condition = QUOTE('ACE_Kestrel' in items _player && {!GVAR(isKestrel)}); + statement = QUOTE(call FUNC(openKestrel)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(data\4500NV1.paa); + hotkey = "K"; + }; + class ACE_CloseKestrel { + displayName = "$STR_ACE_Wind_CloseKestrel"; + condition = QUOTE(GVAR(isKestrel)); + statement = QUOTE(call FUNC(closeKestrel)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(data\4500NV1.paa); + hotkey = "K"; + }; + }; + }; + + class Item_Base_F; + class ACE_Item_Kestrel: Item_Base_F { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; + scopeCurator = 2; + displayName = "$STR_ACE_Kestrel_Name"; + vehicleClass = "Items"; + class TransportItems { + class ACE_Kestrel { + name = "ACE_Kestrel"; + count = 1; + }; + }; + }; + + class Box_NATO_Support_F; + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_Kestrel,6); + }; + }; +}; diff --git a/addons/kestrel/CfgWeapons.hpp b/addons/kestrel/CfgWeapons.hpp new file mode 100644 index 0000000000..6db0e4b7d4 --- /dev/null +++ b/addons/kestrel/CfgWeapons.hpp @@ -0,0 +1,20 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_Kestrel: ACE_ItemCore { + author = "$STR_ACE_Common_ACETeam"; + scope = 2; + displayName = "$STR_ACE_Kestrel_Name"; + descriptionShort = "$STR_ACE_Kestrel_Description"; + model = PATHTOF(kestrel4500.p3d); + picture = PATHTOF(data\4500NV.paa); + icon = "iconObject_circle"; + mapSize = 0.034; + + class ItemInfo: InventoryItem_Base_F { + mass = 2; + }; + }; +}; diff --git a/addons/kestrel/README.md b/addons/kestrel/README.md new file mode 100644 index 0000000000..f5b91783c1 --- /dev/null +++ b/addons/kestrel/README.md @@ -0,0 +1,12 @@ +ace_kestrel +=========== + +Adds the Kestrel weather and wind meter. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/kestrel/RscTitles.hpp b/addons/kestrel/RscTitles.hpp new file mode 100644 index 0000000000..2530dbcda7 --- /dev/null +++ b/addons/kestrel/RscTitles.hpp @@ -0,0 +1,125 @@ + +class RscPicture; +class RscText; + +class RscTitles { + class ACE_Kestrel { + onload = QUOTE(_this call FUNC(onLoadKestrel)); + //onunload = ""; + idd = -1; + movingEnable = 0; + enableDisplay = 1; + duration = 1e+011; + fadein = 0; + fadeout = 0; + enablesimulation = 1; + + class controls { + // has to be first to be in the background + class Wheel: RscPicture { + idc = 3; + type = 0; + style = "48 + 0x800"; + text = ""; + x = "safeZoneX + 0.07"; + y = "safeZoneY + safeZoneH - 0.76"; + h = "0.15"; + w = "0.15"; + }; + + class Kestrel1: RscPicture { + idc = 1; + text = PATHTOF(data\4500NV1.paa); + style = "48 + 0x800"; + x = "safeZoneX - 0.25"; + y = "safeZoneY + safeZoneH - 0.8"; + h = "0.75"; + w = "0.75"; + }; + class Kestrel2: Kestrel1 { + idc = 2; + text = PATHTOF(data\4500NV2.paa); + colorText[] = {0,0,0,1-(sunOrMoon*sunOrMoon+(moonIntensity/5))}; + }; + + class HUD1: RscText { + idc = 11; + type = 0; + style = 1; + text = ""; + x = "safeZoneX + 0.08"; + y = "safeZoneY + safeZoneH - 0.51"; + h = "0.09"; + w = "0.108"; + shadow = 0; + font = "PuristaMedium"; + sizeEx = 0.04; + colorText[] = {0.0745,0.2196,0.1216,0.7}; + colorBackground[] = {0,0,0,0}; + lineSpacing = 1; + }; + class HUD2: HUD1 { + idc = 12; + y = "safeZoneY + safeZoneH - 0.48"; + }; + class HUD3: HUD1 { + idc = 13; + y = "safeZoneY + safeZoneH - 0.45"; + }; + class HUD4: HUD1 { + idc = 14; + y = "safeZoneY + safeZoneH - 0.418"; + }; + }; + }; + + // helper class to prevent flickering. Used together with preloadTitleRsc command. + class ACE_Kestrel_Preload { + idd = -1; + movingEnable = 0; + duration = 1e+011; + fadein = 0; + fadeout = 0; + class controls { + class Preload_0: RscPicture { + text = PATHTOF(data\kestrel_0.paa); + }; + class Preload_1: Preload_0 { + text = PATHTOF(data\kestrel_1.paa); + }; + class Preload_2: Preload_0 { + text = PATHTOF(data\kestrel_2.paa); + }; + class Preload_3: Preload_0 { + text = PATHTOF(data\kestrel_3.paa); + }; + class Preload_4: Preload_0 { + text = PATHTOF(data\kestrel_4.paa); + }; + class Preload_5: Preload_0 { + text = PATHTOF(data\kestrel_5.paa); + }; + class Preload_6: Preload_0 { + text = PATHTOF(data\kestrel_6.paa); + }; + class Preload_7: Preload_0 { + text = PATHTOF(data\kestrel_7.paa); + }; + class Preload_8: Preload_0 { + text = PATHTOF(data\kestrel_8.paa); + }; + class Preload_9: Preload_0 { + text = PATHTOF(data\kestrel_9.paa); + }; + /*class Preload_A: Preload_0 { + text = PATHTOF(data\4500NV.paa); + }; + class Preload_B: Preload_0 { + text = PATHTOF(data\4500NV1.paa); + }; + class Preload_C: Preload_0 { + text = PATHTOF(data\4500NV2.paa); + };*/ + }; + }; +}; diff --git a/addons/kestrel/XEH_preInit.sqf b/addons/kestrel/XEH_preInit.sqf new file mode 100644 index 0000000000..09d9b1a0ef --- /dev/null +++ b/addons/kestrel/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(onLoadKestrel); +PREP(openKestrel); +PREP(closeKestrel); + +GVAR(isKestrel) = false; + +ADDON = true; diff --git a/addons/kestrel/config.cpp b/addons/kestrel/config.cpp new file mode 100644 index 0000000000..61735f1697 --- /dev/null +++ b/addons/kestrel/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Item_Kestrel"}; + weapons[] = {"ACE_Kestrel"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_interaction"}; + author[] = {"Falke","commy2","KoffeinFlummi","CAA-Picard"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "RscTitles.hpp" diff --git a/addons/kestrel/data/4500NV.paa b/addons/kestrel/data/4500NV.paa new file mode 100644 index 0000000000..fd72433b9e Binary files /dev/null and b/addons/kestrel/data/4500NV.paa differ diff --git a/addons/kestrel/data/4500NV1.paa b/addons/kestrel/data/4500NV1.paa new file mode 100644 index 0000000000..9a29b346fb Binary files /dev/null and b/addons/kestrel/data/4500NV1.paa differ diff --git a/addons/kestrel/data/4500NV2.paa b/addons/kestrel/data/4500NV2.paa new file mode 100644 index 0000000000..992743a3a6 Binary files /dev/null and b/addons/kestrel/data/4500NV2.paa differ diff --git a/addons/kestrel/data/arrow1.paa b/addons/kestrel/data/arrow1.paa new file mode 100644 index 0000000000..8edb257ead Binary files /dev/null and b/addons/kestrel/data/arrow1.paa differ diff --git a/addons/kestrel/data/body.paa b/addons/kestrel/data/body.paa new file mode 100644 index 0000000000..bec55bb418 Binary files /dev/null and b/addons/kestrel/data/body.paa differ diff --git a/addons/kestrel/data/gpstemp.paa b/addons/kestrel/data/gpstemp.paa new file mode 100644 index 0000000000..ef45fe406c Binary files /dev/null and b/addons/kestrel/data/gpstemp.paa differ diff --git a/addons/kestrel/data/kestrel_0.paa b/addons/kestrel/data/kestrel_0.paa new file mode 100644 index 0000000000..190c25f100 Binary files /dev/null and b/addons/kestrel/data/kestrel_0.paa differ diff --git a/addons/kestrel/data/kestrel_1.paa b/addons/kestrel/data/kestrel_1.paa new file mode 100644 index 0000000000..fe757888e4 Binary files /dev/null and b/addons/kestrel/data/kestrel_1.paa differ diff --git a/addons/kestrel/data/kestrel_2.paa b/addons/kestrel/data/kestrel_2.paa new file mode 100644 index 0000000000..1b0fda0a65 Binary files /dev/null and b/addons/kestrel/data/kestrel_2.paa differ diff --git a/addons/kestrel/data/kestrel_3.paa b/addons/kestrel/data/kestrel_3.paa new file mode 100644 index 0000000000..659f4597a3 Binary files /dev/null and b/addons/kestrel/data/kestrel_3.paa differ diff --git a/addons/kestrel/data/kestrel_4.paa b/addons/kestrel/data/kestrel_4.paa new file mode 100644 index 0000000000..abb1ed6580 Binary files /dev/null and b/addons/kestrel/data/kestrel_4.paa differ diff --git a/addons/kestrel/data/kestrel_5.paa b/addons/kestrel/data/kestrel_5.paa new file mode 100644 index 0000000000..800ed80d8b Binary files /dev/null and b/addons/kestrel/data/kestrel_5.paa differ diff --git a/addons/kestrel/data/kestrel_6.paa b/addons/kestrel/data/kestrel_6.paa new file mode 100644 index 0000000000..784e441c21 Binary files /dev/null and b/addons/kestrel/data/kestrel_6.paa differ diff --git a/addons/kestrel/data/kestrel_7.paa b/addons/kestrel/data/kestrel_7.paa new file mode 100644 index 0000000000..9452286c2d Binary files /dev/null and b/addons/kestrel/data/kestrel_7.paa differ diff --git a/addons/kestrel/data/kestrel_8.paa b/addons/kestrel/data/kestrel_8.paa new file mode 100644 index 0000000000..31fe71ce84 Binary files /dev/null and b/addons/kestrel/data/kestrel_8.paa differ diff --git a/addons/kestrel/data/kestrel_9.paa b/addons/kestrel/data/kestrel_9.paa new file mode 100644 index 0000000000..978506ef5d Binary files /dev/null and b/addons/kestrel/data/kestrel_9.paa differ diff --git a/addons/kestrel/data/rad.paa b/addons/kestrel/data/rad.paa new file mode 100644 index 0000000000..13a3ffe6f7 Binary files /dev/null and b/addons/kestrel/data/rad.paa differ diff --git a/addons/kestrel/data/tasten.paa b/addons/kestrel/data/tasten.paa new file mode 100644 index 0000000000..8a140ec5f0 Binary files /dev/null and b/addons/kestrel/data/tasten.paa differ diff --git a/addons/kestrel/data/tasten1.paa b/addons/kestrel/data/tasten1.paa new file mode 100644 index 0000000000..af441a51de Binary files /dev/null and b/addons/kestrel/data/tasten1.paa differ diff --git a/addons/kestrel/functions/fnc_closeKestrel.sqf b/addons/kestrel/functions/fnc_closeKestrel.sqf new file mode 100644 index 0000000000..cfec327da6 --- /dev/null +++ b/addons/kestrel/functions/fnc_closeKestrel.sqf @@ -0,0 +1,6 @@ +// by commy2 +#include "script_component.hpp" + +GVAR(isKestrel) = false; + +(["ACE_Kestrel"] call BIS_fnc_rscLayer) cutText ["", "PLAIN", 0, false]; diff --git a/addons/kestrel/functions/fnc_onLoadKestrel.sqf b/addons/kestrel/functions/fnc_onLoadKestrel.sqf new file mode 100644 index 0000000000..cdfc325698 --- /dev/null +++ b/addons/kestrel/functions/fnc_onLoadKestrel.sqf @@ -0,0 +1,156 @@ +// by Falke, commy2 +#include "script_component.hpp" + +GVAR(windHead) = 0; +GVAR(wheelState) = 1; + +[{ + + // exit loop + if (!GVAR(isKestrel) || {!("ACE_Kestrel" in items ACE_player)}) exitWith { + call FUNC(closeKestrel); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + // get controls + private ["_dlgKestrel", "_ctrlKestrel1", "_ctrlKestrelWheel", "_ctrlKestrel2", "_ctrlHUD1", "_ctrlHUD2", "_ctrlHUD3", "_ctrlHUD4"]; + + disableSerialization; + _dlgKestrel = _this select 0; + _ctrlKestrel1 = _dlgKestrel displayCtrl 1; + _ctrlKestrel2 = _dlgKestrel displayCtrl 2; + _ctrlKestrelWheel = _dlgKestrel displayCtrl 3; + _ctrlHUD1 = _dlgKestrel displayCtrl 11; + _ctrlHUD2 = _dlgKestrel displayCtrl 12; + _ctrlHUD3 = _dlgKestrel displayCtrl 13; + _ctrlHUD4 = _dlgKestrel displayCtrl 14; + + // don't show the kestrel in gunner view + private "_show"; + _show = cameraView != "GUNNER"; + + _ctrlKestrel1 ctrlShow _show; + _ctrlKestrel2 ctrlShow _show; + _ctrlKestrelWheel ctrlShow _show; + _ctrlHUD1 ctrlShow _show; + _ctrlHUD2 ctrlShow _show; + _ctrlHUD3 ctrlShow _show; + _ctrlHUD4 ctrlShow _show; + + if !(_show) exitWith {}; + + // handle shown values + private ["_position", "_directon", "_windC", "_windD", "_windR", "_windB", "_windA"]; + + _position = eyePos ACE_player; + _directon = direction ACE_player; + + _windC = sqrt ((wind select 0) ^ 2 + (wind select 1) ^ 2); + _windD = (wind select 0) atan2 (wind select 1); + + _windR = _directon - _windD; + + if (_windR < 0) then { + _windR = _windR + 360; + }; + + _windB = _windC * sin _windR; + _windA = sqrt (_windC ^ 2 - _windB ^ 2); + + if (_windR < 90) then { + _windA = _windA - 2 * _windA; + }; + + if (_windR > 270) then { + _windA = _windA - 2 * _windA; + }; + + // in building + _intersects = 0; + if (lineIntersects [_position, _position vectorAdd [0, 0, 15]]) then {_intersects = _intersects + 1}; + + if (lineIntersects [_position, _position vectorAdd [- 15 * sin windDir, - 15 * cos windDir, 0]]) then {_intersects = _intersects + 1}; + if (lineIntersects [_position, _position vectorAdd [- 15 * sin (windDir - 90), - 15 * cos (windDir - 90), 0]]) then {_intersects = _intersects + 1}; + if (lineIntersects [_position, _position vectorAdd [- 15 * sin (windDir + 90), - 15 * cos (windDir + 90), 0]]) then {_intersects = _intersects + 1}; + if (lineIntersects [_position, _position vectorAdd [- 15 * sin (windDir + 180), - 15 * cos (windDir + 180), 0]]) then {_intersects = _intersects + 1}; + + if (_intersects > 3) then { + _windA = 99.99; + _windB = 99.99; + }; + + // in wind direction + _intersects = 0; + if (lineIntersects [_position, _position vectorAdd [- 5 * sin windDir, - 5 * cos windDir, 0]]) then {_intersects = _intersects + 1}; + if (lineIntersects [_position, _position vectorAdd [- 5 * sin (windDir - 15), - 5 * cos (windDir - 15), 0]]) then {_intersects = _intersects + 1}; + if (lineIntersects [_position, _position vectorAdd [- 5 * sin (windDir + 15), - 5 * cos (windDir + 15), 0]]) then {_intersects = _intersects + 1}; + + if (_intersects > 2) then { + _windA = 99.99; + _windB = 99.99; + }; + + if (ACE_player != vehicle ACE_player) then { + _windA = 99.99; + _windB = 99.99; + }; + + if (_windA == 99.99) then { + + GVAR(windHead) = 0; + + _windA = "0.00"; + _windB = "0.00"; + + } else { + + GVAR(windHead) = _windA; + + if (_windA < 0) then { + _windA = format ["-%1", [-1 * _windA, 1, 2] call CBA_fnc_formatNumber]; + } else { + _windA = format [ "%1", [ _windA, 1, 2] call CBA_fnc_formatNumber]; + }; + + if (_windB < 0) then { + _windB = format ["-%1", [-1 * _windB, 1, 2] call CBA_fnc_formatNumber]; + } else { + _windB = format [ "%1", [ _windB, 1, 2] call CBA_fnc_formatNumber]; + }; + + }; + + _directon = round _directon; + if (_directon == 360) then {_directon = 0}; + + _ctrlHUD1 ctrlSetText _windA; + _ctrlHUD2 ctrlSetText _windB; + _ctrlHUD3 ctrlSetText str _directon; + _ctrlHUD4 ctrlSetText str ((round (EGVAR(weather,currentTemperature) * 10)) / 10); + + // adjust kestrel picture in the dark + private "_brightness"; + _brightness = call EFUNC(common,ambientBrightness); + + _ctrlKestrel2 ctrlSetTextColor [0, 0, 0, 1 - _brightness]; + + // handle wheel + private ["_wheelState", "_wheelStateAdd"]; + + _wheelState = GVAR(wheelState); + _wheelStateAdd = ((round GVAR(windHead) * 2) min 5) max -5; + + _wheelState = _wheelState + _wheelStateAdd; + + if (_wheelState < 0) then {_wheelState = _wheelState + 9}; + if (_wheelState > 9) then {_wheelState = _wheelState - 9}; + + GVAR(wheelState) = _wheelState; + + if (preloadTitleRsc ["ACE_Kestrel_Preload", "PLAIN"]) then { + _ctrlKestrelWheel ctrlSetText format [QUOTE(PATHTOF(data\kestrel_%1.paa)), _wheelState]; + _ctrlKestrelWheel ctrlSetTextColor [_brightness, _brightness, _brightness, 1]; + }; + +}, 0.01, _this select 0] call CBA_fnc_addPerFrameHandler; diff --git a/addons/kestrel/functions/fnc_openKestrel.sqf b/addons/kestrel/functions/fnc_openKestrel.sqf new file mode 100644 index 0000000000..25ec9eba67 --- /dev/null +++ b/addons/kestrel/functions/fnc_openKestrel.sqf @@ -0,0 +1,6 @@ +// by commy2 +#include "script_component.hpp" + +GVAR(isKestrel) = true; + +(["ACE_Kestrel"] call BIS_fnc_rscLayer) cutRsc ["ACE_Kestrel", "PLAIN", 0, false]; diff --git a/addons/kestrel/functions/script_component.hpp b/addons/kestrel/functions/script_component.hpp new file mode 100644 index 0000000000..528b26affc --- /dev/null +++ b/addons/kestrel/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\kestrel\script_component.hpp" \ No newline at end of file diff --git a/addons/kestrel/kestrel4500.p3d b/addons/kestrel/kestrel4500.p3d new file mode 100644 index 0000000000..43cb6ce9d5 Binary files /dev/null and b/addons/kestrel/kestrel4500.p3d differ diff --git a/addons/kestrel/kestrel4500rad.p3d b/addons/kestrel/kestrel4500rad.p3d new file mode 100644 index 0000000000..7b2b62ccf5 Binary files /dev/null and b/addons/kestrel/kestrel4500rad.p3d differ diff --git a/addons/kestrel/script_component.hpp b/addons/kestrel/script_component.hpp new file mode 100644 index 0000000000..a38231c511 --- /dev/null +++ b/addons/kestrel/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT kestrel +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_KESTREL + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_KESTREL + #define DEBUG_SETTINGS DEBUG_ENABLED_KESTREL +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/kestrel/stringtable.xml b/addons/kestrel/stringtable.xml new file mode 100644 index 0000000000..5f54fd6489 --- /dev/null +++ b/addons/kestrel/stringtable.xml @@ -0,0 +1,64 @@ + + + + + + Approximate Temperature + Ungefähre Temperatur + Temperatura aproximada + Estimer la température + Przybliżona temperatura + Odhadovaná teplota + HÅ‘mérséklet nagyábol + ÐŸÑ€Ð¸Ð¼ÐµÑ€Ð½Ð°Ñ Ñ‚ÐµÐ¼Ð¿ÐµÑ€Ð°Ñ‚ÑƒÑ€Ð° + + + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + Kestrel 4500NV + + + Applied Ballistics Meter + Applied Ballistics Meter + Anemómetro balístico + Applied Ballistics Meter + UrzÄ…dzenie do monitorowania pogody + Zařízení pro měření vítru + Monitoraggio Balistico Attivo + Applied Ballistics Meter + Medidor Balístico Ativo + метеоÑÑ‚Ð°Ð½Ñ†Ð¸Ñ + + + Open Kestrel + Kestrel öffnen + Abrir Kestrel + Ouvrir Kestrel + Otwórz Kestrel + Otevřít Kestrel + Abrir Kestrel + Apri Kestrel + Kestrel bekapcsolása + Открыть Kestrel + + + Close Kestrel + Kestrel schließen + Cerrar Kestrel + Fermer Kestrel + Zamknij Kestrel + Zavřít Kestrel + Fechar Kestrel + Chiudi Kestrel + Kestrel kikapcsolása + Закрыть Kestrel + + + \ No newline at end of file diff --git a/addons/kestrel/ui/WindLight-01.paa b/addons/kestrel/ui/WindLight-01.paa new file mode 100644 index 0000000000..9865029c93 Binary files /dev/null and b/addons/kestrel/ui/WindLight-01.paa differ diff --git a/addons/kestrel/ui/WindLight-02.paa b/addons/kestrel/ui/WindLight-02.paa new file mode 100644 index 0000000000..a02147e6ee Binary files /dev/null and b/addons/kestrel/ui/WindLight-02.paa differ diff --git a/addons/kestrel/ui/WindLight-03.paa b/addons/kestrel/ui/WindLight-03.paa new file mode 100644 index 0000000000..340cfdcd6e Binary files /dev/null and b/addons/kestrel/ui/WindLight-03.paa differ diff --git a/addons/kestrel/ui/WindLight-04.paa b/addons/kestrel/ui/WindLight-04.paa new file mode 100644 index 0000000000..6d8404fb86 Binary files /dev/null and b/addons/kestrel/ui/WindLight-04.paa differ diff --git a/addons/kestrel/ui/WindLight-05.paa b/addons/kestrel/ui/WindLight-05.paa new file mode 100644 index 0000000000..2de5cdbd74 Binary files /dev/null and b/addons/kestrel/ui/WindLight-05.paa differ diff --git a/addons/kestrel/ui/WindLight-06.paa b/addons/kestrel/ui/WindLight-06.paa new file mode 100644 index 0000000000..c5e0a40af7 Binary files /dev/null and b/addons/kestrel/ui/WindLight-06.paa differ diff --git a/addons/kestrel/ui/WindLight-07.paa b/addons/kestrel/ui/WindLight-07.paa new file mode 100644 index 0000000000..4df57f7585 Binary files /dev/null and b/addons/kestrel/ui/WindLight-07.paa differ diff --git a/addons/kestrel/ui/WindLight-08.paa b/addons/kestrel/ui/WindLight-08.paa new file mode 100644 index 0000000000..8c5012502f Binary files /dev/null and b/addons/kestrel/ui/WindLight-08.paa differ diff --git a/addons/kestrel/ui/WindLight-09.paa b/addons/kestrel/ui/WindLight-09.paa new file mode 100644 index 0000000000..15173a56ab Binary files /dev/null and b/addons/kestrel/ui/WindLight-09.paa differ diff --git a/addons/kestrel/ui/WindLight-10.paa b/addons/kestrel/ui/WindLight-10.paa new file mode 100644 index 0000000000..83c860cecb Binary files /dev/null and b/addons/kestrel/ui/WindLight-10.paa differ diff --git a/addons/kestrel/ui/WindLight-11.paa b/addons/kestrel/ui/WindLight-11.paa new file mode 100644 index 0000000000..8beeb80d98 Binary files /dev/null and b/addons/kestrel/ui/WindLight-11.paa differ diff --git a/addons/kestrel/ui/WindLight-12.paa b/addons/kestrel/ui/WindLight-12.paa new file mode 100644 index 0000000000..d9a62f9e81 Binary files /dev/null and b/addons/kestrel/ui/WindLight-12.paa differ diff --git a/addons/kestrel/ui/WindLight-13.paa b/addons/kestrel/ui/WindLight-13.paa new file mode 100644 index 0000000000..87a8dfcca9 Binary files /dev/null and b/addons/kestrel/ui/WindLight-13.paa differ diff --git a/addons/kestrel/ui/WindLight-14.paa b/addons/kestrel/ui/WindLight-14.paa new file mode 100644 index 0000000000..f9200aaf2d Binary files /dev/null and b/addons/kestrel/ui/WindLight-14.paa differ diff --git a/addons/kestrel/ui/WindLight-15.paa b/addons/kestrel/ui/WindLight-15.paa new file mode 100644 index 0000000000..e3ee52d21e Binary files /dev/null and b/addons/kestrel/ui/WindLight-15.paa differ diff --git a/addons/kestrel/ui/WindLight-16.paa b/addons/kestrel/ui/WindLight-16.paa new file mode 100644 index 0000000000..9b835e62c4 Binary files /dev/null and b/addons/kestrel/ui/WindLight-16.paa differ diff --git a/addons/kestrel/ui/WindModerate-01.paa b/addons/kestrel/ui/WindModerate-01.paa new file mode 100644 index 0000000000..fd4d255c35 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-01.paa differ diff --git a/addons/kestrel/ui/WindModerate-02.paa b/addons/kestrel/ui/WindModerate-02.paa new file mode 100644 index 0000000000..db6e8dcebc Binary files /dev/null and b/addons/kestrel/ui/WindModerate-02.paa differ diff --git a/addons/kestrel/ui/WindModerate-03.paa b/addons/kestrel/ui/WindModerate-03.paa new file mode 100644 index 0000000000..300934ff37 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-03.paa differ diff --git a/addons/kestrel/ui/WindModerate-04.paa b/addons/kestrel/ui/WindModerate-04.paa new file mode 100644 index 0000000000..f7b8331dae Binary files /dev/null and b/addons/kestrel/ui/WindModerate-04.paa differ diff --git a/addons/kestrel/ui/WindModerate-05.paa b/addons/kestrel/ui/WindModerate-05.paa new file mode 100644 index 0000000000..a3b0a532ff Binary files /dev/null and b/addons/kestrel/ui/WindModerate-05.paa differ diff --git a/addons/kestrel/ui/WindModerate-06.paa b/addons/kestrel/ui/WindModerate-06.paa new file mode 100644 index 0000000000..495ec6bc15 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-06.paa differ diff --git a/addons/kestrel/ui/WindModerate-07.paa b/addons/kestrel/ui/WindModerate-07.paa new file mode 100644 index 0000000000..d0471a4c4f Binary files /dev/null and b/addons/kestrel/ui/WindModerate-07.paa differ diff --git a/addons/kestrel/ui/WindModerate-08.paa b/addons/kestrel/ui/WindModerate-08.paa new file mode 100644 index 0000000000..967e9d8ef7 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-08.paa differ diff --git a/addons/kestrel/ui/WindModerate-09.paa b/addons/kestrel/ui/WindModerate-09.paa new file mode 100644 index 0000000000..54ef3eabf9 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-09.paa differ diff --git a/addons/kestrel/ui/WindModerate-10.paa b/addons/kestrel/ui/WindModerate-10.paa new file mode 100644 index 0000000000..e7608c2e02 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-10.paa differ diff --git a/addons/kestrel/ui/WindModerate-11.paa b/addons/kestrel/ui/WindModerate-11.paa new file mode 100644 index 0000000000..6d1ce9418e Binary files /dev/null and b/addons/kestrel/ui/WindModerate-11.paa differ diff --git a/addons/kestrel/ui/WindModerate-12.paa b/addons/kestrel/ui/WindModerate-12.paa new file mode 100644 index 0000000000..2b853dca89 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-12.paa differ diff --git a/addons/kestrel/ui/WindModerate-13.paa b/addons/kestrel/ui/WindModerate-13.paa new file mode 100644 index 0000000000..56443ab4f9 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-13.paa differ diff --git a/addons/kestrel/ui/WindModerate-14.paa b/addons/kestrel/ui/WindModerate-14.paa new file mode 100644 index 0000000000..06cb4610fb Binary files /dev/null and b/addons/kestrel/ui/WindModerate-14.paa differ diff --git a/addons/kestrel/ui/WindModerate-15.paa b/addons/kestrel/ui/WindModerate-15.paa new file mode 100644 index 0000000000..5f548b6ac9 Binary files /dev/null and b/addons/kestrel/ui/WindModerate-15.paa differ diff --git a/addons/kestrel/ui/WindModerate-16.paa b/addons/kestrel/ui/WindModerate-16.paa new file mode 100644 index 0000000000..617e83193d Binary files /dev/null and b/addons/kestrel/ui/WindModerate-16.paa differ diff --git a/addons/kestrel/ui/WindStrong-01.paa b/addons/kestrel/ui/WindStrong-01.paa new file mode 100644 index 0000000000..87c2db663c Binary files /dev/null and b/addons/kestrel/ui/WindStrong-01.paa differ diff --git a/addons/kestrel/ui/WindStrong-02.paa b/addons/kestrel/ui/WindStrong-02.paa new file mode 100644 index 0000000000..8d29483635 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-02.paa differ diff --git a/addons/kestrel/ui/WindStrong-03.paa b/addons/kestrel/ui/WindStrong-03.paa new file mode 100644 index 0000000000..fc08f14e1b Binary files /dev/null and b/addons/kestrel/ui/WindStrong-03.paa differ diff --git a/addons/kestrel/ui/WindStrong-04.paa b/addons/kestrel/ui/WindStrong-04.paa new file mode 100644 index 0000000000..3fbbd70302 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-04.paa differ diff --git a/addons/kestrel/ui/WindStrong-05.paa b/addons/kestrel/ui/WindStrong-05.paa new file mode 100644 index 0000000000..2254b0d545 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-05.paa differ diff --git a/addons/kestrel/ui/WindStrong-06.paa b/addons/kestrel/ui/WindStrong-06.paa new file mode 100644 index 0000000000..6054696d61 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-06.paa differ diff --git a/addons/kestrel/ui/WindStrong-07.paa b/addons/kestrel/ui/WindStrong-07.paa new file mode 100644 index 0000000000..d62308dfc9 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-07.paa differ diff --git a/addons/kestrel/ui/WindStrong-08.paa b/addons/kestrel/ui/WindStrong-08.paa new file mode 100644 index 0000000000..cce04ab099 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-08.paa differ diff --git a/addons/kestrel/ui/WindStrong-09.paa b/addons/kestrel/ui/WindStrong-09.paa new file mode 100644 index 0000000000..e2c53aec6f Binary files /dev/null and b/addons/kestrel/ui/WindStrong-09.paa differ diff --git a/addons/kestrel/ui/WindStrong-10.paa b/addons/kestrel/ui/WindStrong-10.paa new file mode 100644 index 0000000000..609b54096a Binary files /dev/null and b/addons/kestrel/ui/WindStrong-10.paa differ diff --git a/addons/kestrel/ui/WindStrong-11.paa b/addons/kestrel/ui/WindStrong-11.paa new file mode 100644 index 0000000000..705cc5bd10 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-11.paa differ diff --git a/addons/kestrel/ui/WindStrong-12.paa b/addons/kestrel/ui/WindStrong-12.paa new file mode 100644 index 0000000000..d8d585d6eb Binary files /dev/null and b/addons/kestrel/ui/WindStrong-12.paa differ diff --git a/addons/kestrel/ui/WindStrong-13.paa b/addons/kestrel/ui/WindStrong-13.paa new file mode 100644 index 0000000000..d903c832ab Binary files /dev/null and b/addons/kestrel/ui/WindStrong-13.paa differ diff --git a/addons/kestrel/ui/WindStrong-14.paa b/addons/kestrel/ui/WindStrong-14.paa new file mode 100644 index 0000000000..91153a801b Binary files /dev/null and b/addons/kestrel/ui/WindStrong-14.paa differ diff --git a/addons/kestrel/ui/WindStrong-15.paa b/addons/kestrel/ui/WindStrong-15.paa new file mode 100644 index 0000000000..d0a34d79e4 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-15.paa differ diff --git a/addons/kestrel/ui/WindStrong-16.paa b/addons/kestrel/ui/WindStrong-16.paa new file mode 100644 index 0000000000..1be25039e4 Binary files /dev/null and b/addons/kestrel/ui/WindStrong-16.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-01.paa b/addons/kestrel/ui/WindVeryLight-01.paa new file mode 100644 index 0000000000..561e52ec88 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-01.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-02.paa b/addons/kestrel/ui/WindVeryLight-02.paa new file mode 100644 index 0000000000..fbce91664a Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-02.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-03.paa b/addons/kestrel/ui/WindVeryLight-03.paa new file mode 100644 index 0000000000..f20ced9770 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-03.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-04.paa b/addons/kestrel/ui/WindVeryLight-04.paa new file mode 100644 index 0000000000..6b104848da Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-04.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-05.paa b/addons/kestrel/ui/WindVeryLight-05.paa new file mode 100644 index 0000000000..f8e30a0c64 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-05.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-06.paa b/addons/kestrel/ui/WindVeryLight-06.paa new file mode 100644 index 0000000000..3a11d94cba Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-06.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-07.paa b/addons/kestrel/ui/WindVeryLight-07.paa new file mode 100644 index 0000000000..b956cb478b Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-07.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-08.paa b/addons/kestrel/ui/WindVeryLight-08.paa new file mode 100644 index 0000000000..090f630d8f Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-08.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-09.paa b/addons/kestrel/ui/WindVeryLight-09.paa new file mode 100644 index 0000000000..d8b8b7eff1 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-09.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-10.paa b/addons/kestrel/ui/WindVeryLight-10.paa new file mode 100644 index 0000000000..0151ad3779 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-10.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-11.paa b/addons/kestrel/ui/WindVeryLight-11.paa new file mode 100644 index 0000000000..241980a1e0 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-11.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-12.paa b/addons/kestrel/ui/WindVeryLight-12.paa new file mode 100644 index 0000000000..adcaf136fa Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-12.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-13.paa b/addons/kestrel/ui/WindVeryLight-13.paa new file mode 100644 index 0000000000..d381f0cc9e Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-13.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-14.paa b/addons/kestrel/ui/WindVeryLight-14.paa new file mode 100644 index 0000000000..0e77f697e2 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-14.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-15.paa b/addons/kestrel/ui/WindVeryLight-15.paa new file mode 100644 index 0000000000..ad283a4d76 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-15.paa differ diff --git a/addons/kestrel/ui/WindVeryLight-16.paa b/addons/kestrel/ui/WindVeryLight-16.paa new file mode 100644 index 0000000000..b7ae70a989 Binary files /dev/null and b/addons/kestrel/ui/WindVeryLight-16.paa differ diff --git a/addons/kestrel/ui/noWind.paa b/addons/kestrel/ui/noWind.paa new file mode 100644 index 0000000000..8fa262c286 Binary files /dev/null and b/addons/kestrel/ui/noWind.paa differ diff --git a/addons/laser/README.md b/addons/laser/README.md new file mode 100644 index 0000000000..acd112e233 --- /dev/null +++ b/addons/laser/README.md @@ -0,0 +1,12 @@ +ace_laser +========= + +Contains various functions necessary for the realitic protrayal of laser mechanics in other components. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [walterpearce](https://github.com/walterpearce) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/laser_selfdesignate/$PBOPREFIX$ b/addons/laser_selfdesignate/$PBOPREFIX$ new file mode 100644 index 0000000000..3871f5df99 --- /dev/null +++ b/addons/laser_selfdesignate/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\laser_selfdesignate \ No newline at end of file diff --git a/addons/laser_selfdesignate/CfgEventhandlers.hpp b/addons/laser_selfdesignate/CfgEventhandlers.hpp new file mode 100644 index 0000000000..27cc988813 --- /dev/null +++ b/addons/laser_selfdesignate/CfgEventhandlers.hpp @@ -0,0 +1,27 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_pre_init)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_post_init)); + }; +}; + +class Extended_GetIn_EventHandlers { + class B_Heli_Attack_01_F { + class ADDON { + getIn = QUOTE(call FUNC(onGetin)); + }; + } +}; + +class Extended_GetOut_EventHandlers { + class B_Heli_Attack_01_F { + class ADDON { + getOut = QUOTE(call FUNC(onGetout)); + }; + }; +}; diff --git a/addons/laser_selfdesignate/CfgUI.hpp b/addons/laser_selfdesignate/CfgUI.hpp new file mode 100644 index 0000000000..11fab908d7 --- /dev/null +++ b/addons/laser_selfdesignate/CfgUI.hpp @@ -0,0 +1,32 @@ +class RscPicture; +class RscText; +class RscControlsGroupNoScrollbars; +/* This disables air radar. We need to make this a seperate HUD addon +class RscInGameUI +{ + class RscUnitInfo + { + class CA_Radar: RscControlsGroupNoScrollbars + { + class controls + { + class CA_RadarBackground: RscPicture { + colorText[] = {0,0,0,0}; + text = ""; + }; + class CA_RadarIcon: RscPicture { + colorText[] = {0,0,0,0}; + }; + class CA_Heading: RscText { + colorText[] = {0,0,0,0}; + }; + }; + }; + }; +}; +class CfgInGameUI +{ + +}; + +*/ \ No newline at end of file diff --git a/addons/laser_selfdesignate/CfgVehicles.hpp b/addons/laser_selfdesignate/CfgVehicles.hpp new file mode 100644 index 0000000000..eed000544c --- /dev/null +++ b/addons/laser_selfdesignate/CfgVehicles.hpp @@ -0,0 +1,35 @@ +class CfgVehicles { + class AllVehicles; + + class Air: AllVehicles { + class Turrets; + }; + class Helicopter: Air + { + class Turrets: Turrets { + class MainTurret; + }; + // TODO: move these to a different HUD addon + // commanderCanSee = 2+32; + // gunnerCanSee = 2+32; + // driverCanSee = 2+32; + + }; + class Helicopter_Base_F: Helicopter { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class Heli_Attack_01_base_F: Helicopter_Base_F { + class Turrets: Turrets { + class MainTurret: MainTurret {}; + }; + }; + class B_Heli_Attack_01_F: Heli_Attack_01_base_F { + class Turrets: Turrets { + class MainTurret: MainTurret { + stabilizedInAxes = 4; // This stablizes the turret a bit more for laser designation + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/laser_selfdesignate/CfgWeapons.hpp b/addons/laser_selfdesignate/CfgWeapons.hpp new file mode 100644 index 0000000000..a966144b10 --- /dev/null +++ b/addons/laser_selfdesignate/CfgWeapons.hpp @@ -0,0 +1,10 @@ +class CfgWeapons { + class LauncherCore; + + class RocketPods: LauncherCore { + canLock = 1; // Disable locking unless newb mode + }; + class missiles_DAGR: RocketPods { + canLock = 1; // Disable locking unless newb mode + }; +}; \ No newline at end of file diff --git a/addons/laser_selfdesignate/README.md b/addons/laser_selfdesignate/README.md new file mode 100644 index 0000000000..75b3d2753b --- /dev/null +++ b/addons/laser_selfdesignate/README.md @@ -0,0 +1,12 @@ +ace_laser_selfdesignate +======================= + +Allows gunners to lase their own targets. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [walterpearce](https://github.com/walterpearce) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/laser_selfdesignate/XEH_post_init.sqf b/addons/laser_selfdesignate/XEH_post_init.sqf new file mode 100644 index 0000000000..6904ee6c47 --- /dev/null +++ b/addons/laser_selfdesignate/XEH_post_init.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" +NO_DEDICATED; + diff --git a/addons/laser_selfdesignate/XEH_pre_init.sqf b/addons/laser_selfdesignate/XEH_pre_init.sqf new file mode 100644 index 0000000000..4e98fce7ec --- /dev/null +++ b/addons/laser_selfdesignate/XEH_pre_init.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +PREP(onGetIn); +PREP(onGetOut); + +PREP(laserHudDesignateOn); +PREP(laserHudDesignateOff); + +GVAR(laser) = nil; +GVAR(laserActive) = false; + +FUNC(getPosASL) = {visiblePositionASL (_this select 0)}; \ No newline at end of file diff --git a/addons/laser_selfdesignate/config.cpp b/addons/laser_selfdesignate/config.cpp new file mode 100644 index 0000000000..5452ee4e22 --- /dev/null +++ b/addons/laser_selfdesignate/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_main", "ace_laser" }; + version = VERSION; + }; +}; + +#include "CfgUI.hpp" + +#include "CfgEventhandlers.hpp" +#include "CfgWeapons.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf new file mode 100644 index 0000000000..088f3d9303 --- /dev/null +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOff.sqf @@ -0,0 +1,20 @@ +#include "script_component.hpp" + +if(isNil QGVAR(laser)) exitWith { + false +}; +if(!local GVAR(laser)) then { + false +}; + +_handle = GVAR(laser) getVariable ["ACE_PFH_HANDLE", nil]; +if(!isNil "_handle") then { + [_handle] call cba_fnc_removePerFrameHandler; +}; + +REM(ACE_LASERS, GVAR(laser)); +deleteVehicle GVAR(laser); +GVAR(laser) = nil; +GVAR(laserActive) = false; + +true \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf new file mode 100644 index 0000000000..bac440c853 --- /dev/null +++ b/addons/laser_selfdesignate/functions/fnc_laserHudDesignateOn.sqf @@ -0,0 +1,90 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +TRACE_1("enter", _this); + +FUNC(magnitude) = { + _this distance [0, 0, 0] +}; + +FUNC(mat_normalize3d) = { + private ["_mag"]; + PARAMS_3(_vx,_vy,_vz); + + _mag = _this call FUNC(magnitude); + if (_mag == 0) then {_mag = 1}; + [(_vx/_mag), (_vy/_mag), (_vz/_mag)] +}; + +FUNC(laserHudDesignatePFH) = { + _args = _this select 0; + _laserTarget = _args select 0; + _shooter = _args select 1; + + _vehicle = vehicle _shooter; + _weapon = currentWeapon _vehicle; + + if(!alive _shooter || isNull _vehicle || isNull _laserTarget || !GVAR(laserActive) ) exitWith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + // Retrieve the gunner and turret memory point information + _gunnerInfo = [_vehicle, _weapon] call CBA_fnc_getFirer; + + _turret = [_vehicle, _gunnerInfo select 1] call CBA_fnc_getTurret; + _pov = getText (_turret >> "memoryPointGunnerOptics"); + _gunBeg = getText (_turret >> "gunBeg"); + _gunEnd = getText (_turret >> "gunEnd"); + TRACE_3("", _pov, _gunBeg, _gunEnd); + + // Pull the PIP pov or barrel direction, depending on how the model is set up + _povPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _pov ) ); + _povDir = [0,0,0]; + if(_pov == "pip0_pos") then { + _pipDir = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition "pip0_dir" ) ); + _povDir = [_povPos, _pipDir] call BIS_fnc_vectorDiff; + } else { + _gunBeginPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunBeg ) ); + _gunEndPos = ATLtoASL ( _vehicle modelToWorld (_vehicle selectionPosition _gunEnd ) ); + _povDir = [_gunEndPos, _gunBeginPos] call BIS_fnc_vectorDiff; + }; + + TRACE_4("", _povDir, _povPos, _gunBeginPos, _gunEndPos); + + _result = [_povPos, _povDir] call EFUNC(laser,shootCone); + + if((count _result) > 0) then { + _resultPositions = _result select 2; + + if((count _resultPositions) > 0) then { + _firstResult = _resultPositions select 0; + _pos = _firstResult select 0; + + // If the laser has moved less than a half meter, then dont move it. + // Just regular use of lasers will commonly make them move this much, + // but not across multiple close frames. + // This loses accuracy a little, but saves position updates per frame. + //if( ((getPosASL _laserTarget) distance _pos) > 0.5) then { + _laserTarget setPosATL (ASLToATL _pos); + //}; +#ifdef DEBUG_MODE_FULL + drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLToATL _pos, 0.75, 0.75, 0, "", 0.5, 0.025, "TahomaB"]; +#endif + }; + }; +}; + +if(isNil QGVAR(laser)) then { + _laserTarget = "LaserTarget" createVehicle (getpos player); + + GVAR(laserActive) = true; + + _handle = [FUNC(laserHudDesignatePFH), 0, [_laserTarget, player]] call cba_fnc_addPerFrameHandler; + _laserTarget setVariable ["ACE_PFH_HANDLE", _handle, false]; + + GVAR(laser) = _laserTarget; +} else { + [] call FUNC(laserHudDesignateOff); + [] call FUNC(laserHudDesignateOn); +}; + diff --git a/addons/laser_selfdesignate/functions/fnc_onGetin.sqf b/addons/laser_selfdesignate/functions/fnc_onGetin.sqf new file mode 100644 index 0000000000..d6f555c02f --- /dev/null +++ b/addons/laser_selfdesignate/functions/fnc_onGetin.sqf @@ -0,0 +1,13 @@ +#define DEBUG_MODE_FULL +#include "script_component.hpp" +// TODO: we should do this differently eventually +private["_onActionId", "_offActionId"]; +TRACE_1("ENTER", _this); + +// TODO: THIS SHOULD NOT BE ACTIONS EVENTUALLY + +_onActionId = player addAction ["Laser Designator On", { _this call FUNC(laserHudDesignateOn) }, [], 1, false, false, "", QUOTE( (gunner (vehicle player)) == player && !GVAR(laserActive))]; +player setVariable[QGVAR(onActionId), _onActionId, false]; + +_offActionId = player addAction ["Laser Designator Off", { _this call FUNC(laserHudDesignateOff) }, [], 1, false, false, "", QUOTE( (gunner (vehicle player)) == player && GVAR(laserActive))]; +player setVariable[QGVAR(offActionId), _offActionId, false]; \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/fnc_onGetout.sqf b/addons/laser_selfdesignate/functions/fnc_onGetout.sqf new file mode 100644 index 0000000000..2a32403c19 --- /dev/null +++ b/addons/laser_selfdesignate/functions/fnc_onGetout.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +_onActionId = player getVariable[QGVAR(onActionId), -1]; +_offActionId = player getVariable[QGVAR(offActionId), -1]; + +player removeAction _onActionId; +player removeAction _offActionId; + +player setVariable[QGVAR(onActionId), -1, false]; +player setVariable[QGVAR(offActionId), -1, false]; \ No newline at end of file diff --git a/addons/laser_selfdesignate/functions/script_component.hpp b/addons/laser_selfdesignate/functions/script_component.hpp new file mode 100644 index 0000000000..38c6d2c44b --- /dev/null +++ b/addons/laser_selfdesignate/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\Addons\laser_selfdesignate\script_component.hpp" diff --git a/addons/laser_selfdesignate/script_component.hpp b/addons/laser_selfdesignate/script_component.hpp new file mode 100644 index 0000000000..c9742423df --- /dev/null +++ b/addons/laser_selfdesignate/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT laser_selfdesignate +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_LASER_SELFDESIGNATE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_LASER_SELFDESIGNATE + #define DEBUG_SETTINGS DEBUG_SETTINGS_LASER_SELFDESIGNATE +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/laserpointer/README.md b/addons/laserpointer/README.md new file mode 100644 index 0000000000..f4e711513b --- /dev/null +++ b/addons/laserpointer/README.md @@ -0,0 +1,12 @@ +ace_laserpointer +================ + +Adds a laser pointer visible during the day. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/lockbackpacks/README.md b/addons/lockbackpacks/README.md new file mode 100644 index 0000000000..9c721428b1 --- /dev/null +++ b/addons/lockbackpacks/README.md @@ -0,0 +1,12 @@ +ace_lockbackpacks +================= + +Introduces the ability to lock one's backpack. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/magazinerepack/README.md b/addons/magazinerepack/README.md new file mode 100644 index 0000000000..49a3c9d531 --- /dev/null +++ b/addons/magazinerepack/README.md @@ -0,0 +1,12 @@ +ace_magazinerepack +================== + +Adds the ability to consolidate multiple half-empty magazines. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/magazines/$PBOPREFIX$ b/addons/magazines/$PBOPREFIX$ new file mode 100644 index 0000000000..dee71053cc --- /dev/null +++ b/addons/magazines/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\magazines \ No newline at end of file diff --git a/addons/magazines/CfgAmmo.hpp b/addons/magazines/CfgAmmo.hpp new file mode 100644 index 0000000000..2e1e9fceea --- /dev/null +++ b/addons/magazines/CfgAmmo.hpp @@ -0,0 +1,110 @@ + +class CfgAmmo { + + /* 6.5x39mm Grendel */ + + // IR Dim + class B_65x39_Caseless_yellow; + class ACE_B_65x39_Caseless_Tracer_Dim: B_65x39_Caseless_yellow { + nvgOnly = 1; + }; + + class B_65x39_Case_yellow; + class ACE_B_65x39_Case_Tracer_Dim: B_65x39_Case_yellow { + nvgOnly = 1; + }; + + // sub sonic + class B_65x39_Caseless; + class ACE_B_65x39_Caseless_SD: B_65x39_Caseless { + airFriction = -0.00054; + hit = 8.75; + supersonicCrackFar[] = {}; + supersonicCrackNear[] = {}; + typicalSpeed = 320; + audibleFire = 0.8; + visibleFire = 2.5; + }; + + class B_65x39_Case; + class ACE_B_65x39_Case_SD: B_65x39_Case { + airFriction = -0.00054; + hit = 8.75; + supersonicCrackFar[] = {}; + supersonicCrackNear[] = {}; + typicalSpeed = 320; + audibleFire = 0.8; + visibleFire = 2.5; + }; + + // armor piercing + class ACE_B_65x39_Caseless_AP: B_65x39_Caseless { + caliber = 1.8; + hit = 10.5; + }; + + class ACE_B_65x39_Case_AP: B_65x39_Case { + caliber = 1.8; + hit = 10.5; + }; + + + /* 5.56x45mm NATO */ + + // IR Dim + class B_556x45_Ball_Tracer_Red; + class ACE_B_556x45_Ball_Tracer_Dim: B_556x45_Ball_Tracer_Red { + nvgOnly = 1; + }; + + // sub sonic + class B_556x45_Ball; + class ACE_B_556x45_Ball_SD: B_556x45_Ball { + airFriction = -0.0006; + hit = 7; + supersonicCrackFar[] = {}; + supersonicCrackNear[] = {}; + typicalSpeed = 320; + audibleFire = 0.6; + visibleFire = 2.0; + }; + + // armor piercing + class ACE_B_556x45_Ball_AP: B_556x45_Ball { + caliber = 1.4; + hit = 8.4; + }; + + + /* 7.62x51mm NATO */ + + // IR Dim + class B_762x51_Tracer_Red; + class ACE_B_762x51_Tracer_Dim: B_762x51_Tracer_Red { + nvgOnly = 1; + }; + + // sub sonic + class B_762x51_Ball; + class ACE_B_762x51_Ball_SD: B_762x51_Ball { + airFriction = -0.00048; + hit = 10.5; + supersonicCrackFar[] = {}; + supersonicCrackNear[] = {}; + typicalSpeed = 320; + audibleFire = 0.9; + visibleFire = 3.0; + }; + + // armor piercing + class ACE_B_762x51_Ball_AP: B_762x51_Ball { + caliber = 2.4; + hit = 12.6; + }; + + // M118 LR + class ACE_B_762x51_M118LR: B_762x51_Ball { + //typicalspeed = 792; + //airfriction = -0.0008577; + }; +}; diff --git a/addons/magazines/CfgMagazines.hpp b/addons/magazines/CfgMagazines.hpp new file mode 100644 index 0000000000..86cb6d9e1b --- /dev/null +++ b/addons/magazines/CfgMagazines.hpp @@ -0,0 +1,139 @@ + +class CfgMagazines { + + /* 6.5x39mm Grendel - MX */ + + class 30Rnd_65x39_caseless_mag_Tracer; + class ACE_30Rnd_65x39_caseless_mag_Tracer_Dim: 30Rnd_65x39_caseless_mag_Tracer { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_65x39_Caseless_Tracer_Dim"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_Tracer_DimDescription"; + picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_yellow_CA.paa"; + }; + + class 30Rnd_65x39_caseless_mag; + class ACE_30Rnd_65x39_caseless_mag_SD: 30Rnd_65x39_caseless_mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_65x39_Caseless_SD"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_SDName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_SDDescription"; + picture = "\A3\weapons_f\data\ui\m_30stanag_caseless_green_CA.paa"; + initSpeed = 320; + }; + + class ACE_30Rnd_65x39_caseless_mag_AP: 30Rnd_65x39_caseless_mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_65x39_Caseless_AP"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_mag_APName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_mag_APNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_mag_APDescription"; + }; + + + /* 6.5x39mm Grendel - Katiba */ + + class 100Rnd_65x39_caseless_mag; + class 200Rnd_65x39_cased_Box: 100Rnd_65x39_caseless_mag { + initSpeed = 691; + }; + + class 30Rnd_65x39_caseless_green_mag_Tracer; + class ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim: 30Rnd_65x39_caseless_green_mag_Tracer { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_65x39_Caseless_Tracer_Dim"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_Tracer_DimDescription"; + }; + + class 30Rnd_65x39_caseless_green; + class ACE_30Rnd_65x39_caseless_green_mag_SD: 30Rnd_65x39_caseless_green { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_65x39_Caseless_SD"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_SDDescription"; + initSpeed = 320; + }; + + class ACE_30Rnd_65x39_caseless_green_mag_AP: 30Rnd_65x39_caseless_green { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_65x39_Caseless_AP"; + displayName = "$STR_ACE_30Rnd_65x39_caseless_green_mag_APName"; + displayNameShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_APNameShort"; + descriptionShort = "$STR_ACE_30Rnd_65x39_caseless_green_mag_APDescription"; + }; + + + /* 5.56x45mm NATO */ + + class 30Rnd_556x45_Stanag_Tracer_Red; //picture = "\A3\weapons_f\data\ui\m_30stanag_red_ca.paa"; + class ACE_30Rnd_556x45_Stanag_Tracer_Dim: 30Rnd_556x45_Stanag_Tracer_Red { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_556x45_Ball_Tracer_Dim"; + displayName = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_mag_Tracer_DimDescription"; + picture = "\A3\weapons_f\data\ui\m_30stanag_yellow_ca.paa"; + }; + + class 30Rnd_556x45_Stanag; + class ACE_30Rnd_556x45_Stanag_SD: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_556x45_Ball_SD"; + displayName = "$STR_ACE_30Rnd_556x45_mag_SDName"; + displayNameShort = "$STR_ACE_30Rnd_556x45_mag_SDNameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_mag_SDDescription"; + initSpeed = 320; + picture = "\A3\weapons_f\data\ui\m_30stanag_green_ca.paa"; + }; + + class ACE_30Rnd_556x45_Stanag_AP: 30Rnd_556x45_Stanag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_556x45_Ball_AP"; + displayName = "$STR_ACE_30Rnd_556x45_mag_APName"; + displayNameShort = "$STR_ACE_30Rnd_556x45_mag_APNameShort"; + descriptionShort = "$STR_ACE_30Rnd_556x45_mag_APDescription"; + }; + + + /* 7.62x51mm NATO */ + + class 20Rnd_762x51_Mag; + class ACE_20Rnd_762x51_Mag_Tracer: 20Rnd_762x51_Mag { //@todo Green tracers for opfor and yellow tracers for independent + author = "$STR_ACE_Common_ACETeam"; + ammo = "B_762x51_Tracer_Red"; + displayName = "$STR_ACE_20Rnd_762x51_mag_TracerName"; + displayNameShort = "$STR_ACE_20Rnd_762x51_mag_TracerNameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_mag_TracerDescription"; + tracersEvery = 1; + }; + + class ACE_20Rnd_762x51_Mag_Tracer_Dim: ACE_20Rnd_762x51_Mag_Tracer { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_762x51_Tracer_Dim"; + displayName = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimName"; + displayNameShort = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimNameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_mag_Tracer_DimDescription"; + }; + + class ACE_20Rnd_762x51_Mag_SD: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_762x51_Ball_SD"; + displayName = "$STR_ACE_20Rnd_762x51_mag_SDName"; + displayNameShort = "$STR_ACE_20Rnd_762x51_mag_SDNameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_mag_SDDescription"; + initSpeed = 320; + }; + + class ACE_20Rnd_762x51_Mag_AP: 20Rnd_762x51_Mag { + author = "$STR_ACE_Common_ACETeam"; + ammo = "ACE_B_762x51_Ball_AP"; + displayName = "$STR_ACE_20Rnd_762x51_mag_APName"; + displayNameShort = "$STR_ACE_20Rnd_762x51_mag_APNameShort"; + descriptionShort = "$STR_ACE_20Rnd_762x51_mag_APDescription"; + }; +}; diff --git a/addons/magazines/CfgVehicles.hpp b/addons/magazines/CfgVehicles.hpp new file mode 100644 index 0000000000..b78eb71abc --- /dev/null +++ b/addons/magazines/CfgVehicles.hpp @@ -0,0 +1,163 @@ + +#define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) class _xx_##MAGAZINE { \ + magazine = #MAGAZINE; \ + count = COUNT; \ +} + +class CfgVehicles { + class NATO_Box_Base; + class Box_NATO_Wps_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); + }; + }; + + class Box_NATO_WpsSpecial_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); + }; + }; + + class Box_NATO_Ammo_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,2); + }; + }; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,6); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,3); + }; + }; + + class ReammoBox_F; + class B_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,2); + }; + }; + + class EAST_Box_Base; + class Box_East_Wps_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); + }; + }; + + class Box_East_WpsSpecial_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,1); + }; + }; + + class Box_East_Ammo_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,6); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,3); + }; + }; + + class O_supplyCrate_F: B_supplyCrate_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); + }; + }; + + class IND_Box_Base; + class Box_IND_Wps_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + }; + }; + + class Box_IND_WpsSpecial_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,2); + }; + }; + + class Box_IND_Ammo_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,6); + }; + }; + + class FIA_Box_Base_F; + class Box_FIA_Wps_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + }; + }; + + class Box_FIA_Ammo_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); + }; + }; + + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,6); + }; + }; + + class I_supplyCrate_F: B_supplyCrate_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); + }; + }; + + class IG_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); + }; + }; + + class C_supplyCrate_F: ReammoBox_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_Tracer_Dim,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_SD,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_SD,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_65x39_caseless_green_mag_AP,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_Tracer_Dim,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_SD,2); + MACRO_ADDMAGAZINE(ACE_30Rnd_556x45_Stanag_AP,2); + /*MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer,2); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_Tracer_Dim,2); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_SD,2); + MACRO_ADDMAGAZINE(ACE_20Rnd_762x51_Mag_AP,2);*/ + }; + }; +}; diff --git a/addons/magazines/CfgWeapons.hpp b/addons/magazines/CfgWeapons.hpp new file mode 100644 index 0000000000..d54cf28e52 --- /dev/null +++ b/addons/magazines/CfgWeapons.hpp @@ -0,0 +1,460 @@ + +class SlotInfo; + +class CfgWeapons { + + /* MX */ + + class Rifle; + class Rifle_Base_F: Rifle { + class WeaponSlotsInfo; + }; + + class arifle_MX_Base_F: Rifle_Base_F { + magazines[] += { + "ACE_30Rnd_65x39_caseless_mag_Tracer_Dim", + "ACE_30Rnd_65x39_caseless_mag_SD", + "ACE_30Rnd_65x39_caseless_mag_AP", + "100Rnd_65x39_caseless_mag", + "100Rnd_65x39_caseless_mag_Tracer" + }; + + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_H"}; + }; + }; + }; + + class arifle_MX_SW_F: arifle_MX_Base_F { + magazines[] += { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer" + }; + + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: MuzzleSlot { + // Shit is broken again + //compatibleItems[] += {"ACE_muzzle_mzls_H"}; + compatibleItems[] = {"muzzle_snds_H","muzzle_snds_H_SW","ACE_muzzle_mzls_H"}; + }; + }; + }; + + class arifle_MXM_F: arifle_MX_Base_F { + magazines[] += { + "30Rnd_65x39_caseless_mag", + "30Rnd_65x39_caseless_mag_Tracer" + }; + }; + + + /* Katiba */ + + class arifle_katiba_Base_F: Rifle_Base_F { + magazines[] += { + "ACE_30Rnd_65x39_caseless_green_mag_Tracer_Dim", + "ACE_30Rnd_65x39_caseless_green_mag_SD", + "ACE_30Rnd_65x39_caseless_green_mag_AP" + }; + + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_H"}; + }; + }; + }; + + + /* Other */ + + class Rifle_Long_Base_F: Rifle_Base_F { + class WeaponSlotsInfo; + }; + + class EBR_base_F: Rifle_Long_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_B"}; + }; + }; + }; + + class DMR_01_base_F: Rifle_Long_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_B"}; + }; + }; + }; + + class LMG_Mk200_F: Rifle_Long_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_H"}; + }; + }; + }; + + class LMG_Zafir_F: Rifle_Long_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_B"}; + }; + }; + }; + + + /* Assault Rifles */ + + class Tavor_base_F: Rifle_Base_F { + magazines[] += { + "ACE_30Rnd_556x45_Stanag_Tracer_Dim", + "ACE_30Rnd_556x45_Stanag_SD", + "ACE_30Rnd_556x45_Stanag_AP" + }; + + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_L"}; + }; + }; + }; + + class mk20_base_F: Rifle_Base_F { + magazines[] += { + "ACE_30Rnd_556x45_Stanag_Tracer_Dim", + "ACE_30Rnd_556x45_Stanag_SD", + "ACE_30Rnd_556x45_Stanag_AP" + }; + + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_L"}; + }; + }; + }; + + + /* SMGs */ + + class SDAR_base_F: Rifle_Base_F { + magazines[] += { + "ACE_30Rnd_556x45_Stanag_Tracer_Dim", + "ACE_30Rnd_556x45_Stanag_SD", + "ACE_30Rnd_556x45_Stanag_AP" + }; + }; + + class pdw2000_base_F: Rifle_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; + }; + }; + }; + + class SMG_01_Base: Rifle_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; + }; + }; + }; + + class SMG_02_base_F: Rifle_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; + }; + }; + }; + + + /* Pistols */ + + class Pistol; + class Pistol_Base_F: Pistol { + class WeaponSlotsInfo; + }; + + class hgun_P07_F: Pistol_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; + compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; + }; + }; + }; + + class hgun_Rook40_F: Pistol_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; + compatibleItems[] += {"ACE_muzzle_mzls_smg_02"}; + }; + }; + }; + + class hgun_ACPC2_F: Pistol_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; + }; + }; + }; + + class hgun_Pistol_heavy_01_F: Pistol_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo { + compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; + }; + }; + }; + + /*class hgun_Pistol_heavy_02_F: Pistol_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot { + linkProxy = "\A3\data_f\proxies\weapon_slots\MUZZLE"; + compatibleItems[] += {"ACE_muzzle_mzls_smg_01"}; + }; + }; + };*/ + + + /* Silencers */ + + class ItemCore; + class InventoryMuzzleItem_Base_F; + + class muzzle_snds_H: ItemCore { + class ItemInfo: InventoryMuzzleItem_Base_F { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_L: muzzle_snds_H { + class ItemInfo: ItemInfo { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_M: muzzle_snds_H { + class ItemInfo: ItemInfo { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_B: muzzle_snds_H { + class ItemInfo: ItemInfo { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_H_MG: muzzle_snds_H { + class ItemInfo: ItemInfo { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_H_SW: muzzle_snds_H_MG { + class ItemInfo: ItemInfo { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; + + class muzzle_snds_acp: muzzle_snds_H { + class ItemInfo: ItemInfo { + class MagazineCoef { + initSpeed = 1.0; + }; + + class AmmoCoef { + hit = 0.9; + visibleFire = 0.5; + audibleFire = 0.1; + visibleFireTime = 0.5; + audibleFireTime = 0.5; + cost = 1.0; + typicalSpeed = 1.0; + airFriction = 1.0; + }; + + class MuzzleCoef { + dispersionCoef = "0.8f"; + artilleryDispersionCoef = "1.0f"; + fireLightCoef = "0.5f"; + recoilCoef = "1.0f"; + recoilProneCoef = "1.0f"; + minRangeCoef = "1.0f"; + minRangeProbabCoef = "1.0f"; + midRangeCoef = "1.0f"; + midRangeProbabCoef = "1.0f"; + maxRangeCoef = "1.0f"; + maxRangeProbabCoef = "1.0f"; + }; + }; + }; +}; diff --git a/addons/magazines/README.md b/addons/magazines/README.md new file mode 100644 index 0000000000..041a562268 --- /dev/null +++ b/addons/magazines/README.md @@ -0,0 +1,12 @@ +ace_magazines +============= + +Adds new types of ammunition, such as sub-sonic rounds. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/magazines/config.cpp b/addons/magazines/config.cpp new file mode 100644 index 0000000000..c757d62f5c --- /dev/null +++ b/addons/magazines/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2"; + VERSION_CONFIG; + }; +}; + +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/ballistics/newclasses.txt b/addons/magazines/newclasses.txt similarity index 86% rename from addons/ballistics/newclasses.txt rename to addons/magazines/newclasses.txt index 4e162aa749..1a711e8c37 100644 --- a/addons/ballistics/newclasses.txt +++ b/addons/magazines/newclasses.txt @@ -1,13 +1,4 @@ -// CFGWeapons - -ACE_muzzle_mzls_H -ACE_muzzle_mzls_B -ACE_muzzle_mzls_L -ACE_muzzle_mzls_smg_01 -ACE_muzzle_mzls_smg_02 - - // CFGAmmo ACE_B_65x39_Caseless_Tracer_Dim diff --git a/addons/magazines/script_component.hpp b/addons/magazines/script_component.hpp new file mode 100644 index 0000000000..2fa1b774f5 --- /dev/null +++ b/addons/magazines/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT magazines +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MAGAZINES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_MAGAZINES + #define DEBUG_SETTINGS DEBUG_ENABLED_MAGAZINES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/ballistics/stringtable.xml b/addons/magazines/stringtable.xml similarity index 91% rename from addons/ballistics/stringtable.xml rename to addons/magazines/stringtable.xml index 32e5c8097d..c8f652fa39 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/magazines/stringtable.xml @@ -1,7 +1,7 @@  - + 6.5mm 30Rnd Tracer IR-DIM Mag @@ -474,7 +474,7 @@ Calibro: 7.62x51 mm AP<br />Munizioni: 20<br />In uso su: Mk18 ABR Калибр: 7.62x51 мм дозвуковые<br />Патронов: 20<br />Применимы в: Mk18 ABR - + Caliber: 7.62x51mm M118LR<br />Rounds: 20<br />Type: M14 Kaliber: 7,62x51 mm M118LR<br />LÅ‘szerek: 20<br />Típus: M14 Kaliber: 7,62x51mm M118LR<br />Schuss: 20<br />Typ: M14 @@ -486,66 +486,5 @@ Калибр: 7.62x51mm M118LR<br />Патронов: 20<br />Тип: M14 Calibro: 7.62x51mm M118LR<br />Munizioni:20<br />In uso su: M14 - - - Flash Suppressor (6.5 mm) - LángrejtÅ‘ (6,5 mm) - Mündungsfeuerdämpfer (6,5 mm) - Soppressore di fiamma (6.5mm) - Supressor de Clarão (6,5mm) - TÅ‚umik pÅ‚omieni (6,5 mm) - TlumiÄ záblesku (6,5 mm) - Cache-flamme (6,5 mm) - ПламегаÑитель (6,5 мм) - Supresor (6,5 mm) - - - Flash Suppressor (7.62 mm) - LángrejtÅ‘ (7,62 mm) - Mündungsfeuerdämpfer (7,62 mm) - Soppressore di fiamma (7.62mm) - Supressor de Clarão (7,62mm) - TÅ‚umik pÅ‚omieni (7,62 mm) - TlumiÄ záblesku (7,62 mm) - Cache-flamme (7,62 mm) - ПламегаÑитель (7,62 мм) - Supresor (7,62 mm) - - - Flash Suppressor (5.56 mm) - LángrejtÅ‘ (5,56 mm) - Mündungsfeuerdämpfer (5,56 mm) - Soppressore di fiamma (5.56mm) - Supressor de Clarão (5,56mm) - TÅ‚umik pÅ‚omieni (5,56 mm) - TlumiÄ záblesku (5,56 mm) - Cache-flamme (5,56 mm) - ПламегаÑитель (5,56 мм) - Supresor (5,56 mm) - - - Flash Suppressor (.45 ACP) - LángrejtÅ‘ (.45 ACP) - Mündungsfeuerdämpfer (.45 ACP) - Soppressore di fiamma (.45 ACP) - Supressor de Clarão (.45 ACP) - TÅ‚umik pÅ‚omieni (.45 ACP) - TlumiÄ záblesku (.45 ACP) - Cache-flamme (.45 ACP) - ПламегаÑитель (.45 ACP) - Supresor (.45 ACP) - - - Flash Suppressor (9 mm) - LángrejtÅ‘ (9 mm) - Mündungsfeuerdämpfer (9 mm) - Soppressore di fiamma (9 mm) - Supressor de Clarão (9mm) - TÅ‚umik pÅ‚omieni (9 mm) - TlumiÄ záblesku (9 mm) - Cache-flamme (9 mm) - ПламегаÑитель (9 мм) - Supresor (9 mm) - - \ No newline at end of file + diff --git a/addons/main/README.md b/addons/main/README.md new file mode 100644 index 0000000000..aa401a81fa --- /dev/null +++ b/addons/main/README.md @@ -0,0 +1,13 @@ +ace_main +======== + +Backbone of other components, defining most of the commonly used macros. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [walterpearce](https://github.com/walterpearce) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 814c46d24b..3b59e8b373 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -52,7 +52,7 @@ #define ACE_NOZEROING discreteDistance[] = {}; \ discreteDistanceInitIndex = 0; \ weaponInfoType = "RscWeaponEmpty" - + #define ACE_NOTURRETZEROING discreteDistance[] = {}; \ discreteDistanceInitIndex = 0; \ turretInfoType = "RscWeaponEmpty" @@ -62,7 +62,7 @@ irDistance = 300 #define ACE_LASER_DISTANCE_VANILLA irDistance = 300 - + #define ACE_NOLASER irLaserPos = "laser pos"; \ irLaserEnd = "laser dir"; \ irDistance = 0 @@ -100,9 +100,6 @@ #define ACE_BWC ace_bwc = 1 -#define ACE_wind ([] call ace_ballistic_fnc_wind) - - // SCRIPTING MACROS // Items @@ -129,7 +126,7 @@ #define KNOCKOUT ace_common_fx_fnc_knockout #define RING ace_common_fx_fnc_ring -// Stamina +// Stamina #define INC_MASS ace_stamina_fnc_inc_mass // Does this work, due to BWC_CONFIG(NAME) ? @@ -164,7 +161,7 @@ } // Addaction defines for colored text -#define ACE_TEXT_ORANGE(Text) ("" + ##Text + "") +#define ACE_TEXT_ORANGE(Text) ("" + ##Text + "") #define ACE_TEXT_RED(Text) ("" + ##Text + "") #define ACE_TEXT_GREEN(Text) ("" + ##Text + "") #define ACE_TEXT_YELLOW(Text) ("" + ##Text + "") diff --git a/addons/map/README.md b/addons/map/README.md new file mode 100644 index 0000000000..e51efe71d5 --- /dev/null +++ b/addons/map/README.md @@ -0,0 +1,13 @@ +ace_map +======= + +Various tweaks to the in-game map. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [esteldunedain](https://github.com/esteldunedain) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/markers/$PBOPREFIX$ b/addons/markers/$PBOPREFIX$ new file mode 100644 index 0000000000..c385330d39 --- /dev/null +++ b/addons/markers/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\markers \ No newline at end of file diff --git a/addons/markers/CfgEventHandlers.hpp b/addons/markers/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0cd959a047 --- /dev/null +++ b/addons/markers/CfgEventHandlers.hpp @@ -0,0 +1,12 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/markers/InsertMarker.hpp b/addons/markers/InsertMarker.hpp new file mode 100644 index 0000000000..3cf32943c4 --- /dev/null +++ b/addons/markers/InsertMarker.hpp @@ -0,0 +1,147 @@ + +class RscPicture; +class RscText; +class RscStructuredText; +class RscButtonMenuOK; +class RscButtonMenuCancel; +class RscButtonMenu; +class RscEdit; +class RscCombo; +class RscSlider; +class RscXSliderH; + +class RscDisplayInsertMarker { + onLoad = QUOTE(_this call DFUNC(initInsertMarker);); + onUnload = QUOTE(_this call DFUNC(placeMarker);); + idd = 54; + movingEnable = 1; + class controlsBackground { + class RscText_1000: RscText { + idc = 1000; + /*x = "0 * GUI_GRID_INSERTMARKER_W + GUI_GRID_INSERTMARKER_X"; + y = "0 * GUI_GRID_INSERTMARKER_H + GUI_GRID_INSERTMARKER_Y"; + w = "8 * GUI_GRID_INSERTMARKER_W"; + h = "2.5 * GUI_GRID_INSERTMARKER_H"; + colorBackground[] = {0,0,0,0.5};*/ + }; + class Description: RscStructuredText { + colorBackground[] = {0,0,0,0.7}; + idc = 1100; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "9.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + class controls { + //delete ButtonOK; + class ButtonMenuOK: RscButtonMenuOK { + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "8.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + // size = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + // sizeEx = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + }; + class ButtonMenuCancel: RscButtonMenuCancel { + x = "23 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "1.1 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + + text = "X"; + colorBackground[] = {0.75,0,0,0.5}; + colorBackgroundFocused[] = {0.75,0,0,0.5}; + colorBackground2[] = {1,0,0,0.5}; + }; + /*class ButtonMenuInfo: RscButtonMenu { + idc = 2400; + text = "$STR_A3_RscDisplayInsertMarker_ButtonMenuInfo"; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + };*/ + delete ButtonMenuInfo; + class Title: RscText { + moving = 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.8])"}; + idc = 1001; + text = "$STR_A3_RscDisplayInsertMarker_Title"; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "8.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + delete Description; + /*class Info: RscStructuredText { + colorBackground[] = {0,0,0,0.7}; + idc = 1101; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + };*/ + delete Info; + class Picture: RscPicture { + idc = 102; + x = 0.259984; + y = 0.4; + w = 0.05; + h = 0.0666667; + }; + class Text: RscEdit { + idc = 101; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "10.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + /*class SizeX: RscEdit { + idc = 1200; + text = "10"; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class SizeY: RscEdit { + idc = 1201; + text = "10"; + x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + };*/ + class MarkerShape: RscCombo { + idc = 1210; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class MarkerColor: RscCombo { + idc = 1211; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class MarkerAngle: RscXSliderH { + idc = 1220; + text = "10"; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + class MarkerAngleText: RscText { + idc = 1221; + x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)"; + y = "14.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; +}; diff --git a/addons/markers/README.md b/addons/markers/README.md new file mode 100644 index 0000000000..aa9538f8bb --- /dev/null +++ b/addons/markers/README.md @@ -0,0 +1,13 @@ +ace_markers +=========== + +Completely replaces the default marker system, allowing quicker and more precise placement of markers. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/markers/XEH_postInit.sqf b/addons/markers/XEH_postInit.sqf new file mode 100644 index 0000000000..eea149f294 --- /dev/null +++ b/addons/markers/XEH_postInit.sqf @@ -0,0 +1,16 @@ +// by commy2 +#include "script_component.hpp" + +// recieve remote marker data +[QGVAR(setMarkerNetwork), {_this call DFUNC(setMarkerNetwork)}] call EFUNC(common,addEventHandler); + +// recieve marker data for JIP +[QGVAR(setMarkerJIP), {_this call DFUNC(setMarkerJIP)}] call EFUNC(common,addEventHandler); + +// request marker data for JIP +if (isMultiplayer && {!isServer} && {hasInterface}) then { + private "_logic"; + _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + + [QGVAR(sendMarkersJIP), _logic] call EFUNC(common,serverEvent); +}; diff --git a/addons/markers/XEH_preInit.sqf b/addons/markers/XEH_preInit.sqf new file mode 100644 index 0000000000..6ac258ed2a --- /dev/null +++ b/addons/markers/XEH_preInit.sqf @@ -0,0 +1,74 @@ +#include "script_component.hpp" + +PREP(initInsertMarker); +PREP(onLBSelChangedColor); +PREP(onLBSelChangedShape); +PREP(onSliderPosChangedAngle); +PREP(placeMarker); +PREP(sendMarkersJIP); +PREP(setMarkerJIP); +PREP(setMarkerNetwork); + +// init marker types +if (isNil QGVAR(MarkersCache)) then { + _config = configfile >> "CfgMarkers"; + _index = 0; + + GVAR(MarkersCache) = []; + + for "_a" from 0 to (count _config - 1) do { + _marker = _config select _a; + + _scope = getNumber (_marker >> "scope"); + _name = getText (_marker >> "name"); + _icon = getText (_marker >> "icon"); + + if (_scope == 2) then { + _shape lbAdd _name; + _shape lbSetValue [_index, _a]; + _shape lbSetPicture [_index, _icon]; + + GVAR(MarkersCache) pushBack [_name, _a, _icon]; + + _index = _index + 1; + }; + }; +}; + +// init marker colors +if (isNil QGVAR(MarkerColorsCache)) then { + _config = configfile >> "CfgMarkerColors"; + _index = 0; + + GVAR(MarkerColorsCache) = []; + + for "_a" from 0 to (count _config - 1) do { + _marker = _config select _a; + + _scope = getNumber (_marker >> "scope"); + _name = getText (_marker >> "name"); + + if (_scope == 2) then { + _color lbAdd _name; + _color lbSetValue [_index, _a]; + + _rgba = getArray (_marker >> "color"); + + { + if (typeName _x != "SCALAR") then { + _rgba set [_forEachIndex, call compile _x]; + }; + } forEach _rgba; + + _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _rgba select 0, _rgba select 1, _rgba select 2, _rgba select 3]; + + _color lbSetPicture [_index, _icon]; + + GVAR(MarkerColorsCache) pushBack [_name, _a, _icon]; + + _index = _index + 1; + }; + }; +}; + +[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler); diff --git a/addons/markers/config.cpp b/addons/markers/config.cpp new file mode 100644 index 0000000000..24d3c778d8 --- /dev/null +++ b/addons/markers/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "InsertMarker.hpp" diff --git a/TO_MERGE/agm/Markers/scripts/initInsertMarker.sqf b/addons/markers/functions/fnc_initInsertMarker.sqf similarity index 58% rename from TO_MERGE/agm/Markers/scripts/initInsertMarker.sqf rename to addons/markers/functions/fnc_initInsertMarker.sqf index 37a5544bca..d172c6a532 100644 --- a/TO_MERGE/agm/Markers/scripts/initInsertMarker.sqf +++ b/addons/markers/functions/fnc_initInsertMarker.sqf @@ -1,18 +1,18 @@ // stuff taken from bohemia, edited by commy2 +#include "script_component.hpp" #define BORDER 0.005 -with uinamespace do { - _this spawn { +[{ disableserialization; _display = _this select 0; //Prevent Captive Players from placing markers - if (AGM_player getVariable ["AGM_isCaptive", false]) exitWith { - _display closeDisplay 2; //emulate "Cancel" button - }; + /*if (ACE_player getVariable ["ACE_isCaptive", false]) exitWith { + _display closeDisplay 2; //emulate "Cancel" button + };*/ - // display vanilla key input + // prevent vanilla key input _display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}]; _text = _display displayctrl 101; @@ -31,47 +31,41 @@ with uinamespace do { ctrlSetFocus _text; //Change ok button's text based on current channel - [_buttonOK] spawn { - disableserialization; - private ["_buttonOK", "_channel", "_textColor"]; - _buttonOK = _this select 0; + //if (isNull _buttonOK) exitWith {true}; - waitUntil { - if (isNull _buttonOK) exitWith {true}; - _textColor = [1,1,1,1]; - switch (call AGM_Core_fnc_currentChannel) do { - case ("global"): { + _channel = ""; + _textColor = [1,1,1,1]; + switch (call EFUNC(common,currentChannel)) do { + case ("global"): { _channel = localize "str_channel_global"; _textColor = [(216/255),(216/255),(216/255),1]; - }; - case ("side"): { + }; + case ("side"): { _channel = localize "str_channel_side"; _textColor = [(70/255),(211/255),(252/255),1]; - }; - case ("group"): { + }; + case ("group"): { _channel = localize "str_channel_group"; _textColor = [(181/255),(248/255),(98/255),1]; - }; - case ("vehicle"): { + }; + case ("vehicle"): { _channel = localize "str_channel_vehicle"; _textColor = [(255/255),(208/255),(0/255),1]; - }; - case ("direct"): { + }; + case ("direct"): { _channel = localize "str_channel_direct"; _textColor = [(255/255),(255/255),(255/255),1]; - }; - case ("command"): { + }; + case ("command"): { _channel = localize "str_channel_command"; _textColor = [(255/255),(255/255),(70/255),1]; - }; }; - //If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text) - if (_channel != "") then { - _buttonOK ctrlSetTextColor _textColor; - _buttonOK ctrlSetText format [localize "STR_AGM_Markers_PlaceIn", _channel]; - }; - false - }; + }; + + //If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text) + if (_channel != "") then { + _buttonOK ctrlSetTextColor _textColor; + _buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel]; }; //--- Background @@ -150,40 +144,15 @@ with uinamespace do { // init marker shape lb - _config = configfile >> "CfgMarkers"; - _index = 0; - - if (isNil "AGM_Markers_MarkersCache") then { - AGM_Markers_MarkersCache = []; - - for "_a" from 0 to (count _config - 1) do { - _marker = _config select _a; - - _scope = getNumber (_marker >> "scope"); - _name = getText (_marker >> "name"); - _icon = getText (_marker >> "icon"); - - if (_scope == 2) then { - _shape lbAdd _name; - _shape lbSetValue [_index, _a]; - _shape lbSetPicture [_index, _icon]; - - AGM_Markers_MarkersCache pushBack [_name, _a, _icon]; - - _index = _index + 1; - }; - }; - } else { - { + { _shape lbAdd (_x select 0); _shape lbSetValue [_forEachIndex, _x select 1]; _shape lbSetPicture [_forEachIndex, _x select 2]; - } forEach AGM_Markers_MarkersCache; - }; + } forEach GVAR(MarkersCache); - _shape ctrlAddEventHandler ["LBSelChanged", {_this call AGM_Markers_fnc_onLBSelChangedShape}]; + _shape ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}]; - _curSelShape = uiNamespace getVariable ["AGM_Markers_curSelMarkerShape", 0]; + _curSelShape = GETGVAR(curSelMarkerShape,0); _shape lbSetCurSel _curSelShape; _data = _shape lbValue _curSelShape; _config = (configfile >> "CfgMarkers") select _data; @@ -192,74 +161,39 @@ with uinamespace do { // init marker color lb - _config = configfile >> "CfgMarkerColors"; - _index = 0; - - if (isNil "AGM_Markers_MarkerColorsCache") then { - AGM_Markers_MarkerColorsCache = []; - - for "_a" from 0 to (count _config - 1) do { - _marker = _config select _a; - - _scope = getNumber (_marker >> "scope"); - _name = getText (_marker >> "name"); - - if (_scope == 2) then { - _color lbAdd _name; - _color lbSetValue [_index, _a]; - - _rgba = getArray (_marker >> "color"); - - { - if (typeName _x != "SCALAR") then { - _rgba set [_forEachIndex, call compile _x]; - }; - } forEach _rgba; - - _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _rgba select 0, _rgba select 1, _rgba select 2, _rgba select 3]; - - _color lbSetPicture [_index, _icon]; - - AGM_Markers_MarkerColorsCache pushBack [_name, _a, _icon]; - - _index = _index + 1; - }; - }; - } else { - { + { _color lbAdd (_x select 0); _color lbSetValue [_forEachIndex, _x select 1]; _color lbSetPicture [_forEachIndex, _x select 2]; - } forEach AGM_Markers_MarkerColorsCache; - }; + } forEach GVAR(MarkerColorsCache); - _color ctrlAddEventHandler ["LBSelChanged", {_this call AGM_Markers_fnc_onLBSelChangedColor}]; + _color ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}]; - _curSelColor = uiNamespace getVariable ["AGM_Markers_curSelMarkerColor", 0]; + _curSelColor = GETGVAR(curSelMarkerColor,0); _color lbSetCurSel _curSelColor; _data = _color lbValue _curSelColor; _config = (configfile >> "CfgMarkerColors") select _data; _rgba = getArray (_config >> "color"); { - if (typeName _x != "SCALAR") then { - _rgba set [_forEachIndex, call compile _x]; - }; + if (typeName _x != "SCALAR") then { + _rgba set [_forEachIndex, call compile _x]; + }; } forEach _rgba; _picture ctrlSetTextColor _rgba; // init marker angle slider _angle sliderSetRange [-180, 180]; - _angle ctrlAddEventHandler ["SliderPosChanged", {_this call AGM_Markers_fnc_onSliderPosChangedAngle}]; + _angle ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}]; - _curSelAngle = uiNamespace getVariable ["AGM_Markers_curSelMarkerAngle", 0]; + _curSelAngle = GETGVAR(curSelMarkerAngle,0); _angle sliderSetPosition _curSelAngle; _curSelAngle = round _curSelAngle; if (_curSelAngle < 0) then { - _curSelAngle = _curSelAngle + 360; + _curSelAngle = _curSelAngle + 360; }; - _angleText ctrlSetText format [localize "STR_AGM_Markers_MarkerDirection", _curSelAngle]; - }; -}; + _angleText ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _curSelAngle]; + +}, _this] call EFUNC(common,execNextFrame); diff --git a/TO_MERGE/agm/Markers/functions/fn_onLBSelChangedColor.sqf b/addons/markers/functions/fnc_onLBSelChangedColor.sqf similarity index 57% rename from TO_MERGE/agm/Markers/functions/fn_onLBSelChangedColor.sqf rename to addons/markers/functions/fnc_onLBSelChangedColor.sqf index 28c788e260..a79495d442 100644 --- a/TO_MERGE/agm/Markers/functions/fn_onLBSelChangedColor.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedColor.sqf @@ -1,22 +1,23 @@ // by commy2 +#include "script_component.hpp" private ["_ctrl", "_data", "_config", "_color"]; _ctrl = _this select 0; _data = _ctrl lbValue (_this select 1); -uiNamespace setVariable ["AGM_Markers_curSelMarkerColor", _this select 1]; +GVAR(curSelMarkerColor) = _this select 1; _config = (configfile >> "CfgMarkerColors") select _data; _color = getArray (_config >> "color"); { - if (typeName _x != "SCALAR") then { - _color set [_forEachIndex, call compile _x]; - }; + if (typeName _x != "SCALAR") then { + _color set [_forEachIndex, call compile _x]; + }; } forEach _color; ((ctrlParent _ctrl) displayCtrl 102) ctrlSetTextColor _color; -uiNamespace setVariable ["AGM_Markers_currentMarkerColor", _data]; +GVAR(currentMarkerColorConfigName) = (configName _config); diff --git a/TO_MERGE/agm/Markers/functions/fn_onLBSelChangedShape.sqf b/addons/markers/functions/fnc_onLBSelChangedShape.sqf similarity index 66% rename from TO_MERGE/agm/Markers/functions/fn_onLBSelChangedShape.sqf rename to addons/markers/functions/fnc_onLBSelChangedShape.sqf index c47cff385b..57caba8680 100644 --- a/TO_MERGE/agm/Markers/functions/fn_onLBSelChangedShape.sqf +++ b/addons/markers/functions/fnc_onLBSelChangedShape.sqf @@ -1,11 +1,12 @@ // by commy2 +#include "script_component.hpp" private ["_ctrl", "_data", "_config", "_icon"]; _ctrl = _this select 0; _data = _ctrl lbValue (_this select 1); -uiNamespace setVariable ["AGM_Markers_curSelMarkerShape", _this select 1]; +GVAR(curSelMarkerShape) = _this select 1; _config = (configfile >> "CfgMarkers") select _data; @@ -13,4 +14,4 @@ _icon = getText (_config >> "icon"); ((ctrlParent _ctrl) displayCtrl 102) ctrlSetText _icon; -uiNamespace setVariable ["AGM_Markers_currentMarkerShape", _data]; +GVAR(currentMarkerConfigName) = (configName _config); diff --git a/TO_MERGE/agm/Markers/functions/fn_onSliderPosChangedAngle.sqf b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf similarity index 51% rename from TO_MERGE/agm/Markers/functions/fn_onSliderPosChangedAngle.sqf rename to addons/markers/functions/fnc_onSliderPosChangedAngle.sqf index 4dabc45b35..354fb909e1 100644 --- a/TO_MERGE/agm/Markers/functions/fn_onSliderPosChangedAngle.sqf +++ b/addons/markers/functions/fnc_onSliderPosChangedAngle.sqf @@ -1,17 +1,18 @@ // by commy2 +#include "script_component.hpp" private ["_ctrl", "_data", "_direction"]; _ctrl = _this select 0; _data = _this select 1; -uiNamespace setVariable ["AGM_Markers_curSelMarkerAngle", _data]; +GVAR(curSelMarkerAngle) = _data; _direction = round _data; if (_direction < 0) then { - _direction = _direction + 360; + _direction = _direction + 360; }; -((ctrlParent _ctrl) displayCtrl 1221) ctrlSetText format [localize "STR_AGM_Markers_MarkerDirection", _direction]; +((ctrlParent _ctrl) displayCtrl 1221) ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _direction]; -uiNamespace setVariable ["AGM_Markers_currentMarkerAngle", _data]; +GVAR(currentMarkerAngle) = _data; diff --git a/addons/markers/functions/fnc_placeMarker.sqf b/addons/markers/functions/fnc_placeMarker.sqf new file mode 100644 index 0000000000..124e797e31 --- /dev/null +++ b/addons/markers/functions/fnc_placeMarker.sqf @@ -0,0 +1,46 @@ +// by commy2 +#include "script_component.hpp" + +if (_this select 1 == 1) then { + disableserialization; + _display = _this select 0; + + _pos = ctrlPosition (_display displayCtrl 102); + _pos = [ + (_pos select 0) + (_pos select 2) / 2, + (_pos select 1) + (_pos select 3) / 2 + ]; + + switch (true) do { + case (!isNull findDisplay 12): { + _pos = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld _pos; + }; + case (!isNull findDisplay 37): { + _pos = (findDisplay 37 displayCtrl 51) ctrlMapScreenToWorld _pos; + }; + case (!isNull findDisplay 52): { + _pos = (findDisplay 52 displayCtrl 51) ctrlMapScreenToWorld _pos; + }; + case (!isNull findDisplay 53): { + _pos = (findDisplay 53 displayCtrl 51) ctrlMapScreenToWorld _pos; + }; + }; + + // set and send marker data the next frame. the actual marker isn't created yet + [ + { + + [QGVAR(setMarkerNetwork), [ + allMapMarkers select (count allMapMarkers - 1), [ + GETGVAR(currentMarkerConfigName,""), + GETGVAR(currentMarkerColorConfigName,""), + _this, + GETGVAR(currentMarkerAngle,0) + ] + ]] call EFUNC(common,globalEvent); + + }, + _pos + ] call EFUNC(common,execNextFrame); + +}; diff --git a/addons/markers/functions/fnc_sendMarkersJIP.sqf b/addons/markers/functions/fnc_sendMarkersJIP.sqf new file mode 100644 index 0000000000..9915820d72 --- /dev/null +++ b/addons/markers/functions/fnc_sendMarkersJIP.sqf @@ -0,0 +1,13 @@ +// by commy2 +#include "script_component.hpp" + +private "_logic"; + +_logic = _this; + +[QGVAR(setMarkerJIP), _logic, [ + GETGVAR(allMapMarkers,[]), + GETGVAR(allMapMarkersProperties,[]), + _logic + ] +] call EFUNC(common,targetEvent); diff --git a/addons/markers/functions/fnc_setMarkerJIP.sqf b/addons/markers/functions/fnc_setMarkerJIP.sqf new file mode 100644 index 0000000000..74bd4f97f7 --- /dev/null +++ b/addons/markers/functions/fnc_setMarkerJIP.sqf @@ -0,0 +1,35 @@ +// by commy2 +#include "script_component.hpp" + +private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"]; + +_allMapMarkers = _this select 0; +_allMapMarkersProperties = _this select 1; +_logic = _this select 2; + +{ + _index = _allMapMarkers find _x; + + if (_index != -1) then { + _data = _allMapMarkersProperties select _index; + + _config = (configfile >> "CfgMarkers") >> (_data select 0); + if (!isClass _config) then { + WARNING("CfgMarker not found, changed to milDot"); + _config == (configFile >> "CfgMarkers" >> "MilDot"); + }; + _x setMarkerTypeLocal (configName _config); + + _config = (configfile >> "CfgMarkerColors") >> (_data select 1); + if (!isClass _config) then { + WARNING("CfgMarkerColors not found, changed to Default"); + _config == (configFile >> "CfgMarkerColors" >> "Default"); + }; + _x setMarkerColorLocal (configName _config); + + _x setMarkerPosLocal (_data select 2); + _x setMarkerDirLocal (_data select 3); + }; +} forEach allMapMarkers; + +deleteVehicle _logic; diff --git a/addons/markers/functions/fnc_setMarkerNetwork.sqf b/addons/markers/functions/fnc_setMarkerNetwork.sqf new file mode 100644 index 0000000000..194d169f24 --- /dev/null +++ b/addons/markers/functions/fnc_setMarkerNetwork.sqf @@ -0,0 +1,45 @@ +// by commy2 +#include "script_component.hpp" + +private ["_marker", "_data", "_config"]; + +_marker = _this select 0; +_data = _this select 1; + +_config = (configfile >> "CfgMarkers") >> (_data select 0); +if (!isClass _config) then { + WARNING("CfgMarker not found, changed to milDot"); + _config == (configFile >> "CfgMarkers" >> "MilDot"); +}; +_marker setMarkerTypeLocal (configName _config); + +_config = (configfile >> "CfgMarkerColors") >> (_data select 1); +if (!isClass _config) then { + WARNING("CfgMarkerColors not found, changed to Default"); + _config == (configFile >> "CfgMarkerColors" >> "Default"); +}; +_marker setMarkerColorLocal configName _config; + +_marker setMarkerPosLocal (_data select 2); +_marker setMarkerDirLocal (_data select 3); + +// save properties on server machine for JIP, marker editing ready +if (isMultiplayer && {isServer}) then { + private ["_allMapMarkers", "_allMapMarkersProperties", "_index"]; + + _allMapMarkers = GETMVAR(allMapMarkers,[]); + _allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]); + + _index = _allMapMarkers find _marker; + + if (_index == -1) then { + _allMapMarkers pushBack _marker; + _allMapMarkersProperties pushBack _data; + } else { + _allMapMarkers set [_index, _marker]; + _allMapMarkersProperties set [_index, _data]; + }; + + GVAR(allMapMarkers) = _allMapMarkers; + GVAR(allMapMarkersProperties) = _allMapMarkersProperties; +}; diff --git a/addons/markers/functions/script_component.hpp b/addons/markers/functions/script_component.hpp new file mode 100644 index 0000000000..26adba2431 --- /dev/null +++ b/addons/markers/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\markers\script_component.hpp" diff --git a/addons/markers/script_component.hpp b/addons/markers/script_component.hpp new file mode 100644 index 0000000000..2b1cb586a7 --- /dev/null +++ b/addons/markers/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT markers +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MARKERS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_MARKERS + #define DEBUG_SETTINGS DEBUG_ENABLED_MARKERS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/TO_MERGE/agm/Markers/stringtable.xml b/addons/markers/stringtable.xml similarity index 84% rename from TO_MERGE/agm/Markers/stringtable.xml rename to addons/markers/stringtable.xml index e324341854..0d2619ae40 100644 --- a/TO_MERGE/agm/Markers/stringtable.xml +++ b/addons/markers/stringtable.xml @@ -1,8 +1,8 @@  - + - + Direction: %1° Drehung: %1° Direction: %1° @@ -11,7 +11,7 @@ Dirección: %1° Ðаправление: %1 - + Place in: %1 Platz in: %1 Colocar en: %1 diff --git a/addons/medical/$PBOPREFIX$ b/addons/medical/$PBOPREFIX$ new file mode 100644 index 0000000000..03a98be3f5 --- /dev/null +++ b/addons/medical/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\medical \ No newline at end of file diff --git a/addons/medical/CfgEventHandlers.hpp b/addons/medical/CfgEventHandlers.hpp new file mode 100644 index 0000000000..ab62ee2c0a --- /dev/null +++ b/addons/medical/CfgEventHandlers.hpp @@ -0,0 +1,35 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + + +class Extended_Killed_Eventhandlers { + class CaManBase { + class ADDON { + Killed = QUOTE(_this call FUNC(eh_killed)); + }; + }; +}; + +class Extended_Local_Eventhandlers { + class CaManBase { + class ADDON { + Local = QUOTE(_this call FUNC(eh_local)); + }; + }; +}; +class Extended_Init_Eventhandlers { + class CaManBase { + class ADDON { + init = QUOTE(_this call FUNC(onInitForUnit);); + }; + }; +}; diff --git a/addons/medical/CfgFactionClasses.hpp b/addons/medical/CfgFactionClasses.hpp new file mode 100644 index 0000000000..35f77aedb1 --- /dev/null +++ b/addons/medical/CfgFactionClasses.hpp @@ -0,0 +1,7 @@ +class CfgFactionClasses +{ + class NO_CATEGORY; + class ACE_medical: NO_CATEGORY { + displayName = "ACE Medical"; + }; +}; \ No newline at end of file diff --git a/addons/medical/CfgHints.hpp b/addons/medical/CfgHints.hpp new file mode 100644 index 0000000000..2c6409536d --- /dev/null +++ b/addons/medical/CfgHints.hpp @@ -0,0 +1,38 @@ +class CfgHints +{ + class Combat_Space_Enhancement + { + displayName = "Combat Space Enhancement"; + class ACE_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/addons/medical/CfgSounds.hpp b/addons/medical/CfgSounds.hpp new file mode 100644 index 0000000000..de25bda65d --- /dev/null +++ b/addons/medical/CfgSounds.hpp @@ -0,0 +1,45 @@ +class CfgSounds +{ + class GVAR(heartbeat_fast_1) + { + name = QGVAR(heartbeat_fast_1); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_1.wav)),"db-1",1}; + titles[] = {}; + }; + class GVAR(heartbeat_fast_2) + { + name = QGVAR(heartbeat_fast_2); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_2.wav)),"db-1",1}; + titles[] = {}; + }; + class GVAR(heartbeat_fast_3) + { + name = QGVAR(heartbeat_fast_3); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\fast_3.wav)),"db-1",1}; + titles[] = {}; + }; + class GVAR(heartbeat_norm_1) + { + name = QGVAR(heartbeat_norm_1); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\norm_1.wav)),"db-1",1}; + titles[] = {}; + }; + class GVAR(heartbeat_norm_2) + { + name = QGVAR(heartbeat_norm_2); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\norm_2.wav)),"db-1",1}; + titles[] = {}; + }; + class GVAR(heartbeat_slow_1) + { + name = QGVAR(heartbeat_slow_1); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\slow_1.wav)),"db-1",1}; + titles[] = {}; + }; + class GVAR(heartbeat_slow_2) + { + name = QGVAR(heartbeat_slow_2); + sound[] = {QUOTE(PATHTOF(sounds\heart_beats\slow_2.wav)),"db-1",1}; + titles[] = {}; + }; +}; \ No newline at end of file diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp new file mode 100644 index 0000000000..c081efc27f --- /dev/null +++ b/addons/medical/CfgVehicles.hpp @@ -0,0 +1,1039 @@ +class CfgVehicles +{ + class Logic; + class Module_F: Logic { + class ArgumentsBaseUnits { + }; + }; + class ACE_moduleCombatMedicalSystem: Module_F { + scope = 2; + displayName = "Combat Medical System [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(initalizeModuleCMS)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Glowbal"; + class Arguments { + class advancedLevel { + displayName = "Advanced Level"; + description = "How advanced can the medical system be?"; + typeName = "NUMBER"; + class values { + class basic { + name = "Basic. Only bleeding and pain."; + value = 0; + default = 1; + }; + class normal { + name = "Normal. Bleeding, Pain, Blood pressure and heart rate"; + value = 1; + }; + class full { + name = "Full. Everything enabled."; + value = 2; + }; + }; + }; + 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 mediACEtting { + 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 ACE_moduleDamageSettings: Module_F { + scope = 2; + displayName = "Damage Settings [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleDamageSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Glowbal"; + 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 ACE_moduleAssignMedicRoles: Module_F { + scope = 2; + displayName = "Set Medic Class [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleAssignMedicRoles)); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Glowbal"; + 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 ACE medic class to a unit"; // Short description, will be formatted as structured text + sync[] = {}; + }; + }; + + class ACE_moduleAssignMedicalVehicle: Module_F { + scope = 2; + displayName = "set Medical Vehicle [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleAssignMedicalVehicle)); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Glowbal"; + 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 ACE medical vehicle class to a vehicle."; + sync[] = {}; + }; + }; + + class ACE_moduleAssignMedicalFacility: Module_F { + scope = 2; + displayName = "Set Medical Facility [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleAssignMedicalFacility)); + functionPriority = 10; + isGlobal = 2; + isTriggerActivated = 0; + isDisposable = 0; + author = "Glowbal"; + 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 ACE_moduleAssignMedicalEquipment: Module_F { + scope = 2; + displayName = "Assign Medical Equipment [ACE]"; + icon = QUOTE(PATHTOF(data\ACE_medical_module.paa)); + category = "ACE_medical"; + function = QUOTE(FUNC(moduleAssignMedicalEquipment)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "Glowbal"; + 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 ACE_bodyBag: MapBoard_altis_F { + scope = 1; + side = -1; + model = QUOTE(PATHTOF(equipment\bodybag.p3d)); + icon = ""; + displayName = $STR_ACE_MAG_BODYBAG_DISPLAY; + }; + + + class Item_Base_F; + class ACE_bandage_basicItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_BANDAGE_BASIC_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_bandage_basic + { + name = "ACE_bandage_basic"; + count = 1; + }; + }; + }; + class ACE_packing_bandageItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_PACKING_BANDAGE_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_packing_bandage + { + name = "ACE_packing_bandage"; + count = 1; + }; + }; + }; + class ACE_bandageElasticItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_BANDAGE_ELASTIC_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_bandageElastic + { + name = "ACE_bandageElastic"; + count = 1; + }; + }; + }; + class ACE_tourniquetItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_TOURNIQUET_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_tourniquet + { + name = "ACE_tourniquet"; + count = 1; + }; + }; + }; + class ACE_splintItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_SPLINT_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_splint + { + name = "ACE_splint"; + count = 1; + }; + }; + }; + class ACE_morphineItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_MORPHINE_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_morphine + { + name = "ACE_morphine"; + count = 1; + }; + }; + }; + class ACE_atropineItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_ATROPINE_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_atropine + { + name = "ACE_atropine"; + count = 1; + }; + }; + }; + class ACE_epinephrineItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_EPINEPHRINE_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_epinephrine + { + name = "ACE_epinephrine"; + count = 1; + }; + }; + }; + class ACE_plasma_ivItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_PLASMA_IV; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_plasma_iv + { + name = "ACE_plasma_iv"; + count = 1; + }; + }; + }; + class ACE_plasma_iv_500Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_PLASMA_IV_500; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_plasma_iv_500 + { + name = "ACE_plasma_iv_500"; + count = 1; + }; + }; + }; + class ACE_plasma_iv_250Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_PLASMA_IV_250; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_plasma_iv_250 + { + name = "ACE_plasma_iv_250"; + count = 1; + }; + }; + }; + class ACE_blood_ivItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_BLOOD_IV; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_blood_iv + { + name = "ACE_blood_iv"; + count = 1; + }; + }; + }; + class ACE_blood_iv_500Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_BLOOD_IV_500; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_blood_iv_500 + { + name = "ACE_blood_iv_500"; + count = 1; + }; + }; + }; + class ACE_blood_iv_250Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_BLOOD_IV_250; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_blood_iv_250 + { + name = "ACE_blood_iv_250"; + count = 1; + }; + }; + }; + class ACE_saline_ivItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_SALINE_IV; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_saline_iv + { + name = "ACE_saline_iv"; + count = 1; + }; + }; + }; + class ACE_saline_iv_500Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_SALINE_IV_500; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_saline_iv_500 + { + name = "ACE_saline_iv_500"; + count = 1; + }; + }; + }; + class ACE_saline_iv_250Item: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_SALINE_IV_250; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_saline_iv_250 + { + name = "ACE_saline_iv_250"; + count = 1; + }; + }; + }; + class ACE_quikclotItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_QUIKCLOT_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_quikclot + { + name = "ACE_quikclot"; + count = 1; + }; + }; + }; + class ACE_nasopharyngeal_tubeItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_NPA_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_nasopharyngeal_tube + { + name = "ACE_nasopharyngeal_tube"; + count = 1; + }; + }; + }; + class ACE_opaItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_OPA_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_opa + { + name = "ACE_opa"; + count = 1; + }; + }; + }; + class ACE_liquidSkinItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_LIQUID_SKIN_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_liquidSkin + { + name = "ACE_liquidSkin"; + count = 1; + }; + }; + }; + class ACE_chestsealItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_CHEST_SEAL_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_chestseal + { + name = "ACE_chestseal"; + count = 1; + }; + }; + }; + class ACE_personal_aid_kitItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_AID_KIT_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_personal_aid_kit + { + name = "ACE_personal_aid_kit"; + count = 1; + }; + }; + }; + class ACE_bodyBagItem: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_MAG_BODYBAG_DISPLAY; + author = "Glowbal"; + vehicleClass = "Items"; + class TransportItems + { + class ACE_itemBodyBag + { + name = "ACE_itemBodyBag"; + count = 1; + }; + }; + }; + + + class NATO_Box_Base; + class ACE_medical_supply_crate_cms : NATO_Box_Base { + scope = 2; + accuracy = 1000; + displayName = "Medical Supply Crate [ACE]"; + model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; + author = "Glowbal"; + class TransportItems { + class ACE_bandage_basic { + name = "ACE_bandage_basic"; + count = 25; + }; + class ACE_packing_bandage { + name = "ACE_packing_bandage"; + count = 25; + }; + class ACE_tourniquet { + name = "ACE_tourniquet"; + count = 25; + }; + class ACE_splint { + name = "ACE_splint"; + count = 25; + }; + class ACE_plasma_iv { + name = "ACE_plasma_iv"; + count = 25; + }; + class ACE_plasma_iv_500 { + name = "ACE_plasma_iv_500"; + count = 25; + }; + class ACE_plasma_iv_250 { + name = "ACE_plasma_iv_250"; + count = 25; + }; + class ACE_blood_iv { + name = "ACE_blood_iv"; + count = 25; + }; + class ACE_blood_iv_500 { + name = "ACE_blood_iv_500"; + count = 25; + }; + class ACE_blood_iv_250 { + name = "ACE_blood_iv_250"; + count = 25; + }; + class ACE_saline_iv { + name = "ACE_saline_iv"; + count = 25; + }; + class ACE_saline_iv_500 { + name = "ACE_saline_iv_500"; + count = 25; + }; + class ACE_saline_iv_250 { + name = "ACE_saline_iv_250"; + count = 25; + }; + class ACE_morphine { + name = "ACE_morphine"; + count = 25; + }; + class ACE_epinephrine { + name = "ACE_epinephrine"; + count = 25; + }; + class ACE_atropine { + name = "ACE_atropine"; + count = 25; + }; + class ACE_quikclot { + name = "ACE_quikclot"; + count = 25; + }; + class ACE_nasopharyngeal_tube { + name = "ACE_nasopharyngeal_tube"; + count = 25; + }; + class ACE_bandageElastic { + name = "ACE_bandageElastic"; + count = 25; + }; + class ACE_liquidSkin { + name = "ACE_liquidSkin"; + count = 25; + }; + class ACE_chestseal { + name = "ACE_chestseal"; + count = 25; + }; + class ACE_personal_aid_kit { + name = "ACE_personal_aid_kit"; + count = 25; + }; + class ACE_surgical_kit { + name = "ACE_surgical_kit"; + count = 25; + }; + class ACE_itemBodyBag { + name = "ACE_itemBodyBag"; + count = 5; + }; + }; + }; + + + #define ARM_LEG_ARMOR_DEFAULT 2 + #define ARM_LEG_ARMOR_BETTER 3 + #define ARM_LEG_ARMOR_CSAT 4 + + class Man; + class CAManBase: Man { + class HitPoints { + class HitHead; + class HitBody; + // "DEACTIVE" DEFAULT HITPOINTS + class HitHands { + armor = 999; //armor = 2; + explosionShielding = 0; //explosionShielding = 1; + material = -1; + minimalHit = 0; + name = ""; + passThrough = 1; + radius = 0; //radius = 0.06; + visual = "injury_hands"; + }; + class HitLegs { + armor = 999; //armor = 2; + explosionShielding = 0; //explosionShielding = 1; + material = -1; + minimalHit = 0; + name = ""; + passThrough = 1; + radius = 0; //radius = 0.08; + visual = "injury_legs"; + }; + + class HitLeftArm { + armor = ARM_LEG_ARMOR_DEFAULT; //2; + explosionShielding = 1; + material = -1; + minimalHit = 0; + name = "hand_l"; + passThrough = 1; + radius = 0.06; + visual = "injury_hands"; + }; + class HitRightArm: HitLeftArm { + name = "hand_r"; + }; + class HitLeftLeg { + armor = ARM_LEG_ARMOR_DEFAULT; //2; + explosionShielding = 1; + material = -1; + minimalHit = 0; + name = "leg_l"; + passThrough = 1; + radius = 0.08; + visual = "injury_legs"; + }; + class HitRightLeg: HitLeftLeg { + name = "leg_r"; + }; + }; + }; + + class SoldierWB: CAManBase {}; + class SoldierEB: CAManBase {}; + class SoldierGB: CAManBase {}; + + class B_Soldier_base_F: SoldierWB {}; + class B_Soldier_04_f: B_Soldier_base_F { + class HitPoints: HitPoints { + class HitHead: HitHead {}; + class HitBody: HitBody {}; + class HitHands: HitHands {}; + class HitLegs: HitLegs {}; + + class HitLeftArm: HitLeftArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + }; + }; + + class B_Soldier_05_f: B_Soldier_base_F { + class HitPoints: HitPoints { + class HitHead: HitHead {}; + class HitBody: HitBody {}; + class HitHands: HitHands {}; + class HitLegs: HitLegs {}; + + class HitLeftArm: HitLeftArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + }; + }; + + class I_Soldier_base_F: SoldierGB {}; + + class I_Soldier_03_F: I_Soldier_base_F { + class HitPoints: HitPoints { + class HitHead: HitHead {}; + class HitBody: HitBody {}; + class HitHands: HitHands {}; + class HitLegs: HitLegs {}; + + class HitLeftArm: HitLeftArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + }; + }; + + class I_Soldier_04_F: I_Soldier_base_F { + class HitPoints: HitPoints { + class HitHead: HitHead {}; + class HitBody: HitBody {}; + class HitHands: HitHands {}; + class HitLegs: HitLegs {}; + + class HitLeftArm: HitLeftArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_BETTER; + }; + }; + }; + + class O_Soldier_base_F: SoldierEB { + class HitPoints: HitPoints { + class HitHead: HitHead {}; + class HitBody: HitBody {}; + class HitHands: HitHands {}; + class HitLegs: HitLegs {}; + + class HitLeftArm: HitLeftArm { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + }; + }; + + class O_Soldier_02_F: O_Soldier_base_F { + class HitPoints: HitPoints { + class HitHead: HitHead {}; + class HitBody: HitBody {}; + class HitHands: HitHands {}; + class HitLegs: HitLegs {}; + + class HitLeftArm: HitLeftArm { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + + class HitRightArm: HitRightArm { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + + class HitLeftLeg: HitLeftLeg { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + + class HitRightLeg: HitRightLeg { + armor = ARM_LEG_ARMOR_CSAT; + passThrough = 0.85; + }; + }; + }; +}; diff --git a/addons/medical/CfgWeapons.hpp b/addons/medical/CfgWeapons.hpp new file mode 100644 index 0000000000..34636cf0fb --- /dev/null +++ b/addons/medical/CfgWeapons.hpp @@ -0,0 +1,317 @@ +class CfgWeapons { + class ItemCore; + class InventoryItem_Base_F; + class ACE_bandage_basic: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_BANDAGE_BASIC_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\field_dressing.paa)); + model = QUOTE(PATHTOF(equipment\bandages\fielddressing.p3d)); + descriptionShort = $STR_ACE_MAG_BANDAGE_BASIC_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_BANDAGE_BASIC_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=0.5; + type=201; + }; + }; + class ACE_packing_bandage: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_PACKING_BANDAGE_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\packing_bandage.paa)); + model = QUOTE(PATHTOF(equipment\bandages\packingbandage.p3d)); + descriptionShort = $STR_ACE_MAG_PACKING_BANDAGE_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_PACKING_BANDAGE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_bandageElastic: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_BANDAGE_ELASTIC_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\bandageElastic.paa)); + model = "\A3\Structures_F_EPA\Items\Medical\Bandage_F.p3d"; + descriptionShort = $STR_ACE_MAG_BANDAGE_ELASTIC_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_BANDAGE_ELASTIC_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_tourniquet: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_TOURNIQUET_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\tourniquet.paa)); + model = QUOTE(PATHTOF(equipment\Tourniquet.p3d)); + descriptionShort = $STR_ACE_MAG_TOURNIQUET_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_TOURNIQUET_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_splint: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_SPLINT_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\splint.paa)); + descriptionUse = $STR_ACE_MAG_SPLINT_DESC_USE; + descriptionShort = $STR_ACE_MAG_SPLINT_DESC_SHORT; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_morphine: ItemCore + { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_MORPHINE_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\morphine.paa)); + model = QUOTE(PATHTOF(equipment\Morphinpen.p3d)); + descriptionShort = $STR_ACE_MAG_MORPHINE_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_MORPHINE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_atropine: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_ATROPINE_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\atropine.paa)); + model = QUOTE(PATHTOF(equipment\Atropin-pen.p3d)); + descriptionShort = $STR_ACE_MAG_ATROPINE_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_ATROPINE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_epinephrine: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_EPINEPHRINE_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\epinephrine.paa)); + model = QUOTE(PATHTOF(equipment\Epipen.p3d)); + descriptionShort = $STR_ACE_MAG_EPINEPHRINE_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_EPINEPHRINE_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_plasma_iv: ItemCore { + scope = 2; + value = 1; + count = 1; + displayName = $STR_ACE_MAG_PLASMA_IV; + picture = QUOTE(PATHTOF(equipment\img\plasma_iv.paa)); + descriptionShort = $STR_ACE_MAG_PLASMA_IV_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_PLASMA_IV_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_plasma_iv_500: ACE_plasma_iv { + displayName = $STR_ACE_MAG_PLASMA_IV_500; + }; + class ACE_plasma_iv_250: ACE_plasma_iv_500 { + displayName = $STR_ACE_MAG_PLASMA_IV_250; + }; + class ACE_blood_iv: ItemCore { + scope = 2; + value = 1; + count = 1; + model = "\A3\Structures_F_EPA\Items\Medical\BloodBag_F.p3d"; + displayName = $STR_ACE_MAG_BLOOD_IV; + picture = QUOTE(PATHTOF(equipment\img\bloodbag.paa)); + descriptionShort = $STR_ACE_MAG_BLOOD_IV_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_BLOOD_IV_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_blood_iv_500: ACE_blood_iv { + displayName = $STR_ACE_MAG_BLOOD_IV_500; + }; + class ACE_blood_iv_250: ACE_blood_iv_500 { + displayName = $STR_ACE_MAG_BLOOD_IV_250; + }; + class ACE_saline_iv: ItemCore { + scope = 2; + value = 1; + count = 1; + displayName = $STR_ACE_MAG_SALINE_IV; + picture = QUOTE(PATHTOF(equipment\img\saline_iv.paa)); + descriptionShort = $STR_ACE_MAG_SALINE_IV_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_SALINE_IV_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_saline_iv_500: ACE_saline_iv { + displayName = $STR_ACE_MAG_SALINE_IV_500; + }; + class ACE_saline_iv_250: ACE_saline_iv_500 { + displayName = $STR_ACE_MAG_SALINE_IV_250; + }; + class ACE_quikclot: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_QUIKCLOT_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\quickclot.paa)); + descriptionShort = $STR_ACE_MAG_QUIKCLOT_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_QUIKCLOT_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_nasopharyngeal_tube: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_NPA_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\nasopharyngeal_tube.paa)); + descriptionUse = $STR_ACE_MAG_NPA_DESC_USE; + descriptionShort = $STR_ACE_MAG_NPA_DESC_SHORT; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_opa: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_OPA_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\nasopharyngeal_tube.paa)); + descriptionShort = $STR_ACE_MAG_OPA_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_OPA_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_liquidSkin: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_LIQUID_SKIN_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\liquidSkin.paa)); + model = QUOTE(PATHTOF(equipment\skinliquid.p3d)); + descriptionShort = $STR_ACE_MAG_LIQUID_SKIN_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_LIQUID_SKIN_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_chestseal: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_CHEST_SEAL_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\chestseal.paa)); + descriptionShort = $STR_ACE_MAG_CHEST_SEAL_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_CHEST_SEAL_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=1; + type=201; + }; + }; + class ACE_personal_aid_kit: ItemCore { + scope = 2; + value = 1; + count = 1; + type = 16; + displayName = $STR_ACE_MAG_AID_KIT_DISPLAY; + picture = QUOTE(PATHTOF(equipment\img\personal_aid_kit.paa)); + model = QUOTE(PATHTOF(equipment\Personal-aidkits\MTP.p3d)); + descriptionShort = $STR_ACE_MAG_AID_KIT_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_AID_KIT_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass=2; + type=201; + }; + }; + class ACE_surgical_kit: ItemCore + { + scope=2; + displayName= $STR_ACE_MAG_SURGICALKIT_DISPLAY; + model = QUOTE(PATHTOF(equipment\surgical_kit.p3d)); + picture = QUOTE(PATHTOF(equipment\img\surgical_kit.paa)); + descriptionShort = $STR_ACE_MAG_SURGICALKIT_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_SURGICALKIT_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass= 5; + type=201; + }; + }; + class ACE_itemBodyBag: ItemCore + { + scope=2; + displayName= $STR_ACE_MAG_BODYBAG_DISPLAY; + model = QUOTE(PATHTOF(equipment\bodybagItem.p3d)); + picture = QUOTE(PATHTOF(equipment\img\bodybag.paa)); + descriptionShort = $STR_ACE_MAG_BODYBAG_DESC_SHORT; + descriptionUse = $STR_ACE_MAG_BODYBAG_DESC_USE; + class ItemInfo: InventoryItem_Base_F + { + mass= 15; + type=201; + }; + }; +}; diff --git a/addons/medical/README.md b/addons/medical/README.md new file mode 100644 index 0000000000..0b2b7a4038 --- /dev/null +++ b/addons/medical/README.md @@ -0,0 +1,10 @@ +ace_medical +=============== + +Provides a basic and advanced medical system. + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [Glowbal](https://github.com/Glowbal) diff --git a/addons/medical/XEH_postInit.sqf b/addons/medical/XEH_postInit.sqf new file mode 100644 index 0000000000..062df32ddf --- /dev/null +++ b/addons/medical/XEH_postInit.sqf @@ -0,0 +1,245 @@ +/** + * XEH_postInit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" +#include "variable_defines.sqf" + +GVAR(injuredUnitCollection) = []; +[{ + { + if (!alive _x || !local _x) then { + GVAR(injuredUnitCollection) set [ _forEachIndex, ObjNull]; + } else { + [_x] call FUNC(handleUnitVitals); + + private "_pain"; + _pain = _X getvariable [QGVAR(amountOfPain), 0]; + if (_pain > 5 && (random(1) > 0.5)) then { + _x setvariable [QGVAR(amountOfPain), _pain + 0.002]; + }; + if (_pain > 45) then { + if (random(1) > 0.6) then { + [_X] call FUNC(setUnconsciousState); + }; + //[_X] call FUNC(playInjuredSound); + }; + }; + }foreach GVAR(injuredUnitCollection); + GVAR(injuredUnitCollection) = GVAR(injuredUnitCollection) - [ObjNull]; +}, 1, [] ] call CBA_fnc_addPerFrameHandler; + +[ + {(([_this select 0,QGVAR(bloodVolume)] call EFUNC(common,getDefinedVariable)) < 65)}, + {(([_this select 0,QGVAR(amountOfPain)] call EFUNC(common,getDefinedVariable)) > 48)}, + {(((_this select 0) call FUNC(getBloodLoss)) > 0.25)}, + {((_this select 0) getvariable ["ACE_inReviveState", false])} +] call FUNC(registerUnconsciousCondition); + +call FUNC(handleDisplayEffects); + +// Assigning all eventhandlers +["Medical_treatmentCompleted", FUNC(onTreatmentCompleted)] call ace_common_fnc_addEventHandler; +["onStartMovingUnit", FUNC(onStartMovingUnit)] call ace_common_fnc_addEventHandler; +["onUnconscious", FUNC(onUnconscious)] call ace_common_fnc_addEventHandler; +["carryObjectDropped", FUNC(onCarryObjectDropped)] call ace_common_fnc_addEventHandler; + +if (isNil QGVAR(ENABLE_REVIVE_F)) then { + GVAR(ENABLE_REVIVE_F) = 0; +}; + + +// Keybindings +GVAR(keyPressed) = false; + +["ACE3", + localize "STR_ACE_OPEN_CMS_MENU_DESC", + { if (!GVAR(keyPressed)) then { + GVAR(keyPressed) = true; + GVAR(timeMenuOpened) = time; + [] call FUNC(openMenu); + + true; + } else { + false; + }; + }, + [ 0, [false, false, false]], + false, + "keydown"] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_OPEN_CMS_MENU_DESC", + { + GVAR(keyPressed) = false; + if (time - GVAR(timeMenuOpened) >= (0.25*accTime)) then { + disableSerialization; + _display = uiNamespace getVariable QGVAR(medicalMenu); + if (!isnil "_display") then { + closeDialog 314412; + }; + }; + false; + }, + [ 0, [false, false, false]], + false, + "keyUp"] call cba_fnc_registerKeybind; + + +// Adding the treatment options for all available medical equipment. + +// Advanced Treatment options +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_BLOODIV_1000ml","STR_ACE_ACTION_BLOODIV_1000ML_TOOLTIP",'ACE_blood_iv'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_BLOODIV_500ml","STR_ACE_ACTION_BLOODIV_500ML_TOOLTIP",'ACE_blood_iv_500'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_BLOODIV_250ml","STR_ACE_ACTION_BLOODIV_250ML_TOOLTIP",'ACE_blood_iv_250'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_PLASMAIV_1000ml","STR_ACE_ACTION_PLASMAIV_1000ML_TOOLTIP",'ACE_plasma_iv'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_PLASMAIV_500ml","STR_ACE_ACTION_PLASMAIV_500ML_TOOLTIP",'ACE_plasma_iv_500'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_PLASMAIV_250ml","STR_ACE_ACTION_PLASMAIV_250ML_TOOLTIP",'ACE_plasma_iv_250'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_SALINEIV_1000ml","STR_ACE_ACTION_SALINEIV_1000ML_TOOLTIP",'ACE_saline_iv'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_SALINEIV_500ml","STR_ACE_ACTION_SALINEIV_500ML_TOOLTIP",'ACE_saline_iv_500'); +ADD_TREATMENT_ADVANCED("STR_ACE_ACTION_SALINEIV_250ml","STR_ACE_ACTION_SALINEIV_250ML_TOOLTIP",'ACE_saline_iv_250'); + +["STR_ACE_ACTION_PERSONAL_AID_KIT","STR_ACE_ACTION_PERSONAL_AID_KIT_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + if !([_this select 0,_this select 1, 'ACE_personal_aid_kit'] call FUNC(hasEquipment)) exitwith { + false; + }; + _inMedFacility = ([_caller] call FUNC(inMedicalFacility)); + _hasOpenWounds = ([_target] call FUNC(hasOpenWounds)); + + if ((GVAR(setting_aidKitRestrictions) == 0 && _inMedFacility) || + (GVAR(setting_aidKitRestrictions) == 1 && _inMedFacility && (!_hasOpenWounds)) || + (GVAR(setting_aidKitRestrictions) == 2) || + (GVAR(setting_aidKitRestrictions) == 3 && (!_hasOpenWounds))) exitwith { + + ((GVAR(setting_aidKitMedicsOnly) && [_caller] call FUNC(isMedic) || !GVAR(setting_aidKitMedicsOnly))); + }; + false; +},TREATMENT_ADVANCED('ACE_personal_aid_kit'),'advanced'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_PERFORM_CPR","STR_ACE_ACTION_PERFORM_CPR_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + (!(_caller getvariable[QGVAR(isProvidingCPR), false]) && ((_target getvariable [QGVAR(inCardiacArrest),false]) || !([_target] call EFUNC(common,isAwake)))) +},TREATMENT_ADVANCED('ACE_CPR'),'advanced'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_STOP_CPR","STR_ACE_ACTION_STOP_CPR_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + (_caller getvariable[QGVAR(isProvidingCPR), false]) +},{((_this select 0) setvariable[QGVAR(isProvidingCPR), nil, true])},'advanced'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_STITCHING","STR_ACE_ACTION_STITCHING_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + ((GVAR(setting_allowStitching) == 0 && [_Caller] call FUNC(isMedic)) || GVAR(setting_allowStitching) == 1) +},TREATMENT_ADVANCED('ACE_surgical_kit'),'advanced'] call FUNC(addTreatmentOption); + +// Airway Management +["STR_ACE_ACTION_APPLY_NPA","STR_ACE_ACTION_APPLY_NPA_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + if !([_this select 0,_this select 1, 'ACE_nasopharyngeal_tube'] call FUNC(hasEquipment)) exitwith { + false; + }; + (!([_target, QGVAR(airwayTreated)] call EFUNC(common,getDefinedVariable)) && !([_target] call EFUNC(common,isAwake))) +},TREATMENT_AIRWAY('ACE_nasopharyngeal_tube'),'advanced'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_REMOVE_NPA","STR_ACE_ACTION_REMOVE_NPA_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + ([_target, QGVAR(airwayTreated)] call EFUNC(common,getDefinedVariable)); +}, {GVAR(INTERACTION_TARGET) setvariable [QGVAR(airwayTreated), nil, true]; (_this select 0) addItem 'ACE_nasopharyngeal_tube';},'airway'] call FUNC(addTreatmentOption); + + +// Bandaging +ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_BANDAGE_BASIC","STR_ACE_ACTION_BANDAGE_BASIC_TOOLTIP",'ACE_bandage_basic'); +ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_QUIKCLOT","STR_ACE_ACTION_QUIKCLOT_TOOLTIP",'ACE_quikclot'); +ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_BANDAGE_ELASTIC","STR_ACE_ACTION_BANDAGE_ELASTIC_TOOLTIP",'ACE_bandageElastic'); +ADD_TREATMENT_BANDAGE("STR_ACE_ACTION_PACKING_BANDAGE","STR_ACE_ACTION_PACKING_BANDAGE_TOOLTIP",'ACE_packing_bandage'); + +["STR_ACE_ACTION_REMOVE_TOURNIQUET","STR_ACE_ACTION_REMOVE_TOURNIQUET_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + ([_target, call FUNC(getSelectedBodyPart)] call FUNC(hasTourniquetAppliedTo)); +},{[_this select 0,_this select 1,call FUNC(getSelectedBodyPart)] call FUNC(actionRemoveTourniquet)},'bandage'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_APPLY_TOURNIQUET","STR_ACE_ACTION_APPLY_TOURNIQUET_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + (!([_target, call FUNC(getSelectedBodyPart)] call FUNC(hasTourniquetAppliedTo)) && ([_caller,_target,'ACE_tourniquet'] call FUNC(hasEquipment))); +},TREATMENT_BANDAGE('ACE_tourniquet'),'bandage'] call FUNC(addTreatmentOption); + + +// Medication +ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_MORPHINE","STR_ACE_ACTION_MORPHINE_TOOLTIP",'ACE_morphine'); +ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_ATROPINE","STR_ACE_ACTION_ATROPINE_TOOLTIP",'ACE_atropine'); +ADD_TREATMENT_MEDICATION("STR_ACE_ACTION_EPINEPHRINE","STR_ACE_ACTION_EPINEPHRINE_TOOLTIP",'ACE_epinephrine'); + + +// Examine +["STR_ACE_ACTION_CHECK_PULSE","STR_ACE_ACTION_CHECK_PULSE_TOOLTIP",{ + true; +},{[_this select 0,_this select 1] call FUNC(actionCheckPulse)},'examine'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_CHECK_BP","STR_ACE_ACTION_CHECK_BP_TOOLTIP",{ + true; +},{[_this select 0,_this select 1] call FUNC(actionCheckBloodPressure);},'examine'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_CHECK_RESPONSE","STR_ACE_ACTION_CHECK_RESPONSE_TOOLTIP",{ + true; +},{[_this select 0,_this select 1] call FUNC(actionCheckResponse)},'examine'] call FUNC(addTreatmentOption); + + +// Drag/Movement +["STR_ACE_ACTION_DRAG_PATIENT","STR_ACE_ACTION_DRAG_PATIENT_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + (isNull ([_caller] call EFUNC(common,getCarriedObj)) && isNull ([_target] call EFUNC(common,getCarriedObj)) && (_caller != _target) && (vehicle _target == _target)); +}, {[_this select 0,_this select 1] call FUNC(actionDragUnit)},'drag'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_CARRY_PATIENT","STR_ACE_ACTION_CARRY_PATIENT_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + (isNull ([_caller] call EFUNC(common,getCarriedObj)) && isNull ([_target] call EFUNC(common,getCarriedObj)) && (_caller != _target) && (vehicle _target == _target)); +}, {[_this select 0,_this select 1] call FUNC(actionCarryUnit)},'drag'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_BODYBAG","STR_ACE_ACTION_BODYBAG_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + (isNull ([_caller] call EFUNC(common,getCarriedObj)) && isNull ([_target] call EFUNC(common,getCarriedObj)) && (_caller != _target) && (vehicle _target == _target) && ([_caller, _target] call FUNC(canPutInBodyBag))); +}, {[_this select 0,_this select 1] call FUNC(actionPlaceInBodyBag)},'drag'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_DROP_PATIENT","STR_ACE_ACTION_DROP_PATIENT_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + (!(isNull ([_caller] call EFUNC(common,getCarriedObj))) && ([_caller] call FUNC(isMovingUnit))); +}, {[_this select 0,_this select 1] call FUNC(actionDropUnit)},'drag'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_LOAD_PATIENT","STR_ACE_ACTION_LOAD_PATIENT_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + ((vehicle _target == _target)); +}, {[_this select 0,_this select 1] call FUNC(actionLoadUnit)},'drag'] call FUNC(addTreatmentOption); + +["STR_ACE_ACTION_UNLOAD_PATIENT","STR_ACE_ACTION_UNLOAD_PATIENT_TOOLTIP",{ + _caller = _this select 0; + _target = _this select 1; + + ((vehicle _target != _target)); +}, {[_this select 0,_this select 1] call FUNC(actionUnloadUnit)},'drag'] call FUNC(addTreatmentOption); diff --git a/addons/medical/XEH_preInit.sqf b/addons/medical/XEH_preInit.sqf new file mode 100644 index 0000000000..331edd5b21 --- /dev/null +++ b/addons/medical/XEH_preInit.sqf @@ -0,0 +1,169 @@ +/** + * XEH_preInit); + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +PREP(actionCarryUnit); +PREP(ActioncheckBloodPressure); +PREP(ActionCheckBloodPressureLocal); +PREP(ActionCheckPulse); +PREP(actionCheckPulseLocal); +PREP(actionCheckResponse); +PREP(actionDragUnit); +PREP(actionDropUnit); +PREP(actionLoadUnit); +PREP(actionPlaceInBodyBag); +PREP(actionRemoveTourniquet); +PREP(actionUnloadUnit); + +PREP(addActivityToLog); +PREP(addHeartRateAdjustment); +PREP(addOpenWounds); +PREP(addToInjuredCollection); +PREP(addToQuickViewLog); +PREP(addToTriageList); +PREP(addTreatmentOption); + +PREP(canAccessMedicalEquipment); +PREP(canPutInBodyBag); +PREP(determineIfFatal); +PREP(determineIfUnconscious); +PREP(fromNumberToBodyPart); + +PREP(effectPain); +PREP(effectBleeding); +PREP(effectBlackOut); + +PREP(getActivityLog); +PREP(getBloodLoss); +PREP(getBloodPressure); +PREP(getBloodVolumeChange); +PREP(getBodyPartNumber); +PREP(getCardiacOutput); +PREP(getCurrentSelectedInjuryData); +PREP(getHeartRateChange); +PREP(getNewDamageBodyPart); +PREP(getQuickViewLog); +PREP(getSelectedBodyPart); +PREP(getTreatmentOptions); +PREP(getTriageList); +PREP(getTriageStatus); +PREP(getTypeOfDamage); + +// Handling events & actions +PREP(handleBandageOpening); +PREP(handleDamage); +PREP(handleDisplayEffects); +PREP(handleHeal); +PREP(handleReactionHit); +PREP(handleTreatment); +PREP(handleTreatment_Action_AdvancedLocal); +PREP(handleTreatment_Action_AirwayLocal); +PREP(handleTreatment_Action_BandageLocal); +PREP(handleTreatment_Action_CPR); +PREP(handleTreatment_Action_CPRLocal); +PREP(handleTreatment_Action_fullHeal); +PREP(handleTreatment_Action_fullHealLocal); +PREP(handleTreatment_Action_MedicationLocal); +PREP(handleTreatment_Action_Stitching); +PREP(handleTreatment_Action_tourniquet); +PREP(handleTreatment_Action_tourniquetLocal); +PREP(handleTreatment_Category_Advanced); +PREP(handleTreatment_Category_Airway); +PREP(handleTreatment_Category_Bandaging); +PREP(handleTreatment_Category_Medication); +PREP(handleUI_DisplayOptions); +PREP(handleUI_dropDownTriageCard); +PREP(handleUnitVitals); +PREP(handleDropUnit); + +PREP(hasEquipment); +PREP(hasMedicalEnabled); +PREP(hasOpenWounds); +PREP(hasTourniquetAppliedTo); + +PREP(increasePain); +PREP(initalizeModuleCMS); +PREP(inMedicalFacility); +PREP(isMedic); +PREP(isMedicalVehicle); +PREP(isSetTreatmentMutex); +PREP(isMovingUnit); + +PREP(moduleAssignMedicalEquipment); +PREP(moduleAssignMedicalFacility); +PREP(moduleAssignMedicalVehicle); +PREP(moduleAssignMedicRoles); +PREP(moduleDamageSettings); + +PREP(onInitForUnit); +PREP(onInjury_assignAirwayStatus); +PREP(onInjury_assignFractures); +PREP(onInjury_assignOpenWounds); +PREP(onKilled); +PREP(onLocal); +PREP(onMenuOpen); +PREP(onTreatmentCompleted); +PREP(onUnconscious); +PREP(onStartMovingUnit); +PREP(onCarryObjectDropped); +PREP(onDamage); + +PREP(openMenu); +PREP(playInjuredSound); +PREP(setCardiacArrest); +PREP(setDamageBodyPart); +PREP(setDead); +PREP(setMedicRole); +PREP(setTriageStatus); +PREP(treatmentMutex); + +PREP(updateActivityLog); +PREP(updateBodyImg); +PREP(updateIcons); +PREP(updateUIInfo); + +PREP(useEquipment); +PREP(cacheHandledamageCall); +PREP(checkDamage); + + +PREP(setUnconsciousState); +PREP(isUnconscious); +PREP(getUnconsciousCondition); +PREP(registerUnconsciousCondition); +PREP(cleanUpCopyOfBody_F); +PREP(makeCopyOfBody_F); +PREP(canGoUnconsciousState); +PREP(setDead); +PREP(moduleBasicRevive); + +PREP(setWeaponsCorrectUnconscious); +PREP(setCaptiveSwitch); + + +// initalize all module parameters. +GVAR(setting_allowInstantDead) = true; +GVAR(setting_AdvancedLevel) = 0; +GVAR(setting_advancedWoundsSetting) = false; +GVAR(setting_advancedMedicRoles) = false; +GVAR(setting_medicalDifficulty) = 1; +GVAR(setting_enableBandagingAid) = true; +GVAR(setting_allowAIFullHeal) = false; +GVAR(setting_enableForUnits) = 1; +GVAR(setting_allowAirwayInjuries) = false; +GVAR(setting_aidKitRestrictions) = 0; +GVAR(setting_removeAidKitOnUse) = true; +GVAR(setting_aidKitMedicsOnly) = false; +GVAR(setting_bandageWaitingTime) = 5; +GVAR(setting_allowVehicleCrashInjuries) = true; +GVAR(setting_allowStitching) = 0; + +ADDON = true; diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp new file mode 100644 index 0000000000..96af8ac1ca --- /dev/null +++ b/addons/medical/config.cpp @@ -0,0 +1,31 @@ +#include "script_component.hpp" + +class CfgPatches +{ + class ADDON + { + units[] = {"ACE_medical_supply_crate_cms", "ACE_bandage_basicItem","ACE_packing_bandageItem","ACE_bandageElasticItem","ACE_tourniquetItem","ACE_splintItem","ACE_morphineItem","ACE_atropineItem","ACE_epinephrineItem","ACE_plasma_ivItem","ACE_plasma_iv_500Item","ACE_plasma_iv250Item","ACE_blood_ivItem","ACE_blood_iv_500Item","ACE_blood_iv_250Item","ACE_saline_ivItem","ACE_saline_iv_500Item","ACE_saline_iv_250Item","ACE_quikclotItem","ACE_nasopharyngeal_tubeItem","ACE_opaItem","ACE_liquidSkinItem","ACE_chestsealItem","ACE_personal_aid_kitItem"}; + weapons[] = {"ACE_surgical_kit"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ACE_gui","ACE_common"}; + version = VERSION; + author[] = {$STR_ACE_Common_ACETeam, "Glowbal"}; + authorUrl = "http://csemod.com"; + }; +}; +class CfgAddons { + class PreloadAddons { + class ADDON { + list[] = {QUOTE(ADDON)}; + }; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgFactionClasses.hpp" +#include "CfgWeapons.hpp" +#include "CfgSounds.hpp" +#include "CfgVehicles.hpp" +#include "ui\define.hpp" +#include "ui\menu.hpp" +#include "ui\RscTitles.hpp" diff --git a/addons/medical/data/ACE_medical_module.paa b/addons/medical/data/ACE_medical_module.paa new file mode 100644 index 0000000000..9cb6c4782d Binary files /dev/null and b/addons/medical/data/ACE_medical_module.paa differ diff --git a/addons/medical/data/background_img.paa b/addons/medical/data/background_img.paa new file mode 100644 index 0000000000..de59065e3b Binary files /dev/null and b/addons/medical/data/background_img.paa differ diff --git a/addons/gui/data/black_out.paa b/addons/medical/data/black_out.paa similarity index 100% rename from addons/gui/data/black_out.paa rename to addons/medical/data/black_out.paa diff --git a/addons/gui/data/bleeding.paa b/addons/medical/data/bleeding.paa similarity index 100% rename from addons/gui/data/bleeding.paa rename to addons/medical/data/bleeding.paa diff --git a/addons/medical/data/body_arm_left.paa b/addons/medical/data/body_arm_left.paa new file mode 100644 index 0000000000..245cc4ba31 Binary files /dev/null and b/addons/medical/data/body_arm_left.paa differ diff --git a/addons/medical/data/body_arm_right.paa b/addons/medical/data/body_arm_right.paa new file mode 100644 index 0000000000..2023d1e0b4 Binary files /dev/null and b/addons/medical/data/body_arm_right.paa differ diff --git a/addons/medical/data/body_arms.paa b/addons/medical/data/body_arms.paa new file mode 100644 index 0000000000..b4b272f73d Binary files /dev/null and b/addons/medical/data/body_arms.paa differ diff --git a/addons/medical/data/body_background.paa b/addons/medical/data/body_background.paa new file mode 100644 index 0000000000..d3f7440e68 Binary files /dev/null and b/addons/medical/data/body_background.paa differ diff --git a/addons/medical/data/body_head.paa b/addons/medical/data/body_head.paa new file mode 100644 index 0000000000..77ddd995bc Binary files /dev/null and b/addons/medical/data/body_head.paa differ diff --git a/addons/medical/data/body_img-arms.paa b/addons/medical/data/body_img-arms.paa new file mode 100644 index 0000000000..f469a59359 Binary files /dev/null and b/addons/medical/data/body_img-arms.paa differ diff --git a/addons/medical/data/body_img-head.paa b/addons/medical/data/body_img-head.paa new file mode 100644 index 0000000000..2f7d15e1ca Binary files /dev/null and b/addons/medical/data/body_img-head.paa differ diff --git a/addons/medical/data/body_img-legs.paa b/addons/medical/data/body_img-legs.paa new file mode 100644 index 0000000000..35f68d8635 Binary files /dev/null and b/addons/medical/data/body_img-legs.paa differ diff --git a/addons/medical/data/body_img-torso.paa b/addons/medical/data/body_img-torso.paa new file mode 100644 index 0000000000..cc5ecb9d60 Binary files /dev/null and b/addons/medical/data/body_img-torso.paa differ diff --git a/addons/medical/data/body_leg_left.paa b/addons/medical/data/body_leg_left.paa new file mode 100644 index 0000000000..a116305258 Binary files /dev/null and b/addons/medical/data/body_leg_left.paa differ diff --git a/addons/medical/data/body_leg_right.paa b/addons/medical/data/body_leg_right.paa new file mode 100644 index 0000000000..02ce66ba70 Binary files /dev/null and b/addons/medical/data/body_leg_right.paa differ diff --git a/addons/medical/data/body_legs.paa b/addons/medical/data/body_legs.paa new file mode 100644 index 0000000000..9af3adc2ca Binary files /dev/null and b/addons/medical/data/body_legs.paa differ diff --git a/addons/medical/data/body_torso.paa b/addons/medical/data/body_torso.paa new file mode 100644 index 0000000000..0a7212ac95 Binary files /dev/null and b/addons/medical/data/body_torso.paa differ diff --git a/addons/medical/data/border_arm_left.paa b/addons/medical/data/border_arm_left.paa new file mode 100644 index 0000000000..eae1d751cf Binary files /dev/null and b/addons/medical/data/border_arm_left.paa differ diff --git a/addons/medical/data/border_arm_right.paa b/addons/medical/data/border_arm_right.paa new file mode 100644 index 0000000000..0aea4ce20e Binary files /dev/null and b/addons/medical/data/border_arm_right.paa differ diff --git a/addons/medical/data/border_head.paa b/addons/medical/data/border_head.paa new file mode 100644 index 0000000000..3b2e7aaf10 Binary files /dev/null and b/addons/medical/data/border_head.paa differ diff --git a/addons/medical/data/border_leg_left.paa b/addons/medical/data/border_leg_left.paa new file mode 100644 index 0000000000..7ff3b170fa Binary files /dev/null and b/addons/medical/data/border_leg_left.paa differ diff --git a/addons/medical/data/border_leg_right.paa b/addons/medical/data/border_leg_right.paa new file mode 100644 index 0000000000..bef0f70779 Binary files /dev/null and b/addons/medical/data/border_leg_right.paa differ diff --git a/addons/medical/data/border_torso.paa b/addons/medical/data/border_torso.paa new file mode 100644 index 0000000000..2b70076939 Binary files /dev/null and b/addons/medical/data/border_torso.paa differ diff --git a/addons/medical/data/buttonDisabled_gradient.paa b/addons/medical/data/buttonDisabled_gradient.paa new file mode 100644 index 0000000000..43b1b8d100 Binary files /dev/null and b/addons/medical/data/buttonDisabled_gradient.paa differ diff --git a/addons/medical/data/buttonNormal_gradient.paa b/addons/medical/data/buttonNormal_gradient.paa new file mode 100644 index 0000000000..2210f98741 Binary files /dev/null and b/addons/medical/data/buttonNormal_gradient.paa differ diff --git a/addons/medical/data/buttonNormal_gradient2.paa b/addons/medical/data/buttonNormal_gradient2.paa new file mode 100644 index 0000000000..cabe6c7fed Binary files /dev/null and b/addons/medical/data/buttonNormal_gradient2.paa differ diff --git a/addons/medical/data/buttonNormal_gradient3.paa b/addons/medical/data/buttonNormal_gradient3.paa new file mode 100644 index 0000000000..7da9fbcf8a Binary files /dev/null and b/addons/medical/data/buttonNormal_gradient3.paa differ diff --git a/addons/medical/data/buttonNormal_gradient_top.paa b/addons/medical/data/buttonNormal_gradient_top.paa new file mode 100644 index 0000000000..904e1a62f7 Binary files /dev/null and b/addons/medical/data/buttonNormal_gradient_top.paa differ diff --git a/addons/gui/data/hit.paa b/addons/medical/data/hit.paa similarity index 100% rename from addons/gui/data/hit.paa rename to addons/medical/data/hit.paa diff --git a/addons/medical/data/icons/advanced_treatment_small.paa b/addons/medical/data/icons/advanced_treatment_small.paa new file mode 100644 index 0000000000..8becb9d2df Binary files /dev/null and b/addons/medical/data/icons/advanced_treatment_small.paa differ diff --git a/addons/medical/data/icons/airway_management_small.paa b/addons/medical/data/icons/airway_management_small.paa new file mode 100644 index 0000000000..ab4da47958 Binary files /dev/null and b/addons/medical/data/icons/airway_management_small.paa differ diff --git a/addons/medical/data/icons/bandage_fracture_small.paa b/addons/medical/data/icons/bandage_fracture_small.paa new file mode 100644 index 0000000000..a869f260ec Binary files /dev/null and b/addons/medical/data/icons/bandage_fracture_small.paa differ diff --git a/addons/medical/data/icons/examine_patient_small.paa b/addons/medical/data/icons/examine_patient_small.paa new file mode 100644 index 0000000000..2e9fc9831d Binary files /dev/null and b/addons/medical/data/icons/examine_patient_small.paa differ diff --git a/addons/medical/data/icons/icon_advanced_treatment.paa b/addons/medical/data/icons/icon_advanced_treatment.paa new file mode 100644 index 0000000000..d6bf6effd9 Binary files /dev/null and b/addons/medical/data/icons/icon_advanced_treatment.paa differ diff --git a/addons/medical/data/icons/icon_airway_management.paa b/addons/medical/data/icons/icon_airway_management.paa new file mode 100644 index 0000000000..f444f5f385 Binary files /dev/null and b/addons/medical/data/icons/icon_airway_management.paa differ diff --git a/addons/medical/data/icons/icon_bandage_fracture.paa b/addons/medical/data/icons/icon_bandage_fracture.paa new file mode 100644 index 0000000000..df8d1de571 Binary files /dev/null and b/addons/medical/data/icons/icon_bandage_fracture.paa differ diff --git a/addons/medical/data/icons/icon_bleeding.paa b/addons/medical/data/icons/icon_bleeding.paa new file mode 100644 index 0000000000..d11c2ed496 Binary files /dev/null and b/addons/medical/data/icons/icon_bleeding.paa differ diff --git a/addons/medical/data/icons/icon_carry.paa b/addons/medical/data/icons/icon_carry.paa new file mode 100644 index 0000000000..7ebb830b03 Binary files /dev/null and b/addons/medical/data/icons/icon_carry.paa differ diff --git a/addons/medical/data/icons/icon_examine_patient.paa b/addons/medical/data/icons/icon_examine_patient.paa new file mode 100644 index 0000000000..12eb06c890 Binary files /dev/null and b/addons/medical/data/icons/icon_examine_patient.paa differ diff --git a/addons/medical/data/icons/icon_medication.paa b/addons/medical/data/icons/icon_medication.paa new file mode 100644 index 0000000000..98893ad863 Binary files /dev/null and b/addons/medical/data/icons/icon_medication.paa differ diff --git a/addons/medical/data/icons/icon_toggle_self.paa b/addons/medical/data/icons/icon_toggle_self.paa new file mode 100644 index 0000000000..3078eb5dd5 Binary files /dev/null and b/addons/medical/data/icons/icon_toggle_self.paa differ diff --git a/addons/medical/data/icons/icon_tourniquet.paa b/addons/medical/data/icons/icon_tourniquet.paa new file mode 100644 index 0000000000..8b34a7bfbb Binary files /dev/null and b/addons/medical/data/icons/icon_tourniquet.paa differ diff --git a/addons/medical/data/icons/icon_tourniquet_small.paa b/addons/medical/data/icons/icon_tourniquet_small.paa new file mode 100644 index 0000000000..a457e2c0d5 Binary files /dev/null and b/addons/medical/data/icons/icon_tourniquet_small.paa differ diff --git a/addons/medical/data/icons/icon_triage_card.paa b/addons/medical/data/icons/icon_triage_card.paa new file mode 100644 index 0000000000..850ab0f4ce Binary files /dev/null and b/addons/medical/data/icons/icon_triage_card.paa differ diff --git a/addons/medical/data/icons/medication_small.paa b/addons/medical/data/icons/medication_small.paa new file mode 100644 index 0000000000..b6acd670c8 Binary files /dev/null and b/addons/medical/data/icons/medication_small.paa differ diff --git a/addons/medical/data/icons/toggle_self_small.paa b/addons/medical/data/icons/toggle_self_small.paa new file mode 100644 index 0000000000..73108e5a98 Binary files /dev/null and b/addons/medical/data/icons/toggle_self_small.paa differ diff --git a/addons/medical/data/icons/triage_card_small.paa b/addons/medical/data/icons/triage_card_small.paa new file mode 100644 index 0000000000..92eb0f0d20 Binary files /dev/null and b/addons/medical/data/icons/triage_card_small.paa differ diff --git a/addons/gui/data/painScreen.paa b/addons/medical/data/painScreen.paa similarity index 100% rename from addons/gui/data/painScreen.paa rename to addons/medical/data/painScreen.paa diff --git a/addons/medical/data/ui_background.paa b/addons/medical/data/ui_background.paa new file mode 100644 index 0000000000..f1c42c7d7d Binary files /dev/null and b/addons/medical/data/ui_background.paa differ diff --git a/addons/medical/equipment/Atropin-pen.p3d b/addons/medical/equipment/Atropin-pen.p3d new file mode 100644 index 0000000000..a34d11641a Binary files /dev/null and b/addons/medical/equipment/Atropin-pen.p3d differ diff --git a/addons/medical/equipment/Atropin-pen_used.p3d b/addons/medical/equipment/Atropin-pen_used.p3d new file mode 100644 index 0000000000..85c123f9af Binary files /dev/null and b/addons/medical/equipment/Atropin-pen_used.p3d differ diff --git a/addons/medical/equipment/Bandage elastic.p3d b/addons/medical/equipment/Bandage elastic.p3d new file mode 100644 index 0000000000..c215842967 Binary files /dev/null and b/addons/medical/equipment/Bandage elastic.p3d differ diff --git a/addons/medical/equipment/Bandage-Pack.p3d b/addons/medical/equipment/Bandage-Pack.p3d new file mode 100644 index 0000000000..441af289c9 Binary files /dev/null and b/addons/medical/equipment/Bandage-Pack.p3d differ diff --git a/addons/medical/equipment/Bandage-elastic.p3d b/addons/medical/equipment/Bandage-elastic.p3d new file mode 100644 index 0000000000..c5a84c09f6 Binary files /dev/null and b/addons/medical/equipment/Bandage-elastic.p3d differ diff --git a/addons/medical/equipment/Epipen.p3d b/addons/medical/equipment/Epipen.p3d new file mode 100644 index 0000000000..8a1b0e5e35 Binary files /dev/null and b/addons/medical/equipment/Epipen.p3d differ diff --git a/addons/medical/equipment/Epipen_used.p3d b/addons/medical/equipment/Epipen_used.p3d new file mode 100644 index 0000000000..af1294b0e2 Binary files /dev/null and b/addons/medical/equipment/Epipen_used.p3d differ diff --git a/addons/medical/equipment/Morphinpen.p3d b/addons/medical/equipment/Morphinpen.p3d new file mode 100644 index 0000000000..06a39e7d56 Binary files /dev/null and b/addons/medical/equipment/Morphinpen.p3d differ diff --git a/addons/medical/equipment/Morphinpen_used.p3d b/addons/medical/equipment/Morphinpen_used.p3d new file mode 100644 index 0000000000..6e6bf06119 Binary files /dev/null and b/addons/medical/equipment/Morphinpen_used.p3d differ diff --git a/addons/medical/equipment/Personal-aidkits/MTP.p3d b/addons/medical/equipment/Personal-aidkits/MTP.p3d new file mode 100644 index 0000000000..f2313e9652 Binary files /dev/null and b/addons/medical/equipment/Personal-aidkits/MTP.p3d differ diff --git a/addons/medical/equipment/Personal-aidkits/data/MTP_co.paa b/addons/medical/equipment/Personal-aidkits/data/MTP_co.paa new file mode 100644 index 0000000000..660ebe3477 Binary files /dev/null and b/addons/medical/equipment/Personal-aidkits/data/MTP_co.paa differ diff --git a/addons/medical/equipment/Personal-aidkits/data/Mulitcam.paa b/addons/medical/equipment/Personal-aidkits/data/Mulitcam.paa new file mode 100644 index 0000000000..3e55892c84 Binary files /dev/null and b/addons/medical/equipment/Personal-aidkits/data/Mulitcam.paa differ diff --git a/addons/medical/equipment/Personal-aidkits/data/Personalaidkit.rvmat b/addons/medical/equipment/Personal-aidkits/data/Personalaidkit.rvmat new file mode 100644 index 0000000000..a071c22c19 --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/Personal-aidkits/data/Personalaidkit_nohq.paa b/addons/medical/equipment/Personal-aidkits/data/Personalaidkit_nohq.paa new file mode 100644 index 0000000000..0d03b45372 Binary files /dev/null and b/addons/medical/equipment/Personal-aidkits/data/Personalaidkit_nohq.paa differ diff --git a/addons/medical/equipment/Personal-aidkits/data/Personalaidkit_smdi.paa b/addons/medical/equipment/Personal-aidkits/data/Personalaidkit_smdi.paa new file mode 100644 index 0000000000..2fb8bec533 Binary files /dev/null and b/addons/medical/equipment/Personal-aidkits/data/Personalaidkit_smdi.paa differ diff --git a/addons/medical/equipment/QuickClot.p3d b/addons/medical/equipment/QuickClot.p3d new file mode 100644 index 0000000000..aa431372bb Binary files /dev/null and b/addons/medical/equipment/QuickClot.p3d differ diff --git a/addons/medical/equipment/Tourniquet.p3d b/addons/medical/equipment/Tourniquet.p3d new file mode 100644 index 0000000000..300a74c166 Binary files /dev/null and b/addons/medical/equipment/Tourniquet.p3d differ diff --git a/addons/medical/equipment/bandages/fielddressing.p3d b/addons/medical/equipment/bandages/fielddressing.p3d new file mode 100644 index 0000000000..6b7f94ef9b Binary files /dev/null and b/addons/medical/equipment/bandages/fielddressing.p3d differ diff --git a/addons/medical/equipment/bandages/fielddressing.rvmat b/addons/medical/equipment/bandages/fielddressing.rvmat new file mode 100644 index 0000000000..7eda45da4f --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/bandages/fielddressing_color.paa b/addons/medical/equipment/bandages/fielddressing_color.paa new file mode 100644 index 0000000000..7d68a365c2 Binary files /dev/null and b/addons/medical/equipment/bandages/fielddressing_color.paa differ diff --git a/addons/medical/equipment/bandages/fielddressing_garbage.p3d b/addons/medical/equipment/bandages/fielddressing_garbage.p3d new file mode 100644 index 0000000000..0939de5c08 Binary files /dev/null and b/addons/medical/equipment/bandages/fielddressing_garbage.p3d differ diff --git a/addons/medical/equipment/bandages/fielddressing_nohq.paa b/addons/medical/equipment/bandages/fielddressing_nohq.paa new file mode 100644 index 0000000000..c66785cf13 Binary files /dev/null and b/addons/medical/equipment/bandages/fielddressing_nohq.paa differ diff --git a/addons/medical/equipment/bandages/fielddressing_smdi.paa b/addons/medical/equipment/bandages/fielddressing_smdi.paa new file mode 100644 index 0000000000..96376989f7 Binary files /dev/null and b/addons/medical/equipment/bandages/fielddressing_smdi.paa differ diff --git a/addons/medical/equipment/bandages/packingbandage.p3d b/addons/medical/equipment/bandages/packingbandage.p3d new file mode 100644 index 0000000000..c1cc09af35 Binary files /dev/null and b/addons/medical/equipment/bandages/packingbandage.p3d differ diff --git a/addons/medical/equipment/bandages/packingbandage.rvmat b/addons/medical/equipment/bandages/packingbandage.rvmat new file mode 100644 index 0000000000..3d65ab3b93 --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/bandages/packingbandage_color.paa b/addons/medical/equipment/bandages/packingbandage_color.paa new file mode 100644 index 0000000000..54b1f75e2e Binary files /dev/null and b/addons/medical/equipment/bandages/packingbandage_color.paa differ diff --git a/addons/medical/equipment/bandages/packingbandage_garbage.p3d b/addons/medical/equipment/bandages/packingbandage_garbage.p3d new file mode 100644 index 0000000000..cb695caac6 Binary files /dev/null and b/addons/medical/equipment/bandages/packingbandage_garbage.p3d differ diff --git a/addons/medical/equipment/bandages/packingbandage_nohq.paa b/addons/medical/equipment/bandages/packingbandage_nohq.paa new file mode 100644 index 0000000000..1b3782c501 Binary files /dev/null and b/addons/medical/equipment/bandages/packingbandage_nohq.paa differ diff --git a/addons/medical/equipment/bandages/packingbandage_smdi.paa b/addons/medical/equipment/bandages/packingbandage_smdi.paa new file mode 100644 index 0000000000..8d5b3848ac Binary files /dev/null and b/addons/medical/equipment/bandages/packingbandage_smdi.paa differ diff --git a/addons/medical/equipment/bodybag.p3d b/addons/medical/equipment/bodybag.p3d new file mode 100644 index 0000000000..4a6b6e85ab Binary files /dev/null and b/addons/medical/equipment/bodybag.p3d differ diff --git a/addons/medical/equipment/bodybagItem.p3d b/addons/medical/equipment/bodybagItem.p3d new file mode 100644 index 0000000000..11168bf776 Binary files /dev/null and b/addons/medical/equipment/bodybagItem.p3d differ diff --git a/addons/medical/equipment/data/Atropinpen_co.paa b/addons/medical/equipment/data/Atropinpen_co.paa new file mode 100644 index 0000000000..3e44836bee Binary files /dev/null and b/addons/medical/equipment/data/Atropinpen_co.paa differ diff --git a/addons/medical/equipment/data/Epipen_co.paa b/addons/medical/equipment/data/Epipen_co.paa new file mode 100644 index 0000000000..2a1afe1f33 Binary files /dev/null and b/addons/medical/equipment/data/Epipen_co.paa differ diff --git a/addons/medical/equipment/data/Field-Dressing.rvmat b/addons/medical/equipment/data/Field-Dressing.rvmat new file mode 100644 index 0000000000..9c43af9abf --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/data/Field-Dressing_nohq.paa b/addons/medical/equipment/data/Field-Dressing_nohq.paa new file mode 100644 index 0000000000..6972636a3d Binary files /dev/null and b/addons/medical/equipment/data/Field-Dressing_nohq.paa differ diff --git a/addons/medical/equipment/data/Field-Dressing_smdi.paa b/addons/medical/equipment/data/Field-Dressing_smdi.paa new file mode 100644 index 0000000000..f450605958 Binary files /dev/null and b/addons/medical/equipment/data/Field-Dressing_smdi.paa differ diff --git a/addons/medical/equipment/data/Field-dressing.paa b/addons/medical/equipment/data/Field-dressing.paa new file mode 100644 index 0000000000..07bae7d595 Binary files /dev/null and b/addons/medical/equipment/data/Field-dressing.paa differ diff --git a/addons/medical/equipment/data/Liquid-skin.paa b/addons/medical/equipment/data/Liquid-skin.paa new file mode 100644 index 0000000000..fda64304bc Binary files /dev/null and b/addons/medical/equipment/data/Liquid-skin.paa differ diff --git a/addons/medical/equipment/data/Tournequit_co.paa b/addons/medical/equipment/data/Tournequit_co.paa new file mode 100644 index 0000000000..e83aada994 Binary files /dev/null and b/addons/medical/equipment/data/Tournequit_co.paa differ diff --git a/addons/medical/equipment/data/bandage-elastic.paa b/addons/medical/equipment/data/bandage-elastic.paa new file mode 100644 index 0000000000..3164b5d4ca Binary files /dev/null and b/addons/medical/equipment/data/bandage-elastic.paa differ diff --git a/addons/medical/equipment/data/bodybag.rvmat b/addons/medical/equipment/data/bodybag.rvmat new file mode 100644 index 0000000000..b0e6c2363c --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/data/bodybagItem.rvmat b/addons/medical/equipment/data/bodybagItem.rvmat new file mode 100644 index 0000000000..c72890391b --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/data/bodybagItem_co.paa b/addons/medical/equipment/data/bodybagItem_co.paa new file mode 100644 index 0000000000..d04f8ec64c Binary files /dev/null and b/addons/medical/equipment/data/bodybagItem_co.paa differ diff --git a/addons/medical/equipment/data/bodybagItem_nohq.paa b/addons/medical/equipment/data/bodybagItem_nohq.paa new file mode 100644 index 0000000000..5699ec5e04 Binary files /dev/null and b/addons/medical/equipment/data/bodybagItem_nohq.paa differ diff --git a/addons/medical/equipment/data/bodybagItem_smdi.paa b/addons/medical/equipment/data/bodybagItem_smdi.paa new file mode 100644 index 0000000000..cf4cf805e3 Binary files /dev/null and b/addons/medical/equipment/data/bodybagItem_smdi.paa differ diff --git a/addons/medical/equipment/data/bodybag_co.paa b/addons/medical/equipment/data/bodybag_co.paa new file mode 100644 index 0000000000..21996761b7 Binary files /dev/null and b/addons/medical/equipment/data/bodybag_co.paa differ diff --git a/addons/medical/equipment/data/bodybag_nohq.paa b/addons/medical/equipment/data/bodybag_nohq.paa new file mode 100644 index 0000000000..5c6b35c595 Binary files /dev/null and b/addons/medical/equipment/data/bodybag_nohq.paa differ diff --git a/addons/medical/equipment/data/env_co.paa b/addons/medical/equipment/data/env_co.paa new file mode 100644 index 0000000000..77645347b5 Binary files /dev/null and b/addons/medical/equipment/data/env_co.paa differ diff --git a/addons/medical/equipment/data/morphin_co.paa b/addons/medical/equipment/data/morphin_co.paa new file mode 100644 index 0000000000..8d91fd0e10 Binary files /dev/null and b/addons/medical/equipment/data/morphin_co.paa differ diff --git a/addons/medical/equipment/data/quickclot_co.paa b/addons/medical/equipment/data/quickclot_co.paa new file mode 100644 index 0000000000..bf0edccd7e Binary files /dev/null and b/addons/medical/equipment/data/quickclot_co.paa differ diff --git a/addons/medical/equipment/data/surgical_kit.rvmat b/addons/medical/equipment/data/surgical_kit.rvmat new file mode 100644 index 0000000000..3f0deac2fa --- /dev/null +++ b/addons/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="z\ace\addons\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="z\ace\addons\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/addons/medical/equipment/data/surgical_kit_co.paa b/addons/medical/equipment/data/surgical_kit_co.paa new file mode 100644 index 0000000000..3e622afe48 Binary files /dev/null and b/addons/medical/equipment/data/surgical_kit_co.paa differ diff --git a/addons/medical/equipment/data/surgical_kit_metal.rvmat b/addons/medical/equipment/data/surgical_kit_metal.rvmat new file mode 100644 index 0000000000..65192a777f --- /dev/null +++ b/addons/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/addons/medical/equipment/data/surgical_kit_nohq.paa b/addons/medical/equipment/data/surgical_kit_nohq.paa new file mode 100644 index 0000000000..b8027515bc Binary files /dev/null and b/addons/medical/equipment/data/surgical_kit_nohq.paa differ diff --git a/addons/medical/equipment/field_dressing.p3d b/addons/medical/equipment/field_dressing.p3d new file mode 100644 index 0000000000..39b516c6bc Binary files /dev/null and b/addons/medical/equipment/field_dressing.p3d differ diff --git a/addons/medical/equipment/field_dressing_used.p3d b/addons/medical/equipment/field_dressing_used.p3d new file mode 100644 index 0000000000..a29958cca0 Binary files /dev/null and b/addons/medical/equipment/field_dressing_used.p3d differ diff --git a/addons/medical/equipment/img/atropine.paa b/addons/medical/equipment/img/atropine.paa new file mode 100644 index 0000000000..49b79e99e5 Binary files /dev/null and b/addons/medical/equipment/img/atropine.paa differ diff --git a/addons/medical/equipment/img/bandageElastic.paa b/addons/medical/equipment/img/bandageElastic.paa new file mode 100644 index 0000000000..bbf7901ceb Binary files /dev/null and b/addons/medical/equipment/img/bandageElastic.paa differ diff --git a/addons/medical/equipment/img/bloodbag.paa b/addons/medical/equipment/img/bloodbag.paa new file mode 100644 index 0000000000..489614bf44 Binary files /dev/null and b/addons/medical/equipment/img/bloodbag.paa differ diff --git a/addons/medical/equipment/img/bodybag.paa b/addons/medical/equipment/img/bodybag.paa new file mode 100644 index 0000000000..a3a7257fc3 Binary files /dev/null and b/addons/medical/equipment/img/bodybag.paa differ diff --git a/addons/medical/equipment/img/chestseal.paa b/addons/medical/equipment/img/chestseal.paa new file mode 100644 index 0000000000..be0f4f77bf Binary files /dev/null and b/addons/medical/equipment/img/chestseal.paa differ diff --git a/addons/medical/equipment/img/epinephrine.paa b/addons/medical/equipment/img/epinephrine.paa new file mode 100644 index 0000000000..d4c556281a Binary files /dev/null and b/addons/medical/equipment/img/epinephrine.paa differ diff --git a/addons/medical/equipment/img/field_dressing.paa b/addons/medical/equipment/img/field_dressing.paa new file mode 100644 index 0000000000..bfe11f2a07 Binary files /dev/null and b/addons/medical/equipment/img/field_dressing.paa differ diff --git a/addons/medical/equipment/img/liquidSkin.paa b/addons/medical/equipment/img/liquidSkin.paa new file mode 100644 index 0000000000..40e72038ec Binary files /dev/null and b/addons/medical/equipment/img/liquidSkin.paa differ diff --git a/addons/medical/equipment/img/morphine.paa b/addons/medical/equipment/img/morphine.paa new file mode 100644 index 0000000000..16918da53f Binary files /dev/null and b/addons/medical/equipment/img/morphine.paa differ diff --git a/addons/medical/equipment/img/nasopharyngeal_tube.paa b/addons/medical/equipment/img/nasopharyngeal_tube.paa new file mode 100644 index 0000000000..6629605519 Binary files /dev/null and b/addons/medical/equipment/img/nasopharyngeal_tube.paa differ diff --git a/addons/medical/equipment/img/packing_bandage.paa b/addons/medical/equipment/img/packing_bandage.paa new file mode 100644 index 0000000000..5825d17a77 Binary files /dev/null and b/addons/medical/equipment/img/packing_bandage.paa differ diff --git a/addons/medical/equipment/img/personal_aid_kit.paa b/addons/medical/equipment/img/personal_aid_kit.paa new file mode 100644 index 0000000000..87d6a1612f Binary files /dev/null and b/addons/medical/equipment/img/personal_aid_kit.paa differ diff --git a/addons/medical/equipment/img/plasma_iv.paa b/addons/medical/equipment/img/plasma_iv.paa new file mode 100644 index 0000000000..31eb3e34df Binary files /dev/null and b/addons/medical/equipment/img/plasma_iv.paa differ diff --git a/addons/medical/equipment/img/quickclot.paa b/addons/medical/equipment/img/quickclot.paa new file mode 100644 index 0000000000..8727b7d1d0 Binary files /dev/null and b/addons/medical/equipment/img/quickclot.paa differ diff --git a/addons/medical/equipment/img/saline_iv.paa b/addons/medical/equipment/img/saline_iv.paa new file mode 100644 index 0000000000..a957e36d7c Binary files /dev/null and b/addons/medical/equipment/img/saline_iv.paa differ diff --git a/addons/medical/equipment/img/splint.paa b/addons/medical/equipment/img/splint.paa new file mode 100644 index 0000000000..87c1cb8686 Binary files /dev/null and b/addons/medical/equipment/img/splint.paa differ diff --git a/addons/medical/equipment/img/surgical_kit.paa b/addons/medical/equipment/img/surgical_kit.paa new file mode 100644 index 0000000000..e6b3533a12 Binary files /dev/null and b/addons/medical/equipment/img/surgical_kit.paa differ diff --git a/addons/medical/equipment/img/tourniquet.paa b/addons/medical/equipment/img/tourniquet.paa new file mode 100644 index 0000000000..1a0dace011 Binary files /dev/null and b/addons/medical/equipment/img/tourniquet.paa differ diff --git a/addons/medical/equipment/skinliquid.p3d b/addons/medical/equipment/skinliquid.p3d new file mode 100644 index 0000000000..b3d761e256 Binary files /dev/null and b/addons/medical/equipment/skinliquid.p3d differ diff --git a/addons/medical/equipment/splint.p3d b/addons/medical/equipment/splint.p3d new file mode 100644 index 0000000000..42f3ad14b7 Binary files /dev/null and b/addons/medical/equipment/splint.p3d differ diff --git a/addons/medical/equipment/surgical_kit.p3d b/addons/medical/equipment/surgical_kit.p3d new file mode 100644 index 0000000000..9f616a100f Binary files /dev/null and b/addons/medical/equipment/surgical_kit.p3d differ diff --git a/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf b/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf new file mode 100644 index 0000000000..9f645e80ad --- /dev/null +++ b/addons/medical/functions/fnc_ActionCheckBloodPressureLocal.sqf @@ -0,0 +1,58 @@ +/** + * fn_checkBloodPressureLocal.sqf + * @Descr: Displays specified units current blood pressure + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_unit","_bloodPressure","_bloodPressureHigh","_bloodPressureLow","_title","_content"]; +_caller = _this select 0; +_unit = _this select 1; + +_bloodPressure = [_unit] call FUNC(getBloodPressure); +if (!alive _unit) then { + _bloodPressure = [0,0]; +}; + +_bloodPressureHigh = _bloodPressure select 1; +_bloodPressureLow = _bloodPressure select 0; +_output = ""; +_logOutPut = ""; +if ([_caller] call FUNC(isMedic)) then { + _output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_1"; + _logOutPut = format["%1/%2",round(_bloodPressureHigh),round(_bloodPressureLow)]; +} else { + if (_bloodPressureHigh > 20) then { + _output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_2"; + _logOutPut = "Low"; + if (_bloodPressureHigh > 100) then { + _output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_3"; + _logOutPut = "Normal"; + if (_bloodPressureHigh > 160) then { + _output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_4"; + _logOutPut = "High"; + }; + + }; + } else { + if (random(10) > 3) then { + _output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_5"; + _logOutPut = "No Blood Pressure"; + } else { + _output = "STR_ACE_CHECK_BLOODPRESSURE_OUTPUT_6"; + }; + }; +}; + +_title = format["STR_ACE_CHECK_BLOODPRESSURE"]; +_content = ["STR_ACE_CHECK_BLOODPRESSURE_CHECKED_MEDIC", _output]; +[_caller, _title, _content, 0,[[_unit] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)] ] call EFUNC(gui,sendDisplayInformationTo); + +if (_logOutPut != "") then { + [_unit,"examine",format["%1 checked Blood Pressure: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog); +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_ActionCheckPulse.sqf b/addons/medical/functions/fnc_ActionCheckPulse.sqf new file mode 100644 index 0000000000..52e9158329 --- /dev/null +++ b/addons/medical/functions/fnc_ActionCheckPulse.sqf @@ -0,0 +1,39 @@ +/** + * fn_checkPulse.sqf + * @Descr: Displays specified units current pulse + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + #include "script_component.hpp" + +private ["_caller","_target","_title","_content"]; +_caller = _this select 0; +_target = _this select 1; + +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; +[_caller, true] call FUNC(treatmentMutex); + +_title = format["STR_ACE_CHECK_PULSE"]; +_content = ["STR_ACE_CHECK_PULSE_CONTENT"]; +[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[2 + round(random(1)), + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target"]; + _caller = _this select 0; + _target = _this select 1; + [[_caller, _target], QUOTE(FUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); + [_caller,false] call FUNC(treatmentMutex); + }, // on success + { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0),false] call FUNC(treatmentMutex); + }, // on failure + [_caller, _target] // arguments +] call EFUNC(gui,loadingBar); diff --git a/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf b/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf new file mode 100644 index 0000000000..d96ae8b19c --- /dev/null +++ b/addons/medical/functions/fnc_ActioncheckBloodPressure.sqf @@ -0,0 +1,40 @@ +/** + * fn_checkBloodPressure.sqf + * @Descr: Displays specified units current blood pressure + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_title","_content"]; +_caller = _this select 0; +_target = _this select 1; + +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; +[_caller, true] call FUNC(treatmentMutex); + +_title = format["STR_ACE_CHECK_BLOODPRESSURE"]; +_content = ["STR_ACE_CHECK_BLOODPRESSURE_CONTENT"]; +[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[2 + round(random(1)), + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target"]; + _caller = _this select 0; + _target = _this select 1; + [_this, QUOTE(FUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); + [_caller,false] call FUNC(treatmentMutex); + }, // on success + { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0),false] call FUNC(treatmentMutex); + }, // on failure + [_caller, _target] // arguments +] call EFUNC(gui,loadingBar); + diff --git a/addons/medical/functions/fnc_actionCarryUnit.sqf b/addons/medical/functions/fnc_actionCarryUnit.sqf new file mode 100644 index 0000000000..d3cfb35aee --- /dev/null +++ b/addons/medical/functions/fnc_actionCarryUnit.sqf @@ -0,0 +1,95 @@ +/* + 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 +*/ + +#include "script_component.hpp" + + +private ["_caller", "_unit", "_positionUnit", "_killOnDrop"]; +_caller = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_unit = [_this, 1, objNull, [objNull]] call BIS_fnc_param; +_killOnDrop = [_this, 2, false, [false]] call BIS_fnc_param; + +["FUNC(actionDragUnit) has been called",2] call EFUNC(common,debug); + +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; +[_caller, true] call FUNC(treatmentMutex); + +if (!(_unit isKindOf "CaManBase") || !(_caller isKindOf "CaManBase")) exitwith{ [_caller, false] call FUNC(treatmentMutex);}; +if (vehicle _caller != _caller || vehicle _unit != _unit) exitwith { [_caller, false] call FUNC(treatmentMutex);}; + +if (!([_caller] call EFUNC(common,canInteract)) || {_caller == _unit} || {(([_unit] call EFUNC(common,isAwake)))}) exitwith { + [_caller, false] call FUNC(treatmentMutex); +}; + +if (([_caller] call EFUNC(common,getCarriedObj)) != _unit && !(isNull ([_caller] call EFUNC(common,getCarriedObj))) || {!isNull(_unit getvariable [QGVAR(beingDragged),objNull]) || !isNull(_caller getvariable [QGVAR(dragging),objNull])} || {!isNull(_unit getvariable [QGVAR(beingCarried),objNull]) || !isNull(_caller getvariable [QGVAR(carrying),objNull])}) exitwith { + [_caller,objNull] call EFUNC(common,carryObj); + [_caller, false] call FUNC(treatmentMutex); +}; +_caller action ["WeaponOnBack", _caller]; +_killOnDrop = false; +if (!alive _unit) exitwith { + [_caller, false] call FUNC(treatmentMutex); + [{ + _this call FUNC(actionCarryUnit); + }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); +}; + +if !([_caller,_unit] call EFUNC(common,carryObj)) exitwith { + ["couldn't carry object!"] call EFUNC(common,debug); [_caller,false] call FUNC(treatmentMutex); +}; + +if (primaryWeapon _caller == "") then { + _caller addWeapon "ACE_FakePrimaryWeapon"; +}; +_caller selectWeapon (primaryWeapon _caller); + +_unit attachTo [_caller, [0.1, -0.1, -1.25], "LeftShoulder"]; + +[_unit,"AinjPfalMstpSnonWnonDf_carried_dead", 2, true] call EFUNC(common,doAnimation); +[_caller,"acinpercmstpsraswrfldnon", 1] call EFUNC(common,doAnimation); + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[2, + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1.5))}, // the condition + { + private ["_caller","_target"]; + _caller = _this select 0; + _target = _this select 1; + _killOnDrop = _this select 2; + [_caller, false] call FUNC(treatmentMutex); + + // Registration for drag/carry functions + _target setvariable [QGVAR(beingCarried),_caller,true]; + _caller setvariable [QGVAR(carrying),_unit,true]; + + // Removing any old drop scroll wheel actions + // TODO Do we still want scroll wheel actions? + if (!isnil QGVAR(DROP_ADDACTION)) then { + _caller removeAction GVAR(DROP_ADDACTION); + GVAR(DROP_ADDACTION) = nil; + }; + // Adding the drop scroll wheel action. + GVAR(DROP_ADDACTION) = _caller addAction [format["Drop %1",[_target] call EFUNC(common,getName)], {[_this select 1, _this select 2] call FUNC(actionDropUnit);}]; + + // Raise an event + ["onStartMovingUnit", [_caller], [_caller, _Target, _killOnDrop, false]] call EFUNC(common,targetEvent); + + }, // on success + { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), false] call FUNC(treatmentMutex); + [(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj); + }, // on failure + [_caller, _unit, _killOnDrop] // arguments +] call EFUNC(gui,loadingBar); \ No newline at end of file diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf new file mode 100644 index 0000000000..ae69f52272 --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -0,0 +1,51 @@ +/** + * fn_checkPulseLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_unit", "_heartRateOutput", "_heartRate","_logOutPut", "_title","_content"]; +_caller = _this select 0; +_unit = _this select 1; + + +_heartRate = [_unit,QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); +if (!alive _unit) then { + _heartRate = 0; +}; +_heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_5"; +_logOutPut = "No heart rate"; + +if (_heartRate > 1.0) then { + if ([_caller] call FUNC(isMedic)) then { + _heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_1"; + _logOutPut = format["%1",round(_heartRate)]; + } else { + // non medical personel will only find a pulse/HR + _heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_2"; + _logOutPut = "Weak"; + if (_heartRate > 60) then { + if (_heartRate > 100) then { + _heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_3"; + _logOutPut = "Strong"; + } else { + _heartRateOutput = "STR_ACE_CHECK_PULSE_OUTPUT_4"; + _logOutPut = "Normal"; + }; + }; + }; +}; + +_title = "STR_ACE_CHECK_PULSE"; +_content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput]; +[_caller, _title, _content, 0, [[_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(gui,sendDisplayInformationTo); + +if (_logOutPut != "") then { + [_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog); +}; diff --git a/addons/medical/functions/fnc_actionCheckResponse.sqf b/addons/medical/functions/fnc_actionCheckResponse.sqf new file mode 100644 index 0000000000..d2201e15f2 --- /dev/null +++ b/addons/medical/functions/fnc_actionCheckResponse.sqf @@ -0,0 +1,51 @@ +/** + * fn_checkResponse.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target"]; +_caller = _this select 0; +_target = _this select 1; + +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; +[_caller, true] call FUNC(treatmentMutex); + +_title = format["STR_ACE_CHECK_RESPONSE"]; +_content = ["STR_ACE_CHECK_RESPONSE_CONTENT"]; +[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[2 + round(random(1)), + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target", "_output", "_title", "_content"]; + _caller = _this select 0; + _target = _this select 1; + + _output = ""; + if ([_target] call EFUNC(common,isAwake)) then { + _output = format[localize "STR_ACE_CHECK_REPONSE_RESPONSIVE",[_target] call EFUNC(common,getName)]; + } else { + _output = format[localize "STR_ACE_CHECK_REPONSE_UNRESPONSIVE",[_target] call EFUNC(common,getName)]; + }; + + _title = format["STR_ACE_CHECK_RESPONSE"]; + _content = [format[localize "STR_ACE_CHECK_REPONSE_YOU_CHECKED",[_target] call EFUNC(common,getName)],_output]; + [_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo); + [_target,"examine",_output] call FUNC(addToQuickViewLog); + + [_caller,false] call FUNC(treatmentMutex); + }, // on success + { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0),false] call FUNC(treatmentMutex); + }, // on failure + [_caller, _target] // arguments +] call EFUNC(gui,loadingBar); diff --git a/addons/medical/functions/fnc_actionDragUnit.sqf b/addons/medical/functions/fnc_actionDragUnit.sqf new file mode 100644 index 0000000000..d0fa1c70ea --- /dev/null +++ b/addons/medical/functions/fnc_actionDragUnit.sqf @@ -0,0 +1,102 @@ +/* +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: call +*/ + +#include "script_component.hpp" + +private ["_caller", "_unit", "_positionUnit", "_killOnDrop"]; +_caller = [_this, 0, objNull, [objNull]] call BIS_fnc_param; +_unit = [_this, 1, objNull, [objNull]] call BIS_fnc_param; +_killOnDrop = [_this, 2, false, [false]] call BIS_fnc_param; + +["FUNC(actionDragUnit) has been called",2] call EFUNC(common,debug); + +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {}; +[_caller, true] call FUNC(treatmentMutex); + +if (!(_unit isKindOf "CaManBase") || !(_caller isKindOf "CaManBase")) exitwith{ [_caller, false] call FUNC(treatmentMutex);}; +if (vehicle _caller != _caller || vehicle _unit != _unit) exitwith { [_caller, false] call FUNC(treatmentMutex);}; + +if (!([_caller] call EFUNC(common,canInteract)) || {_caller == _unit} || {(([_unit] call EFUNC(common,isAwake)))}) exitwith { + [_caller, false] call FUNC(treatmentMutex); +}; + +if (([_caller] call EFUNC(common,getCarriedObj)) != _unit && !(isNull ([_caller] call EFUNC(common,getCarriedObj))) || {!isNull(_unit getvariable [QGVAR(beingDragged),objNull]) || !isNull(_caller getvariable [QGVAR(dragging),objNull])}) exitwith { + [_caller,objNull] call EFUNC(common,carryObj); + [_caller, false] call FUNC(treatmentMutex); +}; + +if (!alive _unit) exitwith { + [_caller, false] call FUNC(treatmentMutex); + [{ + _this call FUNC(actionDragUnit); + }, [_caller, ([_unit,_caller] call FUNC(makeCopyOfBody_F)), _killOnDrop], 0.25, 0.25] call EFUNC(common,waitAndExecute); +}; + +if (primaryWeapon _caller == "") then { + _caller addWeapon "ACE_FakePrimaryWeapon"; +}; +_caller selectWeapon (primaryWeapon _unit); + +_unit setDir (getDir _unit + 180) % 360; +_unit setPos ((getPos _unit) vectorAdd ((vectorDir _caller) vectorMultiply 1.5)); + +if !([_caller,_unit,[0.125, 1.007, 0]] call EFUNC(common,carryObj)) exitwith { + [_caller, false] call FUNC(treatmentMutex); + // well something went horribly wrong here, should never reach this, since we do checks above.. + +}; + +[_unit, "AinjPpneMstpSnonWrflDb", 2, true] call EFUNC(common,doAnimation); + +_caller selectWeapon (primaryWeapon _caller); // if no primairy weapon, add a fake one first +if (currentWeapon _caller == primaryWeapon _caller) then { + [_caller,"AcinPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); +} else { + [_caller,"AcinPknlMstpSnonWnonDnon", 1] call EFUNC(common,doAnimation); +}; + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[2, + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1.5))}, // the condition + { + private ["_caller","_target"]; + _caller = _this select 0; + _target = _this select 1; + _killOnDrop = _this select 2; + [_caller, false] call FUNC(treatmentMutex); + + // Registration for drag/carry functions + _target setvariable [QGVAR(beingDragged),_caller,true]; + _caller setvariable [QGVAR(dragging), _target,true]; + + // Removing any old drop scroll wheel actions + // TODO Do we still want scroll wheel actions? + if (!isnil QGVAR(DROP_ADDACTION)) then { + _caller removeAction GVAR(DROP_ADDACTION); + GVAR(DROP_ADDACTION) = nil; + }; + // Adding the drop scroll wheel action. + GVAR(DROP_ADDACTION) = _caller addAction [format["Drop %1",[_target] call EFUNC(common,getName)], {[_this select 1, _this select 2] call FUNC(actionDropUnit);}]; + + // Raise an event + ["onStartMovingUnit", [_caller], [_caller, _Target, _killOnDrop, true]] call EFUNC(common,targetEvent); + + }, // on success + { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0), false] call FUNC(treatmentMutex); + [(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj); + }, // on failure + [_caller, _unit, _killOnDrop] // arguments +] call EFUNC(gui,loadingBar); diff --git a/addons/medical/functions/fnc_actionDropUnit.sqf b/addons/medical/functions/fnc_actionDropUnit.sqf new file mode 100644 index 0000000000..7154f6a5d5 --- /dev/null +++ b/addons/medical/functions/fnc_actionDropUnit.sqf @@ -0,0 +1,24 @@ + +/* + 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: +*/ + +#include "script_component.hpp" + +private ["_caller", "_unit","_info","_draggedPerson"]; +_caller = _this select 0; +_unit = _this select 1; + +if (!isnil QGVAR(DROP_ADDACTION)) then { + [_caller,objNull] call EFUNC(common,carryObj); + _caller removeAction GVAR(DROP_ADDACTION); + GVAR(DROP_ADDACTION) = nil; +}; diff --git a/addons/medical/functions/fnc_actionLoadUnit.sqf b/addons/medical/functions/fnc_actionLoadUnit.sqf new file mode 100644 index 0000000000..cd20140bdb --- /dev/null +++ b/addons/medical/functions/fnc_actionLoadUnit.sqf @@ -0,0 +1,31 @@ +/** + * fn_load_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + + +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; + +_vehicle = [_caller, _unit] call EFUNC(common,loadPerson_F); +if (!isNull _vehicle) then { + if (!isnil QGVAR(DROP_ADDACTION)) then { + _caller removeAction GVAR(DROP_ADDACTION); + GVAR(DROP_ADDACTION) = nil; + }; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf new file mode 100644 index 0000000000..8df95c24d9 --- /dev/null +++ b/addons/medical/functions/fnc_actionPlaceInBodyBag.sqf @@ -0,0 +1,43 @@ +/** + * fn_placeInBodyBag.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_caller"]; +_unit = _this select 0; +_caller = _this select 1; + +if !([_caller, "ACE_itemBodyBag"] call EFUNC(common,hasItem)) exitwith {}; + +[_caller, "ACE_itemBodyBag"] call EFUNC(common,useItem); + +_nameOfUnit = [_unit] call EFUNC(common,getName); +if (alive _unit) then { + // force kill the unit. + [_unit, true] call EFUNC(common,setDead); +}; +_onPosition = getPos _unit; +_allVariables = [_unit] call EFUNC(common,getAllDefinedSetVariables); +deleteVehicle _unit; + +_bodyBagCreated = createVehicle ["ACE_bodyBag", _onPosition, [], 0, "NONE"]; +_bodyBagCreated setvariable [QEGVAR(common,nameOfBody), _nameOfUnit, true]; + +{ +// [_bodyBagCreated,_x select 0, _x select 2] call EFUNC(common,setDefinedVariable); +}foreach _allVariables; +// reset the position to ensure it is on the correct one. +_bodyBagCreated setPos _onPosition; + +[[_bodyBagCreated], QEFUNC(common,revealObject_f), true] call BIS_fnc_MP; + +_bodyBagCreated setvariable [QEGVAR(logistics,enableDrag), true, true]; + +_bodyBagCreated; \ No newline at end of file diff --git a/addons/medical/functions/fnc_actionRemoveTourniquet.sqf b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf new file mode 100644 index 0000000000..30363453e2 --- /dev/null +++ b/addons/medical/functions/fnc_actionRemoveTourniquet.sqf @@ -0,0 +1,62 @@ +/** + * fn_removeTourniquet.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_part","_selectionName","_removeItem","_tourniquets"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; + +[_caller,"You attempt to remove a tourniquet"] call EFUNC(common,sendHintTo); +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {["MUTEX HAS BEEN SET - EXITING"] call EFUNC(common,debug);}; +[_caller,true] call FUNC(treatmentMutex); + +_part = [_selectionName] call FUNC(getBodyPartNumber); +_tourniquets = [_target,QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable); + +if ((_tourniquets select _part) == 0) exitwith { + [_caller, false] call FUNC(treatmentMutex); + [_caller,"There is no tourniquet on this body part!"] call EFUNC(common,sendHintTo); +}; + +if (vehicle _caller == _caller && (vehicle _target == _target)) then { + [_caller,"AinvPknlMstpSlayWrflDnon_medic", 1] call EFUNC(common,doAnimation); +}; + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[2.5, + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target", "_selectionName", "_part","_tourniquets"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + + _part = [_selectionName] call FUNC(getBodyPartNumber); + _tourniquets = [_target,QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable); + _tourniquets set[_part,0]; + [_target,QGVAR(tourniquets),_tourniquets] call EFUNC(common,setDefinedVariable); + + _caller addItem "ACE_tourniquet"; + [_caller,false] call FUNC(treatmentMutex); + + [_target,"treatment",format["%1 removed a tourniquet on %2",[_caller] call EFUNC(common,getName),_selectionName]] call FUNC(addActivityToLog); + + [_caller,false] call FUNC(treatmentMutex); + }, // on success + { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + [(_this select 0),false] call FUNC(treatmentMutex); + }, // on failure + [_caller, _target, _selectionName] // arguments +] call EFUNC(gui,loadingBar); + + diff --git a/addons/medical/functions/fnc_actionUnloadUnit.sqf b/addons/medical/functions/fnc_actionUnloadUnit.sqf new file mode 100644 index 0000000000..6eefb4b138 --- /dev/null +++ b/addons/medical/functions/fnc_actionUnloadUnit.sqf @@ -0,0 +1,28 @@ +/** + * fn_unload_CMS.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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 {}; + +if ([_caller, _unit] call EFUNC(common,unloadPerson_F)) then { + if (_drag) then { + if ((vehicle _caller) == _caller) then { + [[_caller,_unit], QUOTE(FUNC(actionDragUnit)), _caller, false] call BIS_fnc_MP; + }; + }; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_addActivityToLog.sqf b/addons/medical/functions/fnc_addActivityToLog.sqf new file mode 100644 index 0000000000..c5fd4b1976 --- /dev/null +++ b/addons/medical/functions/fnc_addActivityToLog.sqf @@ -0,0 +1,46 @@ +/** + * fn_addActivityToLog.sqf + * @Descr: adds an item to the activity log + * @Author: Glowbal + * + * @Arguments: [unit OBJECT, type STRING, message STRING] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_caller","_type","_activity","_log"]; + +_unit = _this select 0; +_type = _this select 1; +_message = _this select 2; + +if (!local _unit) exitwith { + [_this, QUOTE(FUNC(addActivityToLog)), _unit] call EFUNC(common,execRemoteFnc); +}; +_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, QGVAR(activityLog)] call EFUNC(common,getDefinedVariable); +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, QGVAR(activityLog),_log] call EFUNC(common,setDefinedVariable); +["Medical_OnActivityLogChanged", [_unit, _type, _message]] call ace_common_fnc_localEvent; diff --git a/addons/medical/functions/fnc_addHeartRateAdjustment.sqf b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf new file mode 100644 index 0000000000..798ec18b0e --- /dev/null +++ b/addons/medical/functions/fnc_addHeartRateAdjustment.sqf @@ -0,0 +1,22 @@ +/** + * fn_addHeartRateAdjustment.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 + */ + +#include "script_component.hpp" + +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, QGVAR(heartRateAdjustments)] call EFUNC(common,getDefinedVariable); +_adjustment pushback [_value, _time, _callBack]; +_unit setvariable [QGVAR(heartRateAdjustments), _adjustment ]; +["Medical_onHeartRateAdjustmentAdded", [_unit, _value, _time]] call ace_common_fnc_localEvent; \ No newline at end of file diff --git a/addons/medical/functions/fnc_addOpenWounds.sqf b/addons/medical/functions/fnc_addOpenWounds.sqf new file mode 100644 index 0000000000..1a87e409f9 --- /dev/null +++ b/addons/medical/functions/fnc_addOpenWounds.sqf @@ -0,0 +1,47 @@ +/** + * fn_addOpenWounds.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 + */ + +#include "script_component.hpp" + +private ["_unit", "_bodyPart", "_type", "_openWounds", "_selection", "_amount", "_newAmount", "_global"]; +_unit = _this select 0; +_bodyPart = _this select 1; +_type = _this select 2; +_amount = _this select 3; +_global = if (count _this > 4) then {_this select 4} else {true}; + +if (typeName _bodyPart == "STRING") then { + _bodyPart = [_bodyPart] call FUNC(getBodyPartNumber); +}; +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 EFUNC(common,debug); +}; + +_openWounds = [_unit,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); +_selection = _openWounds select _bodyPart; +_newAmount = (_selection select _type) + _amount; +if (_newAmount < 0) then { + _newAmount = 0; +}; +_selection set [ _type, _newAmount]; +_openWounds set [ _bodyPart , _selection]; +[_unit, QGVAR(openWounds),_openWounds, _global] call EFUNC(common,setDefinedVariable); + +[_unit] call FUNC(addToInjuredCollection); +["Medical_onOpenWoundsAdded", [_unit, _bodyPart, _type, _amount]] call ace_common_fnc_localEvent; \ No newline at end of file diff --git a/addons/medical/functions/fnc_addToInjuredCollection.sqf b/addons/medical/functions/fnc_addToInjuredCollection.sqf new file mode 100644 index 0000000000..f82e0fd5e4 --- /dev/null +++ b/addons/medical/functions/fnc_addToInjuredCollection.sqf @@ -0,0 +1,29 @@ +/** + * fnc_addToInjuredCollection.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private "_unit"; +_unit = _this select 0; +if !(local _unit) exitwith{ + [[_unit], QUOTE(FUNC(addToInjuredCollection)), _unit] call EFUNC(common,execRemoteFnc); +}; + +if !(_unit getvariable[QGVAR(addedToUnitLoop),false]) then{ + _unit setvariable [QGVAR(addedToUnitLoop),true, true]; +}; + +if ([_unit] call FUNC(hasMedicalEnabled)) then { + if (isnil QGVAR(injuredUnitCollection)) then { + GVAR(injuredUnitCollection) = []; + }; + if (_unit in GVAR(injuredUnitCollection)) exitwith {}; + GVAR(injuredUnitCollection) pushback _unit; +}; diff --git a/addons/medical/functions/fnc_addToQuickViewLog.sqf b/addons/medical/functions/fnc_addToQuickViewLog.sqf new file mode 100644 index 0000000000..ddac44c3b2 --- /dev/null +++ b/addons/medical/functions/fnc_addToQuickViewLog.sqf @@ -0,0 +1,45 @@ +/** + * fn_addToQuickViewLog.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_type","_activity","_log", "_lastNumber", "_message"]; + +_unit = _this select 0; +_type = _this select 1; +_message = _this select 2; + +if (!local _unit) exitwith { + [_this, QUOTE(FUNC(addToQuickViewLog)), _unit] call EFUNC(common,execRemoteFnc); +}; + +_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,QGVAR(quickViewLog)] call EFUNC(common,getDefinedVariable); +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,QGVAR(quickViewLog),_log] call EFUNC(common,setDefinedVariable); +["Medical_onQuickViewLogChanged", [_unit, _type, _message]] call ace_common_fnc_localEvent; \ No newline at end of file diff --git a/addons/medical/functions/fnc_addToTriageList.sqf b/addons/medical/functions/fnc_addToTriageList.sqf new file mode 100644 index 0000000000..ec6fbc7d60 --- /dev/null +++ b/addons/medical/functions/fnc_addToTriageList.sqf @@ -0,0 +1,41 @@ +/** + * fn_addToTriageList.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_caller","_newItem","_log", "_inList","_amount"]; +_unit = _this select 0; +_newItem = _this select 1; + +if (!local _unit) exitwith { + [_this, QUOTE(FUNC(addToTriageList)), _unit] call EFUNC(common,execRemoteFnc); +}; + +_log = [_unit,QGVAR(triageCard)] call EFUNC(common,getDefinedVariable); +_inList = false; +_amount = 1; +{ + if ((_x select 0) == _newItem) exitwith { + private "_info"; + _info = _log select _foreachIndex; + _info set [1,(_info select 1) + 1]; + _log set [_foreachIndex, _info]; + + _amount = (_info select 1); + _inList = true; + }; +}foreach _log; + +if (!_inList) then { + _log pushback [_newItem,1]; +}; + +[_unit,QGVAR(triageCard),_log] call EFUNC(common,setDefinedVariable); +["Medical_onItemAddedToTriageCard", [_unit, _newItem, _amount]] call ace_common_fnc_localEvent; \ No newline at end of file diff --git a/addons/medical/functions/fnc_addTreatmentOption.sqf b/addons/medical/functions/fnc_addTreatmentOption.sqf new file mode 100644 index 0000000000..12d5cb1da1 --- /dev/null +++ b/addons/medical/functions/fnc_addTreatmentOption.sqf @@ -0,0 +1,31 @@ +/** + * fnc_addTreatmentOption.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_displayName","_tooltip","_condition","_code", "_category","_options"]; +_displayName = _this select 0; +_tooltip = _this select 1; +_condition = _this select 2; +_code = _this select 3; +_category = _this select 4; + +if (isLocalized _displayName) then { + _displayName = localize _displayName; +}; + +if (isLocalized _tooltip) then { + _tooltip = localize _tooltip; +}; + +_options = missionNamespace getvariable [QGVAR(registeredTreatmentOptions_)+_category, []]; +_options pushback [_displayName, _tooltip, _condition, _code]; + +missionNamespace setvariable [QGVAR(registeredTreatmentOptions_)+_category, _options]; diff --git a/addons/medical/functions/fnc_cacheHandleDamageCall.sqf b/addons/medical/functions/fnc_cacheHandleDamageCall.sqf new file mode 100644 index 0000000000..b692c2e871 --- /dev/null +++ b/addons/medical/functions/fnc_cacheHandleDamageCall.sqf @@ -0,0 +1,128 @@ +/** + * fnc_cacheHandleDamageCall.sqf + * @Descr: Cache a handleDamage call to execute it 3 frames later + * @Author: KoffeinFlummi + * + * @Arguments: [unit OBJECT, selection STRING, damagE NUMBER, source OBJECT, projectile STRING (Could be an OBJECT on occasion)] + * @Return: + * @PublicAPI: false + */ + + +#include "script_component.hpp" + +private ["_unit", "_selectionName","_damage", "_source","_projectile","_hitSelections","_hitPoints","_newDamage","_cache_hitpoints","_cache_projectiles","_cache_params","_cache_damages"]; +_unit = _this select 0; +_selectionName = _this select 1; +_damage = _this select 2; +_source = _this select 3; +_projectile = _this select 4; + +_hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; +_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; + +// Calculate change in damage. +_newDamage = _damage - (damage _unit); +if (_selectionName in _hitSelections) then { + _newDamage = _damage - (_unit getHitPointDamage (_hitPoints select (_hitSelections find _selectionName))); +}; + +// we want to move damage to another selection; have to do it ourselves. +// this is only the case for limbs, so this will not impact the killed EH. +if (_selectionName != (_this select 1)) then { + _unit setHitPointDamage [_hitPoints select (_hitSelections find _selectionName), _damage + _newDamage]; + _newDamage = 0; +}; +_damage = _damage + _newDamage; + +// From AGM medical: +// Exclude falling damage to everything other than legs; reduce structural damage. +if (((velocity _unit) select 2 < -5) && (vehicle _unit == _unit)) then { + _unit setVariable [QGVAR(isFalling), True]; +}; +if (_unit getVariable [QGVAR(isFalling), false] && !(_selectionName in ["", "leg_l", "leg_r"])) exitWith {}; +if (_unit getVariable [QGVAR(isFalling), false]) then { + _newDamage = _newDamage * 0.7; +}; + +// Finished with the current frame, reset variables +// Note: sometimes handleDamage spans over 2 or even 3 frames. +if (diag_frameno > (_unit getVariable [QGVAR(frameNo_damageCaching), -3]) + 2) then { + _unit setVariable [QGVAR(frameNo_damageCaching), diag_frameno]; + + // handle the cached damages 3 frames later + [{ + private ["_args","_unit","_frameNo"]; + _args = _this select 0; + _unit = _args select 0; + _frameNo = _args select 1; + + if (diag_frameno > _frameNo + 2) then { + _cache_projectiles = _unit getVariable [QGVAR(cachedProjectiles), []]; + _cache_hitpoints = _unit getVariable [QGVAR(cachedHitPoints), []]; + _cache_damages = _unit getVariable [QGVAR(cachedDamages), []]; + _cache_params = _unit getVariable [QGVAR(cachedHandleDamageParams), []]; + { + if (typeName _x == typeName "") then { + (_cache_params select _foreachIndex) call FUNC(handleDamage); + }; + }foreach _cache_projectiles; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + }, 0, [_unit, diag_frameno] ] call CBA_fnc_addPerFrameHandler; + + _unit setVariable [QGVAR(cachedProjectiles), []]; + _unit setVariable [QGVAR(cachedHitPoints), []]; + _unit setVariable [QGVAR(cachedDamages), []]; + _unit setVariable [QGVAR(cachedHandleDamageParams), []]; +}; + +// Make sure there's only one damaged selection per projectile per frame. +_cache_projectiles = _unit getVariable QGVAR(cachedProjectiles); +_cache_hitpoints = _unit getVariable QGVAR(cachedHitPoints); +_cache_damages = _unit getVariable QGVAR(cachedDamages); +_cache_params = _unit getVariable QGVAR(cachedHandleDamageParams); + +// Caching of the damage events +if (_selectionName != "") then { + + // Check if the current projectile has already been handled once + if (_projectile in _cache_projectiles) then { + private ["_index","_otherDamage"]; + // if it has been handled, find the index in the cache + _index = _cache_projectiles find _projectile; + + // Find the previous damage this projectile has done + _otherDamage = (_cache_damages select _index); + + // Take the highest damage of the two + if (_otherDamage > _newDamage) then { + _newDamage = 0; + } else { + private ["_hitPoint", "_restore"]; + // Restore the damage before the previous damage was processed + _hitPoint = _cache_hitpoints select _index; + _restore = ((_unit getHitPointDamage _hitPoint) - _otherDamage) max 0; + _unit setHitPointDamage [_hitPoint, _restore]; + + // Make entry unfindable and add the new damage cache + _cache_projectiles set [_index, objNull]; + _cache_projectiles pushBack _projectile; + _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); + _cache_damages pushBack _newDamage; + _cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile]; + }; + } else { + // This is an unhandled projectile + _cache_projectiles pushBack _projectile; + _cache_hitpoints pushBack (_hitPoints select (_hitSelections find _selectionName)); + _cache_damages pushBack _newDamage; + _cache_params pushBack [_unit, _selectionName, _damage, _source, _projectile]; + }; +}; + +// Store the new cached values +_unit setVariable [QGVAR(cachedProjectiles), _cache_projectiles]; +_unit setVariable [QGVAR(cachedHitPoints), _cache_hitpoints]; +_unit setVariable [QGVAR(cachedDamages), _cache_damages]; +_unit setVariable [QGVAR(cachedHandleDamageParams), _cache_params]; diff --git a/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf new file mode 100644 index 0000000000..d0522a79dd --- /dev/null +++ b/addons/medical/functions/fnc_canAccessMedicalEquipment.sqf @@ -0,0 +1,27 @@ +/** + * fn_canAccessMedicalEquipment.sqf + * @Descr: Check if caller can access targets medical equipment, based upon accessLevel + * @Author: Glowbal + * + * @Arguments: [target OBJECT, caller OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_target", "_caller", "_accessLevel", "_return"]; +_target = _this select 0; +_caller = _this select 1; + +_accessLevel = _target getvariable [QGVAR(allowSharedEquipmentAccess), -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/addons/common/functions/fnc_canGoUnconsciousState.sqf b/addons/medical/functions/fnc_canGoUnconsciousState.sqf similarity index 93% rename from addons/common/functions/fnc_canGoUnconsciousState.sqf rename to addons/medical/functions/fnc_canGoUnconsciousState.sqf index 905dc56a43..6eaf983e31 100644 --- a/addons/common/functions/fnc_canGoUnconsciousState.sqf +++ b/addons/medical/functions/fnc_canGoUnconsciousState.sqf @@ -14,4 +14,4 @@ private ["_unit"]; _unit = _this select 0; -(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call FUNC(isAwake))}) \ No newline at end of file +(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(common,isAwake))}) \ No newline at end of file diff --git a/addons/medical/functions/fnc_canPutInBodyBag.sqf b/addons/medical/functions/fnc_canPutInBodyBag.sqf new file mode 100644 index 0000000000..07626c0d21 --- /dev/null +++ b/addons/medical/functions/fnc_canPutInBodyBag.sqf @@ -0,0 +1,17 @@ +/** + * fn_canPutInBodyBag.sqf + * @Descr: + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_caller"]; +_caller = _this select 0; +_target = _this select 1; + +([_caller, "ACE_itemBodyBag"] call EFUNC(common,hasItem) && {(!(alive _target) || (_target getvariable [QEGVAR(common,isDead),false]) || (_target getvariable ["ACE_inReviveState", false]))} && {(_target distance _caller) < 7.5} && (vehicle _target == _unit)); // return \ No newline at end of file diff --git a/addons/medical/functions/fnc_checkDamage.sqf b/addons/medical/functions/fnc_checkDamage.sqf new file mode 100644 index 0000000000..67495c25de --- /dev/null +++ b/addons/medical/functions/fnc_checkDamage.sqf @@ -0,0 +1,55 @@ +/* + * Author: KoffeinFlummi + * + * Checks the unit for leg and arm damage, and removes orphan structural damage. + * + * Arguments: + + 0: Unit + * 1: Leg Damage + * 2: Arm Damage + * 3: Remove orphan damage? (Bool; optional, default No) + * + * Return Value: + * None + */ + +#define LEGDAMAGETRESHOLD1 1 +#define LEGDAMAGETRESHOLD2 1.7 +#define ARMDAMAGETRESHOLD1 1 +#define ARMDAMAGETRESHOLD2 1.7 + +private ["_unit", "_legdamage", "_armdamage", "_damagesum"]; + +_unit = _this select 0; +_legdamage = _this select 1; +_armdamage = _this select 2; + +// Leg Damage +// lightly wounded, only limit walking speed (forceWalk is for suckers) +if (_legdamage >= LEGDAMAGETRESHOLD1) then { + if (_unit getHitPointDamage "HitLegs" != 1) then {_unit setHitPointDamage ["HitLegs", 1]}; +} else { + if (_unit getHitPointDamage "HitLegs" != 0) then {_unit setHitPointDamage ["HitLegs", 0]}; +}; +// @ŧodo: force prone for completely fucked up legs. + +// Arm Damage +// fx only +if (_armdamage >= ARMDAMAGETRESHOLD1) then { + if (_unit getHitPointDamage "HitHands" != 1) then {_unit setHitPointDamage ["HitHands", 1]}; +} else { + if (_unit getHitPointDamage "HitHands" != 0) then {_unit setHitPointDamage ["HitHands", 0]}; +}; + +// remove leftover structural damage if unit is already fully healed +if (count _this > 3 and _this select 3) then { + _damagesum = (_unit getHitPointDamage "HitHead") + + (_unit getHitPointDamage "HitBody") + + (_unit getHitPointDamage "HitLeftArm") + + (_unit getHitPointDamage "HitRightArm") + + (_unit getHitPointDamage "HitLeftLeg") + + (_unit getHitPointDamage "HitRightLeg"); + if (_damagesum <= 0.06) then { + _unit setDamage 0; + }; +}; diff --git a/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf b/addons/medical/functions/fnc_cleanUpCopyOfBody_f.sqf similarity index 95% rename from addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf rename to addons/medical/functions/fnc_cleanUpCopyOfBody_f.sqf index 8831b438b0..b20169e9f5 100644 --- a/addons/common/functions/fnc_cleanUpCopyOfBody_f.sqf +++ b/addons/medical/functions/fnc_cleanUpCopyOfBody_f.sqf @@ -15,7 +15,7 @@ _unit = _this select 0; _copy = _unit getvariable QGVAR(copyOfBody_f); if (isnil "_copy") exitwith {false}; -[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call FUNC(debug); +[format["Cleaning up a copy of Body: %1 %2", _unit, _copy]] call EFUNC(common,debug); // lets clean it up _unit setvariable [QGVAR(originalCopy_f), nil, true]; _unit setvariable [QGVAR(copyOfBody_f), nil, true]; diff --git a/addons/medical/functions/fnc_determineIfFatal.sqf b/addons/medical/functions/fnc_determineIfFatal.sqf new file mode 100644 index 0000000000..b14822efeb --- /dev/null +++ b/addons/medical/functions/fnc_determineIfFatal.sqf @@ -0,0 +1,41 @@ +/** + * fn_determineIfFatal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_Players), GVAR(damageThreshold_Players), GVAR(damageThreshold_Players) * 1.7]]; +} else { + _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_AI), GVAR(damageThreshold_AI), GVAR(damageThreshold_AI) * 1.7]]; +}; + +_damageBodyPart = ([_unit,QGVAR(bodyPartStatus),[0,0,0,0,0,0]] call EFUNC(common,getDefinedVariable)) 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/addons/medical/functions/fnc_determineIfUnconscious.sqf b/addons/medical/functions/fnc_determineIfUnconscious.sqf new file mode 100644 index 0000000000..ebc3af26eb --- /dev/null +++ b/addons/medical/functions/fnc_determineIfUnconscious.sqf @@ -0,0 +1,40 @@ +/** + * fn_determineIfUnconscious.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_Players), GVAR(damageThreshold_Players), GVAR(damageThreshold_Players)]]; +} else { + missionNamespace getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_AI), GVAR(damageThreshold_AI), GVAR(damageThreshold_AI)]]; +}; + +_damageBodyPart = ([_unit,QGVAR(bodyPartStatus),[0,0,0,0,0,0]] call EFUNC(common,getDefinedVariable)) select _part; + +// Check if damage to body part is higher as damage head +if (_part == 0) exitwith { + ((_damageBodyPart * GVAR(setting_medicalDifficulty)) >= ((_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 * GVAR(setting_medicalDifficulty)) >= ((_damageThreshold select 1) * 0.5) && {(random(1) > 0.4)}); +}; +// Check if damage to body part is higher as damage limbs +((_damageBodyPart * GVAR(setting_medicalDifficulty)) >= ((_damageThreshold select 2) * 0.8) && {(random(1) > 0.7)}); \ No newline at end of file diff --git a/addons/gui/functions/fnc_effectBlackOut.sqf b/addons/medical/functions/fnc_effectBlackOut.sqf similarity index 100% rename from addons/gui/functions/fnc_effectBlackOut.sqf rename to addons/medical/functions/fnc_effectBlackOut.sqf diff --git a/addons/gui/functions/fnc_effectBleeding.sqf b/addons/medical/functions/fnc_effectBleeding.sqf similarity index 100% rename from addons/gui/functions/fnc_effectBleeding.sqf rename to addons/medical/functions/fnc_effectBleeding.sqf diff --git a/addons/gui/functions/fnc_effectPain.sqf b/addons/medical/functions/fnc_effectPain.sqf similarity index 100% rename from addons/gui/functions/fnc_effectPain.sqf rename to addons/medical/functions/fnc_effectPain.sqf diff --git a/addons/medical/functions/fnc_fromNumberToBodyPart.sqf b/addons/medical/functions/fnc_fromNumberToBodyPart.sqf new file mode 100644 index 0000000000..a556ea1211 --- /dev/null +++ b/addons/medical/functions/fnc_fromNumberToBodyPart.sqf @@ -0,0 +1,39 @@ +/** + * fn_fromNumberToBodyPart.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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/addons/medical/functions/fnc_getActivityLog.sqf b/addons/medical/functions/fnc_getActivityLog.sqf new file mode 100644 index 0000000000..5f5f1ba6de --- /dev/null +++ b/addons/medical/functions/fnc_getActivityLog.sqf @@ -0,0 +1,23 @@ +/** + * fn_getActivityLog.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private["_unit"]; +_unit = _this select 0; +_log = [_unit,QGVAR(activityLog)] call EFUNC(common,getDefinedVariable); + +if (isnil "_log") then { + _log = []; +}; +if (typeName _log != typeName []) then { + _log = []; +}; +_log diff --git a/addons/medical/functions/fnc_getBloodLoss.sqf b/addons/medical/functions/fnc_getBloodLoss.sqf new file mode 100644 index 0000000000..929ca2b856 --- /dev/null +++ b/addons/medical/functions/fnc_getBloodLoss.sqf @@ -0,0 +1,36 @@ +/** + * fn_getBloodLoss.sqf + * @Descr: Calculate the total blood loss of a unit. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: NUMBER Total blood loss of unit + * @PublicAPI: true + */ + +#include "script_component.hpp" + +#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, QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable); +_openWounds = [_this, QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); +_cardiacOutput = [_this] call FUNC(getCardiacOutput); + +{ + 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/addons/medical/functions/fnc_getBloodPressure.sqf b/addons/medical/functions/fnc_getBloodPressure.sqf new file mode 100644 index 0000000000..620b8d541d --- /dev/null +++ b/addons/medical/functions/fnc_getBloodPressure.sqf @@ -0,0 +1,31 @@ +/** + * fn_getBloodPressure.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 + */ + +#include "script_component.hpp" + +/* + 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 FUNC(getCardiacOutput); +_resistance = [_unit, QGVAR(peripheralResistance)] call EFUNC(common,getDefinedVariable); + +_bloodPressureHigh = (_cardiacOutput * MODIFIER_BP_HIGH) * _resistance; +_bloodPressureLow = (_cardiacOutput * MODIFIER_BP_LOW) * _resistance; + +[_bloodPressureLow, _bloodPressureHigh]; \ No newline at end of file diff --git a/addons/medical/functions/fnc_getBloodVolumeChange.sqf b/addons/medical/functions/fnc_getBloodVolumeChange.sqf new file mode 100644 index 0000000000..69b240b1d7 --- /dev/null +++ b/addons/medical/functions/fnc_getBloodVolumeChange.sqf @@ -0,0 +1,59 @@ +/** + * fn_getBloodVolumeChange.sqf + * @Descr: Calculates the blood volume change and decreases the IVs given to the unit. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: NUMBER Bloodvolume change + * @PublicAPI: false + */ + +#include "script_component.hpp" + +/* + 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 [QGVAR(bloodVolume), 100]; +_bloodVolumeChange = -(_unit call FUNC(getBloodLoss)); + +if (_bloodVolume < 100.0) then { + if ((_unit getvariable [QGVAR(salineIVVolume), 0]) > 0) then { + _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; + _ivVolume = (_unit getvariable [QGVAR(salineIVVolume), 0]) + IV_CHANGE_PER_SECOND; + _unit setvariable [QGVAR(salineIVVolume),_ivVolume]; + if ([QEGVAR(fieldRations,module)] call EFUNC(common,isModuleEnabled_F)) then { + if ([_unit] call EFUNC(fieldRations,canDrink)) then { + _unit setvariable [QEGVAR(fieldRations,drinkStatus), (_unit getvariable [QEGVAR(fieldRations,drinkStatus), 100]) + 0.2]; + }; + }; + }; + if ((_unit getvariable [QGVAR(plasmaIVVolume), 0]) > 0) then { + _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; + _ivVolume = (_unit getvariable [QGVAR(plasmaIVVolume), 0]) + IV_CHANGE_PER_SECOND; + _unit setvariable [QGVAR(plasmaIVVolume),_ivVolume]; + }; + if ((_unit getvariable [QGVAR(bloodIVVolume), 0]) > 0) then { + _bloodVolumeChange = _bloodVolumeChange + BLOOD_CHANGE_PER_SECOND; + _ivVolume = (_unit getvariable [QGVAR(bloodIVVolume), 0]) + IV_CHANGE_PER_SECOND; + _unit setvariable [QGVAR(bloodIVVolume),_ivVolume]; + }; +}; + +_bloodVolumeChange diff --git a/addons/medical/functions/fnc_getBodyPartNumber.sqf b/addons/medical/functions/fnc_getBodyPartNumber.sqf new file mode 100644 index 0000000000..6bfc041c80 --- /dev/null +++ b/addons/medical/functions/fnc_getBodyPartNumber.sqf @@ -0,0 +1,54 @@ +/** + * fn_getBodyPartNumber.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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.5) then { + 2 + } else { + 3 + }; + }; + case "hand_l": { + 2 + }; + case "hand_r": { + 3 + }; + case "legs": { + if (random(1)>=0.5) then { + 4 + } else { + 5 + }; + }; + case "leg_l": { + 4 + }; + case "leg_r": { + 5 + }; + default { + -1 + }; + }; +_part \ No newline at end of file diff --git a/addons/medical/functions/fnc_getCardiacOutput.sqf b/addons/medical/functions/fnc_getCardiacOutput.sqf new file mode 100644 index 0000000000..a22bb3d5d9 --- /dev/null +++ b/addons/medical/functions/fnc_getCardiacOutput.sqf @@ -0,0 +1,25 @@ +/** + * fn_getCardiacOutput.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 + */ + +#include "script_component.hpp" + +/* + 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 [QGVAR(bloodVolume), 100])/MODIFIER_CARDIAC_OUTPUT) + ((_unit getvariable [QGVAR(heartRate), 80])/80-1); \ No newline at end of file diff --git a/addons/medical/functions/fnc_getCurrentSelectedInjuryData.sqf b/addons/medical/functions/fnc_getCurrentSelectedInjuryData.sqf new file mode 100644 index 0000000000..93e2a6c871 --- /dev/null +++ b/addons/medical/functions/fnc_getCurrentSelectedInjuryData.sqf @@ -0,0 +1,19 @@ +/** + * fn_getCurrentSelectedInjuryData.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_return", "_current"]; +_return = ""; +if (dialog) then { + _current = lbCurSel 213; + _return = lbData [213,_current]; +}; +_return; \ No newline at end of file diff --git a/addons/medical/functions/fnc_getHeartRateChange.sqf b/addons/medical/functions/fnc_getHeartRateChange.sqf new file mode 100644 index 0000000000..a3c0c239cd --- /dev/null +++ b/addons/medical/functions/fnc_getHeartRateChange.sqf @@ -0,0 +1,82 @@ +/** + * fn_getHeartRateChange.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: void + * @PublicAPI: false + */ + +#include "script_component.hpp" + +#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 [QGVAR(inCardiacArrest),false])) then { + _heartRate = _unit getvariable [QGVAR(heartRate), 80]; + _bloodLoss = _unit call FUNC(getBloodLoss); + + _adjustment = _unit getvariable [QGVAR(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 [QGVAR(heartRateAdjustments), _adjustment]; + + _bloodVolume = _unit getvariable [QGVAR(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/addons/medical/functions/fnc_getNewDamageBodyPart.sqf b/addons/medical/functions/fnc_getNewDamageBodyPart.sqf new file mode 100644 index 0000000000..ec1efcab9f --- /dev/null +++ b/addons/medical/functions/fnc_getNewDamageBodyPart.sqf @@ -0,0 +1,28 @@ +/** + * fnc_getNewDamageBodyPart.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_selectionName","_newDamage", "_previousDamage", "_origDamage", "_number"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_number = _this select 2; + +_previousDamage = _unit getvariable [QGVAR(bodyPartStatusPrevious), [0,0,0,0,0,0]]; +_newDamage = _amountOfDamage - (_previousDamage select _number); +_previousDamage set [_number, _newDamage]; +[_unit,QGVAR(bodyPartStatusPrevious),_previousDamage] call EFUNC(common,setDefinedVariable); + + +_origDamage = [_unit,QGVAR(bodyPartStatus),[0,0,0,0,0,0]] call EFUNC(common,getDefinedVariable); +_origDamage set [_number, (_origDamage select _number) + _newDamage]; /* We are storing the total Damage done on a body part for determining the damage properly */ +[_unit,QGVAR(bodyPartStatus),_origDamage] call EFUNC(common,setDefinedVariable); + +_newDamage \ No newline at end of file diff --git a/addons/medical/functions/fnc_getQuickViewLog.sqf b/addons/medical/functions/fnc_getQuickViewLog.sqf new file mode 100644 index 0000000000..356c08391e --- /dev/null +++ b/addons/medical/functions/fnc_getQuickViewLog.sqf @@ -0,0 +1,22 @@ +/** + * fn_getQuickViewLog.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private["_unit"]; +_unit = _this select 0; +_log = [_unit,QGVAR(quickViewLog)] call EFUNC(common,getDefinedVariable); +if (isnil "_log") then { + _log = []; +}; +if (typeName _log != typeName []) then { + _log = []; +}; +_log diff --git a/addons/medical/functions/fnc_getSelectedBodyPart.sqf b/addons/medical/functions/fnc_getSelectedBodyPart.sqf new file mode 100644 index 0000000000..6e018c2aac --- /dev/null +++ b/addons/medical/functions/fnc_getSelectedBodyPart.sqf @@ -0,0 +1,16 @@ +/** + * fn_getSelectedBodyPart.sqf + * @Descr: Get the current selected body part for client + * @Author: Glowbal + * + * @Arguments: [] + * @Return: STRING bodyPart selected + * @PublicAPI: true + */ + +#include "script_component.hpp" + +if (isnil QGVAR(selectedBodyPart)) then { + GVAR(selectedBodyPart) = "head"; +}; +GVAR(selectedBodyPart) \ No newline at end of file diff --git a/addons/medical/functions/fnc_getTreatmentOptions.sqf b/addons/medical/functions/fnc_getTreatmentOptions.sqf new file mode 100644 index 0000000000..b2bd75dc78 --- /dev/null +++ b/addons/medical/functions/fnc_getTreatmentOptions.sqf @@ -0,0 +1,49 @@ +/** + * fnc_getTreatmentOptions.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + + +private ["_caller","_target","_category", "_result", "_nameCaller", "_nameTarget"]; +_caller = _this select 0; +_target = _this select 1; +_category = _this select 2; + +if ((_category == "advanced" || _category == "airway") && (_caller == _target)) exitwith { + []; +}; + +if (!([_caller] call EFUNC(common,canInteract))) exitwith { + []; +}; + +if (([_caller] call EFUNC(common,beingCarried))) exitwith { + []; +}; + +if (!(isNull([_caller] call EFUNC(common,getCarriedObj))) && _category != "drag") exitwith { + []; +}; + +_nameCaller = [_caller] call EFUNC(common,getName); +_nameTarget = [_Target] call EFUNC(common,getName); + +_result = []; +{ + if ([_caller, _target] call (_x select 2)) then { + + private ["_caller", "_target", "_category"]; + + // title, code, tooltip + _result pushback [format[_x select 0, _nameCaller, _nameTarget], _x select 3, format[_x select 1, _nameCaller, _nameTarget]]; + }; +}foreach (missionNamespace getvariable [QGVAR(registeredTreatmentOptions_)+_category, []]); + +_result; \ No newline at end of file diff --git a/addons/medical/functions/fnc_getTriageList.sqf b/addons/medical/functions/fnc_getTriageList.sqf new file mode 100644 index 0000000000..89660d7c97 --- /dev/null +++ b/addons/medical/functions/fnc_getTriageList.sqf @@ -0,0 +1,22 @@ +/** + * fn_getTriageList.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private["_unit"]; +_unit = _this select 0; +_log = [_unit,QGVAR(triageCard)] call EFUNC(common,getDefinedVariable); +if (isnil "_log") then { + _log = []; +}; +if (typeName _log != typeName []) then { + _log = []; +}; +_log diff --git a/addons/medical/functions/fnc_getTriageStatus.sqf b/addons/medical/functions/fnc_getTriageStatus.sqf new file mode 100644 index 0000000000..58b2f3f0d5 --- /dev/null +++ b/addons/medical/functions/fnc_getTriageStatus.sqf @@ -0,0 +1,24 @@ +/** + * fn_getTriageStatus.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_return","_status"]; +_unit = _this select 0; +_status = _unit getvariable [QGVAR(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/addons/medical/functions/fnc_getTypeOfDamage.sqf b/addons/medical/functions/fnc_getTypeOfDamage.sqf new file mode 100644 index 0000000000..80bbb0c972 --- /dev/null +++ b/addons/medical/functions/fnc_getTypeOfDamage.sqf @@ -0,0 +1,30 @@ +/** + * fn_getTypeOfDamage.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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/addons/common/functions/fnc_getUnconsciousCondition.sqf b/addons/medical/functions/fnc_getUnconsciousCondition.sqf similarity index 100% rename from addons/common/functions/fnc_getUnconsciousCondition.sqf rename to addons/medical/functions/fnc_getUnconsciousCondition.sqf diff --git a/addons/medical/functions/fnc_handleBandageOpening.sqf b/addons/medical/functions/fnc_handleBandageOpening.sqf new file mode 100644 index 0000000000..cc27dbdee7 --- /dev/null +++ b/addons/medical/functions/fnc_handleBandageOpening.sqf @@ -0,0 +1,83 @@ +/** + * fn_handleBandageOpening.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +#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", "_waitingTime", "_selectedConfig"]; +_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 = [ + ["ACE_bandage_basic", 900 + random (120), 0.75, 0.4], + ["ACE_packing_bandage", 1200 + random (120), 0.5, 0.6], + ["ACE_bandageElastic", 900 + random (900), 0.75, 0.2], + ["ACE_quikclot", 1, 0.1, 0], + ["default", 1, CFG_DEFAULT_WAITING_TIME, 1] +]; +_selectedConfig = _config select (count _config - 1); +_waitingTime = -1; + +_found = false; +{ + if (_item == _x select 0) exitwith { + _found = true; + if (random(1)> (1 - (_x select CHANCE))) then { + + _waitingTime = (_x select WAITINGTIME); + _selectedConfig = _x; + }; + }; +}foreach _config; + +if (!_found && (random(1)>0.2)) then { + _waitingTime = CFG_DEFAULT_WAITING_TIME; +}; + +if (_waitingTime > 0) then { + [{ + private ["_params", "_config", "_person", "_amount","_bodyPart","_woundClass","_item", "_bandagedWounds","_bandagedBodyPart","_bandagedWoundClass","_openWounds", "_openWoundsBodyPart","_openWoundClass"]; + _params = _this select 0; + _config = _this select 1; + + _person = _params select 0; + _amount = _params select 1; + _bodyPart = _params select 2; + _woundClass = _params select 3; + _item = _params select 4; + + _bandagedWounds = [_person,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable); + _bandagedBodyPart = _bandagedWounds select _bodyPart; + _bandagedWoundClass = _bandagedBodyPart select _woundClass; + if (_bandagedWoundClass >= _amount) then { + _openWounds =[_person,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); + _openWoundsBodyPart = _openWounds select _bodyPart; + _openWoundClass = _openWoundsBodyPart select _woundClass; + + _bandagedBodyPart set [_woundClass,_bandagedWoundClass - (_amount * (_config select RATIO))]; + _openWoundsBodyPart set [_woundClass,_openWoundClass + (_amount * (_config select RATIO))]; + + _bandagedWounds set[_bodyPart,_bandagedBodyPart]; + _openWounds set[_bodyPart,_openWoundsBodyPart]; + [_person,QGVAR(openWounds),_openWounds] call EFUNC(common,setDefinedVariable); + [_person,QGVAR(bandagedWounds),_bandagedWounds] call EFUNC(common,setDefinedVariable); + + ["Medical_onWoundsReopened", [_person, (_amount * (_config select RATIO)), _bodyPart, _woundClass, _item]] call ace_common_fnc_localEvent; + }; + }, [_this, _selectedConfig], _waitingTime, _waitingTime] call EFUNC(common,waitAndExecute); +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleDamage.sqf b/addons/medical/functions/fnc_handleDamage.sqf new file mode 100644 index 0000000000..a157a0b2ae --- /dev/null +++ b/addons/medical/functions/fnc_handleDamage.sqf @@ -0,0 +1,93 @@ +/** + * fn_handleDamage.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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; + +// do not function on non local units +if (!local _unit) exitwith { + nil; +}; + +_bodyPartn = [_selectionName] call FUNC(getBodyPartNumber); + +// Check for vehicle crash +if (vehicle _unit != _unit && {_bodyPartn < 0} && {isNull _sourceOfDamage} && {_typeOfProjectile == ""} && {_selectionName == ""}) then { + if (GVAR(setting_allowVehicleCrashInjuries)) 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 + +// Ensure damage is being handled correctly. +_newDamage = [_unit, _amountOfDamage, _bodyPartn] call FUNC(getNewDamageBodyPart); +[_unit] call FUNC(setDamageBodyPart); + +if ([_unit] call FUNC(hasMedicalEnabled)) then { + _returnDamage = 0; + if (_amountOfDamage < 0) then { + _amountOfDamage = 0; + }; + + // figure out the type of damage so we can use that to determine what injures should be given. + _typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage); + + [_unit, _newDamage, _typeOfDamage, _bodyPartn] call FUNC(onInjury_assignOpenWounds); + + if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) > 0) then { + if (GVAR(setting_allowAirwayInjuries)) then { + [_unit, _amountOfDamage, _typeOfDamage, _bodyPartn] call FUNC(onInjury_assignAirwayStatus); + }; + }; + [_unit, _newDamage, _bodyPartn] call FUNC(increasePain); + + if (([_unit, _bodyPartn] call FUNC(determineIfFatal)) || !(alive (vehicle _unit))) then { + [_unit] call FUNC(setDead); + _returnDamage = 1; + } else { + [_unit] call FUNC(addToInjuredCollection); + if ([_unit, _bodyPartn] call FUNC(determineIfUnconscious)) then { + [_unit] call FUNC(setUnconsciousState); + } else { + [_unit,_newDamage] call FUNC(handleReactionHit); + }; + }; + + if (!(alive (vehicle _unit))) then { + _returnDamage = 1; + [_unit] call FUNC(setDead); + }; + ["Medical_onHandleDamage", _this] call ace_common_fnc_localEvent; +} else { + if (_returnDamage > 0.957) then { + _returnDamage = 0.957; + }; + if (([_unit, _bodyPartn] call FUNC(determineIfFatal)) || !(alive (vehicle _unit))) then { + [_unit] call FUNC(setDead); + _returnDamage = 1; + }; +}; + +_returnDamage; diff --git a/addons/medical/functions/fnc_handleDisplayEffects.sqf b/addons/medical/functions/fnc_handleDisplayEffects.sqf new file mode 100644 index 0000000000..b640532cac --- /dev/null +++ b/addons/medical/functions/fnc_handleDisplayEffects.sqf @@ -0,0 +1,83 @@ +/** + * fn_handleDisplayEffects.sqf + * @Descr: displays visual effects to user + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +if (!hasInterface) exitwith{}; +45 cutRsc [QGVAR(ScreenEffectsBlack),"PLAIN"]; + +FUNC(hb_effect) = { + _heartRate = _this select 0; + if (_heartRate < 0.1) exitwith {}; + _hbSoundsFast = ["ACE_heartbeat_fast_1", "ACE_heartbeat_fast_2", "ACE_heartbeat_fast_3", "ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"]; + _hbSoundsNorm = ["ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"]; + _hbSoundsSlow = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2", "ACE_heartbeat_norm_1", "ACE_heartbeat_norm_2"]; + + if (GVAR(playingHeartBeatSound)) exitwith {}; + GVAR(playingHeartBeatSound) = true; + + _sleep = 60 / _heartRate; + if (_heartRate < 60) then { + _sound = _hbSoundsSlow select (random((count _hbSoundsSlow) -1)); + playSound _sound; + + [{ + GVAR(playingHeartBeatSound) = false; + }, [], _sleep, _sleep] call EFUNC(common,waitAndExecute); + } else { + if (_heartRate > 120) then { + _sound = _hbSoundsFast select (random((count _hbSoundsFast) -1)); + playSound _sound; + [{ + GVAR(playingHeartBeatSound) = false; + }, [], _sleep, _sleep] call EFUNC(common,waitAndExecute); + }; + }; +}; + +GVAR(playingHeartBeatSound) = false; +GVAR(BloodLevel_CC) = ppEffectCreate ["ColorCorrections", 4208]; +GVAR(BloodLevel_CC) ppEffectForceInNVG true; +GVAR(BloodLevel_CC) ppEffectAdjust [1,1,0, [0,0,0,0], [1,1,1,1], [0.2,0.2,0.2,0]]; +GVAR(BloodLevel_CC) ppEffectCommit 0; + +[{ + private ["_unit","_bloodLoss", "_bloodVolume"]; + _unit = ACE_player; + + if (isNull(findDisplay 312)) then { + if ([_unit] call EFUNC(common,isAwake) && false) then { + _bloodLoss = _unit call FUNC(getBloodLoss); + if (_bloodLoss >0) then { + [_bloodLoss] call FUNC(effectBleeding); + }; + + [{ + [((_this select 0) getvariable[QGVAR(amountOfPain), 0])] call FUNC(effectPain); + }, [_unit], 0.25, 0.25] call EFUNC(common,waitAndExecute); + + [(_unit getvariable[QGVAR(heartRate), 70])] call FUNC(hb_effect); + ["medicalEffectsLoop", [_unit]] call ace_common_fnc_localEvent + }; + + // Blood Level Effect + _bloodVolume = _unit getVariable [QGVAR(bloodVolume), 100]; + if (_bloodVolume > 99 || !alive _unit) then { + GVAR(BloodLevel_CC) ppEffectEnable false; + } else { + GVAR(BloodLevel_CC) ppEffectEnable true; + GVAR(BloodLevel_CC) ppEffectAdjust [1, 1, 0, [0.0, 0.0, 0.0, 0.0], [1, 1, 1,_bloodVolume/100], [0.2, 0.2, 0.2, 0]]; + GVAR(BloodLevel_CC) ppEffectCommit 0; + }; + } else { + GVAR(BloodLevel_CC) ppEffectEnable false; + }; + + } , 0.5, [] ] call CBA_fnc_addPerFrameHandler; diff --git a/addons/medical/functions/fnc_handleDropUnit.sqf b/addons/medical/functions/fnc_handleDropUnit.sqf new file mode 100644 index 0000000000..c82fe8ce79 --- /dev/null +++ b/addons/medical/functions/fnc_handleDropUnit.sqf @@ -0,0 +1,88 @@ +/** + * fnc_handleDropUnit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + + +#include "script_component.hpp" + + +private ["_caller","_target","_killOnDrop","_dragging"]; +_caller = _params select 0; +_target = _params select 1; +_killOnDrop = _params select 2; +_dragging = _params select 3; + +[format["fnc_handleDropUnit: %1",_this]] call EFUNC(common,debug); + +if ((isNull ([_caller] call EFUNC(common,getCarriedObj))) || !([_caller] call EFUNC(common,isAwake)) || (vehicle _caller != _caller)) then { + + if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { + _caller removeWeapon "ACE_FakePrimaryWeapon"; + }; + + [_target, false] call EFUNC(common,disableAI_f); + _caller setvariable[QGVAR(onStartMovingUnitParams), nil]; + + // handle the drag & carry administration + if (_dragging) then { + _target setvariable [QGVAR(beingDragged),nil,true]; + _caller setvariable [QGVAR(dragging),nil,true]; + } else { + _target setvariable [QGVAR(beingCarried),nil,true]; + _caller setvariable [QGVAR(carrying),nil,true]; + }; + + // This is for good messure, the object should already have been dropped if it ever reaches this + [_caller,ObjNull] call EFUNC(common,carryObj); + + // handle the drag & carry animiations + if ([_caller] call EFUNC(common,isAwake) && (vehicle _caller == _caller)) then { + [_caller,"amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon", 1] call EFUNC(common,doAnimation); + }; + + if (vehicle _target == _target) then { + if (_dragging) then { + [_target,"AinjPpneMstpSnonWrflDb_release", 2, true] call EFUNC(common,doAnimation); + } else { + [_target,"AinjPfalMstpSnonWrflDnon_carried_Down", 2, true] call EFUNC(common,doAnimation); + }; + } else { + if ([_target] call EFUNC(common,isAwake)) then { + [_target,"", 2] call EFUNC(common,doAnimation); // TODO play animation for the current seat instead + } else { + // this might not work properly + [_target,([_target] call EFUNC(common,getDeathAnim)), 1] call EFUNC(common,doAnimation); + }; + }; + + // Ensure that the unit does not get dropped through the floor of a building + if (!surfaceIsWater getPos _caller) then { + [{ + EXPLODE_3_PVT(_this,_caller,_target,_killOnDrop); + if (vehicle _target == _target && (vehicle _caller == _caller)) then { + // This will set the target body/unit on the correct position, so it doesn't fall through floors. + _positionUnit = getPosATL _target; + _positionUnit set [2, (getPosATL _caller) select 2]; + _target setPosATL _positionUnit; + }; + + if (_killOnDrop) then { + _unit setDamage 1; + }; + [format["fnc_handleDropUnit: %1 - passed setPosATL fix", _caller]] call EFUNC(common,debug); + }, [_caller,_target,_killOnDrop], 0.5, 0.5] call EFUNC(common,waitAndExecute); + } else { + if (_killOnDrop) then { + _unit setDamage 1; + }; + }; + + ["onDropInjured", [_caller], [_caller, _unit, 0]] call EFUNC(common,targetEvent); + +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleHeal.sqf b/addons/medical/functions/fnc_handleHeal.sqf new file mode 100644 index 0000000000..04e17a5d4c --- /dev/null +++ b/addons/medical/functions/fnc_handleHeal.sqf @@ -0,0 +1,29 @@ +/** + * fn_handleHeal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit",'_healer']; +_unit = _this select 0; +_healer = _this select 1; + +if (!(isPlayer _healer) && GVAR(setting_allowAIFullHeal) && !([_unit] call EFUNC(common,isUnconscious))) then { + [_unit, QGVAR(openWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable); + [_unit, QGVAR(bandagedWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable); + + if (_unit != _healer) then { + [_unit,"STR_ACE_BANDAGED","STR_ACE_IS_BANDAGING_YOU", 0, [[_healer] call EFUNC(common,getName)]] call EFUNC(gui,sendDisplayMessageTo); + }; + [_unit,"treatment",format["%1 has patched up the patient",[_healer] call EFUNC(common,getName)]] call FUNC(addActivityToLog); + + ["Medical_onHandleHeal", _this] call ace_common_fnc_localEvent; +}; + +true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleReactionHit.sqf b/addons/medical/functions/fnc_handleReactionHit.sqf new file mode 100644 index 0000000000..2128fa65c6 --- /dev/null +++ b/addons/medical/functions/fnc_handleReactionHit.sqf @@ -0,0 +1,51 @@ +/** + * fn_handleReactionHit.sqf + * @Descr: triggers a reaction to being hit for a unit and spawns on screen effects. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_amountOfDamage"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; + +if (_amountOfDamage > 0.2) then { + // [_unit] call FUNC(playInjuredSound); + 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 EFUNC(common,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 EFUNC(common,setProne); + }; + }; + if (isPlayer _unit) then { + 76 cutRsc [QGVAR(ScreenEffectsHit),"PLAIN"]; + addCamShake [3, 5, _amountOfDamage + random 10]; + }; +} else { + if (_amountOfDamage > 0) then { + if (isPlayer _unit) then { + 76 cutRsc [QGVAR(ScreenEffectsHit),"PLAIN"]; + }; + }; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment.sqf b/addons/medical/functions/fnc_handleTreatment.sqf new file mode 100644 index 0000000000..929dcfdbb0 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment.sqf @@ -0,0 +1,72 @@ +/** + * fnc_handleTreatment.sqf + * @Descr: entry point for all treatment actions. Handles the syncronization between treatment actions and equipment usages. Will pass on the the treatment action to their category handlers. + * When using an undefined category, the caller is responsible for cleaning up, including unlocking the treatment mutex. + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, target OBJECT, selectionName STRING, removeItem STRING, category STRING] + * @Return: nil + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_treatingPerson","_injuredPerson","_selectionName","_removeItem","_attributes","_patient", "_continue", "_prevAnim"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_category = _this select 4; + +if (!local _caller) exitwith { + [[_caller, _target, _selectionName, _removeItem, _category], QUOTE(FUNC(handleTreatment)), _caller] call EFUNC(common,execRemoteFnc); + false; +}; + +if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith { + if (_caller == ACE_player) then { + // display a message - currently occupied with treatment already + }; + false +}; +[_caller, true] call FUNC(treatmentMutex); + +if (!([_caller, _target, _removeItem] call FUNC(hasEquipment)) && _removeItem != "") exitwith { + [_caller, false] call FUNC(treatmentMutex); + false; +}; + +if (primaryWeapon _caller == "") then { + _caller addWeapon "ACE_FakePrimaryWeapon"; +}; +_caller selectWeapon (primaryWeapon _caller); + +// TODO make dynamic +switch (toLower _category) do { + case "bandage": { + ([_caller, _target, _selectionName, _removeItem] call FUNC(handleTreatment_Category_Bandaging)); + }; + case "medication": { + ([_caller, _target, _selectionName, _removeItem] call FUNC(handleTreatment_Category_Medication)); + }; + case "advanced": { + ([_caller, _target, _selectionName, _removeItem] call FUNC(handleTreatment_Category_Advanced)); + }; + case "airway": { + ([_caller, _target, _selectionName, _removeItem] call FUNC(handleTreatment_Category_Airway)); + }; + default { + // Do not handle the request + false; + }; +}; + +// Entry point for any un supported treatment actions. +// Expected to have one of the local events call the treatment completed event. +["Medical_performingTreatment", [_caller, _target, _selectionName, _removeItem, _category]] call ace_common_fnc_localEvent; + +if ([_target] call FUNC(hasMedicalEnabled)) then { + [_target] call FUNC(addToInjuredCollection); +}; + +true; diff --git a/addons/medical/functions/fnc_handleTreatment_Action_AdvancedLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_AdvancedLocal.sqf new file mode 100644 index 0000000000..1afb25f44c --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_AdvancedLocal.sqf @@ -0,0 +1,45 @@ +/** + * fnc_handleTreatment_Action_AdvancedLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_caller", "_selectionName", "_removeItem", "_prevAnim", "_value"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_prevAnim = _this select 4; + +// TODO old code, has to be replaced by something more dynamic. +_attributes = switch (_removeItem) do { + case "ACE_blood_iv": {[QGVAR(bloodIVVolume),1000,"Blood IV"]}; + case "ACE_saline_iv": {[QGVAR(salineIVVolume),1000,"Saline IV"]}; + case "ACE_plasma_iv": {[QGVAR(plasmaIVVolume),1000,"Plasma IV"]}; + + case "ACE_blood_iv_500": {[QGVAR(bloodIVVolume),500,"Blood IV"]}; + case "ACE_saline_iv_500": {[QGVAR(salineIVVolume),500,"Saline IV"]}; + case "ACE_plasma_iv_500": {[QGVAR(plasmaIVVolume),500,"Plasma IV"]}; + + case "ACE_blood_iv_250": {[QGVAR(bloodIVVolume),250,"Blood IV"]}; + case "ACE_saline_iv_250": {[QGVAR(salineIVVolume),250,"Saline IV"]}; + case "ACE_plasma_iv_250": {[QGVAR(plasmaIVVolume),250,"Plasma IV"]}; + + default {[]}; +}; + +if (count _attributes > 1) then { + _value = [_target,(_attributes select 0)] call EFUNC(common,getDefinedVariable); + _value = _value + (_attributes select 1); + [_target,(_attributes select 0),_value] call EFUNC(common,setDefinedVariable); + + // TODO localization + [_target,"treatment",format["%1 has given %4 a %2(%3ml)",[_caller] call EFUNC(common,getName),_attributes select 2,_attributes select 1,_target]] call FUNC(addActivityToLog); + [_target,_removeItem] call FUNC(addToTriageList); +}; diff --git a/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf new file mode 100644 index 0000000000..a140f74f6b --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_AirwayLocal.sqf @@ -0,0 +1,36 @@ +/** + * fn_treatmentAirwayLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim", "_displayingIcon", "_part"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + + +if (!local _target) exitwith{}; + +[_target,"STR_ACE_AIRWAY","STR_ACE_IS_TREATING_YOUR_AIRWAY",0, [([_caller] call EFUNC(common,getName))]] call EFUNC(gui,sendDisplayMessageTo); +[_target,_removeItem] call FUNC(addToTriageList); + + +_airwayStatus = [_target,QGVAR(airway)] call EFUNC(common,getDefinedVariable); +if (_airwayStatus > 0) then { + if (!([_treatingPerson] call FUNC(isMedic))) then { + _target setvariable [QGVAR(airwayTreated), true, true]; + } else { + if (random (1) >= 0.35) then { + _target setvariable [QGVAR(airwayTreated), true, true]; + }; + }; +}; +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf new file mode 100644 index 0000000000..c6a09fa4de --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_BandageLocal.sqf @@ -0,0 +1,143 @@ +/** + * fn_bandageLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_Target","_selectionName","_removeItem","_part","_openWounds","_woundsArray","_highest_amount","_highestSpot","_collectiveImpact", "_highestTotal","_totalNumber", "_selectedData"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +// TODO figure this out later on +//_selectedData = [_this, 4, "", [""]] call BIS_fnc_Param; + +if (!local _target) exitwith{ + ["fnc_bandageLocal called on non local machine",3] call EFUNC(common,debug); +}; + +if (_caller != _target) then { + [_target,"STR_ACE_BANDAGING", "STR_ACE_IS_BANDAGING_YOU", 0, [[_treatingPerson] call EFUNC(common,getName)]] call EFUNC(gui,sendDisplayMessageTo); +}; + +[_target,_removeItem] call FUNC(addToTriageList); + +// TODO make dynamic +_collectiveImpact = switch (_removeItem) do { + case "ACE_packing_bandage": {[1.0, 1.5, 1.2]}; + case "ACE_bandageElastic": {[1.3, 0.9, 0.9]}; + case "ACE_bandage_basic": {[1.5, 1.0, 0.6]}; + case "ACE_stitching": {[2.0, 2.0, 2.0]}; + case "ACE_quikclot": {[0.9, 0.3, 0.3]}; + default {[0.9, 0.5, 0.5]}; +}; + +_part = [_selectionName] call FUNC(getBodyPartNumber); + +_openWounds = [_target,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); +_woundsArray = _openWounds select _part; + +// Find the type of which we have the most injures and the amount of this for the selected bodypart. +_highestSpot = 0; +_highest_amount = 0; +{ + if (_x > _highest_amount) then { + _highestSpot = _foreachIndex; + _highest_amount = _x; + }; +}foreach _woundsArray; + +// If we have bandaging aid enabled (on easy difficulty), we will find the body part with the most injuries and use that instead. +if (GVAR(setting_enableBandagingAid)) then { + _highestTotal = 0; + { + // find out how many injuries this bodypart has + _totalNumber = 0; + { + _totalNumber = _totalNumber + _x; + }foreach _x; + + // Check if this body part has the highest amount of injuries + if (_totalNumber > _highestTotal) then { + _part = _foreachIndex; + _highestTotal = _totalNumber; + }; + }foreach _openWounds; + + // Find the type of which we have the most injures and the amount of this for the selected bodypart. + _woundsArray = _openWounds select _part; + _highestSpot = 0; + _highest_amount = 0; + { + if (_x > _highest_amount) then { + _highestSpot = _foreachIndex; + _highest_amount = _x; + }; + }foreach _woundsArray; +}; + +// Find the amount of impact the used bandage has for the injury +_impactOfBandage = (_collectiveImpact select _highestSpot); + +_wounds = _highest_amount; +_amountOfInpact = 0; + +// if we have wounds, log that we have bandaged those and find the real impact of the bandage +if (_wounds > 0) then { + [_target,"treatment",format["%2 has bandaged a wound on %1",[_part] call FUNC(fromNumberToBodyPart),[_caller] call EFUNC(common,getName)]] call FUNC(addActivityToLog); + + _amountOfInpact = _impactOfBandage; + if (_impactOfBandage > _wounds) then { + _amountOfInpact = _wounds; + }; +}; + +// Decrease the impact +_wounds = (_wounds - _impactOfBandage); +if (_wounds < 0) then { + _wounds = 0; +}; +// Adjust the wounds value for the unit +_woundsArray set[_highestSpot, _wounds]; +_openWounds set [_part, _woundsArray]; +[_target,QGVAR(openWounds),_openWounds] call EFUNC(common,setDefinedVariable); + + +// Check if we have wounds opening enabled +if (isnil QGVAR(setting_advancedWoundsSetting)) then { + GVAR(setting_advancedWoundsSetting) = true; +}; +if (_amountOfInpact > 0.0 && GVAR(setting_advancedWoundsSetting)) then { + + // Find the bandaged body part + _bandagedWounds = [_target,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable); + _bandagedPart = _bandagedWounds select _part; + + // Increase the amount of bandaged wounds + _bandagedWound = _bandagedPart select _highestSpot; + _bandagedPart set [_highestSpot,_bandagedWound + _amountOfInpact]; + _bandagedWounds set[_part,_bandagedPart]; + + // Store the new bandaged wounds + [_target,QGVAR(bandagedWounds),_bandagedWounds] call EFUNC(common,setDefinedVariable); + + // Do not provide the possibility for small injuries to open again + if (_highestSpot > 0) then { + [_target, _amountOfInpact,_part,_highestSpot, _removeItem] call FUNC(handleBandageOpening); + }; +}; + +// If all wounds have been bandaged, we will reset all damage to 0. +if (!([_target] call FUNC(hasOpenWounds))) then { + _target setDamage 0; + // TODO also set hitpoints to 0 +}; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf b/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf new file mode 100644 index 0000000000..61e12687a7 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_CPR.sqf @@ -0,0 +1,71 @@ +/** + * fn_performCPR.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 + */ + +#include "script_component.hpp" + +#define CPR_TIME 25 // time in seconds + +private ["_caller","_target", "_selectionName", "_prevAnim"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_prevAnim = _this select 4; + +// only allow CPR once +if (_caller getvariable[QGVAR(isProvidingCPR), false]) exitwith {true}; + +_caller setvariable[QGVAR(isProvidingCPR), true, true]; + +[_this] call EFUNC(common,debug); +[_caller] call FUNC(treatmentMutex); + +if (_target == _caller) exitwith{[_caller,"You cannot give yourself CPR"] call EFUNC(common,sendHintTo); true}; + +[_caller,"You start providing CPR"] call EFUNC(common,sendHintTo); + +if (vehicle _target == _target) then { + [_unit,"AinjPpneMstpSnonWrflDnon_rolltoback", 1] call EFUNC(common,doAnimation); +}; + +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; +[CPR_TIME, + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1)) && (_caller getvariable[QGVAR(isProvidingCPR), false])}, // the condition + { + private ["_caller","_target", "_selectionName", "_prevAnim"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + + [[_caller, _target], QUOTE(FUNC(handleTreatment_Action_CPRLocal)), _target] call EFUNC(common,execRemoteFnc); + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + _caller setvariable[QGVAR(isProvidingCPR), nil, true]; + ["Medical_handleTreatment_CPR", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on success + { + private ["_caller","_target", "_selectionName", "_prevAnim"]; + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + _caller setvariable[QGVAR(isProvidingCPR), nil, true]; + ["Medical_handleTreatment_CPR", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on failure + [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments +] call EFUNC(gui,loadingBar); + +true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_CPRLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_CPRLocal.sqf new file mode 100644 index 0000000000..537fd85088 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_CPRLocal.sqf @@ -0,0 +1,35 @@ +/** + * fnc_handleTreatment_Action_CPRLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target", "_n"]; +_caller = _this select 0; +_target = _this select 1; + + +_n = _target getvariable [QEGVAR(common,ENABLE_REVIVE_COUNTER),0]; +if (_n > 0) then { + _n = _n - random(20); + if (_n < 0) then { + _n = 0; + }; + _target setvariable [QEGVAR(common,ENABLE_REVIVE_COUNTER), _n]; +}; + +if (random(1)>= 0.6) exitwith { + [_caller,"CPR Success"] call cse_fnc_sendHintTo; + _target setvariable [QGVAR(inCardiacArrest), nil,true]; + + [_target, QGVAR(heartRate),40] call EFUNC(common,setDefinedVariable); + [_target, QGVAR(bloodPressure),[50,70]] call EFUNC(common,setDefinedVariable); +}; + +true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_MedicationLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_MedicationLocal.sqf new file mode 100644 index 0000000000..d10bce389a --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_MedicationLocal.sqf @@ -0,0 +1,182 @@ +/** + * fnc_handleTreatment_Action_MedicationLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_selectionName","_removeItem","_attributes"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +_attributes = switch (_removeItem) do { + case "ACE_morphine": { + [QGVAR(givenMorphine),"Morphine"] + }; + case "ACE_atropine": { + [QGVAR(givenAtropine),"Atropine"] + }; + case "ACE_epinephrine": { + [QGVAR(givenEpinephrine),"Epinephrine"] + }; + default {[]}; +}; + +if (count _attributes > 1) then { + private ["_value","_patient"]; + [_target] call FUNC(addToInjuredCollection); + _value = [_target,(_attributes select 0)] call EFUNC(common,getDefinedVariable); + [_target,(_attributes select 0),_value + 1] call EFUNC(common,setDefinedVariable); + + _patient = "patient"; + if (_target == _caller) then { + _patient = "himself"; + }; + [_target,"treatment",format["%1 has given %3 %2",[_caller] call EFUNC(common,getName), (_attributes select 1),_patient]] call FUNC(addActivityToLog); + [_target,_removeItem] call FUNC(addToTriageList); + + _usedMedication = { + private ["_target","_var","_usedMed","_morphineUsed","_epiUsed","_atroUsed","_totalUsed"]; + _target = _this select 0; + _var = _this select 1; + _overDose = 5; + _wearOff = 120; + + if (!alive _target) exitwith{}; + if (count _this > 2) then { + _overDose = _this select 2; + if (count _this > 3) then { + _wearOff = _this select 3; + }; + }; + _usedMed = [_target, _var, 0] call EFUNC(common,getDefinedVariable); + if (isnil "_usedMed") then { + _usedMed = 0; + }; + if (_usedMed > (_overDose + round(random(2)))) then { + [_target] call EFUNC(common,setDead); + }; + + _morphineUsed = _target getvariable [QGVAR(givenMorphine), 0]; + _epiUsed = _target getvariable [QGVAR(givenEpinephrine), 0]; + _atroUsed = _target getvariable [QGVAR(givenAtropine), 0]; + _totalUsed = _morphineUsed + _epiUsed + _atroUsed; + + if (_totalUsed > 10) then { + [_target] call EFUNC(common,setDead); + }; + _wearOff = _wearOff + (round(random(30))); + + [{ + _target = _this select 0; + _wearOff = _this select 1; + _var = _this select 2; + + _amountDecreased = 0; + _usedMed = [_this select 0, _this select 2] call EFUNC(common,getDefinedVariable); + if (typeName _usedMed != typeName 0) then { + _usedMed = 0; + }; + + if (_usedMed > 0) then { + [{ + _args = _this select 0; + _amountDecreased = _args select 3; + _usedMed = ([_args select 0, _args select 2] call EFUNC(common,getDefinedVariable)); + [_args select 0, _args select 2,_usedMed - 0.001] call EFUNC(common,setDefinedVariable); + _amountDecreased = _amountDecreased + 0.001; + + if (_amountDecreased >= 1 || (_usedMed - 0.001 <= 0)) then { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + _args set [3, _amountDecreased]; + }, 1, [_target, _wearOff,_var, 0] ] call CBA_fnc_addPerFrameHandler; + }; + }, [_target, _wearOff, _var], _wearOff, _wearOff] call EFUNC(common,waitAndExecute); + + }; + + private ["_heartRate","_pain"]; + + switch (_removeItem) do { + case "ACE_atropine": { + + _heartRate = [_target, QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); + //_heartRate = [_target, QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); + if (alive _target) then { + if (_heartRate > 0) then { + if (_heartRate <= 40) then { + [_target, -(10 + random(20)), 30] call FUNC(addHeartRateAdjustment); + }; + + if (_heartRate > 40) then { + if (_heartRate > 120) then { + [_target, -(10 + random(50)), 30] call FUNC(addHeartRateAdjustment); + } else { + [_target, -(10 + random(40)), 30] call FUNC(addHeartRateAdjustment); + }; + }; + }; + //[_target, QGVAR(heartRate),_heartRate] call EFUNC(common,setDefinedVariable); + [_target,(_attributes select 0),5] call _usedMedication; + }; + }; + case "ACE_epinephrine": { + _heartRate = [_target, QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); + if (alive _target) then { + if (_heartRate > 0) then { + if (_heartRate <= 40) then { + [_target, (10 + random(20)), 30] call FUNC(addHeartRateAdjustment); + }; + + if (_heartRate > 40) then { + if (_heartRate > 120) then { + [_target, (10 + random(50)), 30] call FUNC(addHeartRateAdjustment); + } else { + [_target, (10 + random(40)), 30, {}] call FUNC(addHeartRateAdjustment); + }; + }; + }; + [_target,(_attributes select 0),3] call _usedMedication; + }; + }; + case "ACE_morphine": { + private ["_usedMorphine"]; + _pain = [_target, QGVAR(amountOfPain)] call EFUNC(common,getDefinedVariable); + _pain = 0; + //_pain = _pain - 35; + if (_pain <= 0) then { + _pain = 0; + }; + _heartRate = [_target, QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); + [format["used morphine: %1",_heartRate]] call EFUNC(common,debug); + if (alive _target) then { + if (_heartRate > 0) then { + if (_heartRate <= 40) then { + [_target, -(10 + random(20)), 40] call FUNC(addHeartRateAdjustment); + }; + if (_heartRate > 40) then { + if (_heartRate > 120) then { + [_target, -(10 + random(50)), 40] call FUNC(addHeartRateAdjustment); + } else { + [_target, -(10 + random(40)), 40] call FUNC(addHeartRateAdjustment); + }; + }; + }; + }; + [_target, QGVAR(amountOfPain),_pain] call EFUNC(common,setDefinedVariable); + [_target,(_attributes select 0),4,120] call _usedMedication; + }; + default { + + }; + }; +}; +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf b/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf new file mode 100644 index 0000000000..a6e9156966 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_Stitching.sqf @@ -0,0 +1,104 @@ +/** + * fn_performStitching.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +#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"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_prevAnim = _this select 4; + +[_caller,"STR_ACE_STITCHING","STR_ACE_START_STITCHING_INJURIES", 0, [[_injuredPerson] call EFUNC(common,getName),_selectionName]] call EFUNC(gui,sendDisplayMessageTo); + +_bandagedWounds = [_injuredPerson,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable); +_bodyPartN = [_selectionName] call FUNC(getBodyPartNumber); + +_allWounds = _bandagedWounds select _bodyPartN; +_totalTime = ((_allWounds select 0) * WAITING_TIME_MEDIUM) + ((_allWounds select 1) * WAITING_TIME_MEDIUM) + ((_allWounds select 2) * WAITING_TIME_MEDIUM); + + +// Get the current position for the treatment person +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; + +_caller setvariable [QGVAR(lastStichPerformed), diag_tickTime]; +[{ + private ["_caller","_target", "_selectionName", "_prevAnim", "_removeItem","_args"]; + _args = _this select 0; + _caller = _args select 0; + _target = _args select 1; + _selectionName = _args select 2; + _removeItem = _args select 3; + _prevAnim = _args select 4; + + if ((vehicle _caller != _caller) || ((getPos _caller) distance (_caller getvariable GVAR(ORIGINAL_POSITION_PLAYER))) >= 1) then { + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + [QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + ["Medical_handleTreatment_Stitching", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + if (diag_tickTime - (_caller getvariable [QGVAR(lastStichPerformed), diag_tickTime - WAITING_TIME_MEDIUM]) >= WAITING_TIME_MEDIUM) then { + _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime]; + + _bandagedWounds = [_target,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable); + _allWounds = _bandagedWounds select _bodyPartN; + { + if (_x > 0) exitwith { + _value = _x - 1; + if (_value < 0) then { + _value = 0; + }; + + _allWounds set[_foreachIndex, _value]; + }; + }foreach _allWounds; + + _bandagedWounds set [_bodyPartN, _allWounds]; + [_target, QGVAR(bandagedWounds), _bandagedWounds] call EFUNC(common,setDefinedVariable); + + if (((_allWounds select 0) * 2.5) + ((_allWounds select 1) * 3.5) + ((_allWounds select 2) * 4.5) <= 0) then { + [_target,"treatment",format["%1 has stitched up some bandages wounds",[_caller] call EFUNC(common,getName)]] call FUNC(addActivityToLog); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + [QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + ["Medical_handleTreatment_Stitching", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + }; +}, 0.1, [_caller, _target, _selectionName, _removeItem, _prevAnim] ] call CBA_fnc_addPerFrameHandler; + + +// Necessary for showing the loading bar along side +[_totalTime, // the time to wait + {_caller = _this select 0; ((vehicle _caller != _caller) ||((getPos _caller) distance GVAR(ORIGINAL_POSITION_PLAYER)) < 1)}, // the condition, called every frame + {}, // on success + {}, // on failure + [_caller] // arguments +] call EFUNC(gui,loadingBar); + +true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf new file mode 100644 index 0000000000..53f82f74f0 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_fullHeal.sqf @@ -0,0 +1,74 @@ +/** + * fn_heal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_caller", "_selectionName", "_removeItem", "_prevAnim"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; +_prevAnim = _this select 4; + +if !((GVAR(setting_aidKitRestrictions) == 0 && ([_caller] call FUNC(inMedicalFacility))) || (GVAR(setting_aidKitRestrictions) == 1 && ([_caller] call FUNC(inMedicalFacility)) && (!([_unit] call FUNC(hasOpenWounds)))) || (GVAR(setting_aidKitRestrictions) == 2) || (GVAR(setting_aidKitRestrictions) == 3 && (!([_unit] call FUNC(hasOpenWounds))))) exitwith {false}; + + +// Get the current position for the treatment person +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; + +[7, // the time to wait + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition, called every frame + { + private ["_caller","_target", "_selectionName", "_prevAnim", "_removeItem"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + _prevAnim = _this select 4; + + if (GVAR(setting_removeAidKitOnUse)) then { + [_caller, _target, _removeItem] call FUNC(useEquipment); + }; + [[_caller, _target], QUOTE(FUNC(handleTreatment_Action_HealLocal)), _target] call EFUNC(common,execRemoteFnc); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + [QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon); + ["Medical_handleTreatment_FullHeal", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on success + { + private ["_caller","_target", "_selectionName", "_prevAnim", "_removeItem"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + _prevAnim = _this select 4; + + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + [QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon); + ["Medical_handleTreatment_FullHeal", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on failure + [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments +] call EFUNC(gui,loadingBar); + + +if (!(_unit getvariable [QEGVAR(common,isDead),false]) && alive _unit) then { + [[_unit,_caller], QUOTE(FUNC(healLocal)), _unit] call EFUNC(common,execRemoteFnc); +}; +true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf new file mode 100644 index 0000000000..1d08a00e23 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_fullHealLocal.sqf @@ -0,0 +1,67 @@ +/** + * fn_healLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_caller"]; +_unit = _this select 0; +_caller = _this select 1; + +if (alive _unit) exitwith { + [_unit,"treatment",format["%1 used a personal aid kit",[_caller] call EFUNC(common,getName)]] call FUNC(addActivityToLog); + + // Public variables + [_unit,QGVAR(openWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(bandagedWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable); + + if (GVAR(setting_AdvancedLevel) > 0) then { + [_unit,QGVAR(fractures),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(airway),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(splints),0] call EFUNC(common,setDefinedVariable); + }; + + [_unit,QGVAR(tourniquets),[0,0,0,0,0,0]] call EFUNC(common,setDefinedVariable); + + //[QGVAR(activityLog),[]] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(triageLevel),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(triageCard),[]] call EFUNC(common,setDefinedVariable); + + // Private variables + [_unit,QGVAR(bloodVolume),100] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(bloodIVVolume),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(plasmaIVVolume),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(salineIVVolume),0] call EFUNC(common,setDefinedVariable); + + if (GVAR(setting_AdvancedLevel) > 0) then { + [_unit,QGVAR(heartRate),80] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(andrenaline),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(bloodPressure),[80,120]] call EFUNC(common,setDefinedVariable); + }; + [_unit,QGVAR(amountOfPain),0] call EFUNC(common,setDefinedVariable); + + [_unit,QGVAR(givenMorphine),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(givenAtropine),0] call EFUNC(common,setDefinedVariable); + [_unit,QGVAR(givenEpinephrine),0] call EFUNC(common,setDefinedVariable); + + [_unit,QGVAR(bodyPartStatus),[0,0,0,0,0,0]] call EFUNC(common,setDefinedVariable); + + // Resetting damage + _unit setDamage 0; + + // Resetting potential revive state + [_unit,QEGVAR(common,ENABLE_REVIVE_SETDEAD_F), 0] call EFUNC(common,setDefinedVariable); + [_unit,QEGVAR(common,ENABLE_REVIVE_COUNTER), 0] call EFUNC(common,setDefinedVariable); + + + ["Medical_onFullyHealed", [_unit, true]] call ace_common_fnc_localEvent; + [format["Completed healLocal %1", _this]] call EFUNC(common,debug); +}; + +["Medical_onFullyHealed", [_unit, false]] call ace_common_fnc_localEvent; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf b/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf new file mode 100644 index 0000000000..6b9e9b3f5d --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_tourniquet.sqf @@ -0,0 +1,36 @@ +/** + * fnc_handleTreatment_Action_tourniquet.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_part","_selectionName","_removeItem", "_tourniquets"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +_part = [_selectionName] call FUNC(getBodyPartNumber); +if (_part == 0 || _part == 1) exitwith { + [_caller,"You cannot apply a CAT on this body part!"] call EFUNC(common,sendHintTo); + false; +}; + +[_caller, _target, _removeItem] call FUNC(useEquipment); + +_tourniquets = [_target, QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable); +if ((_tourniquets select _part) > 0) exitwith { + [_caller,"There is already a tourniquet on this body part!"] call EFUNC(common,sendHintTo); + false; +}; + +[_caller, _unit,_removeItem] call FUNC(useEquipment); +[[_caller, _target, _selectionName, _removeItem], QUOTE(FUNC(handleTreatment_Action_TourniquetLocal)), _unit] call EFUNC(common,execRemoteFnc); + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Action_tourniquetLocal.sqf b/addons/medical/functions/fnc_handleTreatment_Action_tourniquetLocal.sqf new file mode 100644 index 0000000000..f2ce6ff6a5 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Action_tourniquetLocal.sqf @@ -0,0 +1,56 @@ +/** + * fnc_handleTreatment_Action_tourniquetLocal.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_part","_selectionName","_removeItem", "_tourniquets", "_applyingTo"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + + +[_target,"treatment",format["%1 applied a tourniquet on %2",[_caller] call EFUNC(common,getName),_selectionName]] call FUNC(addActivityToLog); +[_target,_removeItem] call FUNC(addToTriageList); +[_target] call FUNC(addToInjuredCollection); + + +_part = [_selectionName] call FUNC(getBodyPartNumber); + +// Place a tourniquet on the bodypart +_tourniquets = [_target, QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable); +_applyingTo = (_tourniquets select _part) + 1 + round(random(100)); +_tourniquets set[_part, _applyingTo]; +[_target, QGVAR(tourniquets), _tourniquets] call EFUNC(common,setDefinedVariable); + +[{ + private ["_args","_target","_applyingTo","_part", "_tourniquets"]; + _args = _this select 0; + _target = _args select 0; + _applyingTo = _args select 1; + _part = _args select 2; + + if (!alive _target) exitwith { + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + _tourniquets = [_injuredPerson,QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable); + if !((_tourniquets select _part) == _applyingTo) exitwith { + // Tourniquet has been removed + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + + _pain = [_target, QGVAR(amountOfPain)] call EFUNC(common,getDefinedVariable); + _pain = _pain + 0.005; + [_target, QGVAR(amountOfPain),_pain] call EFUNC(common,setDefinedVariable); + +}, 5, [_target, _applyingTo, _part] ] call CBA_fnc_addPerFrameHandler; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf new file mode 100644 index 0000000000..2189a57a29 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Category_Advanced.sqf @@ -0,0 +1,94 @@ +/** + * fnc_handleTreatment_Category_Advanced.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +// Time in seconds +#define ADVANCED_TREATMENT_TIME 5 + +private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim", "_displayingIcon"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +// TODO add fake weapon for treatment, in case no primairy weapon is present +// Handle the animations +_prevAnim = ""; +if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _caller == "PRONE")) then { + if (primaryWeapon _caller == "") then { + _prevAnim = animationState _caller; + }; + [_caller,"AinvPknlMstpSlayWrflDnon_medic", 1] call EFUNC(common,doAnimation); +}; + +if (ACE_player == _caller) then { + // Displaying the treatment icon action + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); +}; + +_isHandled = switch (_removeItem) do { + case "ACE_personal_aid_kit": { + ([_caller, _target, _selectionName, _removeItem, _prevAnim] call FUNC(handleTreatment_Action_FullHeal)); + }; + case "ACE_surgical_kit": { + ([_caller, _target, _selectionName, _removeItem, _prevAnim] call FUNC(handleTreatment_Action_Stitching)); + }; + case "ACE_CPR": { + ([_caller, _target, _selectionName, _removeItem, _prevAnim] call FUNC(handleTreatment_Action_CPR)); + }; + default { + // handle it ourself + + // Get the current position for the treatment person + _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; + + [ADVANCED_TREATMENT_TIME, // the time to wait + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition, called every frame + { + private ["_caller","_target", "_selectionName", "_prevAnim", "_removeItem"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + _prevAnim = _this select 4; + + [_caller, _target, _removeItem] call FUNC(useEquipment); + [[_caller, _target, _selectionName, _removeItem], QUOTE(FUNC(handleTreatment_Action_AdvancedLocal)), _target] call EFUNC(common,execRemoteFnc); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + ["Medical_handleTreatment_Advanced", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on success + { + private ["_caller","_target", "_selectionName", "_prevAnim", "_removeItem"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + _prevAnim = _this select 4; + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + ["Medical_handleTreatment_Advanced", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on failure + [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments + ] call EFUNC(gui,loadingBar); + true; + }; +}; +_isHandled; diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf new file mode 100644 index 0000000000..3456e6df18 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Category_Airway.sqf @@ -0,0 +1,77 @@ +/** + * fnc_handleTreatment_Category_Airway.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim", "_displayingIcon", "_part"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +// we can only treat the head or torso for this +_part = [_selectionName] call FUNC(getBodyPartNumber); +if (_part == 0 || _part == 1) exitwith { + // TODO add fake weapon for treatment, in case no primairy weapon is present + // Handle the animations + _prevAnim = ""; + if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _caller == "PRONE")) then { + if (primaryWeapon _caller == "") then { + _prevAnim = animationState _caller; + }; + [_caller,"AinvPknlMstpSlayWrflDnon_medic", 1] call EFUNC(common,doAnimation); + }; + + if (ACE_player == _caller) then { + // Displaying the treatment icon action + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_airway_management.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); + }; + + // Get the current position for the treatment person + _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; + + [5, // the time to wait + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target", "_selectionName", "_prevAnim"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + [_caller, _target, _removeItem] call FUNC(useEquipment); + + [[_caller, _target, _selectionName, _removeItem], QUOTE(FUNC(handleTreatment_Action_AirwayLocal)), _target] call EFUNC(common,execRemoteFnc); + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + ["Medical_handleTreatment_Airway", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on success + { + private ["_caller","_target", "_selectionName", "_prevAnim"]; + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + ["Medical_handleTreatment_Airway", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on failure + [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments + ] call EFUNC(gui,loadingBar); + true; +}; +// TODO display message to caller + +["Medical_handleTreatment_Airway", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + +false; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf new file mode 100644 index 0000000000..c1113166f5 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Category_Bandaging.sqf @@ -0,0 +1,97 @@ +/** + * fnc_handleTreatment_Category_Bandaging.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim", "_displayingIcon"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +// TODO find selected data/wound in menu +_selectedData = [_this, 4, "", [""]] call BIS_fnc_Param; + + +// TODO add fake weapon for treatment, in case no primairy weapon is present +// Handle the animations +_prevAnim = ""; +if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _caller == "PRONE")) then { + if (primaryWeapon _caller == "") then { + _prevAnim = animationState _caller; + }; + [_caller,"AinvPknlMstpSlayWrflDnon_medic", 1] call EFUNC(common,doAnimation); +}; + +if (ACE_player == _caller) then { + switch (_removeItem) do { + case "ACE_tourniquet": { + + }; + case "ACE_splint": { + + }; + default { + [_caller, "STR_ACE_BANDAGING", "STR_ACE_APPLY_BANDAGE", 0, [[_target] call EFUNC(common,getName), _selectionName]] call EFUNC(gui,sendDisplayMessageTo); + }; + }; + // Displaying the treatment icon action + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); +}; + +// Get the current position for the treatment person +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; + +if (isnil QGVAR(setting_bandageWaitingTime)) then { + GVAR(setting_bandageWaitingTime) = 5; +}; + +[GVAR(setting_bandageWaitingTime), // the time to wait + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + + switch (_removeItem) do { + case "ACE_tourniquet": { + [_caller, _target, _selectionName, _removeItem] call FUNC(handleTreatment_Action_tourniquet); + }; + case "ACE_splint": { + // TODO implement splints + }; + default { + [[_caller, _target, _selectionName, _removeItem], QUOTE(FUNC(handleTreatment_Action_BandageLocal)), _target] call EFUNC(common,execRemoteFnc); + [_caller, _target, _removeItem] call FUNC(useEquipment); + }; + }; + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + ["Medical_handleTreatment_Bandaging", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on success + { + private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim"]; + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + ["Medical_handleTreatment_Bandaging", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on failure + [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments +] call EFUNC(gui,loadingBar); + +true; \ No newline at end of file diff --git a/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf b/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf new file mode 100644 index 0000000000..f57ab20783 --- /dev/null +++ b/addons/medical/functions/fnc_handleTreatment_Category_Medication.sqf @@ -0,0 +1,69 @@ +/** + * fnc_handleTreatment_Category_Medication.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim", "_displayingIcon"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +// TODO add fake weapon for treatment, in case no primairy weapon is present +// Handle the animations +_prevAnim = ""; +if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _caller == "PRONE")) then { + if (primaryWeapon _caller == "") then { + _prevAnim = animationState _caller; + }; + [_caller,"AinvPknlMstpSlayWrflDnon_medic", 1] call EFUNC(common,doAnimation); +}; + +if (ACE_player == _caller) then { + // Displaying the treatment icon action + [QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\medication_small.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon); +}; + +// Get the current position for the treatment person +_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller]; + +[4, // the time to wait + {((vehicle (_this select 0) != (_this select 0)) ||((getPos (_this select 0)) distance ((_this select 0) getvariable QGVAR(StartingPositionHandleTreatment)) < 1))}, // the condition + { + private ["_caller","_target", "_selectionName", "_prevAnim"]; + _caller = _this select 0; + _target = _this select 1; + _selectionName = _this select 2; + _removeItem = _this select 3; + [_caller, _target, _removeItem] call FUNC(useEquipment); + + [[_caller, _target, _selectionName, _removeItem], QUOTE(FUNC(handleTreatment_Action_MedicationLocal)), _target] call EFUNC(common,execRemoteFnc); + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + ["Medical_handleTreatment_Medication", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on success + { + private ["_caller","_target", "_selectionName", "_prevAnim"]; + [(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo); + + if (_prevAnim != "") then { + [_caller,_prevAnim, 0] call EFUNC(common,doAnimation); + }; + + ["Medical_handleTreatment_Medication", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent; + ["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent; + }, // on failure + [_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments +] call EFUNC(gui,loadingBar); + +true; diff --git a/addons/medical/functions/fnc_handleUI_DisplayOptions.sqf b/addons/medical/functions/fnc_handleUI_DisplayOptions.sqf new file mode 100644 index 0000000000..f56bbbf699 --- /dev/null +++ b/addons/medical/functions/fnc_handleUI_DisplayOptions.sqf @@ -0,0 +1,85 @@ +/** + * fn_displayOptions.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +#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 (!hasInterface) exitwith{}; + +disableSerialization; +_display = uiNamespace getVariable QGVAR(medicalMenu); +if (isNil "_display") exitwith {}; // no valid dialog present + +if ((_name == "toggle")) exitwith { + + if (GVAR(INTERACTION_TARGET) != ACE_player) then { + _newTarget = ACE_player; + } else { + _newTarget = GVAR(INTERACTION_TARGET_PREVIOUS); + }; + + GVAR(INTERACTION_TARGET_PREVIOUS) = GVAR(INTERACTION_TARGET); + [_newTarget] spawn { + closeDialog 0; + sleep 0.1; + [_this select 0] call FUNC(openMenu); + }; +}; + +// Clean the dropdown options list from all actions +for [{_x=START_IDC},{_x <= END_IDC},{_x=_x+1}] do { + _ctrl = (_display displayCtrl (_x)); + _ctrl ctrlSetText ""; + _ctrl ctrlShow false; + _ctrl ctrlSetEventHandler ["ButtonClick",""]; + _ctrl ctrlSetTooltip ""; + _ctrl ctrlCommit 0; +}; + +GVAR(LatestDisplayOptionMenu) = _name; + +// The triage card has no options available +lbClear 212; +if (_name == "triage") exitwith { + ctrlEnable[212,true]; + _card = ([GVAR(INTERACTION_TARGET)] call FUNC(getTriageList)); + { + lbadd[212,format["%1 x%2", getText(configFile >> "CfgWeapons" >> (_x select 0) >> "displayName"), _x select 1]]; + }foreach _card; + if (count _card == 0) then { + lbadd[212,"No Entries"]; + }; +}; + +ctrlEnable[212,false]; + +_entries = [ACE_player, GVAR(INTERACTION_TARGET),_name] call FUNC(getTreatmentOptions); + +{ + //player sidechat format["TRIGGERED: %1",_x]; + if (_foreachIndex > END_IDC) exitwith {}; + _ctrl = (_display displayCtrl (START_IDC + _foreachIndex)); + if (!(_foreachIndex > AMOUNT_OF_ENTRIES)) then { + _ctrl ctrlSetText (_x select 0); + _code = format["[ACE_player, ACE_medical_INTERACTION_TARGET] 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; +}foreach _entries; diff --git a/addons/medical/functions/fnc_handleUI_dropDownTriageCard.sqf b/addons/medical/functions/fnc_handleUI_dropDownTriageCard.sqf new file mode 100644 index 0000000000..2d895cae70 --- /dev/null +++ b/addons/medical/functions/fnc_handleUI_dropDownTriageCard.sqf @@ -0,0 +1,28 @@ +/** + * fn_handleUI_dropDownTriageCard.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_display","_pos","_ctrl","_curPos","_idc"]; +disableSerialization; +_display = uiNamespace getVariable QGVAR(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/addons/medical/functions/fnc_handleUnitVitals.sqf b/addons/medical/functions/fnc_handleUnitVitals.sqf new file mode 100644 index 0000000000..7ced1ec393 --- /dev/null +++ b/addons/medical/functions/fnc_handleUnitVitals.sqf @@ -0,0 +1,129 @@ +/** + * fn_handleUnitVitals.sqf + * @Descr: Updates the vitals. Is expected to be called every second. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: void + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_heartRate","_bloodPressure","_bloodVolume","_painStatus"]; +_unit = _this select 0; + +_bloodVolume = ([_unit, QGVAR(bloodVolume)] call EFUNC(common,getDefinedVariable)) + ([_unit] call FUNC(getBloodVolumeChange)); +if (_bloodVolume <= 0) then { + _bloodVolume = 0; +}; +_unit setvariable [QGVAR(bloodVolume), _bloodVolume]; + + +// Set variables for synchronizing information across the net +if (_bloodVolume < 90) then { + if !(_unit getvariable [QGVAR(hasLostBlood), false]) then { + _unit setvariable [QGVAR(hasLostBlood), true, true]; + }; +} else { + if (_unit getvariable [QGVAR(hasLostBlood),false]) then { + _unit setvariable [QGVAR(hasLostBlood), false, true]; + }; +}; + +if ((_unit call FUNC(getBloodLoss)) > 0) then { + if !(_unit getvariable [QGVAR(isBleeding), false]) then { + _unit setvariable [QGVAR(isBleeding), true, true]; + }; +} else { + if (_unit getvariable [QGVAR(isBleeding), false]) then { + _unit setvariable [QGVAR(isBleeding), false, true]; + }; +}; + +_painStatus = [_unit,QGVAR(amountOfPain),0] call EFUNC(common,getDefinedVariable); +if (_painStatus > 0) then { + if !(_unit getvariable [QGVAR(hasPain), false]) then { + _unit setvariable [QGVAR(hasPain), true, true]; + }; +} else { + if (_unit getvariable [QGVAR(hasPain), false]) then { + _unit setvariable [QGVAR(hasPain), false, true]; + }; +}; + + +if (_bloodVolume < 30) exitwith { + [_unit] call FUNC(setDead); +}; + +if ([_unit] call EFUNC(common,isAwake)) then { + if (_bloodVolume < 60) then { + if (random(1) > 0.9) then { + [_unit] call FUNC(setUnconsciousState); + }; + }; +}; + +// handle advanced medical, with vitals +if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) > 0) exitwith { + + // Set the vitals + _heartRate = ([_unit, QGVAR(heartRate)] call EFUNC(common,getDefinedVariable)) + ([_unit] call FUNC(getHeartRateChange)); + _unit setvariable [QGVAR(heartRate), _heartRate]; + + _bloodPressure = [_unit] call FUNC(getBloodPressure); + _unit setvariable [QGVAR(bloodPressure), _bloodPressure]; + + // Handle airway + if (GVAR(setting_allowAirwayInjuries)) then { + _airwayStatus = _unit getvariable [QGVAR(airwayStatus), 100]; + if (((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) && !((_unit getvariable [QGVAR(airwaySecured), false]))) then { + if (_airwayStatus >= 0.5) then { + _unit setvariable [QGVAR(airwayStatus), _airwayStatus - 0.5]; + }; + } else { + if !((_unit getvariable [QGVAR(airwayOccluded), false]) || (_unit getvariable [QGVAR(airwayCollapsed), false])) then { + if (_airwayStatus <= 98.5) then { + _unit setvariable [QGVAR(airwayStatus), _airwayStatus + 1.5]; + }; + }; + }; + }; + + // Check vitals for medical status + // TODO check for in revive state instead of variable + if ((_unit getvariable[QEGVAR(common,ENABLE_REVIVE_SETDEAD_F),0]) == 0) then { + _bloodPressureL = _bloodPressure select 0; + _bloodPressureH = _bloodPressure select 1; + + if (!(_unit getvariable [QGVAR(inCardiacArrest),false])) then { + if (_heartRate < 10 || _bloodPressureH < 30 || _bloodVolume < 20) then { + [_unit] call FUNC(setUnconsciousState); // safety check to ensure unconsciousness for units if they are not dead already. + }; + + if (_bloodPressureH > 260) then { + if (random(1) > 0.7) then { + [_unit] call FUNC(setCardiacArrest); + }; + }; + if (_bloodPressureL < 40 && _heartRate > 190) then { + if (random(1) > 0.7) then { + [_unit] call FUNC(setCardiacArrest); + }; + }; + if (_bloodPressureH > 145 && _heartRate > 150) then { + if (random(1) > 0.7) then { + [_unit] call FUNC(setCardiacArrest); + }; + }; + if (_heartRate > 200) then { + [_unit] call FUNC(setCardiacArrest); + }; + + if (_heartRate < 20) then { + [_unit] call FUNC(setCardiacArrest); + }; + }; + }; +}; diff --git a/addons/medical/functions/fnc_hasEquipment.sqf b/addons/medical/functions/fnc_hasEquipment.sqf new file mode 100644 index 0000000000..bdf652fd30 --- /dev/null +++ b/addons/medical/functions/fnc_hasEquipment.sqf @@ -0,0 +1,39 @@ +/** + * fn_hasEquipment.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 + */ + +#include "script_component.hpp" + +private ["_medic", "_patient", "_item", "_return"]; +_medic = _this select 0; +_patient = _this select 1; +_item = _this select 2; + +if (isnil QGVAR(setting_allowSharedEquipment)) then { + GVAR(setting_allowSharedEquipment) = true; +}; +if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { + true; +}; + +if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { + true; +}; + +_return = false; +if ([vehicle _medic] call FUNC(isMedicalVehicle) && {(vehicle _medic != _medic)}) then { + _crew = crew vehicle _medic; + { + if ([_x, _medic] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { + _return = true; + }; + }foreach _crew; +}; + +_return \ No newline at end of file diff --git a/addons/medical/functions/fnc_hasMedicalEnabled.sqf b/addons/medical/functions/fnc_hasMedicalEnabled.sqf new file mode 100644 index 0000000000..7a14d97c51 --- /dev/null +++ b/addons/medical/functions/fnc_hasMedicalEnabled.sqf @@ -0,0 +1,21 @@ +/** + * fn_hasMedicalEnabled.sqf + * @Descr: Check if unit has CMS enabled. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit", "_medicalEnabled"]; +_unit = _this select 0; + +_medicalEnabled = _unit getvariable QGVAR(enableMedical); +if (isnil "_medicalEnabled") exitwith { + (((GVAR(setting_enableForUnits) == 0 && (isPlayer _unit || (_unit getvariable [QEGVAR(common,isDeadPlayer), false])))) || (GVAR(setting_enableForUnits) == 1)); +}; + +_medicalEnabled; diff --git a/addons/medical/functions/fnc_hasOpenWounds.sqf b/addons/medical/functions/fnc_hasOpenWounds.sqf new file mode 100644 index 0000000000..fdfef6883f --- /dev/null +++ b/addons/medical/functions/fnc_hasOpenWounds.sqf @@ -0,0 +1,16 @@ +/** + * fn_hasOpenWounds.sqf + * @Descr: Check if unit has open wounds + * @Author: Glowbal + * + * @Arguments: [unit OBJECT (The unit to check)] + * @Return: BOOL + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private "_openWounds"; +_openWounds = [_this select 0,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); + +({(((_x select 0) + (_x select 1) + (_x select 2)) > 0)}count _openWounds > 0); \ No newline at end of file diff --git a/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf new file mode 100644 index 0000000000..ee6cd5fd61 --- /dev/null +++ b/addons/medical/functions/fnc_hasTourniquetAppliedTo.sqf @@ -0,0 +1,13 @@ +/** + * fnc_hasTourniquetAppliedTo.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +((([(_this select 0),QGVAR(tourniquets)] call EFUNC(common,getDefinedVariable)) select ([(_this select 1)] call FUNC(getBodyPartNumber))) > 0); \ No newline at end of file diff --git a/addons/medical/functions/fnc_inMedicalFacility.sqf b/addons/medical/functions/fnc_inMedicalFacility.sqf new file mode 100644 index 0000000000..8f86fbab8b --- /dev/null +++ b/addons/medical/functions/fnc_inMedicalFacility.sqf @@ -0,0 +1,51 @@ +/** + * fn_inMedicalFacility.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 + */ + +#include "script_component.hpp" + +private ["_unit","_eyePos","_objects","_isInBuilding","_medicalFacility"]; +_unit = _this select 0; + +_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 [QGVAR(isMedicalFacility),false])) exitwith { + _isInBuilding = true; + }; +}foreach _objects; +if (!_isInBuilding) then { + _objects = position _unit nearObjects 7.5; + { + if (((typeOf _x) in _medicalFacility) || (_x getVariable [QGVAR(isMedicalFacility),false])) exitwith { + _isInBuilding = true; + }; + }foreach _objects; +}; +_isInBuilding \ No newline at end of file diff --git a/addons/medical/functions/fnc_increasePain.sqf b/addons/medical/functions/fnc_increasePain.sqf new file mode 100644 index 0000000000..64a29989e4 --- /dev/null +++ b/addons/medical/functions/fnc_increasePain.sqf @@ -0,0 +1,46 @@ +/** + * fn_increasePain.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 + */ + +#include "script_component.hpp" + +private ["_unit","_amountOfDamage","_selectionName","_sourceOfDamage","_painStatus"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_selectionName = _this select 2; + +if (!alive _unit || (_amountOfDamage <= 0)) exitwith{}; +_painStatus = [_unit,QGVAR(amountOfPain),0] call EFUNC(common,getDefinedVariable); + +if (typeName _selectionName == "STRING") then { + _selectionName = [_selectionName] call FUNC(getBodyPartNumber); +}; + +_amountOfDamage = _amountOfDamage * 10; + +_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,QGVAR(amountOfPain),_painStatus] call EFUNC(common,setDefinedVariable); +["Medical_onPainIncreased", [_unit, _selectionName, _painStatus]] call ace_common_fnc_localEvent; + +nil; \ No newline at end of file diff --git a/addons/medical/functions/fnc_initalizeModuleCMS.sqf b/addons/medical/functions/fnc_initalizeModuleCMS.sqf new file mode 100644 index 0000000000..40e50c6fb0 --- /dev/null +++ b/addons/medical/functions/fnc_initalizeModuleCMS.sqf @@ -0,0 +1,71 @@ +/* +init.sqf +Usage: +Author: Glowbal + +Arguments: +Returns: + +Affects: Local +Executes: call +*/ + +#include "script_component.hpp" + +private ["_logic"]; +_logic = _this select 0; + +if (isNull _logic) exitwith {}; + +// Damage thresholds only in case the damge threshold module hasn't been placed down. +if (isnil QGVAR(damageThreshold_AI)) then { + GVAR(damageThreshold_AI) = 1; +}; + +if (isnil QGVAR(damageThreshold_Players)) then { + GVAR(damageThreshold_Players) = 1; +}; + +GVAR(setting_allowInstantDead) = _logic getvariable["setting_allowInstantDead", true]; +GVAR(setting_AdvancedLevel) = _logic getvariable["advancedLevel", 0]; +GVAR(setting_advancedWoundsSetting) = _logic getvariable["openingOfWounds", true]; +GVAR(setting_advancedMedicRoles) = _logic getvariable["medicSetting", false]; +GVAR(setting_medicalDifficulty) = _logic getvariable["difficultySetting", 1]; +GVAR(setting_enableBandagingAid) = _logic getvariable["bandagingAid", GVAR(setting_AdvancedLevel) == 0]; +GVAR(setting_allowAIFullHeal) = _logic getvariable["allowAIFullHeal", false]; +GVAR(setting_enableForUnits) = _logic getvariable["enableFor", 1]; +GVAR(setting_allowAirwayInjuries) = (_logic getvariable["enableAirway", 0]) == 1; +GVAR(setting_aidKitRestrictions) = _logic getvariable["aidKitRestrictions", 0]; +GVAR(setting_removeAidKitOnUse) = _logic getvariable["aidKitUponUsage", false]; +GVAR(setting_aidKitMedicsOnly) = _logic getvariable["aidKitMedicsOnly", false]; +GVAR(setting_bandageWaitingTime) = _logic getvariable["bandageTime", 5]; +GVAR(setting_allowVehicleCrashInjuries) = _logic getvariable["vehCrashes", true]; +GVAR(setting_allowStitching) = _logic getvariable["stitchingMedicsOnly", 0]; + +if (GVAR(setting_AdvancedLevel) == -1) exitwith{}; +GVAR(isEnabled) = true; + + +waituntil{!isnil "ACE_gui" && !isnil "ACE_common"}; + + +if (GVAR(setting_AdvancedLevel) > 0) then { + [ + {(([_this select 0,QGVAR(heartRate)] call EFUNC(common,getDefinedVariable)) < 20)} + ] call FUNC(registerUnconsciousCondition); + + if (GVAR(setting_allowAirwayInjuries)) then { + [ + {(([_this select 0,QGVAR(airway)] call EFUNC(common,getDefinedVariable)) > 2)} + ] call FUNC(registerUnconsciousCondition); + }; +}; + +if (!hasInterface) exitwith{}; + +{ + if(_x == "FirstAidKit" || {_x == "Medikit"}) then { + player removeItem _x; + }; +}foreach (items player); + diff --git a/addons/medical/functions/fnc_isMedic.sqf b/addons/medical/functions/fnc_isMedic.sqf new file mode 100644 index 0000000000..ef824c06f1 --- /dev/null +++ b/addons/medical/functions/fnc_isMedic.sqf @@ -0,0 +1,33 @@ +/** + * fn_medicClass.sqf + * @Descr: Check if a unit is any medical class above normal. + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_unit","_class","_return"]; +_unit = [_this, 0, objNull,[ObjNull]] call BIS_fnc_Param; + +if (isnil QGVAR(setting_advancedMedicRoles)) exitwith { + true; +}; + +if (GVAR(setting_advancedMedicRoles)) then { + _class = [_unit,QGVAR(medicClass)] call EFUNC(common,getDefinedVariable); + _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/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf new file mode 100644 index 0000000000..9489c518b7 --- /dev/null +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -0,0 +1,17 @@ +/** + * fn_isMedicalVehicle.sqf + * @Descr: Check if vehicle is a medical vehicle + * @Author: Glowbal + * + * @Arguments: [vehicle OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +#include "script_component.hpp" + +private ["_veh"]; +_veh = _this select 0; + +if !(_veh getvariable [QGVAR(isMedicalVehicle), true]) exitwith {false}; // exit in case the false is set. +((getNumber(configFile >> "CfgVehicles" >> typeOf _veh >> QGVAR(isMedicalVehicle)) == 1) || (_veh getvariable [QGVAR(isMedicalVehicle), false])); \ No newline at end of file diff --git a/addons/medical/functions/fnc_isMovingUnit.sqf b/addons/medical/functions/fnc_isMovingUnit.sqf new file mode 100644 index 0000000000..326a7b1e97 --- /dev/null +++ b/addons/medical/functions/fnc_isMovingUnit.sqf @@ -0,0 +1,16 @@ +/** + * fnc_isMovingUnit.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private "_unit"; +_unit = _this select 0; + +(!(isNull(_unit getvariable [QGVAR(carrying),objNull])) || !(isNull(_unit getvariable [QGVAR(dragging),objNull]))) diff --git a/addons/medical/functions/fnc_isSetTreatmentMutex.sqf b/addons/medical/functions/fnc_isSetTreatmentMutex.sqf new file mode 100644 index 0000000000..2280b066df --- /dev/null +++ b/addons/medical/functions/fnc_isSetTreatmentMutex.sqf @@ -0,0 +1,16 @@ +/** + * fn_isSetTreatmentMutex.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +// Max locked time is 2 minutes. +#define MAX_LOCKED_TIME 120 + +(time - ((_this select 0) getvariable [QGVAR(PerformingTreatmentMutex), -MAX_LOCKED_TIME]) <= MAX_LOCKED_TIME); \ No newline at end of file diff --git a/addons/common/functions/fnc_isUnconscious.sqf b/addons/medical/functions/fnc_isUnconscious.sqf similarity index 100% rename from addons/common/functions/fnc_isUnconscious.sqf rename to addons/medical/functions/fnc_isUnconscious.sqf diff --git a/addons/common/functions/fnc_makeCopyOfBody_f.sqf b/addons/medical/functions/fnc_makeCopyOfBody_f.sqf similarity index 87% rename from addons/common/functions/fnc_makeCopyOfBody_f.sqf rename to addons/medical/functions/fnc_makeCopyOfBody_f.sqf index 498e8a2168..cee0631862 100644 --- a/addons/common/functions/fnc_makeCopyOfBody_f.sqf +++ b/addons/medical/functions/fnc_makeCopyOfBody_f.sqf @@ -15,7 +15,7 @@ _oldBody = _this select 0; _caller = _this select 1; if (alive _oldBody) exitwith {_oldBody}; // we only want to do this for dead bodies - _name = _oldBody getvariable [QGVAR(name),"unknown"]; + _name = _oldBody getvariable ["ACE_name","unknown"]; _class = typeof _oldBody; _side = side _caller; _group = createGroup _side; @@ -23,19 +23,19 @@ _caller = _this select 1; _newUnit = _group createUnit [typeof _oldBody, _position, [], 0, "NONE"]; - _allVariables = [_oldBody] call FUNC(getAllDefinedSetVariables); + _allVariables = [_oldBody] call EFUNC(common,getAllDefinedSetVariables); // [NAME (STRING), TYPENAME (STRING), VALUE (ANY), DEFAULT GLOBAL (BOOLEAN)] { - [_newUnit,_x select 0, _x select 2] call FUNC(setDefinedVariable); + [_newUnit,_x select 0, _x select 2] call EFUNC(common,setDefinedVariable); }foreach _allVariables; - _newUnit setVariable [QGVAR(name),_name,true]; + _newUnit setVariable ["ACE_name",_name,true]; _newUnit disableAI "TARGET"; _newUnit disableAI "AUTOTARGET"; _newUnit disableAI "MOVE"; _newUnit disableAI "ANIM"; _newUnit disableAI "FSM"; - _newUnit setvariable [QGVAR(isDead),true,true]; + _newUnit setvariable ["ACE_isDead",true,true]; removeallweapons _newUnit; removeallassigneditems _newUnit; diff --git a/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf new file mode 100644 index 0000000000..2236d30fce --- /dev/null +++ b/addons/medical/functions/fnc_moduleAssignMedicRoles.sqf @@ -0,0 +1,61 @@ +/** + * fn_assignMedicRoles.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_logic","_setting","_objects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; + + [format["AssignMedicalRoles called. Arguments are: %1 %2", _this]] call EFUNC(common,debug); + +if (!isNull _logic) then { + _list = _logic getvariable ["EnableList",""]; + + _splittedList = [_list, ","] call BIS_fnc_splitString; + _nilCheckPassedList = ""; + { + _x = [_x] call EFUNC(common,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 { + [["synchronizedObjects for the 'Assign Medic Role' Module is deprecated. Please use the enable for list instead!"], 1] call EFUNC(common,debug); + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + [_x,_setting] call FUNC(setMedicRole); + }; + }; + }; + }foreach _objects; + }; + { + if (!isnil "_x") then { + if (typeName _x == typeName objNull) then { + if (local _x) then { + [_x,_setting] call FUNC(setMedicRole); + }; + }; + }; + }foreach _parsedList; + }; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf b/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf new file mode 100644 index 0000000000..f26cfd9ffc --- /dev/null +++ b/addons/medical/functions/fnc_moduleAssignMedicalEquipment.sqf @@ -0,0 +1,81 @@ +/** + * fn_assignMedicalEquipment.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 "ACE_bandage_basic" +#define PACKING_BANDAGES "ACE_packing_bandage" + +#include "script_component.hpp" + +private ["_logic","_setting","_objects", "_medicsLoadout", "_nonMedics", "_code"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + _setting = _logic getvariable ["equipment",0]; + waituntil {!isnil "ACE_gui"}; // ensure the player unit is available. + waituntil {time>0}; + + _start = diag_tickTime; + + // 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 "ACE_tourniquet"; + }; + for "_i" from 1 to 3 do { + player addItem "ACE_morphine"; + }; + for "_i" from 1 to 2 do { + player addItem "ACE_epinephrine"; + }; + }; + + _nonMedics = { + for "_i" from 1 to 3 do { + player addItem BASIC_BANDAGES; + }; + player addItem "ACE_tourniquet"; + player addItem "ACE_morphine"; + }; + + // TODO make this neat code. + switch (_setting) do { + case ALL_PLAYERS: { + _code = if ([player] call FUNC(isMedic)) then { + _medicsLoadout; + } else { + _nonMedics; + }; + + call _code; + player addEventhandler["Respawn", _code]; + }; + case ONLY_MEDICS: { + _code = if ([player] call FUNC(isMedic)) then { + _medicsLoadout; + } else { + {}; + }; + call _code; + player addEventhandler["Respawn", _code]; + }; + default {}; + }; + }; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf new file mode 100644 index 0000000000..92ac746303 --- /dev/null +++ b/addons/medical/functions/fnc_moduleAssignMedicalFacility.sqf @@ -0,0 +1,25 @@ +/** + * fn_assignMedicalFacility.sqf + * @Descr: Register synchronized objects from passed object as a medical facility for CMS. + * @Author: Glowbal + * + * @Arguments: [logic OBJECT] + * @Return: BOOL + * @PublicAPI: true + */ + +#include "script_component.hpp" + +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[QGVAR(isMedicalFacility), true, true]; + }; + }foreach _objects; +}; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf new file mode 100644 index 0000000000..485eaba63b --- /dev/null +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -0,0 +1,62 @@ +/** + * fn_assignMedicalVehicle.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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 EFUNC(common,debug); + +if (!isNull _logic) then { + _list = _logic getvariable ["EnableList",""]; + _setting = _logic getvariable ["enabled",0]; + + _splittedList = [_list, ","] call BIS_fnc_splitString; + _nilCheckPassedList = ""; + { + _x = [_x] call EFUNC(common,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 [QGVAR(isMedicalVehicle), _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 [QGVAR(isMedicalVehicle), _setting, true]; + }; + }; + }; + }; + }foreach _parsedList; + }; + +true \ No newline at end of file diff --git a/addons/common/functions/fnc_moduleBasicRevive.sqf b/addons/medical/functions/fnc_moduleBasicRevive.sqf similarity index 100% rename from addons/common/functions/fnc_moduleBasicRevive.sqf rename to addons/medical/functions/fnc_moduleBasicRevive.sqf diff --git a/addons/medical/functions/fnc_moduleDamageSettings.sqf b/addons/medical/functions/fnc_moduleDamageSettings.sqf new file mode 100644 index 0000000000..9040d2ff81 --- /dev/null +++ b/addons/medical/functions/fnc_moduleDamageSettings.sqf @@ -0,0 +1,20 @@ +/** + * fnc_moduleDamageSettings.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_logic","_setting","_objects"]; +_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param; +if (!isNull _logic) then { + GVAR(damageThreshold_AI) = _logic getvariable ["damageThresholdAI", 1]; + GVAR(damageThreshold_Players) = _logic getvariable ["damageThresholdPlayers", 1]; +}; + +true \ No newline at end of file diff --git a/addons/medical/functions/fnc_onCarryObjectDropped.sqf b/addons/medical/functions/fnc_onCarryObjectDropped.sqf new file mode 100644 index 0000000000..4b7dd14a59 --- /dev/null +++ b/addons/medical/functions/fnc_onCarryObjectDropped.sqf @@ -0,0 +1,21 @@ +/** + * fnc_onCarryObjectDropped.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_params"]; +_unit = _this select 0; + +[format["fnc_onCarryObjectDropped: %1",_this]] call EFUNC(common,debug); + +_params = _unit getvariable QGVAR(onStartMovingUnitParams); +if (!isnil "_params") then { + _params call FUNC(handleDropUnit); +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onDamage.sqf b/addons/medical/functions/fnc_onDamage.sqf new file mode 100644 index 0000000000..489759f9b6 --- /dev/null +++ b/addons/medical/functions/fnc_onDamage.sqf @@ -0,0 +1,88 @@ +/** + * fnc_onDamage.sqf + * @Descr: Called when some dude gets shot. Or stabbed. Or blown up. Or pushed off a cliff. Or hit by a car. Or burnt. Or poisoned. Or gassed. Or cut. You get the idea. + * @Author: KoffeinFlummi + * + * @Arguments: [unit OBJECT, selection STRING, damagE NUMBER, source OBJECT, projectile STRING (Could be an OBJECT on occasion)] + * @Return: damage value to be inflicted + * @PublicAPI: false + */ + +#include "script_component.hpp" + +#define ARMOURCOEF 2 + +private ["_unit", "_selectionName", "_damage", "_source", "_source", "_projectile", "_hitSelections", "_hitPoints", "_newDamage", "_found", "_cache_projectiles", "_cache_hitpoints", "_cache_damages"]; +_unit = _this select 0; +_selectionName = _this select 1; +_damage = _this select 2; +_source = _this select 3; +_projectile = _this select 4; + +if (!([_unit] call FUNC(hasMedicalEnabled))) exitwith { + call FUNC(handleDamage); // let it run through the damage threshold script +}; + +// Otherwise we carry on with collecting the necessary information + +if (typeName _projectile == "OBJECT") then { + _projectile = typeOf _projectile; +}; + +// This seems to only show up in MP too, but since it doesn't +// collide with anything, I'll check it in SP as well. +if (_selectionName == "r_femur_hit") then { + _selectionName = "leg_r"; +}; + +// If the damage is being weird, we just tell it to fuck off. +if !(_selectionName in ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]) exitWith {0.01}; + +// Cache the handleDamage call +[_unit, _selectionName, _damage, _source, _projectile] call FUNC(cacheHandledamageCall); + +// Check if a unit would die from this hit +if (alive (vehicle _unit)) then { + _bodyPartn = [_selectionName] call FUNC(getBodyPartNumber); + + // Find the correct Damage threshold for unit. + _damageThreshold = [1,1,1]; + if (isPlayer _unit) then { + _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_Players), GVAR(damageThreshold_Players), GVAR(damageThreshold_Players) * 1.7]]; + } else { + _damageThreshold =_unit getvariable[QGVAR(unitDamageThreshold), [GVAR(damageThreshold_AI), GVAR(damageThreshold_AI), GVAR(damageThreshold_AI) * 1.7]]; + }; + _damageBodyPart = ([_unit,QGVAR(bodyPartStatus),[0,0,0,0,0,0]] call EFUNC(common,getDefinedVariable)) select _bodyPartn; + + _hitSelections = ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]; + _hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"]; + + // Calculate change in damage. + _previousDamage = _unit getvariable [QGVAR(bodyPartStatusPrevious), [0,0,0,0,0,0]]; + _newDamage = _damage - (_previousDamage select _bodyPartn); + + // Check if damage to body part is higher as damage head + if (_bodyPartn == 0) exitwith { + if (_damageBodyPart >= ((_damageThreshold select 0) + _newDamage) && {(random(1) > 0.2)}) then { + _damage = 1; + }; + }; + + // Check if damage to body part is higher as damage torso + if (_bodyPartn == 1) exitwith { + if (_damageBodyPart >= ((_damageThreshold select 1) + _newDamage) && {(random(1) > 0.2)}) then { + _damage = 1; + }; + }; + // Check if damage to body part is higher as damage limbs + if (_damageBodyPart >= ((_damageThreshold select 2) + _newDamage) && {(random(1) > 0.95)}) exitwith { + _damage = 1; + }; + // Checking if we should return full damage or not + if (_damage > 0.975) then { + _damage = 0.975; + }; +} else { + _damage = 1; +}; +_damage diff --git a/addons/medical/functions/fnc_onInitForUnit.sqf b/addons/medical/functions/fnc_onInitForUnit.sqf new file mode 100644 index 0000000000..596dc38b98 --- /dev/null +++ b/addons/medical/functions/fnc_onInitForUnit.sqf @@ -0,0 +1,31 @@ +/** + * fn_onInitForUnit.sqf + * @Descr: Deprecated. Is no longer used, as we dropped init eventhandler methods. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_handler"]; +_unit = _this select 0; + +if (!local _unit) exitwith {}; +if !(_unit isKindOf "CAManBase") exitwith{}; + +_unit addEventhandler["handleDamage", { + if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) >= 0) then { + call FUNC(onDamage); // cache damage and pass it to handleDamage function + }; +}]; + +_unit addEventHandler["handleHeal", { + if ((missionNamespace getvariable[QGVAR(setting_AdvancedLevel), 0]) >= 0) then { + call FUNC(handleHeal) + }; +}]; + +["medical_onInitForUnit", [_unit]] call ace_common_fnc_localEvent; diff --git a/addons/medical/functions/fnc_onInjury_assignAirwayStatus.sqf b/addons/medical/functions/fnc_onInjury_assignAirwayStatus.sqf new file mode 100644 index 0000000000..df233be89d --- /dev/null +++ b/addons/medical/functions/fnc_onInjury_assignAirwayStatus.sqf @@ -0,0 +1,26 @@ +/** + * fn_assignAirwayStatus.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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 [QGVAR(airwayCollapsed), true, true]; + }; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onInjury_assignFractures.sqf b/addons/medical/functions/fnc_onInjury_assignFractures.sqf new file mode 100644 index 0000000000..19b4e95858 --- /dev/null +++ b/addons/medical/functions/fnc_onInjury_assignFractures.sqf @@ -0,0 +1,70 @@ +/** + * fn_assignFractures.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +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,QGVAR(fractures)] call EFUNC(common,getDefinedVariable); + _selection = _fractures select _bodyPartn; + _selection set [ _size, (_selection select _size) + _amountOfBrokenBones ]; + _fractures set [ _bodyPartn , _selection]; + + [_unit, QGVAR(fractures),_fractures] call EFUNC(common,setDefinedVariable); +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onInjury_assignOpenWounds.sqf b/addons/medical/functions/fnc_onInjury_assignOpenWounds.sqf new file mode 100644 index 0000000000..f03f4c7abe --- /dev/null +++ b/addons/medical/functions/fnc_onInjury_assignOpenWounds.sqf @@ -0,0 +1,70 @@ +/** + * fn_assignOpenWounds.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" +#define ADD_INJURY(BODYPART,TYPE,AMOUNT) _selection = _openWounds select BODYPART; \ + _newAmount = (_selection select TYPE) + AMOUNT; \ + _selection set [ TYPE, _newAmount]; \ + _openWounds set [BODYPART , _selection]; + + +private ["_unit", "_amountOfDamage", "_typeOfInjury", "_bodyPartn", "_openWounds","_newAmount","_selection"]; +_unit = _this select 0; +_amountOfDamage = _this select 1; +_typeOfInjury = _this select 2; +_bodyPartn = _this select 3; + +if (_amountOfDamage > 0.05) exitwith { + _openWounds = [_unit,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); + switch (toLower _typeOfInjury) do { + case "bullet": { + ADD_INJURY(_bodyPartn, round(random(2)), 1); + }; + case "grenade": { + ADD_INJURY(_bodyPartn, round(random(2)), 1); + for "_i" from 0 to round(random(3)) /* step +1 */ do { + ADD_INJURY(round(random(6)), round(random(2)), 1); + }; + }; + case "explosive": { + ADD_INJURY(_bodyPartn, round(random(2)), 1); + for "_i" from 0 to round(random(4)) /* step +1 */ do { + ADD_INJURY(round(random(6)), round(random(2)), 1); + }; + }; + case "shell": { + ADD_INJURY(_bodyPartn, round(random(2)), 1); + for "_i" from 0 to round(random(5)) /* step +1 */ do { + ADD_INJURY(round(random(6)), round(random(2)), 1); + }; + }; + case "backblast": { + if (random(1)>=0.5) then{ + ADD_INJURY(_bodyPartn, round(random(2)), 1); + }; + }; + case "unknown": { + ADD_INJURY(_bodyPartn, round(random(1)), 1); + }; + case "vehiclecrash": { + if (random(1)>=0.5) then{ + ADD_INJURY(_bodyPartn, round(random(1)), 1); + }; + }; + default { + ADD_INJURY(_bodyPartn, round(random(1)), 1); + }; + }; + [_unit, QGVAR(openWounds),_openWounds] call EFUNC(common,setDefinedVariable); + + true; +}; + +false; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onKilled.sqf b/addons/medical/functions/fnc_onKilled.sqf new file mode 100644 index 0000000000..e3609a57e5 --- /dev/null +++ b/addons/medical/functions/fnc_onKilled.sqf @@ -0,0 +1,12 @@ +#include "script_component.hpp" + +private["_unit"]; +_unit = _this select 0; +if (!local _unit) exitwith {}; +[_unit, QGVAR(amountOfPain),0,true] call EFUNC(common,setDefinedVariable); +[_unit, QGVAR(heartRate),0,true] call EFUNC(common,setDefinedVariable); +[_unit, QGVAR(bloodPressure), [0,0],true] call EFUNC(common,setDefinedVariable); +if (_unit getvariable[QEGVAR(common,unconscious_non_captive_f),false]) then { + _unit setCaptive false; + _unit setvariable[QEGVAR(common,unconscious_non_captive_f),nil]; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onLocal.sqf b/addons/medical/functions/fnc_onLocal.sqf new file mode 100644 index 0000000000..83611baa04 --- /dev/null +++ b/addons/medical/functions/fnc_onLocal.sqf @@ -0,0 +1,10 @@ +#include "script_component.hpp" + +private["_unit", "_local"]; +_unit = _this select 0; +_local = _this select 1; +if (_local) then { + if (_unit getvariable[QGVAR(addedToUnitLoop),false]) then { + [_unit] call FUNC(addToInjuredCollection); + }; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onMenuOpen.sqf b/addons/medical/functions/fnc_onMenuOpen.sqf new file mode 100644 index 0000000000..5597dacce1 --- /dev/null +++ b/addons/medical/functions/fnc_onMenuOpen.sqf @@ -0,0 +1,76 @@ +/** + * fn_onMenuOpen.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +if (isnil QGVAR(LatestDisplayOptionMenu)) then { + GVAR(LatestDisplayOptionMenu) = "triage"; +} else { + if (GVAR(LatestDisplayOptionMenu) == "toggle") then { + GVAR(LatestDisplayOptionMenu) = "triage"; + GVAR(INTERACTION_TARGET) = GVAR(INTERACTION_TARGET_PREVIOUS); + }; +}; + +private ["_display","_target"]; +_target = GVAR(INTERACTION_TARGET); +if (isnil QGVAR(INTERACTION_TARGET_PREVIOUS)) then { + GVAR(INTERACTION_TARGET_PREVIOUS) = _target; +}; +[GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); + +[] call FUNC(updateActivityLog); +[_target] call FUNC(updateUIInfo); + +// 11 till 18 +disableSerialization; +_display = _this select 0; //uiNamespace getVariable QGVAR(medicalMenu); +if (isnil "_display") exitwith { + +}; + +(_display displayCtrl 11) ctrlSetTooltip localize "STR_ACE_UI_VIEW_TRIAGE_CARD"; +(_display displayCtrl 12) ctrlSetTooltip localize "STR_ACE_UI_EXAMINE_PATIENT"; +(_display displayCtrl 13) ctrlSetTooltip localize "STR_ACE_UI_BANDAGE_FRACTURES"; +(_display displayCtrl 14) ctrlSetTooltip localize "STR_ACE_UI_MEDICATION"; +(_display displayCtrl 15) ctrlSetTooltip localize "STR_ACE_UI_AIRWAY_MANAGEMENT"; +(_display displayCtrl 16) ctrlSetTooltip localize "STR_ACE_UI_ADVANCED_TREATMENT"; +(_display displayCtrl 17) ctrlSetTooltip localize "STR_ACE_UI_DRAG_CARRY"; +(_display displayCtrl 18) ctrlSetTooltip localize "STR_ACE_UI_TOGGLE_SELF"; + +(_display displayCtrl 301) ctrlSetTooltip localize "STR_ACE_UI_SELECT_HEAD"; +(_display displayCtrl 302) ctrlSetTooltip localize "STR_ACE_UI_SELECT_TORSO"; +(_display displayCtrl 303) ctrlSetTooltip localize "STR_ACE_UI_SELECT_ARM_R"; +(_display displayCtrl 304) ctrlSetTooltip localize "STR_ACE_UI_SELECT_ARM_L"; +(_display displayCtrl 305) ctrlSetTooltip localize "STR_ACE_UI_SELECT_LEG_R"; +(_display displayCtrl 306) ctrlSetTooltip localize "STR_ACE_UI_SELECT_LEG_L"; +(_display displayCtrl 2001) ctrlSetTooltip localize "STR_ACE_UI_SELECT_TRIAGE_STATUS"; + + +(_display displayCtrl 1) ctrlSetText format["%1",[_target] call EFUNC(common,getName)]; +setMousePosition [ 0.4, 0.4]; + +[QGVAR(onMenuOpen), "onEachFrame", { + if (isNull GVAR(INTERACTION_TARGET)) then { + GVAR(INTERACTION_TARGET) = ACE_player; + }; + [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo); + [GVAR(INTERACTION_TARGET)] call FUNC(updateIcons); + [GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions); + + [] call FUNC(updateActivityLog); + + _status = [GVAR(INTERACTION_TARGET)] call FUNC(getTriageStatus); + ((_this select 0) displayCtrl 2000) ctrlSetText (_status select 0); + ((_this select 0) displayCtrl 2000) ctrlSetBackgroundColor (_status select 2); + + }, [_display]] call BIS_fnc_addStackedEventHandler; + + ["Medical_onMenuOpen", [ACE_player, _interactionTarget]] call ace_common_fnc_localEvent; diff --git a/addons/medical/functions/fnc_onStartMovingUnit.sqf b/addons/medical/functions/fnc_onStartMovingUnit.sqf new file mode 100644 index 0000000000..7fe3dd8d65 --- /dev/null +++ b/addons/medical/functions/fnc_onStartMovingUnit.sqf @@ -0,0 +1,25 @@ +/** + * fnc_onStartMovingUnit.sqf + * @Descr: is called when a unit start to move another unit through either carry or drag actions. + * + * @Author: Glowbal + * + * @Arguments: [caller OBJECT, unit OBJECT, killOnDrop BOOL (Should the unit be killed when being dropped), dragging BOOL (true means the dragging animations should be played, false will play carry animations)] + * @Return: nil + * @PublicAPI: false + */ + +#include "script_component.hpp" + + +private ["_caller","_target","_killOnDrop","_dragging"]; +_caller = _this select 0; +_target = _this select 1; +_killOnDrop = _this select 2; +_dragging = _this select 3; + +_caller setvariable[QGVAR(onStartMovingUnitParams), [_caller, _target, _killOnDrop, _dragging]]; + +[_target, true] call EFUNC(common,disableAI_f); + +nil; \ No newline at end of file diff --git a/addons/medical/functions/fnc_onTreatmentCompleted.sqf b/addons/medical/functions/fnc_onTreatmentCompleted.sqf new file mode 100644 index 0000000000..4505575f00 --- /dev/null +++ b/addons/medical/functions/fnc_onTreatmentCompleted.sqf @@ -0,0 +1,26 @@ +/** + * fnc_handleTreatmentCompleted.sqf + * @Descr: Called when a treatment action has been completed. + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_caller", "_target","_selectionName","_removeItem"]; +_caller = _this select 0; +_target = _this select 1; +_selectionName = _this select 2; +_removeItem = _this select 3; + +if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then { + _caller removeWeapon "ACE_FakePrimaryWeapon"; +}; + +[_caller,false] call FUNC(treatmentMutex); + +// TODO: BUG: if AI finishes treatment, it will also hide the icon for the player +[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon); diff --git a/addons/medical/functions/fnc_onUnconscious.sqf b/addons/medical/functions/fnc_onUnconscious.sqf new file mode 100644 index 0000000000..b18f55c099 --- /dev/null +++ b/addons/medical/functions/fnc_onUnconscious.sqf @@ -0,0 +1,23 @@ +/** + * fnc_onUnconscious.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_state"]; +_unit = _this select 0; +_state = _this select 1; + +if (_state) then { + if (GVAR(setting_allowAirwayInjuries)) then { + if (random(1) >= 0.3) then { + _unit setvariable [QGVAR(airwayOccluded), true, true]; + }; + }; +}; \ No newline at end of file diff --git a/addons/medical/functions/fnc_openMenu.sqf b/addons/medical/functions/fnc_openMenu.sqf new file mode 100644 index 0000000000..5e0b488ff5 --- /dev/null +++ b/addons/medical/functions/fnc_openMenu.sqf @@ -0,0 +1,44 @@ +/** + * fn_openMenu.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + + +if (dialog) exitwith { + disableSerialization; + + private "_display"; + _display = uiNamespace getVariable QGVAR(medicalMenu); + if (!isnil "_display") then { + closeDialog 314412; + }; + +}; + +private ["_interactionTarget"]; +_interactionTarget = objNull; +if (count _this > 0) then { + _interactionTarget = _this select 0; + +} else { + _interactionTarget = cursortarget; + if (isNull _interactionTarget) then { + _interactionTarget = ACE_player; + }; + if (_interactionTarget distance ACE_player > 5 || !(_interactionTarget isKindOf "CaManBase")) then { + _interactionTarget = ACE_player; + }; +}; + +if (isNull _interactionTarget) then { + _interactionTarget = ACE_player; +}; +GVAR(INTERACTION_TARGET) = _interactionTarget; +createDialog QGVAR(medicalMenu); diff --git a/addons/medical/functions/fnc_playInjuredSound.sqf b/addons/medical/functions/fnc_playInjuredSound.sqf new file mode 100644 index 0000000000..f514f8ddae --- /dev/null +++ b/addons/medical/functions/fnc_playInjuredSound.sqf @@ -0,0 +1,95 @@ +/** + * fn_playInjuredSound.sqf + * @Descr: Play the injured sound for a unit if the unit is damaged. The sound broadcasted across MP. + * Will not play if the unit has already played a sound within to close a time frame. + * Delay: With minimal damage (below 1), the delay is (10 + random(50)) seconds. Otherwise it is 60 seconds / damage. + * + * @Author: Glowbal + * + * @Arguments: [unit OBJECT] + * @Return: nil + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_amountOfDamage","_bodyPartStatus","_availableSounds_A","_availableSounds_B","_availableSounds_C","_sound"]; +_unit = _this select 0; +if (!local _unit) exitwith{}; + +// Lock if the unit is already playing a sound. +if ((_unit getvariable [QGVAR(playingInjuredSound),false])) exitwith {}; +_unit setvariable [QGVAR(playingInjuredSound),true]; + +// Classnames of the available sounds. +_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" +]; + +// TODO Maybe base this off hitpoint damage +// Find the amount of damage for this unit, based upon body part status. +_bodyPartStatus = [_unit,QGVAR(bodyPartStatus)] call EFUNC(common,getDefinedVariable); +_amountOfDamage = 0; +{ + _amountOfDamage = _amountOfDamage + _x; +}foreach _bodyPartStatus; + +// Play the sound if there is any damage present. +if (_amountOfDamage > 0) exitwith { + _sound = ""; + + // Select the to be played sound based upon damage amount. + 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))); + }; + + // Play the sound + playSound3D [((getArray(configFile >> "CfgSounds" >> _sound >> "sound") select 0)), _unit, false, getPos _unit, 2, 1, 15]; // +2db, 15 meters. + + // Figure out what the delay will be before it is possible to play a sound again. + private "_delay"; + _delay = 1; + if (_amountOfDamage < 1) then { + _delay = 10 + random(50); + } else { + _delay = (60 / _amountOfDamage); + }; + + // Clean up the lock + [{ + (_this select 0) setvariable [QGVAR(playingInjuredSound),nil]; + }, [_unit], _delay, _delay] call EFUNC(common,waitAndExecute); +}; + +// Clean up in case there has not been played any sounds. +_unit setvariable [QGVAR(playingInjuredSound),nil]; diff --git a/addons/common/functions/fnc_registerUnconsciousCondition.sqf b/addons/medical/functions/fnc_registerUnconsciousCondition.sqf similarity index 100% rename from addons/common/functions/fnc_registerUnconsciousCondition.sqf rename to addons/medical/functions/fnc_registerUnconsciousCondition.sqf diff --git a/addons/common/functions/fnc_setCaptiveSwitch.sqf b/addons/medical/functions/fnc_setCaptiveSwitch.sqf similarity index 100% rename from addons/common/functions/fnc_setCaptiveSwitch.sqf rename to addons/medical/functions/fnc_setCaptiveSwitch.sqf diff --git a/addons/medical/functions/fnc_setCardiacArrest.sqf b/addons/medical/functions/fnc_setCardiacArrest.sqf new file mode 100644 index 0000000000..090af82b49 --- /dev/null +++ b/addons/medical/functions/fnc_setCardiacArrest.sqf @@ -0,0 +1,47 @@ +/** + * fn_setCardiacArrest.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 + */ + +#include "script_component.hpp" + +private ["_unit", "_modifier","_timer","_counter", "_heartRate"]; +_unit = _this select 0; + +if (_unit getvariable [QGVAR(inCardiacArrest),false]) exitwith {}; +[format["%1 is put into cardiac arrest",_unit]] call EFUNC(common,debug); +_unit setvariable [QGVAR(inCardiacArrest), true,true]; +[_unit,QGVAR(heartRate), 0] call EFUNC(common,setDefinedVariable); + +["Medical_onEnteredCardiacArrest", [_unit]] call ace_common_fnc_localEvent; + +[_unit] call FUNC(setUnconsciousState); +_counter = 120 + round(random(600)); +_timer = 0; + +[{ + private ["_args","_unit","_timer","_counter","_heartRate"]; + _args = _this select 0; + _unit = _args select 0; + _timer = _args select 1; + _counter = _args select 2; + + _heartRate = [_unit,QGVAR(heartRate)] call EFUNC(common,getDefinedVariable); + if (_heartRate > 0 || !alive _unit) exitwith { + _unit setvariable [QGVAR(inCardiacArrest), nil,true]; + [(_this select 1)] call cba_fnc_removePerFrameHandler; + }; + if (_counter - _timer < 1) exitwith { + + [_unit] call FUNC(setDead); + [(_this select 1)] call cba_fnc_removePerFrameHandler; + _unit setvariable [QGVAR(inCardiacArrest), nil,true]; + }; + _args set[1, _timer + 1]; +}, 1, [_unit, _timer, _counter] ] call CBA_fnc_addPerFrameHandler; + diff --git a/addons/medical/functions/fnc_setDamageBodyPart.sqf b/addons/medical/functions/fnc_setDamageBodyPart.sqf new file mode 100644 index 0000000000..828bd93c7e --- /dev/null +++ b/addons/medical/functions/fnc_setDamageBodyPart.sqf @@ -0,0 +1,53 @@ +/** + * fnc_setDamageBodyPart.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"]; +_unit = _this select 0; + +if (!local _unit) exitwith { + // execute only local +}; + +_bodyStatus = [_unit,QGVAR(bodyPartStatus),[0,0,0,0,0,0]] call EFUNC(common,getDefinedVariable); +// ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"] +_headDamage = _bodyStatus select 0; +if (_headDamage > 0.95) then { + _unit setHitPointDamage ["hitHead", 0.95]; +} else { + _unit setHitPointDamage ["hitHead", _headDamage]; +}; + +_torsoDamage = _bodyStatus select 1; +if (_torsoDamage > 0.95) then { + _unit setHitPointDamage ["hitBody", 0.95]; +} else { + _unit setHitPointDamage ["hitBody", _torsoDamage]; +}; + + +_handsDamage = (_bodyStatus select 2) + (_bodyStatus select 3); +if (_handsDamage > 0.95) then { + _unit setHitPointDamage ["hitHands", 0.95]; +} else { + _unit setHitPointDamage ["hitHands", _handsDamage]; +}; + +_legsDamage = (_bodyStatus select 4) + (_bodyStatus select 5); +if (_legsDamage > 0.95) then { + _unit setHitPointDamage ["hitLegs", 0.95]; +} else { + _unit setHitPointDamage ["hitLegs", _legsDamage]; +}; + +if ({_x > 0} count _bodyStatus == 0) then { + _unit setDamage 0; +}; diff --git a/addons/common/functions/fnc_setDead.sqf b/addons/medical/functions/fnc_setDead.sqf similarity index 72% rename from addons/common/functions/fnc_setDead.sqf rename to addons/medical/functions/fnc_setDead.sqf index 1b24a0552e..d43c1e1afc 100644 --- a/addons/common/functions/fnc_setDead.sqf +++ b/addons/medical/functions/fnc_setDead.sqf @@ -30,7 +30,7 @@ if (isnil QGVAR(ENABLE_REVIVE_F)) then { if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == 2)) && !_force && (alive (vehicle _unit))) exitwith { // enter revive state - _unit setvariable [QGVAR(inReviveState), true, true]; + _unit setvariable ["ACE_inReviveState", true, true]; // Remain unconscious while in revive state [_unit] call FUNC(setUnconsciousState); @@ -53,36 +53,33 @@ if (((GVAR(ENABLE_REVIVE_F) == 1 && isPlayer _unit) || (GVAR(ENABLE_REVIVE_F) == [(_this select 1)] call cba_fnc_removePerFrameHandler; // Cleaning up the variables, as we no longer need them. - _unit setvariable [QGVAR(reviveCounter_f), nil]; - _unit setvariable [QGVAR(inReviveState), nil, true]; + _unit setvariable ["ACE_reviveCounterValue", nil]; + _unit setvariable ["ACE_inReviveState", nil, true]; }; - _counter = _unit getvariable [QGVAR(reviveCounter_f), 0]; + _counter = _unit getvariable ["ACE_reviveCounterValue", 0]; if (_counter >= GVAR(REVIVE_TIMER_F)) exitwith{ if (isPlayer _unit) then { titleText ["You died..","PLAIN DOWN"]; }; - [_unit,QGVAR(isDead), true, true] call FUNC(setDefinedVariable); + [_unit,"ACE_isDead", true, true] call EFUNC(common,setDefinedVariable); if (_playerDead) then { - [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); + [_unit,QGVAR(isDeadPlayer),true,true] call EFUNC(common,setDefinedVariable); }; _unit setdamage 1; // killing a unit will automatically clean up all variables. - [[_unit, true],"killed"] call FUNC(raiseScriptedEvent_f); [(_this select 1)] call cba_fnc_removePerFrameHandler; }; - _unit setvariable [QGVAR(reviveCounter_f),_counter + TIME_BETWEEN_REVIVE_RUNS]; + _unit setvariable ["ACE_reviveCounterValue",_counter + TIME_BETWEEN_REVIVE_RUNS]; }, TIME_BETWEEN_REVIVE_RUNS, [_unit, isPlayer _unit] ] call CBA_fnc_addPerFrameHandler; }; -[_unit,QGVAR(isDead),true,true] call FUNC(setDefinedVariable); +[_unit,"ACE_isDead",true,true] call EFUNC(common,setDefinedVariable); if (isPLayer _unit) then { - [_unit,QGVAR(isDeadPlayer),true,true] call FUNC(setDefinedVariable); + [_unit,QGVAR(isDeadPlayer),true,true] call EFUNC(common,setDefinedVariable); }; _unit setdamage 1; - -[[_unit, false],"killed"] call FUNC(raiseScriptedEvent_f); diff --git a/addons/medical/functions/fnc_setMedicRole.sqf b/addons/medical/functions/fnc_setMedicRole.sqf new file mode 100644 index 0000000000..5c8a67539a --- /dev/null +++ b/addons/medical/functions/fnc_setMedicRole.sqf @@ -0,0 +1,23 @@ +/** + * fn_setMedicRole.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 + */ + +#include "script_component.hpp" + +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 [QGVAR(medicClass), 1, true]; + } else { + _unit setvariable [QGVAR(medicClass), 0, true]; + } +}; diff --git a/addons/medical/functions/fnc_setTriageStatus.sqf b/addons/medical/functions/fnc_setTriageStatus.sqf new file mode 100644 index 0000000000..c37a636c14 --- /dev/null +++ b/addons/medical/functions/fnc_setTriageStatus.sqf @@ -0,0 +1,21 @@ +/** + * fn_setTriageStatus.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit","_caller","_type","_activity","_status"]; + +_unit = _this select 0; +_status = _this select 1; + +if (!local _unit) exitwith { + [_this, QUOTE(FUNC(setTriageStatus)), _unit] call EFUNC(common,execRemoteFnc); +}; +[_unit,QGVAR(triageLevel),_status] call EFUNC(common,setDefinedVariable); \ No newline at end of file diff --git a/addons/common/functions/fnc_setUnconsciousState.sqf b/addons/medical/functions/fnc_setUnconsciousState.sqf similarity index 72% rename from addons/common/functions/fnc_setUnconsciousState.sqf rename to addons/medical/functions/fnc_setUnconsciousState.sqf index bae01b291c..3f53e629e9 100644 --- a/addons/common/functions/fnc_setUnconsciousState.sqf +++ b/addons/medical/functions/fnc_setUnconsciousState.sqf @@ -14,17 +14,17 @@ private ["_unit", "_animState", "_dAnim"]; _unit = _this select 0; if !([_unit] call FUNC(canGoUnconsciousState)) exitwith{ - [format["Exit setUnconscious: %1", _this]] call FUNC(debug); + [format["Exit setUnconscious: %1", _this]] call EFUNC(common,debug); }; // We only want this function to work on local machines if (!local _unit) exitwith { [[_unit], QUOTE(FUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); - [format["Exit setUnconscious: %1", _this]] call FUNC(debug); + [format["Exit setUnconscious: %1", _this]] call EFUNC(common,debug); }; // get rid of the object we are carrying, before we go unconscious. -[_unit, ObjNull, [0,0,0]] call FUNC(carryObj); +[_unit, ObjNull, [0,0,0]] call EFUNC(common,carryObj); // Set the unit in the unconscious state. _unit setvariable ["ACE_isUnconscious",true,true]; @@ -41,23 +41,23 @@ _originalPos = unitPos _unit; // Handle the on screen effects if (isPlayer _unit) then { - [] call FUNC(closeAllDialogs_f); - [true] call EFUNC(GUI,effectBlackOut); - ["unconscious", true] call FUNC(setDisableUserInputStatus); - [false] call FUNC(setVolume_f); + [] call EFUNC(common,closeAllDialogs_f); + [true] call FUNC(effectBlackOut); + ["unconscious", true] call EFUNC(common,setDisableUserInputStatus); + [false] call EFUNC(common,setVolume_f); } else { _unit setUnitPos "DOWN"; - [_unit, true] call FUNC(disableAI_F); + [_unit, true] call EFUNC(common,disableAI_F); }; // So the AI does not get stuck, we are moving the unit to a temp group on its own. -[_unit, true, "ACE_isUnconscious", side group _unit] call FUNC(switchToGroupSide_f); +[_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide_f); -_captiveSwitch = [_unit, true] call FUNC(setCaptiveSwitch); -[_unit, [_unit] call FUNC(getDeathAnim), 1, true] call FUNC(doAnimation); +_captiveSwitch = [_unit, true] call EFUNC(common,setCaptiveSwitch); +[_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); -[format["Unit moving into unconscious: %1", _this]] call FUNC(debug); +[format["Unit moving into unconscious: %1", _this]] call EFUNC(common,debug); _startingTime = time; @@ -75,28 +75,26 @@ _minWaitingTime = (round(random(10)+5)); // Since the unit is no longer alive, get rid of this PFH. if (!alive _unit) exitwith { - [format["%1 Unit no longer alive, exiting"], _unit] call FUNC(debug); + [format["%1 Unit no longer alive, exiting"], _unit] call EFUNC(common,debug); // EXIT PFH [(_this select 1)] call cba_fnc_removePerFrameHandler; - [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); }; // In case the unit is no longer in an unconscious state, we are going to check if we can already reset the animation if !([_unit] call FUNC(isUnconscious)) exitwith { - [format["%1 Unit no longer unconscious, handling exit and animation"], _unit] call FUNC(debug); + [format["%1 Unit no longer unconscious, handling exit and animation"], _unit] call EFUNC(common,debug); // Wait until the unit isn't being carried anymore, so we won't end up with wierd animations - if !([_unit] call FUNC(beingCarried)) then { + if !([_unit] call EFUNC(common,beingCarried)) then { if (vehicle _unit == _unit) then { - [_unit,"amovppnemstpsnonwnondnon", 1] call FUNC(doAnimation); + [_unit,"amovppnemstpsnonwnondnon", 1] call EFUNC(common,doAnimation); } else { // Switch to the units original animation, assuming // TODO: what if the unit switched vehicle? - [_unit, _oldAnimation, 1] call FUNC(doAnimation); + [_unit, _oldAnimation, 1] call EFUNC(common,doAnimation); }; // EXIT PFH [(_this select 1)] call cba_fnc_removePerFrameHandler; - [[_unit, false],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); }; }; // Ensure we are waiting at least a minimum period before checking if we can wake up the unit again, allows for temp knock outs @@ -104,7 +102,7 @@ _minWaitingTime = (round(random(10)+5)); // Wait until the unit is no longer unconscious if (!([_unit] call FUNC(getUnconsciousCondition))) then { - [format["%1 No unconscious condition valid anymore, moving uit out of unconsciousState"], _unit] call FUNC(debug); + [format["%1 No unconscious condition valid anymore, moving uit out of unconsciousState"], _unit] call EFUNC(common,debug); // Reset the unit back to the previous captive state. if (_captiveSwitch) then { [_unit, false] call FUNC(setCaptiveSwitch); @@ -112,31 +110,30 @@ _minWaitingTime = (round(random(10)+5)); _unit setUnconscious false; // Swhich the unit back to its original group - [_unit, false, "ACE_isUnconscious", side group _unit] call FUNC(switchToGroupSide_f); + [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide_f); // Reset any visual and audio effects for players, or enable everything again for AI. if (isPlayer _unit) then { - [false] call EFUNC(GUI,effectBlackOut); - [true] call FUNC(setVolume_f); - ["unconscious", false] call FUNC(setDisableUserInputStatus); + [false] call FUNC(effectBlackOut); + [true] call EFUNC(common,setVolume_f); + ["unconscious", false] call EFUNC(common,setDisableUserInputStatus); } else { - [_unit, false] call FUNC(disableAI_F); + [_unit, false] call EFUNC(common,disableAI_F); _unit setUnitPos _originalPos; // This is not position but stance (DOWN, MIDDLE, UP) }; // Move unit out of unconscious state _unit setvariable ["ACE_isUnconscious", false, true]; - [format["%1 Unit no longer unconsicous"], _unit] call FUNC(debug); + [format["%1 Unit no longer unconsicous"], _unit] call EFUNC(common,debug); }; }; // A check to ensure that the animation is being played properly. // TODO: Might no longer be necessary: Have to test this in MP. - if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call FUNC(getCarriedBy)))} && (time - _startingTime >= 0.5)) then { - [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call FUNC(doAnimation); // Reset animations if unit starts doing wierd things. - [format["%1 Had to reset an animation for unconscious"], _unit] call FUNC(debug); + if (vehicle _unit == _unit && {animationState _unit != "deadState" && animationState _unit != "unconscious"} && {(isNull ([_unit] call EFUNC(common,getCarriedBy)))} && (time - _startingTime >= 0.5)) then { + [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call EFUNC(common,doAnimation); // Reset animations if unit starts doing wierd things. + [format["%1 Had to reset an animation for unconscious"], _unit] call EFUNC(common,debug); }; }, 0.1, [_unit,_animState, _captiveSwitch, _originalPos, _startingTime, _minWaitingTime] ] call CBA_fnc_addPerFrameHandler; -[[_unit, true],"setUnconsciousState"] call FUNC(raiseScriptedEvent_f); diff --git a/addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf b/addons/medical/functions/fnc_setWeaponsCorrectUnconscious.sqf similarity index 100% rename from addons/common/functions/fnc_setWeaponsCorrectUnconscious.sqf rename to addons/medical/functions/fnc_setWeaponsCorrectUnconscious.sqf diff --git a/addons/medical/functions/fnc_treatmentMutex.sqf b/addons/medical/functions/fnc_treatmentMutex.sqf new file mode 100644 index 0000000000..af27737b49 --- /dev/null +++ b/addons/medical/functions/fnc_treatmentMutex.sqf @@ -0,0 +1,23 @@ +/** + * fn_treatmentMutex.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 + */ + +#include "script_component.hpp" + +private ["_unit", "_set"]; + +_unit = _this select 0; +_set = if (count _this > 1) then {_this select 1} else {true}; + +if (_set) exitwith { + _unit setvariable [QGVAR(PerformingTreatmentMutex), time, true]; +}; + +// Max locked time is 2 minutes. +_unit setvariable [QGVAR(PerformingTreatmentMutex), -120, true]; \ No newline at end of file diff --git a/addons/medical/functions/fnc_updateActivityLog.sqf b/addons/medical/functions/fnc_updateActivityLog.sqf new file mode 100644 index 0000000000..58179a8392 --- /dev/null +++ b/addons/medical/functions/fnc_updateActivityLog.sqf @@ -0,0 +1,44 @@ +/** + * fn_updateActivityLog.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +_log = [GVAR(INTERACTION_TARGET)] call FUNC(getActivityLog); +_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 = [GVAR(INTERACTION_TARGET)] call FUNC(getQuickViewLog); +_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, ""]; +}; diff --git a/addons/medical/functions/fnc_updateBodyImg.sqf b/addons/medical/functions/fnc_updateBodyImg.sqf new file mode 100644 index 0000000000..194d2b6e08 --- /dev/null +++ b/addons/medical/functions/fnc_updateBodyImg.sqf @@ -0,0 +1,71 @@ +/** + * fn_updateBodyImg.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_unit", "_interactionDialog", "_openWounds", "_part", "_total", "_amountOfWoundsSmall", "_amountOfWoundsMedium", "_amountOfWoundsLarge", "_bandagedWounds","_alphaLevel", "_damaged"]; +_openWounds = _this select 0; +_bandagedWounds = _this select 1; + +disableSerialization; +_interactionDialog = uiNamespace getvariable QGVAR(medicalMenu); +if (isnil "_interactionDialog") exitwith {}; + +_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/addons/medical/functions/fnc_updateIcons.sqf b/addons/medical/functions/fnc_updateIcons.sqf new file mode 100644 index 0000000000..81c071efca --- /dev/null +++ b/addons/medical/functions/fnc_updateIcons.sqf @@ -0,0 +1,27 @@ +/** + * fn_updateIcons.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_display","_startIDC","_idc","_options","_name","_amount"]; +disableSerialization; +_display = uiNamespace getVariable QGVAR(medicalMenu); + +_startIDC = 111; + +_options = ["triage" , "examine", "bandage", "medication", "airway", "advanced", "drag", "toggle"]; +for "_idc" from _startIDC to 118 step 1 do { + _amount = [ACE_player, GVAR(INTERACTION_TARGET), _options select (_idc - 111)] call FUNC(getTreatmentOptions); + 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/addons/medical/functions/fnc_updateUIInfo.sqf b/addons/medical/functions/fnc_updateUIInfo.sqf new file mode 100644 index 0000000000..4ac6b463f1 --- /dev/null +++ b/addons/medical/functions/fnc_updateUIInfo.sqf @@ -0,0 +1,215 @@ +/** + * fn_updateUIInfo.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ + +#include "script_component.hpp" + +private ["_targetObj","_bodyPartText","_bodyPartN","_openWounds","_bandagedWounds","_fractures","_listOfWounds","_listOfBandagedWounds","_listOfFractures","_counter","_nameEntry","_untreatedWounds" ,"_remainder", "_numberOf", "_airwayStatus", "_airwayTreated"]; +_targetObj = _this select 0; + +_bodyPartText = (call FUNC(getSelectedBodyPart)); +_bodyPartN = [_bodyPartText] call FUNC(getBodyPartNumber); + +if (_bodyPartN < 0 || _bodyPartN > 5) exitwith {}; + +_openWounds = [_targetObj,QGVAR(openWounds)] call EFUNC(common,getDefinedVariable); +_bandagedWounds = [_targetObj,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable); +_fractures = [_targetObj,QGVAR(fractures)] call EFUNC(common,getDefinedVariable); +_airwayStatus = [_targetObj,QGVAR(airway)] call EFUNC(common,getDefinedVariable); + +if (count _this > 1) then { + switch (_this select 1) do { + case QGVAR(openWounds): { _openWounds = _this select 2; }; + case QGVAR(bandagedWounds): { _bandagedWounds = _this select 2; }; + case QGVAR(fractures): { _fractures = _this select 2; }; + }; +}; + +[_openWounds,_bandagedWounds] call FUNC(updateBodyImg); +_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_ACE_UI_HEAD"; + }; + case "body": { + localize "STR_ACE_UI_TORSO"; + }; + case "hand_r": { + localize "STR_ACE_UI_ARM_R"; + }; + case "hand_l": { + localize "STR_ACE_UI_ARM_L"; + }; + case "leg_r": { + localize "STR_ACE_UI_LEG_R"; + }; + case "leg_l": { + localize "STR_ACE_UI_LEG_L"; + }; + default {"-"}; +}; + + +lbadd[213,format[localize "STR_ACE_UI_SELECTED_BODY_PART",_displayBodyPartText]]; +lbSetData [213, _numberOf, ""]; +lbSetColor [213, _numberOf, [0.27, 0.40, 0.26, 1]]; +_numberOf = _numberOf + 1; + +if (GVAR(setting_allowAirwayInjuries)) then { + _airwayTreated = _targetObj getvariable [QGVAR(airwayTreated), false]; + + if (_airwayStatus > 0) then { + _nameEntry = switch (_airwayStatus) do { + case 0: {localize "STR_ACE_UI_NORMAL_BREATHING"}; + case 1: {localize "STR_ACE_UI_DIFFICULT_BREATHING"}; + case 2: {localize "STR_ACE_UI_ALMOST_NO_BREATHING"}; + default {localize "STR_ACE_UI_NO_BREATHING"}; + }; + + if (!(alive _targetObj) || (_targetObj getvariable [QEGVAR(common,isDead), false])) then { + lbadd[213,format["%1",localize "STR_ACE_UI_NO_BREATHING"]]; + } else { + lbadd[213,format["%1",_nameEntry]]; + }; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; + } else { + if (!(alive _targetObj) || (_targetObj getvariable [QEGVAR(common,isDead), false])) then { + lbadd[213,format["%1",localize "STR_ACE_UI_NO_BREATHING"]]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; + }; + }; + + if (_airwayTreated) then { + lbadd[213,localize "STR_ACE_UI_STATUS_NPA_APPLIED"]; + lbSetData [213, _numberOf, ""]; + lbSetColor [213, _numberOf, [0.5, 0.5, 0, 1]]; + _numberOf = _numberOf + 1; + }; +}; + +if (([_targetObj,QGVAR(isBleeding)] call EFUNC(common,getDefinedVariable))) then { + lbadd[213,localize "STR_ACE_UI_STATUS_BLEEDING"]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; +if (([_targetObj,QGVAR(hasLostBlood)] call EFUNC(common,getDefinedVariable))) then { + lbadd[213,localize "STR_ACE_UI_STATUS_LOST_BLOOD"]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; + +if (([_targetObj,QGVAR(hasPain)] call EFUNC(common,getDefinedVariable))) then { + lbadd[213,localize "STR_ACE_UI_STATUS_PAIN"]; + lbSetData [213, _numberOf, ""]; + _numberOf = _numberOf + 1; +}; +if (([_targetObj, _bodyPartText] call FUNC(hasTourniquetAppliedTo))) then { + lbadd[213,localize "STR_ACE_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_ACE_UI_SMALL"}; + case 1: {localize "STR_ACE_UI_MEDIUM"}; + case 2: {localize "STR_ACE_UI_LARGE"}; + default {localize "STR_ACE_UI_SMALL"}; + }; + + if (_untreatedWounds > 1) then { + lbadd[213,format[localize "STR_ACE_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_ACE_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_ACE_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_ACE_UI_SMALL"}; + case 1: {localize "STR_ACE_UI_MEDIUM"}; + case 2: {localize "STR_ACE_UI_LARGE"}; + default {localize "STR_ACE_UI_SMALL"}; + }; + + if (_untreatedWounds > 1) then { + lbadd[213,format[localize "STR_ACE_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_ACE_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_ACE_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_ACE_UI_SMALL"}; + case 1: {localize "STR_ACE_UI_MEDIUM"}; + case 2: {localize "STR_ACE_UI_LARGE"}; + default {localize "STR_ACE_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/addons/medical/functions/fnc_useEquipment.sqf b/addons/medical/functions/fnc_useEquipment.sqf new file mode 100644 index 0000000000..e432585de9 --- /dev/null +++ b/addons/medical/functions/fnc_useEquipment.sqf @@ -0,0 +1,43 @@ +/** + * fn_useEquipment.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 + */ + +#include "script_component.hpp" + +private ["_medic", "_patient", "_item", "_return","_crew"]; +_medic = _this select 0; +_patient = _this select 1; +_item = _this select 2; + +if (isnil QGVAR(setting_allowSharedEquipment)) then { + GVAR(setting_allowSharedEquipment) = true; +}; + +if (GVAR(setting_allowSharedEquipment) && {[_patient, _item] call EFUNC(common,hasItem)}) exitwith { + [[_patient, _item], QUOTE(EFUNC(common,useItem)), _patient] call BIS_fnc_MP; + true; +}; + +if ([_medic, _item] call EFUNC(common,hasItem)) exitwith { + [[_medic, _item], QUOTE(EFUNC(common,useItem)), _medic] call BIS_fnc_MP; + true; +}; + +_return = false; +if ([vehicle _medic] call FUNC(isMedicalVehicle) && {vehicle _medic != _medic}) then { + _crew = crew vehicle _medic; + { + if ([_x, _medic] call FUNC(canAccessMedicalEquipment) && {([_x, _item] call EFUNC(common,hasItem))}) exitwith { + _return = true; + [[_x, _item], QUOTE(EFUNC(common,useItem)), _x] call BIS_fnc_MP; + }; + }foreach _crew; +}; + +_return \ No newline at end of file diff --git a/addons/medical/functions/script_component.hpp b/addons/medical/functions/script_component.hpp new file mode 100644 index 0000000000..140463d68d --- /dev/null +++ b/addons/medical/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\medical\script_component.hpp" diff --git a/addons/medical/script_component.hpp b/addons/medical/script_component.hpp new file mode 100644 index 0000000000..cdbccbd643 --- /dev/null +++ b/addons/medical/script_component.hpp @@ -0,0 +1,25 @@ +#define COMPONENT medical +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MEDICAL + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MEDICAL + #define DEBUG_SETTINGS DEBUG_SETTINGS_MEDICAL +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + + +#define TREATMENT_AIRWAY(ITEM) {[_this select 0,_this select 1,call FUNC(getSelectedBodyPart),ITEM,'airway'] call FUNC(handleTreatment)} +#define TREATMENT_ADVANCED(ITEM) {[_this select 0,_this select 1,call FUNC(getSelectedBodyPart),ITEM,'advanced'] call FUNC(handleTreatment)} +#define TREATMENT_BANDAGE(ITEM) {[_this select 0,_this select 1,call FUNC(getSelectedBodyPart),ITEM,'bandage'] call FUNC(handleTreatment)} +#define TREATMENT_MEDICATION(ITEM) {[_this select 0,_this select 1,call FUNC(getSelectedBodyPart),ITEM,'medication'] call FUNC(handleTreatment)} +#define TREATMENT_OTHER(ITEM) {[_this select 0,_this select 1,call FUNC(getSelectedBodyPart),ITEM,'other'] call FUNC(handleTreatment)} + +#define ADD_TREATMENT_AIRWAY(TITLE,TOOLTIP,ITEM) [TITLE,TOOLTIP,{[_this select 0,_this select 1,ITEM] call FUNC(hasEquipment)},TREATMENT_AIRWAY(ITEM),'airway'] call FUNC(addTreatmentOption) +#define ADD_TREATMENT_ADVANCED(TITLE,TOOLTIP,ITEM) [TITLE,TOOLTIP,{[_this select 0,_this select 1,ITEM] call FUNC(hasEquipment)},TREATMENT_ADVANCED(ITEM),'advanced'] call FUNC(addTreatmentOption) +#define ADD_TREATMENT_BANDAGE(TITLE,TOOLTIP,ITEM) [TITLE,TOOLTIP,{[_this select 0,_this select 1,ITEM] call FUNC(hasEquipment)},TREATMENT_BANDAGE(ITEM),'bandage'] call FUNC(addTreatmentOption) +#define ADD_TREATMENT_MEDICATION(TITLE,TOOLTIP,ITEM) [TITLE,TOOLTIP,{[_this select 0,_this select 1,ITEM] call FUNC(hasEquipment)},TREATMENT_MEDICATION(ITEM),'medication'] call FUNC(addTreatmentOption) +#define ADD_TREATMENT_OTHER(TITLE,TOOLTIP,ITEM) [TITLE,TOOLTIP,{[_this select 0,_this select 1,ITEM] call FUNC(hasEquipment)},TREATMENT_OTHER(ITEM),'other'] call FUNC(addTreatmentOption) diff --git a/addons/medical/sounds/heart_beats/fast_1.wav b/addons/medical/sounds/heart_beats/fast_1.wav new file mode 100644 index 0000000000..4ac1fe6c7d Binary files /dev/null and b/addons/medical/sounds/heart_beats/fast_1.wav differ diff --git a/addons/medical/sounds/heart_beats/fast_2.wav b/addons/medical/sounds/heart_beats/fast_2.wav new file mode 100644 index 0000000000..38bae9cb2a Binary files /dev/null and b/addons/medical/sounds/heart_beats/fast_2.wav differ diff --git a/addons/medical/sounds/heart_beats/fast_3.wav b/addons/medical/sounds/heart_beats/fast_3.wav new file mode 100644 index 0000000000..f600d30567 Binary files /dev/null and b/addons/medical/sounds/heart_beats/fast_3.wav differ diff --git a/addons/medical/sounds/heart_beats/norm_1.wav b/addons/medical/sounds/heart_beats/norm_1.wav new file mode 100644 index 0000000000..73ebe128d6 Binary files /dev/null and b/addons/medical/sounds/heart_beats/norm_1.wav differ diff --git a/addons/medical/sounds/heart_beats/norm_2.wav b/addons/medical/sounds/heart_beats/norm_2.wav new file mode 100644 index 0000000000..c46da91489 Binary files /dev/null and b/addons/medical/sounds/heart_beats/norm_2.wav differ diff --git a/addons/medical/sounds/heart_beats/slow_1.wav b/addons/medical/sounds/heart_beats/slow_1.wav new file mode 100644 index 0000000000..3cf199ba51 Binary files /dev/null and b/addons/medical/sounds/heart_beats/slow_1.wav differ diff --git a/addons/medical/sounds/heart_beats/slow_2.wav b/addons/medical/sounds/heart_beats/slow_2.wav new file mode 100644 index 0000000000..ba50746326 Binary files /dev/null and b/addons/medical/sounds/heart_beats/slow_2.wav differ diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml new file mode 100644 index 0000000000..f23f45c1fc --- /dev/null +++ b/addons/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 %2 + Тащить раненого %2 + Arrastrar a %2r + + + Carry + ÐеÑти + Cargar + + + Carry %2 + ÐеÑти раненого %2 + Cargar a %2 + + + Bodybag + Мешок Ð´Ð»Ñ Ñ‚Ñ€ÑƒÐ¿Ð¾Ð² + Bolsa para cadáveres + + + Put body in bodybag + ПомеÑтить труп в мешок + Meter cuerpo en la bolsa para cadáveres + + + Drop + Положить + Soltar + + + Drop %2 + Положить %2 + Soltar a %2 + + + Load in Vehicle + Погрузить в транÑпорт + Meter en vehículo + + + Load %2 + Погрузить раненого %2 + Cargar a %2 + + + Unload + Выгрузить + Descargar + + + Unload %2 + Выгрузить раненого %2 + Descargar a %2 + + + + + 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 bandage %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 airway + %1 проводит вам интубацию + %1 te está intubando + + + + diff --git a/addons/medical/ui/RscTitles.hpp b/addons/medical/ui/RscTitles.hpp new file mode 100644 index 0000000000..524a1c0ad3 --- /dev/null +++ b/addons/medical/ui/RscTitles.hpp @@ -0,0 +1,74 @@ +class Rsctitles { + class GVAR(ScreenEffectsBlack) { + duration = 10e10; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsBlack))), _this select 0)]); + + class controlsBackground { + class blackScreen: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\black_out.paa)); + colorText[] = {0.0, 0.0, 0.0, 0.0}; + idc = 11112; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; + class GVAR(ScreenEffectsBleeding) { + duration = 1; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsBleeding))), _this select 0)]); + + class controlsBackground { + class bleedingScreen: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\bleeding.paa)); + colorText[] = {0.9, 0.2, 0.2, 0.6}; + idc = 11113; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; + class GVAR(ScreenEffectsHit) { + duration = 1.1; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsHit))), _this select 0)]); + + class controlsBackground { + class effectHit: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\hit.paa)); + colorText[] = {0.7, 0.2, 0.2, 0.4}; + idc = 11113; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; + class GVAR(ScreenEffectsPain) { + duration = 1; + idd = 1111; + movingenable = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QUOTE(GVAR(ScreenEffectsPain))), _this select 0)]); + + class controlsBackground { + class painScreen: ACE_gui_backgroundBase { + text = QUOTE(PATHTOF(data\painScreen.paa)); + colorText[] = {1, 1, 1, 0.5}; + idc = 11115; + x = safezoneX; + y = safezoneY; + w = safezoneW; + h = safezoneH; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/medical/ui/define.hpp b/addons/medical/ui/define.hpp new file mode 100644 index 0000000000..3af837e4f1 --- /dev/null +++ b/addons/medical/ui/define.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\gui\UI\define.hpp" \ No newline at end of file diff --git a/addons/medical/ui/menu.hpp b/addons/medical/ui/menu.hpp new file mode 100644 index 0000000000..f65b5ab807 --- /dev/null +++ b/addons/medical/ui/menu.hpp @@ -0,0 +1,568 @@ +class GVAR(medicalMenu) { + idd = 314412; + movingEnable = true; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(gui,blurScreen); [_this select 0] call FUNC(onMenuOpen);); + onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(gui,blurScreen); [ARR_2(QUOTE(QGVAR(onMenuOpen)), 'onEachFrame')] call BIS_fnc_removeStackedEventHandler;); + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0)"; + }; + class CenterBackground: HeaderBackground { + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + h = "16 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(0,0,0,0.8)"; + colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + }; + class BottomBackground: CenterBackground { + y = "(18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2))"; + h = "9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"}; + text = ""; + }; + + class IconsBackGroundBar: ACE_gui_backgroundBase{ + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "3.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = QUOTE(PATHTOF(data\background_img.paa)); + colorText[] = {1, 1, 1, 0.0}; + }; + class CatagoryLeft: HeaderName { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 0.9}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; + text = $STR_ACE_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_ACE_UI_STATUS; + }; + class CatagoryRight: CatagoryCenter{ + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = $STR_ACE_UI_OVERVIEW; + }; + class Line: ACE_gui_backgroundBase { + idc = -1; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "37 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.03 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = "#(argb,8,8,3)color(1,1,1,0.5)"; + }; + + class iconImg1: ACE_gui_backgroundBase { + idc = 111; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + colorBackground[] = {0,0,0,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = QUOTE(PATHTOF(data\icons\triage_card_small.paa)); + }; + class iconImg2: iconImg1 { + idc = 112; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\examine_patient_small.paa)); + }; + class iconImg3: iconImg1 { + idc = 113; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)); + }; + class iconImg4: iconImg1 { + idc = 114; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\medication_small.paa)); + }; + class iconImg5: iconImg1 { + idc = 115; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\airway_management_small.paa)); + }; + class iconImg6: iconImg1 { + idc = 116; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\advanced_treatment_small.paa)); + }; + class iconImg7: iconImg1 { + idc = 117; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\icon_carry.paa)); + }; + class iconImg8: iconImg1 { + idc = 118; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + text = QUOTE(PATHTOF(data\icons\toggle_self_small.paa)); + }; + + + class BtnIconLeft1: ACE_gui_buttonBase { + idc = 11; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE(['triage'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft2: BtnIconLeft1 { + idc = 12; + x = "3 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['examine'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft3: BtnIconLeft1 { + idc = 13; + x = "4.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['bandage'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft4: BtnIconLeft1 { + idc = 14; + x = "6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['medication'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft5: BtnIconLeft1 { + idc = 15; + x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['airway'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft6: BtnIconLeft1 { + idc = 16; + x = "9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['advanced'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft7: BtnIconLeft1 { + idc = 17; + x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['drag'] call FUNC(handleUI_DisplayOptions);); + }; + class BtnIconLeft8: BtnIconLeft1 { + idc = 18; + x = "12 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(['toggle'] call FUNC(handleUI_DisplayOptions);); + }; + + class TriageCardList: ACE_gui_listBoxBase { + idc = 212; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.0}; + }; + + // Left side + class BtnMenu1: BtnIconLeft1 { + idc = 20; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + text = ""; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.9)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; + animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)"; + animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)"; + animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 1}; + color2[] = {0,0,0, 1}; + colorBackgroundFocused[] = {1,1,1,1}; + colorBackground[] = {1,1,1,1}; + colorbackground2[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorFocused[] = {0,0,0,1}; + periodFocus = 1; + periodOver = 1; + action = ""; + }; + class BtnMenu2: BtnMenu1 { + idc = 21; + y = "6.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu3: BtnMenu1 { + idc = 22; + y = "7.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu4: BtnMenu1 { + idc = 23; + y = "8.7 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text =""; + }; + class BtnMenu5: BtnMenu1 { + idc = 24; + y = "9.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu6: BtnMenu1 { + idc = 25; + y = "10.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu7: BtnMenu1 { + idc = 26; + y = "12 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + class BtnMenu8: BtnMenu1 { + idc = 27; + y = "13.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + text = ""; + }; + // center + + class bodyImgBackground: ACE_gui_backgroundBase { + idc = -1; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.73 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "12.33 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + colorBackground[] = {1,1,1,1}; + colorPicture[] = {1,1,1,1}; + colorText[] = {1,1,1,1}; + text = QUOTE(PATHTOF(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 = QUOTE(PATHTOF(data\body_head.paa)); + }; + + class bodyImgTorso: bodyImgHead { + idc = 51; + text = QUOTE(PATHTOF(data\body_torso.paa)); + }; + class bodyImgArms_l: bodyImgHead { + idc = 52; + text = QUOTE(PATHTOF(data\body_arm_left.paa)); + }; + class bodyImgArms_r: bodyImgHead { + idc = 53; + text = QUOTE(PATHTOF(data\body_arm_right.paa)); + }; + class bodyImgLegs_l: bodyImgHead { + idc = 54; + text = QUOTE(PATHTOF(data\body_leg_left.paa)); + }; + class bodyImgLegs_r: bodyImgHead { + idc = 55; + text = QUOTE(PATHTOF(data\body_leg_right.paa)); + }; + + + class selectHead: ACE_gui_buttonBase { + idc = 301; + x = "18.8 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "3.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.4 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE(GVAR(selectedBodyPart) = 'head'; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectTorso : selectHead { + idc = 302; + x = "18.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "2.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 'body'; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectLeftArm: selectHead{ + idc = 303; + x = "17.4 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.9 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "4.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 'hand_r'; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectRightArm: selectLeftArm{ + idc = 304; + x = "20.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(GVAR(selectedBodyPart) = 'hand_l'; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectLeftLeg :selectHead { + idc = 305; + x = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "1.1 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = QUOTE(GVAR(selectedBodyPart) = 'leg_r'; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + class selectRightLeg :selectLeftLeg { + idc = 306; + x = "19.6 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + action = QUOTE(GVAR(selectedBodyPart) = 'leg_l'; [GVAR(INTERACTION_TARGET)] call FUNC(updateUIInfo);); + }; + + + class TriageTextBottom: HeaderName { + idc = 2000; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {1, 1, 1.0, 1}; + colorBackground[] = {0,0.0,0.0,0.7}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = ""; + }; + + // Right side + class InjuryList: ACE_gui_listBoxBase { + idc = 213; + x = "25.66 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)"; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; + }; + // bottom + + class ActivityLogHeader: CatagoryLeft { + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "18.6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "18.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + colorText[] = {0.6, 0.7, 1.0, 1}; + colorBackground[] = {0,0,0,0}; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + text = $STR_ACE_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_ACE_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: ACE_gui_buttonBase { + idc = 2001; + x = "13.33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "16.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "12.33 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + style = ST_CENTER; + size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.4)"; + SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; + animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureOver = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.0)"; + animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.0)"; + action = QUOTE([] call FUNC(handleUI_dropDownTriageCard);); + }; + class selectTriageStatusNone: selectTriageStatus { + idc = 2002; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_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 = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),0)] call FUNC(setTriageStatus);); + }; + + class selectTriageStatusMinor: selectTriageStatus { + idc = 2003; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_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 = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),1)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusDelayed: selectTriageStatus { + idc = 2004; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_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 = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),2)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusImmediate: selectTriageStatus { + idc = 2005; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_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 = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),3)] call FUNC(setTriageStatus);); + }; + class selectTriageStatusDeceased: selectTriageStatus { + idc = 2006; + x = 0; + y = 0; + w = 0; + h = 0; + text = $STR_ACE_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 = QUOTE([] call FUNC(handleUI_dropDownTriageCard); [ARR_2(GVAR(INTERACTION_TARGET),4)] call FUNC(setTriageStatus);); + }; + }; +}; \ No newline at end of file diff --git a/addons/medical/variable_defines.sqf b/addons/medical/variable_defines.sqf new file mode 100644 index 0000000000..86ada8a01b --- /dev/null +++ b/addons/medical/variable_defines.sqf @@ -0,0 +1,60 @@ +// public variables +[QGVAR(openWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(bandagedWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(fractures),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(airway), 0, true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(tourniquets),[0,0,0,0,0,0],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(splints),[0,0,0,0,0,0],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(isBleeding),false,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(hasPain),false,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(hasLostBlood),false,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(airwayTreated),false,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +// Airway +[QGVAR(airwayOccluded), false, true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(airwayRespiratoryArrest), false, true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(airwayCollapsed), false, true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(airwayStatus), 100, false, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +// logs +[QGVAR(quickViewLog),[],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(activityLog),[],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(triageLevel),0,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(triageCard),[],true, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +[QGVAR(medicClass),0,true, QUOTE(ADDON),0,true] call EFUNC(common,defineVariable); // should be a persistent variable; must not be removed by a reset all defaults call +[QGVAR(isMedicalFacility),0,true, QUOTE(ADDON),0,true] call EFUNC(common,defineVariable); // should be a persistent variable; must not be removed by a reset all defaults call + +[QGVAR(noInstantDeath),false,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(inCardiacArrest),false,true, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +// private variables +[QGVAR(bloodVolume),100,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(bloodIVVolume),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(plasmaIVVolume),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(salineIVVolume),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +[QGVAR(amountOfPain),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(heartRate),80,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(andrenaline),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(heartRateAdjustments),[],false, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +[QGVAR(bloodPressure), [80,120],false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(peripheralResistance), 100,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(cardiacOutput), 5.25,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); // Source for default: http://en.wikipedia.org/wiki/Cardiac_output#Example_values + +[QGVAR(givenMorphine),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(givenAtropine),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(givenEpinephrine),0,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +[QGVAR(bodyPartStatus),[0,0,0,0,0,0],false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +[QGVAR(bodyPartStatusPrevious),[0,0,0,0,0,0],false, QUOTE(ADDON)] call EFUNC(common,defineVariable); + +[QGVAR(addedToUnitLoop),false,false, QUOTE(ADDON)] call EFUNC(common,defineVariable); +["ACE_reviveCounterValue", 0, false, QGVAR(ADDON)] call FUNC(defineVariable); +["ACE_inReviveState", false, true, QGVAR(ADDON)] call FUNC(defineVariable); +["ACE_isDead",false,true,QUOTE(ADDON)] call FUNC(defineVariable); +["ACE_isUnconscious",false,true,QUOTE(ADDON)] call FUNC(defineVariable); +["ACE_isDeadPlayer", false, true, QUOTE(ADDON)] call FUNC(defineVariable); + +GVAR(VarDefinesCompleted) = true; diff --git a/addons/missileguidance/README.md b/addons/missileguidance/README.md new file mode 100644 index 0000000000..bb8047bdf2 --- /dev/null +++ b/addons/missileguidance/README.md @@ -0,0 +1,12 @@ +ace_missileguidance +=================== + +Various new modes for different missiles. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [walterpearce](https://github.com/walterpearce) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/missileguidance/functions/fnc_fired.sqf b/addons/missileguidance/functions/fnc_fired.sqf index dd0cba4fb8..3b4f4b3635 100644 --- a/addons/missileguidance/functions/fnc_fired.sqf +++ b/addons/missileguidance/functions/fnc_fired.sqf @@ -5,7 +5,14 @@ TRACE_1("enter", _this); PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); if(!local _shooter) exitWith { false }; -if(_weapon == "missiles_DAGR") then { - //_this call FUNC(guidance_DAGR); - _this call FUNC(guidance_HellfireII); -}; \ No newline at end of file + +switch _weapon do { + case "missiles_DAGR": { + _this call FUNC(guidance_DAGR); + }; + case "GBU12BombLauncher": { + _this call FUNC(guidance_LGB); + }; +}; + +//_this call FUNC(guidance_HellfireII); diff --git a/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf b/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf index d7d56b7d88..e6551ad4f4 100644 --- a/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf +++ b/addons/missileguidance/functions/fnc_guidance_HellfireII.sqf @@ -1,4 +1,4 @@ -#define DEBUG_MODE_FULL +//#define DEBUG_MODE_FULL #include "script_component.hpp" FUNC(guidance_Hellfire_LOAL_HI_PFH) = { @@ -21,7 +21,7 @@ FUNC(guidance_Hellfire_LOAL_HI_PFH) = { _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; }; - _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace__laser_fnc_findLaserDesignator; + _targets = [_missile, ACE_DEFAULT_LASER_CODE, 70, _curVelocity] call ace_laser_fnc_findLaserDesignator; _addHeight = [0,0,0]; if((_targets select 0)) then { _target = _targets select 1; diff --git a/addons/movement/README.md b/addons/movement/README.md new file mode 100644 index 0000000000..658e4a357a --- /dev/null +++ b/addons/movement/README.md @@ -0,0 +1,12 @@ +ace_movement +============ + +Various tweaks to movement animations. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index edf1991006..54a94ad21f 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -17,3 +17,21 @@ }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; }] call EFUNC(common,addEventHandler); + +["ACE3", + localize "STR_ACE_Movement_Climb", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if (ACE_player != (vehicle ACE_player)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(climb); + true + }, + [47, [false, true, false]], //DIK_V + CTRL//STRG + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp index 7137d44469..e8661b748c 100644 --- a/addons/movement/config.cpp +++ b/addons/movement/config.cpp @@ -17,20 +17,8 @@ class CfgPatches { //#include "CfgInventoryGlobalVariable.hpp" #include "CfgMoves.hpp" -class ACE_Default_Keys { - class climb { - displayName = "$STR_ACE_Movement_Climb"; - condition = QUOTE(_player == _vehicle); - statement = QUOTE([_player] call FUNC(climb);); - key = 47; - shift = 0; - control = 1; - alt = 0; - }; -}; - class ACE_Options { - class useImperial { + class GVAR(useImperial) { displayName = "$STR_ACE_Movement_UseImperial"; default = 0; }; diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf index 8a2988f00f..3f09b82a15 100644 --- a/addons/movement/functions/fnc_climb.sqf +++ b/addons/movement/functions/fnc_climb.sqf @@ -9,12 +9,12 @@ if !([_unit] call FUNC(canClimb)) exitWith { [localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured); }; -if !(_unit getVariable ["ACE_isClimbInit", false]) then { +if !(_unit getVariable [QGVAR(isClimbInit), false]) then { _unit addEventHandler ["AnimDone", { if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)}; }]; - _unit setVariable ["ACE_isClimbInit", true]; + _unit setVariable [QGVAR(isClimbInit), true]; }; [_unit] call EFUNC(common,fixLoweredRifleAnimation); diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf index 9cbd7939bb..a52ed3cb12 100644 --- a/addons/movement/functions/fnc_getWeight.sqf +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -7,7 +7,7 @@ _unit = _this select 0; _weight = loadAbs _unit * 0.1; -if (profileNamespace getVariable ["ACE_useImperial", false]) then { +if (GETGVAR(useImperial, 0) == 1) then { _weight = format ["%1lb", (round (_weight * 100)) / 100]; } else { _weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100]; diff --git a/addons/nametags/README.md b/addons/nametags/README.md new file mode 100644 index 0000000000..b3ee538ce1 --- /dev/null +++ b/addons/nametags/README.md @@ -0,0 +1,12 @@ +ace_nametags +============ + +Adds nametags above other players to simulate the familiarity with the faces with others one would have in real life. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index a7c084a73e..c73ec08cfe 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -1,22 +1,42 @@ +// by commy2 and CAA-Picard #include "script_component.hpp" -// by commy2 and CAA-Picard if (!hasInterface) exitWith {}; -GVAR(ShowNamesTime) = -10; +// Add keybinds +["ACE3", + localize "STR_ACE_NameTags_ShowNames", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + + // Statement + GVAR(ShowNamesTime) = time; + if (call FUNC(canShow)) then{ call FUNC(doShow); }; + // Return false so it doesn't block other actions + false + }, + [29, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + + +// Draw handle addMissionEventHandler ["Draw3D", { - if !(profileNamespace getVariable ["ACE_showPlayerNames", true]) exitWith {}; + if (GVAR(showPlayerNames) == 0) exitWith {}; _player = ACE_player; - if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnCursor", true]) then { + if (GVAR(showPlayerNames) in [2,4]) then { //only on cursor _target = cursorTarget; _target = if (_target in allUnitsUAV) then {objNull} else {effectiveCommander _target}; if (!isNull _target && {side group _target == playerSide} && {_target != _player} && {isPlayer _target || {GVAR(ShowNamesForAI)}} && {!(_target getVariable ["ACE_hideName", false])}) then { _distance = _player distance _target; _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min 1) * GVAR(PlayerNamesMaxAlpha); - if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnKeyPress", false]) then { + if ((GVAR(showPlayerNames) in [3,4])) then { //only on keypress _alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1)); }; [_player, _target, _alpha, _distance * 0.026] call FUNC(drawNameTagIcon); @@ -44,7 +64,7 @@ addMissionEventHandler ["Draw3D", { _alpha = ((1 - 0.2 * (_distance - GVAR(PlayerNamesViewDistance))) min (1 - 0.15 * (_projDist * 5 - _distance - 3)) min 1) * GVAR(PlayerNamesMaxAlpha); - if (profileNamespace getVariable ["ACE_showPlayerNamesOnlyOnKeyPress", false]) then { + if ((GVAR(showPlayerNames) in [3,4])) then { //only on keypress _alpha = _alpha min (1 - (time - GVAR(ShowNamesTime) - 1)); }; diff --git a/addons/nametags/XEH_preInit.sqf b/addons/nametags/XEH_preInit.sqf index 940135dd47..14ecdc8a41 100644 --- a/addons/nametags/XEH_preInit.sqf +++ b/addons/nametags/XEH_preInit.sqf @@ -8,3 +8,5 @@ PREP(getVehicleData); PREP(moduleNameTags); PREP(onMouseZChanged); PREP(setText); + +GVAR(ShowNamesTime) = -10; diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index 04d083dc01..1846cd616e 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -15,37 +15,17 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" -class ACE_Default_Keys { - class showNames { - displayName = "$STR_ACE_NameTags_ShowNames"; - condition = "true"; - statement = QUOTE(GVAR(ShowNamesTime) = time; if (call FUNC(canShow)) then{ call FUNC(doShow); };); - key = 29; - shift = 0; - control = 0; - alt = 0; - allowHolding = 1; - }; -}; - class ACE_Options { - class showPlayerNames { + class GVAR(showPlayerNames) { displayName = "$STR_ACE_NameTags_ShowPlayerNames"; + values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; default = 1; }; - class showPlayerNamesOnlyOnCursor { - displayName = "$STR_ACE_NameTags_ShowPlayerNamesOnlyOnCursor"; - default = 1; - }; - class showPlayerNamesOnlyOnKeyPress { - displayName = "$STR_ACE_NameTags_ShowPlayerNamesOnlyOnKeyPress"; - default = 0; - }; - class showPlayerRanks { + class GVAR(showPlayerRanks) { displayName = "$STR_ACE_NameTags_ShowPlayerRanks"; default = 1; }; - class showVehicleCrewInfo { + class GVAR(showVehicleCrewInfo) { displayName = "$STR_ACE_CrewInfo_ShowVehicleCrewInfo"; default = 1; }; diff --git a/addons/nametags/functions/fnc_canShow.sqf b/addons/nametags/functions/fnc_canShow.sqf index 612baac2d3..8b61352def 100644 --- a/addons/nametags/functions/fnc_canShow.sqf +++ b/addons/nametags/functions/fnc_canShow.sqf @@ -22,6 +22,6 @@ _player = ACE_player; vehicle _player != _player && { (GVAR(CrewInfoVisibility) == 1) || - (GVAR(CrewInfoVisibility) != -1 && profileNamespace getVariable ["ACE_showVehicleCrewInfo", false]) + (GVAR(CrewInfoVisibility) != -1 && GVAR(showVehicleCrewInfo)) } && {!(vehicle _player isKindOf "ParachuteBase")}; diff --git a/addons/nametags/functions/fnc_drawNameTagIcon.sqf b/addons/nametags/functions/fnc_drawNameTagIcon.sqf index f2a8a1f946..af3932f118 100644 --- a/addons/nametags/functions/fnc_drawNameTagIcon.sqf +++ b/addons/nametags/functions/fnc_drawNameTagIcon.sqf @@ -47,7 +47,7 @@ _color = if !(group _target == group _player) then { _name = [_target, true] call EFUNC(common,getName); _rank = TEXTURES_RANKS select ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find rank _target) + 1); -_size = [0, 1] select (profileNamespace getVariable ["ACE_showPlayerRanks", true]); +_size = [0, 1] select GVAR(showPlayerRanks); drawIcon3D [ _rank, diff --git a/addons/nightvision/README.md b/addons/nightvision/README.md new file mode 100644 index 0000000000..469d83d942 --- /dev/null +++ b/addons/nightvision/README.md @@ -0,0 +1,12 @@ +ace_nightvision +=============== + +Adds different types of NVGs with different levels of quality. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [PabstMirror](https://github.com/PabstMirror) diff --git a/addons/noradio/README.md b/addons/noradio/README.md new file mode 100644 index 0000000000..95abf72b6f --- /dev/null +++ b/addons/noradio/README.md @@ -0,0 +1,12 @@ +ace_noradio +=========== + +Disables the automatic callouts for player units. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [bux578](https://github.com/bux578) diff --git a/addons/optionsmenu/$PBOPREFIX$ b/addons/optionsmenu/$PBOPREFIX$ new file mode 100644 index 0000000000..a5c0615815 --- /dev/null +++ b/addons/optionsmenu/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\optionsmenu \ No newline at end of file diff --git a/addons/optionsmenu/CfgEventHandlers.hpp b/addons/optionsmenu/CfgEventHandlers.hpp new file mode 100644 index 0000000000..88bfdf4e6b --- /dev/null +++ b/addons/optionsmenu/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/optionsmenu/README.md b/addons/optionsmenu/README.md new file mode 100644 index 0000000000..f8d8c54d09 --- /dev/null +++ b/addons/optionsmenu/README.md @@ -0,0 +1,12 @@ +ace_optionsmenu +=============== + +Adds the options menu used by other components. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [PabstMirror](https://github.com/PabstMirror) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/optionsmenu/XEH_postInit.sqf b/addons/optionsmenu/XEH_postInit.sqf new file mode 100644 index 0000000000..c0b61d87de --- /dev/null +++ b/addons/optionsmenu/XEH_postInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +//Add Settings from configFile +[] call FUNC(addFromConfig); diff --git a/addons/optionsmenu/XEH_preInit.sqf b/addons/optionsmenu/XEH_preInit.sqf new file mode 100644 index 0000000000..97df9410e6 --- /dev/null +++ b/addons/optionsmenu/XEH_preInit.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addClientSideColor); +PREP(addClientSideOptions); +PREP(addFromConfig); +PREP(loadFromProfile); +PREP(onListBoxSettingsChanged); +PREP(onListBoxShowSelectionChanged); +PREP(onSettingsMenuOpen); +PREP(onSliderPosChanged); +PREP(resetSettings); +PREP(saveToProfile); +PREP(settingsMenuUpdateKeyView); +PREP(settingsMenuUpdateList); +PREP(updateSetting); + +GVAR(clientSideOptions) = []; +GVAR(clientSideColors) = []; + +ADDON = true; diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp new file mode 100644 index 0000000000..51a614bb5a --- /dev/null +++ b/addons/optionsmenu/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Combat Space Enhancement"}; + authorUrl = "http://csemod.com"; + VERSION_CONFIG; + }; +}; + +class CfgAddons { + class PreloadAddons { + class ADDON { + list[] = {QUOTE(ADDON)}; + }; + }; +}; + + +#include "CfgEventHandlers.hpp" +#include "gui\define.hpp" +#include "gui\settingsMenu.hpp" +#include "gui\pauseMenu.hpp" \ No newline at end of file diff --git a/addons/optionsmenu/functions/fnc_addClientSideColor.sqf b/addons/optionsmenu/functions/fnc_addClientSideColor.sqf new file mode 100644 index 0000000000..ca0473cb89 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_addClientSideColor.sqf @@ -0,0 +1,19 @@ +/** + * fnc_addClientSideColor.sqf + * @Descr: N/A + * @Author: PabstMirror + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +private ["_currentValue"]; +PARAMS_4(_name,_localizedName,_localizedDescription,_defaultValue); + +GVAR(clientSideColors) pushBack [_name, _localizedName, _localizedDescription, [], _defaultValue]; + +//Get the current setting from profile (or default) and set it: +_currentValue = [MENU_TAB_COLORS, _name, _defaultValue] call FUNC(loadFromProfile); +[MENU_TAB_COLORS, _name, _currentValue] call FUNC(updateSetting); diff --git a/addons/optionsmenu/functions/fnc_addClientSideOptions.sqf b/addons/optionsmenu/functions/fnc_addClientSideOptions.sqf new file mode 100644 index 0000000000..4ad9584410 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_addClientSideOptions.sqf @@ -0,0 +1,19 @@ +/** + * fnc_addClientSideOptions.sqf + * @Descr: N/A + * @Author: Glowbal + * + * @Arguments: [] + * @Return: + * @PublicAPI: false + */ +#include "script_component.hpp" + +private ["_currentValue"]; +PARAMS_5(_name,_localizedName,_localizedDescription,_possibleValues,_defaultValue); + +GVAR(clientSideOptions) pushBack [_name, _localizedName, _localizedDescription, _possibleValues, -1, _defaultValue]; + +//Get the current setting from profile (or default) and set it: +_currentValue = [MENU_TAB_OPTIONS, _name, _defaultValue] call FUNC(loadFromProfile); +[MENU_TAB_OPTIONS, _name, _currentValue] call FUNC(updateSetting); diff --git a/addons/optionsmenu/functions/fnc_addFromConfig.sqf b/addons/optionsmenu/functions/fnc_addFromConfig.sqf new file mode 100644 index 0000000000..226b5dee73 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_addFromConfig.sqf @@ -0,0 +1,38 @@ +/** +* fnc_addFromConfig.sqf +* @Descr: N/A +* @Author: PabstMirror +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +if (isClass (configFile >> "ACE_Options")) then { + _countOptions = count (configFile >> "ACE_Options"); + for "_index" from 0 to (_countOptions - 1) do { + _optionEntry = (configFile >> "ACE_Options") select _index; + _name = configName _optionEntry; + _displayName = getText (_optionEntry >> "displayName"); + _description = getText (_optionEntry >> "description"); + _default = getNumber (_optionEntry >> "default"); + _choices = getArray (_optionEntry >> "values"); + if ((count _choices) == 0) then { + _choices = [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")]; + }; + [_name, _displayName, _description, _choices, _default] call FUNC(addClientSideOptions); + }; +}; + +if (isClass (configFile >> "ACE_Colors")) then { + _countOptions = count (configFile >> "ACE_Colors"); + for "_index" from 0 to (_countOptions - 1) do { + _optionEntry = (configFile >> "ACE_Colors") select _index; + _name = configName _optionEntry; + _displayName = getText (_optionEntry >> "displayName"); + _description = getText (_optionEntry >> "description"); + _default = getArray (_optionEntry >> "default"); + [_name, _displayName, _description, _default] call FUNC(addClientSideColor); + }; +}; diff --git a/addons/optionsmenu/functions/fnc_loadFromProfile.sqf b/addons/optionsmenu/functions/fnc_loadFromProfile.sqf new file mode 100644 index 0000000000..21819f1add --- /dev/null +++ b/addons/optionsmenu/functions/fnc_loadFromProfile.sqf @@ -0,0 +1,36 @@ +/** +* fnc_loadFromProfile.sqf +* @Descr: N/A +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_typeString", "_settingValue", "_badData"]; +PARAMS_3(_type,_name,_default); + +_typeString = ""; +switch (_type) do { +case (MENU_TAB_OPTIONS): {_typeString = "option";}; +case (MENU_TAB_COLORS): {_typeString = "color";}; +}; + +_settingValue = profileNamespace getvariable [(format ["ace_%1_%2", _typeString, _name]), _default]; + +_badData = isNil "_settingValue"; +if (!_badData) then { + switch (_type) do { + case (MENU_TAB_OPTIONS): {_badData = ((typeName _settingValue) != (typeName 0));}; + case (MENU_TAB_COLORS): {_badData = (((typeName _settingValue) != (typeName [])) || {(count _settingValue) != 4});}; + }; +}; +if (_badData) then { + _settingValue = _default; + systemChat format ["Bad Data in profile [ace_%1_%2] using default", _typeString, _name]; + ERROR("Bad Value in profile"); +}; + +_settingValue diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf new file mode 100644 index 0000000000..066bc76a8f --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -0,0 +1,27 @@ +/** +* fnc_onListBoxSettingsChanged.sqf +* @Descr: N/A +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_settingIndex", "_rightDropDownIndex"]; + +_settingIndex = lbCurSel 200; //Index of left list +_rightDropDownIndex = lbCurSel 400; //Index of right drop down + +if (_rightDropDownIndex < 0) then {_rightDropDownIndex = 0;}; + +switch (GVAR(optionMenu_openTab)) do { +case (MENU_TAB_OPTIONS): { + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideOptions)))) then { + _settingIndex = (GVAR(clientSideOptions) select _settingIndex) select 0; + [MENU_TAB_OPTIONS, _settingIndex, _rightDropDownIndex] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; +}; diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf new file mode 100644 index 0000000000..f4d41674bd --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -0,0 +1,55 @@ +/** +* fnc_onListBoxShowSelectionChanged.sqf +* @Descr: called when the listbox selection has changed. Updates configuration menu information +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_settingsMenu", "_localizedHeader"]; + +PARAMS_1(_openTab); +GVAR(optionMenu_openTab) = _openTab; + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; + +switch (GVAR(optionMenu_openTab)) do { +case (MENU_TAB_OPTIONS): { + _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabOptions")]; + ctrlSetText [13, _localizedHeader]; + lbClear 400; + + (_settingsMenu displayCtrl 301) ctrlShow true; + + (_settingsMenu displayCtrl 400) ctrlShow true; + (_settingsMenu displayCtrl 410) ctrlShow false; + (_settingsMenu displayCtrl 411) ctrlShow false; + (_settingsMenu displayCtrl 412) ctrlShow false; + (_settingsMenu displayCtrl 413) ctrlShow false; + }; +case (MENU_TAB_COLORS): { + _localizedHeader = format ["%1: %2", (localize "STR_ACE_OptionsMenu_OpenConfigMenu"), (localize "STR_ACE_OptionsMenu_TabColors")]; + ctrlSetText [13, _localizedHeader]; + + lbClear 400; + + (_settingsMenu displayCtrl 301) ctrlShow false; + + (_settingsMenu displayCtrl 400) ctrlShow false; + (_settingsMenu displayCtrl 410) ctrlShow true; + (_settingsMenu displayCtrl 411) ctrlShow true; + (_settingsMenu displayCtrl 412) ctrlShow true; + (_settingsMenu displayCtrl 413) ctrlShow true; + + (_settingsMenu displayCtrl 410) sliderSetRange [0, 255]; + (_settingsMenu displayCtrl 411) sliderSetRange [0, 255]; + (_settingsMenu displayCtrl 412) sliderSetRange [0, 255]; + (_settingsMenu displayCtrl 413) sliderSetRange [0, 255]; + }; +}; + +[true] call FUNC(settingsMenuUpdateList); diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf new file mode 100644 index 0000000000..11f5a3ef64 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -0,0 +1,13 @@ +/** +* fnc_onSettingsMenuOpen.sqf +* @Descr: called when the settings or configuration menu has opened. Do not use anywhere else. +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +//Delay a frame +[{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf new file mode 100644 index 0000000000..ac6f52469c --- /dev/null +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -0,0 +1,29 @@ +/** +* fnc_onSliderPosChanged.sqf +* @Descr: N/A +* @Author: PabstMirror +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_newColor", "_settingIndex"]; + +_newColor = []; +{ + _newColor pushBack ((sliderPosition _x) / 255); +} forEach [410, 411, 412, 413]; + +_settingIndex = lbCurSel 200; + +switch (GVAR(optionMenu_openTab)) do { +case (MENU_TAB_COLORS): { + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); + }; +}; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf new file mode 100644 index 0000000000..bdc5c7662a --- /dev/null +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -0,0 +1,30 @@ +/** +* fnc_resetSettings.sqf +* @Descr: +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: true +*/ +#include "script_component.hpp" + +private ["_name", "_default", "_lastSelected"]; + +{ + _name = _x select 0; + _default = _x select 5; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); +} forEach GVAR(clientSideOptions); + +{ + _name = _x select 0; + _default = _x select 4; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); +} forEach GVAR(clientSideColors); + +_lastSelected = lbCurSel 200; +[GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); +if (_lastSelected != -1) then { + lbSetCurSel [200, _lastSelected]; +}; diff --git a/addons/optionsmenu/functions/fnc_saveToProfile.sqf b/addons/optionsmenu/functions/fnc_saveToProfile.sqf new file mode 100644 index 0000000000..30db652186 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_saveToProfile.sqf @@ -0,0 +1,37 @@ +/** +* fnc_saveToProfile.sqf +* @Descr: Save the clientside option to the profile. +* @Author: Glowbal +* +* @Arguments: [name STRING (Name of setting)] +* @Return: BOOL True if saved. +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_nameSelected", "_saved"]; +PARAMS_2(_type,_name); + +_saved = false; +switch (_type) do { +case (MENU_TAB_OPTIONS): { + { + _nameSelected = _x select 0; + if (_nameSelected == _name) exitwith { + profileNamespace setvariable [(format ["ace_option_%1", _name]), (_x select 4)]; + _saved = true; + }; + }foreach GVAR(clientSideOptions); + }; +case (MENU_TAB_COLORS): { + { + _nameSelected = _x select 0; + if (_nameSelected == _name) exitwith { + profileNamespace setvariable [(format ["ace_color_%1", _name]), (_x select 3)]; + _saved = true; + }; + }foreach GVAR(clientSideColors); + }; +}; + +_saved diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf new file mode 100644 index 0000000000..09242bcb8c --- /dev/null +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -0,0 +1,65 @@ +/** +* fnc_settingsMenuUpdateKeyView.sqf +* @Descr: N/A +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; +disableSerialization; + +_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; +_ctrlList = _settingsMenu displayCtrl 200; + +_collection = switch (GVAR(optionMenu_openTab)) do { +case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; +case MENU_TAB_COLORS: {GVAR(clientSideColors)}; + default {[]}; +}; + +if (count _collection > 0) then { + _settingIndex = (lbCurSel _ctrlList); + if (_settingIndex > (count _collection)) then { + _settingIndex = count _collection - 1; + }; + + if (_settingIndex < 0) exitwith { + _settingIndex = 0; + }; + _setting = _collection select _settingIndex; + + _entryName = _setting select 0; + _localizedName = _setting select 1; + _localizedDescription = _setting select 2; + + if (_localizedName == "") then {_localizedName = _entryName;}; + (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; + (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; + (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + + switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_OPTIONS): { + _possibleValues = _setting select 3; + _settingsValue = _setting select 4; + lbClear 400; + { lbAdd [400, _x]; } foreach _possibleValues; + + (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + }; + case (MENU_TAB_COLORS): { + _currentColor = _setting select 3; + { + sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; + } forEach [410, 411, 412, 413]; + }; + }; +} else { //no settings in list: + lbClear 400; + (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; + (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; + (_settingsMenu displayCtrl 300) ctrlSetText _entryName; +}; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf new file mode 100644 index 0000000000..ff825a2141 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -0,0 +1,44 @@ +/** +* fnc_settingsMenuUpdateList.sqf +* @Descr: N/A +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: false +*/ +#include "script_component.hpp" + +private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; +DEFAULT_PARAM(0,_updateKeyView,true); + +disableSerialization; +_settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; +_ctrlList = _settingsMenu displayCtrl 200; + +lbclear _ctrlList; + +switch (GVAR(optionMenu_openTab)) do { +case (MENU_TAB_OPTIONS): { + { + _settingsText = ((_x select 3) select (_x select 4)); + _ctrlList lbadd (_x select 1); + _ctrlList lbadd (_settingsText); + }foreach GVAR(clientSideOptions); + }; +case (MENU_TAB_COLORS): { + { + _color = +(_x select 3); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _ctrlList lbadd (_x select 1); + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 3)]; + }foreach GVAR(clientSideColors); + }; +}; +if (_updateKeyView) then { + [] call FUNC(settingsMenuUpdateKeyView); +}; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf new file mode 100644 index 0000000000..403a09cdb2 --- /dev/null +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -0,0 +1,41 @@ +/** +* fnc_updateSetting.sqf +* @Descr: +* @Author: Glowbal +* +* @Arguments: [] +* @Return: +* @PublicAPI: true +*/ +#include "script_component.hpp" + +private ["_changed"]; +PARAMS_3(_type,_name,_newValue); + +_changed = false; + +switch (_type) do { +case (MENU_TAB_OPTIONS): { + { + if (((_x select 0) == _name) && {!((_x select 4) isEqualTo _newValue)}) then { + _changed = true; + _x set [4, _newValue]; + }; + } foreach GVAR(clientSideOptions); + }; +case (MENU_TAB_COLORS): { + { + if (((_x select 0) == _name) && {!((_x select 3) isEqualTo _newValue)}) then { + _changed = true; + _x set [3, _newValue]; + }; + } foreach GVAR(clientSideColors); + }; +}; + +if (_changed) then { + missionNameSpace setVariable [_name, _newValue]; + [_type, _name] call FUNC(saveToProfile); + ["SettingChanged", [_name, _newValue]] call EFUNC(common,localEvent); + TRACE_2("Variable Updated",_name,_newValue); +}; diff --git a/addons/optionsmenu/functions/script_component.hpp b/addons/optionsmenu/functions/script_component.hpp new file mode 100644 index 0000000000..dd11862f9d --- /dev/null +++ b/addons/optionsmenu/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\optionsmenu\script_component.hpp" \ No newline at end of file diff --git a/addons/optionsmenu/gui/define.hpp b/addons/optionsmenu/gui/define.hpp new file mode 100644 index 0000000000..cb4fe1b509 --- /dev/null +++ b/addons/optionsmenu/gui/define.hpp @@ -0,0 +1,94 @@ +// define.hpp + +class ACE_gui_backgroundBase; +class ACE_gui_editBase; +class ACE_gui_buttonBase; +class ACE_gui_staticBase; +class ACE_gui_listNBox; +class ACE_gui_comboBoxBase; +class RscXSliderH; + + +#ifndef ACE_DEFINE_H +#define ACE_DEFINE_H + +#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" + +#endif diff --git a/addons/common/MainMenu.hpp b/addons/optionsmenu/gui/pauseMenu.hpp similarity index 82% rename from addons/common/MainMenu.hpp rename to addons/optionsmenu/gui/pauseMenu.hpp index 1f1a1dc547..880f418a38 100644 --- a/addons/common/MainMenu.hpp +++ b/addons/optionsmenu/gui/pauseMenu.hpp @@ -1,5 +1,5 @@ -class ACE_Tile_Base { +class ACE_Open_SettingsMenu_BtnBase : ACE_gui_buttonBase { class Attributes { font = "PuristaMedium"; color = "#E5E5E5"; @@ -29,7 +29,6 @@ class ACE_Tile_Base { right = 0; bottom = 0; }; - action = QUOTE((findDisplay 49) closeDisplay 0; 0 spawn GVAR(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)"; @@ -61,7 +60,7 @@ class ACE_Tile_Base { 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"; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; textureNoShortcut = "#(argb,8,8,3)color(0,0,0,0)"; tooltip = ""; tooltipColorBox[] = {1,1,1,1}; @@ -69,35 +68,30 @@ class ACE_Tile_Base { 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)"; + y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY"; w = "15 * (((safezoneW / safezoneH) min 1.2) / 40)"; h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + action = "(findDisplay 49) closeDisplay 0; createDialog 'ACE_settingsMenu';"; }; 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 ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; }; }; class RscDisplayInterruptEditorPreview: RscStandardDisplay { class controls { - class ACE_Tile : ACE_Tile_Base {}; + class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; }; }; +class RscDisplayInterrupt: RscStandardDisplay { + class controls { + class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + }; +}; +class RscDisplayInterruptEditor3D: RscStandardDisplay { + class controls { + class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {}; + }; +}; \ No newline at end of file diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp new file mode 100644 index 0000000000..8d99a591d5 --- /dev/null +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -0,0 +1,234 @@ +class ACE_settingsMenu { + idd = 145246; + movingEnable = false; + onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); + onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); + + #define SIZEX ((0.70 * safezoneW) max 1.0) + #define SIZEY (SIZEX / 1.2) + #define UNITX (SIZEX / 40) + #define UNITY (SIZEY / 25) + #define OFFSETX (safezoneX + (safezoneW - SIZEX)/2) + #define OFFSETY (safezoneY + (safezoneH - (SIZEX / 1.2))/2) + + class controlsBackground { + class HeaderBackground: ACE_gui_backgroundBase { + idc = -1; + type = CT_STATIC; + x = 1 * UNITX + OFFSETX; + y = 1 * UNITY + OFFSETY; + w = 38 * UNITX; + h = 1 * UNITY; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = (UNITY * 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 * UNITY + OFFSETY; + h = 2.5 * UNITY; + 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 * UNITY + OFFSETY; + h = 17.4 * UNITY; + w = 25 * UNITX; + }; + class RightBackground: LeftBackground { + x = 26.1 * UNITX + OFFSETX; + w = 12.9 * UNITX; + }; + }; + + class controls { + class HeaderName { + idc = 1; + type = CT_STATIC; + x = 1 * UNITX + OFFSETX; + y = 1 * UNITY + OFFSETY; + w = 38 * UNITX; + h = 1 * UNITY; + style = ST_LEFT + ST_SHADOW; + font = "PuristaMedium"; + SizeEx = (UNITY * 1); + colorText[] = {0.95, 0.95, 0.95, 0.75}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_OptionsMenu_OpenConfigMenu"; + }; + class labelSubHeader: ACE_gui_staticBase { + idc = 13; + x = 2 * UNITX + OFFSETX; + y = 3.4 * UNITY + OFFSETY; + w = 30 * UNITX; + h = 1 * UNITY; + text = ""; + }; + class selectionAction_1: ACE_gui_buttonBase { + idc = 1000; + text = "$STR_ACE_OptionsMenu_TabOptions"; + x = 1 * UNITX + OFFSETX; + y = 2.1 * UNITY + OFFSETY; + w = 9.5 * UNITX; + h = 1 * UNITY; + 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 = QUOTE([MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged);); + }; + class selectionAction_2: selectionAction_1 { + idc = 1001; + text = "$STR_ACE_OptionsMenu_TabColors"; + x = 10.5 * UNITX + OFFSETX; + action = QUOTE([MENU_TAB_COLORS] call FUNC(onListBoxShowSelectionChanged);); + }; + class selectionAction_3: selectionAction_1 { + idc = 1002; + text = "---"; + x = 20 * UNITX + OFFSETX; + action = ""; + }; + class selectionAction_4: selectionAction_1 { + idc = 1003; + text = "---"; + x = 29.5 * UNITX + OFFSETX; + action = ""; + }; + class listBoxSettingsList: ACE_gui_listNBox { + idc = 200; + x = 2 * UNITX + OFFSETX; + y = 5.5 * UNITY + OFFSETY; + w = 23 * UNITX; + h = 15 * UNITY; + SizeEx = (UNITY * 0.7); + colorBackground[] = {0, 0, 0, 0.9}; + colorSelectBackground[] = {0, 0, 0, 0.9}; + columns[] = {0.0, 0.6}; + onLBSelChanged = QUOTE(_this call FUNC(settingsMenuUpdateKeyView)); + }; + class labelTitle: ACE_gui_staticBase { + idc = 250; + x = 27.1 * UNITX + OFFSETX; + y = 5.1 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 1 * UNITY; + text = ""; + SizeEx = (UNITY * 0.75); + }; + class labelKey: ACE_gui_staticBase { //Variable Name + idc = 300; + x = 27.1 * UNITX + OFFSETX; + y = 6.2 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 1 * UNITY; + text = ""; + SizeEx = (UNITY * 0.60); + }; + class Label2: labelKey { + idc = 301; + y = 7.3 * UNITY + OFFSETY; + text = "$STR_ACE_OptionsMenu_Setting"; + SizeEx = (UNITY * 0.75); + }; + class comboBox1: ACE_gui_comboBoxBase { + idc = 400; + x = 31.1 * UNITX + OFFSETX; + y = 7.3 * UNITY + OFFSETY; + w = 7 * UNITX; + h = 1 * UNITY; + onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); + SizeEx = (UNITY * 0.75); + }; + class sliderBar1: RscXSliderH { + idc = 410; + x = 27.1 * UNITX + OFFSETX; + y = 7.3 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 0.75 * UNITY; + onSliderPosChanged = QUOTE(_this call FUNC(onSliderPosChanged)); + color[] = {1,0,0,0.4}; + colorActive[] = {1,0,0,1}; + }; + class sliderBar2: sliderBar1 { + idc = 411; + y = 8.2 * UNITY + OFFSETY; + color[] = {0,1,0,0.4}; + colorActive[] = {0,1,0,1}; + }; + class sliderBar3: sliderBar1 { + idc = 412; + y = 9.1 * UNITY + OFFSETY; + color[] = {0,0,1,0.4}; + colorActive[] = {0,0,1,1}; + }; + class sliderBar4: sliderBar1 { + idc = 413; + y = 10 * UNITY + OFFSETY; + color[] = {1,1,1,0.4}; + colorActive[] = {1,1,1,1}; + }; + class labelDesc: ACE_gui_staticBase { + idc = 251; + x = 27.1 * UNITX + OFFSETX; + y = 11 * UNITY + OFFSETY; + w = 11 * UNITX; + h = 11 * UNITY; + text = ""; + style = ST_LEFT + ST_MULTI; + lineSpacing = 1; + SizeEx = (UNITY * 0.60); + }; + class actionClose: ACE_gui_buttonBase { + idc = 10; + text = "$STR_DISP_CLOSE"; + x = 1 * UNITX + OFFSETX; + y = 22.3 * UNITY + OFFSETY; + w = 6 * UNITX; + h = 1 * UNITY; + 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 action_animation: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_FixAnimation"; + x = 7.5 * UNITX + OFFSETX; + // action = "if ([player] call ACE_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call ACE_fnc_broadcastAnim; };"; + action = "hint 'todo???'"; + }; + class action_reset: actionClose { + idc = 1100; + text = "$STR_ACE_OptionsMenu_ResetAll"; + x = 14 * (SIZEX / 40) + OFFSETX; + action = QUOTE([] call FUNC(resetSettings)); + }; + }; +}; \ No newline at end of file diff --git a/addons/optionsmenu/script_component.hpp b/addons/optionsmenu/script_component.hpp new file mode 100644 index 0000000000..5120791b76 --- /dev/null +++ b/addons/optionsmenu/script_component.hpp @@ -0,0 +1,19 @@ +#define COMPONENT optionsmenu + +#define DEBUG_MODE_FULL + +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_OPTIONSMENU + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_OPTIONSMENU + #define DEBUG_SETTINGS DEBUG_SETTINGS_OPTIONSMENU +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define MENU_TAB_OPTIONS 0 +#define MENU_TAB_COLORS 1 + diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml new file mode 100644 index 0000000000..bb5744ab16 --- /dev/null +++ b/addons/optionsmenu/stringtable.xml @@ -0,0 +1,74 @@ + + + + + + ACE Options + ACE Optionen + Opciones ACE + Opcje ACE + ACE Nastavení + ACE Options + ACE ÐаÑтройки + Opções do ACE + ACE Opciók + Opzioni ACE + + + Fix Animation + + + Reset All + Rücksetzen + + + Colors + Farben + цвета + Colors + + + Options + Optionen + Opciones + Opcje + Nastavení + Options + ÐаÑтройки + Opções + Opciók + Opzioni + + + Yes + Ja + Si + Tak + Ano + Oui + Да + Igen + Sim + Si + + + No + Nein + No + Nie + Ne + Non + Ðет + Nem + Não + No + + + Setting: + Nastavení: + Einstellung: + YÑтановки: + Ajuste: + + + \ No newline at end of file diff --git a/addons/overheating/CfgEventHandlers.hpp b/addons/overheating/CfgEventHandlers.hpp index f5c0105711..f06e95788e 100644 --- a/addons/overheating/CfgEventHandlers.hpp +++ b/addons/overheating/CfgEventHandlers.hpp @@ -4,6 +4,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + class Extended_FiredBIS_EventHandlers { class CAManBase { class GVAR(Overheat) { diff --git a/addons/overheating/README.md b/addons/overheating/README.md new file mode 100644 index 0000000000..fa18f9dc20 --- /dev/null +++ b/addons/overheating/README.md @@ -0,0 +1,12 @@ +ace_overheating +=============== + +Introduces weapon overheating and jamming, as well as the ability to swap the barrel on some weapons. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf new file mode 100644 index 0000000000..6d0014c2a2 --- /dev/null +++ b/addons/overheating/XEH_postInit.sqf @@ -0,0 +1,25 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_Overheating_UnjamWeapon", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} + ) exitWith {false}; + + // Statement + [ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam); + true + }, + [19, [true, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/overheating/config.cpp b/addons/overheating/config.cpp index 2c7047718a..c3778862e6 100644 --- a/addons/overheating/config.cpp +++ b/addons/overheating/config.cpp @@ -14,18 +14,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" -class ACE_Default_Keys { - class clearJam { - displayName = "$STR_ACE_Overheating_UnjamWeapon"; - condition = QUOTE( [_player] call EFUNC(common,canUseWeapon) && {currentWeapon _player in (_player getVariable [ARR_2(QUOTE(QGVAR(jammedWeapons)), [])])} ); - statement = QUOTE( [ARR_3(_player, currentMuzzle _player, false)] call FUNC(clearJam); ); - key = 19; - shift = 1; - control = 0; - alt = 0; - }; -}; - #include "CfgSounds.hpp" #include "CfgVehicles.hpp" diff --git a/addons/protection/$PBOPREFIX$ b/addons/protection/$PBOPREFIX$ new file mode 100644 index 0000000000..7ba9736ebe --- /dev/null +++ b/addons/protection/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\protection \ No newline at end of file diff --git a/addons/protection/CfgVehicles.hpp b/addons/protection/CfgVehicles.hpp new file mode 100644 index 0000000000..bce583e2ec --- /dev/null +++ b/addons/protection/CfgVehicles.hpp @@ -0,0 +1,5 @@ + +class CfgVehicles { + #include + #include +}; diff --git a/addons/protection/CfgWeapons.hpp b/addons/protection/CfgWeapons.hpp new file mode 100644 index 0000000000..3f706fed41 --- /dev/null +++ b/addons/protection/CfgWeapons.hpp @@ -0,0 +1,4 @@ + +class CfgWeapons { + #include +}; diff --git a/addons/ballistics/FixHelmets.hpp b/addons/protection/FixHelmets.hpp similarity index 100% rename from addons/ballistics/FixHelmets.hpp rename to addons/protection/FixHelmets.hpp diff --git a/addons/ballistics/FixUniforms.hpp b/addons/protection/FixUniforms.hpp similarity index 100% rename from addons/ballistics/FixUniforms.hpp rename to addons/protection/FixUniforms.hpp diff --git a/addons/ballistics/FixVests.hpp b/addons/protection/FixVests.hpp similarity index 99% rename from addons/ballistics/FixVests.hpp rename to addons/protection/FixVests.hpp index 5bfcfd4669..19e5d777d6 100644 --- a/addons/ballistics/FixVests.hpp +++ b/addons/protection/FixVests.hpp @@ -1,5 +1,7 @@ +class ItemCore; class VestItem; + class Vest_Camo_Base: ItemCore { class ItemInfo: VestItem { /*containerClass = "Supply0"; diff --git a/addons/protection/README.md b/addons/protection/README.md new file mode 100644 index 0000000000..a6def1a1bc --- /dev/null +++ b/addons/protection/README.md @@ -0,0 +1,12 @@ +ace_protection +============== + +Fixes and tweaks the protection values of body armour. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/protection/config.cpp b/addons/protection/config.cpp new file mode 100644 index 0000000000..bb4ef3f739 --- /dev/null +++ b/addons/protection/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2"; + VERSION_CONFIG; + }; +}; + +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/protection/script_component.hpp b/addons/protection/script_component.hpp new file mode 100644 index 0000000000..1b2774a8ef --- /dev/null +++ b/addons/protection/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT protection +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_PROTECTION + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_PROTECTION + #define DEBUG_SETTINGS DEBUG_ENABLED_PROTECTION +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/ragdolls/README.md b/addons/ragdolls/README.md new file mode 100644 index 0000000000..b90ba9e5c9 --- /dev/null +++ b/addons/ragdolls/README.md @@ -0,0 +1,12 @@ +ace_ragdolls +============ + +Tweaks the ragdoll behaviour to be more resposive to bullet impacts and explosions. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/realisticnames/README.md b/addons/realisticnames/README.md new file mode 100644 index 0000000000..145ec16a61 --- /dev/null +++ b/addons/realisticnames/README.md @@ -0,0 +1,12 @@ +ace_realisticnames +================== + +Changes the names of various weapons and vehicles to those of their RL counterparts. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/recoil/README.md b/addons/recoil/README.md new file mode 100644 index 0000000000..124f1a25ce --- /dev/null +++ b/addons/recoil/README.md @@ -0,0 +1,12 @@ +ace_recoil +========== + +Overhauls the vanilla recoil, reducing muzzle climb while increasing kickback. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/reload/CfgEventHandlers.hpp b/addons/reload/CfgEventHandlers.hpp index 051db27dda..8de6a01f06 100644 --- a/addons/reload/CfgEventHandlers.hpp +++ b/addons/reload/CfgEventHandlers.hpp @@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + class Extended_Take_EventHandlers { class CAManBase { class ACE_AmmoIndicatorReload { diff --git a/addons/reload/README.md b/addons/reload/README.md new file mode 100644 index 0000000000..6eca14fdd7 --- /dev/null +++ b/addons/reload/README.md @@ -0,0 +1,12 @@ +ace_reload +========== + +Hides the default reload indicators, making it necessary to manually check your magazine. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf new file mode 100644 index 0000000000..d40e5e0442 --- /dev/null +++ b/addons/reload/XEH_postInit.sqf @@ -0,0 +1,24 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_Reload_checkAmmo", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) || + {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, false] call FUNC(checkAmmo); + true + }, + [19, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/reload/config.cpp b/addons/reload/config.cpp index 2d6c933742..6e0c14049d 100644 --- a/addons/reload/config.cpp +++ b/addons/reload/config.cpp @@ -13,18 +13,7 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" + #include "CfgActions.hpp" -class ACE_Default_Keys { - class checkAmmo { - displayName = "$STR_ACE_Reload_checkAmmo"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon) || {_vehicle isKindOf 'StaticWeapon'}); - statement = QUOTE([ARR_3(_player, _vehicle, false)] call FUNC(checkAmmo);); - key = 19; - shift = 0; - control = 1; - alt = 0; - }; -}; - #include "RscInGameUI.hpp" diff --git a/addons/respawn/README.md b/addons/respawn/README.md new file mode 100644 index 0000000000..1a9bcfe49f --- /dev/null +++ b/addons/respawn/README.md @@ -0,0 +1,12 @@ +ace_respawn +=========== + +Various module options to help mission makers to quickly set up various respawn configurations. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [bux578](https://github.com/bux578) diff --git a/addons/resting/CfgEventHandlers.hpp b/addons/resting/CfgEventHandlers.hpp index f0a9f14d91..beb3c4d419 100644 --- a/addons/resting/CfgEventHandlers.hpp +++ b/addons/resting/CfgEventHandlers.hpp @@ -4,3 +4,9 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; diff --git a/addons/resting/README.md b/addons/resting/README.md new file mode 100644 index 0000000000..477ced17b5 --- /dev/null +++ b/addons/resting/README.md @@ -0,0 +1,12 @@ +ace_resting +=========== + +Introduces weapon resting and bipod deployment, allowing the player to increase the stability of his weapon. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf new file mode 100644 index 0000000000..0d999bab86 --- /dev/null +++ b/addons/resting/XEH_postInit.sqf @@ -0,0 +1,27 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_Resting_RestWeapon", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon) && + {inputAction 'reloadMagazine' == 0} && + {!weaponLowered ACE_player} && + {speed ACE_player < 1}) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon); + // Return false so it doesn't block other actions + false + }, + [15, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/resting/config.cpp b/addons/resting/config.cpp index dafa7e5b87..ac710c82a8 100644 --- a/addons/resting/config.cpp +++ b/addons/resting/config.cpp @@ -14,18 +14,6 @@ class CfgPatches { #include "CfgEventHandlers.hpp" -class ACE_Default_Keys { - class restWeapon { - displayName = "$STR_ACE_Resting_RestWeapon"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon) && {inputAction 'reloadMagazine' == 0} && {!weaponLowered _player} && {speed _player < 1}); - statement = QUOTE([ARR_3(_player, _vehicle, currentWeapon _player)] call FUNC(restWeapon)); - key = 15; - shift = 0; - control = 0; - alt = 0; - }; -}; - #include "CfgWeapons.hpp" #include "CfgMoves.hpp" diff --git a/addons/safemode/README.md b/addons/safemode/README.md new file mode 100644 index 0000000000..9c0632f7be --- /dev/null +++ b/addons/safemode/README.md @@ -0,0 +1,12 @@ +ace_safemode +============ + +Adds the ability to use the safety on small arms. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 94e6b789bd..8ae1155d53 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -1,5 +1,25 @@ - -// by commy2 +// by CAA-Picard +#include "script_component.hpp" //["Soldier", {_player = ACE_player; if (currentWeapon _player in (_player getVariable [QGVAR(safedWeapons), []])) then {[false] call FUNC(setSafeModeVisual)}] call EFUNC(common,addInfoDisplayEventHandler); //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" + + +// Add keybinds +["ACE3", + localize "STR_ACE_SafeMode_SafeMode", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, currentWeapon ACE_player, currentMuzzle ACE_player] call FUNC(lockSafety); + true + }, + [41, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/safemode/config.cpp b/addons/safemode/config.cpp index d61a386e20..8371e7f35f 100644 --- a/addons/safemode/config.cpp +++ b/addons/safemode/config.cpp @@ -13,16 +13,3 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class ACE_Default_Keys { - class safeWeapon { - displayName = "$STR_ACE_SafeMode_SafeMode"; - condition = QUOTE([_player] call EFUNC(common,canUseWeapon)); - statement = QUOTE([ARR_3(_player, currentWeapon _player, currentMuzzle _player)] call FUNC(lockSafety)); - exceptions[] = {"ACE_interaction_isNotEscorting"}; - key = 41; - shift = 0; - control = 1; - alt = 0; - }; -}; diff --git a/addons/scopes/README.md b/addons/scopes/README.md new file mode 100644 index 0000000000..9ef4c8fa63 --- /dev/null +++ b/addons/scopes/README.md @@ -0,0 +1,13 @@ +ace_scopes +========== + +Adds adjustable turrets for long-range optics, allowing zeroing in steps of 0.1 MILs. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) +- [bux578](https://github.com/bux578) diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp index daa028ab88..79de7e8214 100644 --- a/addons/scopes/RscTitles.hpp +++ b/addons/scopes/RscTitles.hpp @@ -1,10 +1,10 @@ class RscTitles { - class ACE_Scope_Zeroing { + class ACE_Scopes_Zeroing { idd = -1; movingEnable = 0; enableSimulation = 1; enableDisplay = 1; - onLoad = QUOTE(_this spawn compile preprocessFileLineNumbers 'z\ace\scopes\scripts\zeroingOnLoad.sqf'; uiNamespace setVariable [ARR_2('ACE_Scopes_Debug', _this)];); + onLoad = QUOTE(_this spawn compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(scripts\zeroingOnLoad.sqf))); uiNamespace setVariable [ARR_2('ACE_Scopes_Debug', _this)];); duration = 1e+011; fadein = 0; fadeout = 0; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index e93c7ef3dc..b7fd4bfc3a 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -1,42 +1,115 @@ /* - * Author: KoffeinFlummi + * Author: KoffeinFlummi and CAA-Picard * - * Initializes vars needed for scope adjustment and watches for scope changes. + * Watches for scope changes. + * Defines key bindings * - * Arguments: - * None - * - * Return Value: - * None */ - #include "script_component.hpp" -GVAR(fadeScript) = scriptNull; +if !(hasInterface) exitWith {}; // show overlay after changing weapon/optic 0 spawn { - _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; - while {True} do { - waitUntil {[ACE_player, 0,0] call FUNC(canAdjustScope)}; - _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; - sleep 3; - _layer cutFadeOut 2; + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + while {True} do { + waitUntil {[ACE_player, 0,0] call FUNC(canAdjustScope)}; + _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; + sleep 3; + _layer cutFadeOut 2; - _weapon = currentWeapon ACE_player; - _optics = [ACE_player] call FUNC(getOptics); - waitUntil {sleep 0.05; !(_optics isEqualTo ([ACE_player] call FUNC(getOptics))) or (currentWeapon ACE_player != _weapon)}; - }; + _weapon = currentWeapon ACE_player; + _optics = [ACE_player] call FUNC(getOptics); + waitUntil {sleep 0.05; !(_optics isEqualTo ([ACE_player] call FUNC(getOptics))) or (currentWeapon ACE_player != _weapon)}; + }; }; // instantly hide when scoping in 0 spawn { - _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; - while {True} do { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + while {True} do { waitUntil {sleep 0.05; cameraView == "GUNNER"}; if !(isNull GVAR(fadeScript)) then { - terminate GVAR(fadeScript); + terminate GVAR(fadeScript); + }; + _layer cutText ["", "PLAIN", 0]; }; - _layer cutText ["", "PLAIN", 0]; - }; }; + + +// Add keybinds +["ACE3", + localize "STR_ACE_Scopes_AdjustUp", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, 0, 0.1] call FUNC(adjustScope); + true + }, + [201, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Scopes_AdjustDown", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, 0, -0.1] call FUNC(adjustScope); + true + }, + [209, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Scopes_AdjustLeft", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, -0.1, 0] call FUNC(adjustScope); + true + }, + [209, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Scopes_AdjustRight", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + [ACE_player] call FUNC(inventoryCheck); + if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; + + // Statement + [ACE_player, 0.1, 0] call FUNC(adjustScope); + true + }, + [201, [false, true, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/scopes/XEH_preInit.sqf b/addons/scopes/XEH_preInit.sqf index 7cd5d3ca1a..cc83dd6332 100644 --- a/addons/scopes/XEH_preInit.sqf +++ b/addons/scopes/XEH_preInit.sqf @@ -6,3 +6,5 @@ PREP(firedEH); PREP(getOptics); PREP(hideZeroing); PREP(inventoryCheck); + +GVAR(fadeScript) = scriptNull; diff --git a/addons/scopes/config.cpp b/addons/scopes/config.cpp index 7592ef06e9..9d2ddbeacb 100644 --- a/addons/scopes/config.cpp +++ b/addons/scopes/config.cpp @@ -13,39 +13,9 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" + #include "CfgSounds.hpp" + #include "CfgWeapons.hpp" -class ACE_Default_Keys { - class adjustScopeUp { - displayName = "$STR_ACE_Scopes_AdjustUp"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, 0, 0.1)] call FUNC(canAdjustScope);); - statement = QUOTE([ARR_3(_player, 0, 0.1)] call FUNC(adjustScope);); - allowHolding = 1; - key = 201; - shift = 0; - control = 0; - alt = 0; - }; - class adjustScopeDown: adjustScopeUp { - displayName = "$STR_ACE_Scopes_AdjustDown"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, 0, -0.1)] call FUNC(canAdjustScope);); - statement = QUOTE([ARR_3(_player, 0, -0.1)] call FUNC(adjustScope);); - key = 209; - }; - class adjustScopeLeft: adjustScopeUp { - displayName = "$STR_ACE_Scopes_AdjustLeft"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, -0.1, 0)] call FUNC(canAdjustScope);); - statement = QUOTE([ARR_3(_player, -0.1, 0)] call FUNC(adjustScope);); - key = 209; - control = 1; - }; - class adjustScopeRight: adjustScopeLeft { - displayName = "$STR_ACE_Scopes_AdjustRight"; - condition = QUOTE([_player] call FUNC(inventoryCheck); [ARR_3(_player, 0.1, 0)] call FUNC(canAdjustScope);); - statement = QUOTE([ARR_3(_player, 0.1, 0)] call FUNC(adjustScope);); - key = 201; - }; -}; - #include "RscTitles.hpp" diff --git a/addons/scopes/functions/fnc_canAdjustScope.sqf b/addons/scopes/functions/fnc_canAdjustScope.sqf index 883c14bb76..8aea2ff9e4 100644 --- a/addons/scopes/functions/fnc_canAdjustScope.sqf +++ b/addons/scopes/functions/fnc_canAdjustScope.sqf @@ -29,7 +29,7 @@ if (isNil QGVAR(Adjustment)) then { GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; }; -if (isNil "AGM_Scopes_Optics") then { +if (isNil QGVAR(Optics)) then { GVAR(Optics) = ["", "", ""]; }; diff --git a/addons/scopes/scripts/script_component.hpp b/addons/scopes/scripts/script_component.hpp new file mode 100644 index 0000000000..acca51b4b5 --- /dev/null +++ b/addons/scopes/scripts/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\scopes\script_component.hpp" diff --git a/addons/scopes/scripts/zeroingOnLoad.sqf b/addons/scopes/scripts/zeroingOnLoad.sqf index c78d5785f3..591b5fc07b 100644 --- a/addons/scopes/scripts/zeroingOnLoad.sqf +++ b/addons/scopes/scripts/zeroingOnLoad.sqf @@ -1,7 +1,9 @@ +#include "script_component.hpp" + disableSerialization; _display = _this select 0; -uiNamespace setVariable ["ACE_Scopes_ZeroingDisplay", _display]; +uiNamespace setVariable [QGVAR(ZeroingDisplay, _display]; _vertical = _display displayCtrl 925002; _horizontal = _display displayCtrl 925003; @@ -11,8 +13,8 @@ _weapons = [ handgunWeapon player ]; -if ((currentWeapon player) in _weapons) then { - _zeroing = ACE_Scopes_Adjustment select (_weapons find (currentWeapon player)); +if ((currentWeapon ACE_player) in _weapons) then { + _zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon ACE_player)); _horizontal ctrlSetText (str (_zeroing select 0)); _vertical ctrlSetText (str (_zeroing select 1)); }; diff --git a/addons/scopes/sounds/agm_scopes_click.wav b/addons/scopes/sounds/ace_scopes_click.wav similarity index 100% rename from addons/scopes/sounds/agm_scopes_click.wav rename to addons/scopes/sounds/ace_scopes_click.wav diff --git a/addons/smallarms/README.md b/addons/smallarms/README.md new file mode 100644 index 0000000000..0a62e1dbcc --- /dev/null +++ b/addons/smallarms/README.md @@ -0,0 +1,12 @@ +ace_smallarms +============= + +Tweaks various config values for small arms, improving values like ROF. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/switchunits/README.md b/addons/switchunits/README.md new file mode 100644 index 0000000000..029dfc7cf9 --- /dev/null +++ b/addons/switchunits/README.md @@ -0,0 +1,12 @@ +ace_switchunits +=============== + +Adds insurgency-style unit switching. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [bux578](https://github.com/bux578) +- [commy2](https://github.com/commy2) diff --git a/addons/switchunits/XEH_preInit.sqf b/addons/switchunits/XEH_preInit.sqf index 7443b79565..04e81330cb 100644 --- a/addons/switchunits/XEH_preInit.sqf +++ b/addons/switchunits/XEH_preInit.sqf @@ -1,5 +1,7 @@ #include "script_component.hpp" +ADDON = false; + PREP(addMapFunction); PREP(handleMapClick); PREP(initPlayer); @@ -9,3 +11,5 @@ PREP(module); PREP(nearestPlayers); PREP(switchBack); PREP(switchUnit); + +ADDON = true; diff --git a/addons/switchunits/functions/fnc_addMapFunction.sqf b/addons/switchunits/functions/fnc_addMapFunction.sqf index 2b7c3035c7..1c4e158d80 100644 --- a/addons/switchunits/functions/fnc_addMapFunction.sqf +++ b/addons/switchunits/functions/fnc_addMapFunction.sqf @@ -9,7 +9,7 @@ Parameters: 0: OBJECT - unit - 1: ARRAY - sided + 1: ARRAY - sides Returns: VOID @@ -17,9 +17,14 @@ #include "script_component.hpp" -private ["_unit"]; +private ["_unit", "_sides"]; _unit = _this select 0; +_sides = _this select 1; ["theMapClick", "onMapSingleClick", { - [_this, _pos, _shift, _alt] call FUNC(handleMapClick); + + if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then { + [_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 index 1c45d32d31..bce28963da 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -9,7 +9,7 @@ Parameters: 0: OBJECT - MapClickEventHandlerArgs - 0: OBJECT - unit to switch to + 0: OBJECT - unit // useless 1: ARRAY - sides Returns: @@ -18,9 +18,11 @@ #include "script_component.hpp" -private ["_args", "_currentPlayerUnit", "_sides", "_pos", "_sideNearest"]; +private ["_sides", "_pos", "_sideNearest"]; + +// that's wrong +//_currentPlayerUnit = (_this select 0) select 0; -_currentPlayerUnit = (_this select 0) select 0; _sides = (_this select 0) select 1; _pos = _this select 1; @@ -37,7 +39,7 @@ if (count _sideNearest > 0) then { private ["_switchUnit"]; _switchUnit = _sideNearest select 0; - [_currentPlayerUnit, _switchUnit] call FUNC(switchUnit); + [ACE_player, _switchUnit] call FUNC(switchUnit); openMap false; }; diff --git a/addons/switchunits/functions/fnc_markAiOnMap.sqf b/addons/switchunits/functions/fnc_markAiOnMap.sqf index dcf227f955..e54673c1a5 100644 --- a/addons/switchunits/functions/fnc_markAiOnMap.sqf +++ b/addons/switchunits/functions/fnc_markAiOnMap.sqf @@ -22,45 +22,48 @@ _sidesToShow = _this select 0; _sidesToShow spawn { - private ["_sides", "_allMarkerNames"]; - _sides = _this; - _allMarkerNames = []; + private ["_sides", "_allMarkerNames"]; + _sides = _this; + _allMarkerNames = []; - while { true } do { - sleep 1.5; + while { true } do { + sleep 1.5; - // delete markers - { - deleteMarkerLocal _x; - } forEach _allMarkerNames; + // 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"]; + if (alive ACE_player && {GVAR(OriginalUnit) getVariable ["ACE_CanSwitchUnits", false]}) then { - //_markerName = format ["%1", [_x] call EFUNC(common,getName)]; - _markerName = str _x; + // create markers + { + if (([_x] call FUNC(isValidAi) && (side group _x in _sides)) || (_x getVariable [QGVAR(IsPlayerControlled), false])) then { + private ["_markerName", "_marker", "_markerColor"]; - _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")); + //_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; }; - - _allMarkerNames pushBack _markerName; - }; - } forEach allUnits; - }; + }; }; diff --git a/addons/thermals/README.md b/addons/thermals/README.md new file mode 100644 index 0000000000..edec645164 --- /dev/null +++ b/addons/thermals/README.md @@ -0,0 +1,12 @@ +ace_thermals +============ + +Improves the thermal properties of humans. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/vector/CfgVehicles.hpp b/addons/vector/CfgVehicles.hpp index 1305e73f88..e9fd8945de 100644 --- a/addons/vector/CfgVehicles.hpp +++ b/addons/vector/CfgVehicles.hpp @@ -1,7 +1,7 @@ #define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \ - weapon = #WEAPON; \ - count = COUNT; \ + weapon = #WEAPON; \ + count = COUNT; \ } class CfgVehicles { diff --git a/addons/vector/README.md b/addons/vector/README.md new file mode 100644 index 0000000000..8907a78e49 --- /dev/null +++ b/addons/vector/README.md @@ -0,0 +1,12 @@ +ace_vector +========== + +Adds the Vector rangefinder including all modes found in its real counterpart. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/vector/RscInGameUI.hpp b/addons/vector/RscInGameUI.hpp index dea9d98419..9be7f1ea1c 100644 --- a/addons/vector/RscInGameUI.hpp +++ b/addons/vector/RscInGameUI.hpp @@ -4,162 +4,162 @@ class RscPicture; //class ScrollBar; class RscControlsGroup { - class VScrollbar;//: ScrollBar {}; - class HScrollbar;//: ScrollBar {}; + class VScrollbar;//: ScrollBar {}; + class HScrollbar;//: ScrollBar {}; }; class RscInGameUI { - class RscUnitInfo; - class ACE_RscOptics_vector: RscUnitInfo { - onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgVector', _this select 0];"; - onUnload = "[""onUnload"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; - idd = 300; - controls[] = {"CA_Distance","CA_Heading","CA_OpticsPitch","CA_Elev","CA_OpticsZoom","CA_VisionMode","ACE_ScriptedDisplayControlsGroup"}; + class RscUnitInfo; + class ACE_RscOptics_vector: RscUnitInfo { + onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgVector', _this select 0];"; + onUnload = "[""onUnload"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf"""; + idd = 300; + controls[] = {"CA_Distance","CA_Heading","CA_OpticsPitch","CA_Elev","CA_OpticsZoom","CA_VisionMode","ACE_ScriptedDisplayControlsGroup"}; - class CA_Distance: RscText { - idc = 151; // distance - w = 0; - h = 0; + class CA_Distance: RscText { + idc = 151; // distance + w = 0; + h = 0; + }; + + class CA_Heading: RscText { + idc = 156; // azimuth + w = 0; + h = 0; + }; + + class CA_OpticsPitch: RscText { + idc = 182; // inclination + w = 0; + h = 0; + }; + + class CA_Elev: RscText { + idc = 175; // inclination, more accurate + w = 0; + h = 0; + }; + + class CA_OpticsZoom: RscText { + idc = 180; // some kind of zoom + w = 0; + h = 0; + }; + + class CA_VisionMode: RscText { + idc = 179; // ??? + w = 0; + h = 0; + }; + + class ACE_ScriptedDisplayControlsGroup: RscControlsGroup { + idc = 170; + x = "SafezoneX"; + y = "SafezoneY"; + w = "SafezoneW"; + h = "SafezoneH"; + + class VScrollbar: VScrollbar { + width = 0; + }; + + class HScrollbar: HScrollbar { + height = 0; + }; + + class controls { + class Center: RscPicture { + idc = 1301; + text = ""; + colorText[] = {1,0,0,0.5}; + x = 0.488 * safezoneW /*+ safezoneX*/; + y = 0.4783 * safezoneH /*+ safezoneY*/; + w = 0.4 / 16 * safezoneW; + h = 0.4 / 9 * safezoneH; + }; + + class Crosshair: Center { + idc = 1302; + x = 0.4848 * safezoneW /*+ safezoneX*/; + y = 0.4732 * safezoneH /*+ safezoneY*/; + w = 0.5 / 16 * safezoneW; + h = 0.5 / 9 * safezoneH; + }; + + class Digit0: Center { + idc = 1310; + x = (0.54 + 0 * 0.02) * safezoneW /*+ safezoneX*/; + y = 0.54 * safezoneH /*+ safezoneY*/; + w = 0.5 / 16 * safezoneW; + h = 0.5 / 9 * safezoneH; + }; + + class Digit1: Digit0 { + idc = 1311; + x = (0.54 + 1 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit2: Digit0 { + idc = 1312; + x = (0.54 + 2 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit3: Digit0 { + idc = 1313; + x = (0.54 + 3 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit4: Digit0 { + idc = 1314; + x = (0.54 + 4 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit5: Digit0 { + idc = 1315; + x = (0.35 + 0 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit6: Digit0 { + idc = 1316; + x = (0.35 + 1 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit7: Digit0 { + idc = 1317; + x = (0.35 + 2 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit8: Digit0 { + idc = 1318; + x = (0.35 + 3 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class Digit9: Digit0 { + idc = 1319; + x = (0.35 + 4 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class DigitE1: Digit0 { + idc = 1321; + x = (0.39 + 0 * 0.02) * safezoneW /*+ safezoneX*/; + y = 0.42 * safezoneH /*+ safezoneY*/; + }; + + class DigitE2: DigitE1 { + idc = 1322; + x = (0.39 + 1 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class DigitE3: DigitE1 { + idc = 1323; + x = (0.39 + 2 * 0.02) * safezoneW /*+ safezoneX*/; + }; + + class DigitE4: DigitE1 { + idc = 1324; + x = (0.39 + 3 * 0.02) * safezoneW /*+ safezoneX*/; + }; + }; + }; }; - - class CA_Heading: RscText { - idc = 156; // azimuth - w = 0; - h = 0; - }; - - class CA_OpticsPitch: RscText { - idc = 182; // inclination - w = 0; - h = 0; - }; - - class CA_Elev: RscText { - idc = 175; // inclination, more accurate - w = 0; - h = 0; - }; - - class CA_OpticsZoom: RscText { - idc = 180; // some kind of zoom - w = 0; - h = 0; - }; - - class CA_VisionMode: RscText { - idc = 179; // ??? - w = 0; - h = 0; - }; - - class ACE_ScriptedDisplayControlsGroup: RscControlsGroup { - idc = 170; - x = "SafezoneX"; - y = "SafezoneY"; - w = "SafezoneW"; - h = "SafezoneH"; - - class VScrollbar: VScrollbar { - width = 0; - }; - - class HScrollbar: HScrollbar { - height = 0; - }; - - class controls { - class Center: RscPicture { - idc = 1301; - text = ""; - colorText[] = {1,0,0,0.5}; - x = 0.488 * safezoneW /*+ safezoneX*/; - y = 0.4783 * safezoneH /*+ safezoneY*/; - w = 0.4 / 16 * safezoneW; - h = 0.4 / 9 * safezoneH; - }; - - class Crosshair: Center { - idc = 1302; - x = 0.4848 * safezoneW /*+ safezoneX*/; - y = 0.4732 * safezoneH /*+ safezoneY*/; - w = 0.5 / 16 * safezoneW; - h = 0.5 / 9 * safezoneH; - }; - - class Digit0: Center { - idc = 1310; - x = (0.54 + 0 * 0.02) * safezoneW /*+ safezoneX*/; - y = 0.54 * safezoneH /*+ safezoneY*/; - w = 0.5 / 16 * safezoneW; - h = 0.5 / 9 * safezoneH; - }; - - class Digit1: Digit0 { - idc = 1311; - x = (0.54 + 1 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit2: Digit0 { - idc = 1312; - x = (0.54 + 2 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit3: Digit0 { - idc = 1313; - x = (0.54 + 3 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit4: Digit0 { - idc = 1314; - x = (0.54 + 4 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit5: Digit0 { - idc = 1315; - x = (0.35 + 0 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit6: Digit0 { - idc = 1316; - x = (0.35 + 1 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit7: Digit0 { - idc = 1317; - x = (0.35 + 2 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit8: Digit0 { - idc = 1318; - x = (0.35 + 3 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class Digit9: Digit0 { - idc = 1319; - x = (0.35 + 4 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class DigitE1: Digit0 { - idc = 1321; - x = (0.39 + 0 * 0.02) * safezoneW /*+ safezoneX*/; - y = 0.42 * safezoneH /*+ safezoneY*/; - }; - - class DigitE2: DigitE1 { - idc = 1322; - x = (0.39 + 1 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class DigitE3: DigitE1 { - idc = 1323; - x = (0.39 + 2 * 0.02) * safezoneW /*+ safezoneX*/; - }; - - class DigitE4: DigitE1 { - idc = 1324; - x = (0.39 + 3 * 0.02) * safezoneW /*+ safezoneX*/; - }; - }; - }; - }; }; diff --git a/addons/vector/XEH_postInit.sqf b/addons/vector/XEH_postInit.sqf index c3574c3ae0..0a8f031347 100644 --- a/addons/vector/XEH_postInit.sqf +++ b/addons/vector/XEH_postInit.sqf @@ -1,13 +1,78 @@ // by commy2 +#include "script_component.hpp" -/*player setVariable ["AGM_cooldownVector", 0, false]; +["ACE3", + localize "STR_ACE_Vector_AzimuthKey", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"} && {!(GETGVAR(isDownStateKeyAzimuth,false))}) exitWith {false}; -AGM_isVectorReady = true; -AGM_vectorKey = [false, false]; -AGM_vectorConfig = [0, 0]; -AGM_vectorSettings = [false, false, false, false]; + GVAR(isDownStateKeyAzimuth) = true; -0 spawn { - waitUntil {preloadTitleRsc ["AGM_Digit_Preload", "PLAIN"]}; - waitUntil {preloadTitleRsc ["AGM_Debug_Crosshair", "PLAIN"]}; -};*/ + // Statement + ["azimuth"] call FUNC(onKeyDown); + true + }, + [15, [false, false, false]], + false, + "keydown" +] call CBA_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Vector_AzimuthKey", + { + GVAR(isDownStateKeyAzimuth) = false; + + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + + // Statement + ["azimuth"] call FUNC(onKeyUp); + true + }, + [15, [false, false, false]], + false, + "keyup" +] call CBA_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Vector_DistanceKey", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"} && {!(GETGVAR(isDownStateKeyDistance,false))}) exitWith {false}; + + GVAR(isDownStateKeyDistance) = true; + + // Statement + ["distance"] call FUNC(onKeyDown); + true + }, + [19, [false, false, false]], + false, + "keydown" +] call CBA_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_Vector_DistanceKey", + { + GVAR(isDownStateKeyDistance) = false; + + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + + // Statement + ["distance"] call FUNC(onKeyUp); + true + }, + [19, [false, false, false]], + false, + "keyup" +] call CBA_fnc_registerKeybind; diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index ed020c4913..4ce39de4e9 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -24,6 +24,10 @@ PREP(showRelativeAzimuthDistance); PREP(showRelativeDistance); PREP(showRelativeHeightLength); PREP(showFallOfShort); +PREP(showText); +PREP(nextMode); +PREP(adjustBrightness); +PREP(showReticle); GVAR(holdKeyHandler) = -1; GVAR(isKeyDownAzimuth) = false; @@ -32,3 +36,4 @@ GVAR(keyDownTimeAzimuth) = -1; GVAR(keyDownTimeDistance) = -1; GVAR(useMil) = false; GVAR(useFeet) = false; +GVAR(modeReticle) = 0; diff --git a/addons/vector/config.cpp b/addons/vector/config.cpp index 4837ca0001..4603857506 100644 --- a/addons/vector/config.cpp +++ b/addons/vector/config.cpp @@ -15,31 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" - -class ACE_Default_Keys { - class vectorAzimuth { - displayName = "$STR_ACE_Vector_AzimuthKey"; - condition = QUOTE(currentWeapon player == 'ACE_Vector' && {_vehicle == player} && {cameraView == 'GUNNER'}); - statement = QUOTE(['azimuth'] call FUNC(onKeyDown)); - conditionUp = QUOTE(true); - statementUp = QUOTE(['azimuth'] call FUNC(onKeyUp)); - key = 15; - shift = 0; - control = 0; - alt = 0; - }; - - class vectorDistance { - displayName = "$STR_ACE_Vector_DistanceKey"; - condition = QUOTE(currentWeapon player == 'ACE_Vector' && {_vehicle == player} && {cameraView == 'GUNNER'}); - statement = QUOTE(['distance'] call FUNC(onKeyDown)); - conditionUp = QUOTE(true); - statementUp = QUOTE(['distance'] call FUNC(onKeyUp)); - key = 19; - shift = 0; - control = 0; - alt = 0; - }; -}; - #include "RscInGameUI.hpp" diff --git a/addons/vector/functions/_abort.sqf b/addons/vector/functions/_abort.sqf deleted file mode 100644 index e309745c6f..0000000000 --- a/addons/vector/functions/_abort.sqf +++ /dev/null @@ -1,50 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlVectorCrosshair", "_ctrlDigit0", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_ctrlDigitE4", "_allControls"]; - -waitUntil {currentWeapon player != "AGM_Vector" || {cameraView != "Gunner"}}; - -terminate AGM_Vector_scriptHandle; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlVectorCrosshair = _dlgVector displayCtrl 2; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; -_ctrlDigitE4 = _dlgVector displayCtrl 24; - -_allControls = [ - _ctrlVectorCenter, - _ctrlVectorCrosshair, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3, - _ctrlDigit4, - _ctrlDigit5, - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigitE1, - _ctrlDigitE2, - _ctrlDigitE3, - _ctrlDigitE4 -]; - -{_x ctrlShow false} forEach _allControls; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/_config.sqf b/addons/vector/functions/_config.sqf deleted file mode 100644 index daaa39ff26..0000000000 --- a/addons/vector/functions/_config.sqf +++ /dev/null @@ -1,214 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlVectorCrosshair", "_ctrlDigit0", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_ctrlDigitE4", "_allControls", "_isReticle", "_isNVG", "_time", "_theCount"]; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlVectorCrosshair = _dlgVector displayCtrl 2; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; -_ctrlDigitE4 = _dlgVector displayCtrl 24; - -_allControls = [ - _ctrlVectorCenter, - _ctrlVectorCrosshair, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3, - _ctrlDigit4, - _ctrlDigit5, - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigitE1, - _ctrlDigitE2, - _ctrlDigitE3, - _ctrlDigitE4 -]; - -_ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\dC.paa"; -_ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dq.paa"; -_ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dn.paa"; -_ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dF.paa"; -_ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\di.paa"; -_ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dG.paa"; - -sleep 2; - -{_x ctrlSetText ""} forEach [ - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2 -]; - -_isReticle = AGM_vectorSettings select 0; -_isNVG = AGM_vectorSettings select 1; - -if (_isReticle) then { - if (_isNVG) then { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dn.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\di.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dG.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - } else { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\dr.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - }; - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dn.paa"; - _ctrlDigit2 ctrlSetText ""; - _ctrlDigit3 ctrlSetText ""; -} else { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\dr.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - _ctrlDigit3 ctrlSetText ""; -}; - -waitUntil { - if (AGM_vectorKey select 0) then { - waitUntil { - !(AGM_vectorKey select 0) || {AGM_vectorKey select 1} - }; - if !(AGM_vectorKey select 1) then { - if (_isNVG) then { - _isReticle = false; - _isNVG = false; - } else { - if (_isReticle) then { - _isReticle = true; - _isNVG = true; - } else { - _isReticle = true; - _isNVG = false; - }; - }; - }; - if (_isReticle) then { - if (_isNVG) then { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dn.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\di.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dG.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - } else { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\dr.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - }; - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dn.paa"; - _ctrlDigit2 ctrlSetText ""; - _ctrlDigit3 ctrlSetText ""; - } else { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\dr.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - _ctrlDigit3 ctrlSetText ""; - }; - }; - AGM_vectorKey select 1 -}; - -_time = time; -waitUntil { - if (AGM_vectorKey select 0) then {_time = -1}; - !(AGM_vectorKey select 1) || {time > _time + 1} -}; - -_theCount = 1; -waitUntil { - if (AGM_vectorKey select 1) then { - _theCount = _theCount + 1; - _time = time; - waitUntil {!(AGM_vectorKey select 1) || {time > _time + 1}}; - }; - if (AGM_vectorKey select 0) then {_time = -1}; - time > _time + 1 || {_theCount >= 5} -}; - -if (_theCount >= 5) then { - _ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d5.paa"; - _ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - _ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigitE4 ctrlSetText "\AGM_Vector\rsc\dr.paa"; - - AGM_vectorSettings set [0, _isReticle]; - AGM_vectorSettings set [1, _isNVG]; - - _ctrlVectorCrosshair ctrlShow (AGM_vectorSettings select 0); - - if (AGM_vectorSettings select 1) then { - {_x ctrlSetTextColor [1, 0, 0, 1]} forEach _allControls; - } else { - {_x ctrlSetTextColor [1, 0, 0, 0.5]} forEach _allControls; - }; - - sleep 2; - - {_x ctrlSetText ""} forEach [ - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3, - _ctrlDigitE1, - _ctrlDigitE2, - _ctrlDigitE3, - _ctrlDigitE4 - ]; -} else { - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\d1.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dd.paa"; - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dC.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dn.paa"; - _ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - - sleep 2; - - {_x ctrlSetText ""} forEach [ - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3 - ]; -}; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/_convertFOS.sqf b/addons/vector/functions/_convertFOS.sqf deleted file mode 100644 index 004bc52218..0000000000 --- a/addons/vector/functions/_convertFOS.sqf +++ /dev/null @@ -1,226 +0,0 @@ -/* -BWA3 script, by commy2 -this code is property of the ArmA 3 Bundeswehr modification -ask us nicely at http://www.bwmod.de/ if you want to re-use any of this script -we don't support changed code based on this work -*/ -#include "script_component.hpp" - -private["_number", "_coordinate", "_isNegative", "_digit0", "_digit1", "_digit2", "_digit3", "_digit4"]; - -_number = _this select 0; -_coordinate = _this select 1; - -_number = round _number; -_isNegative = if (_number < 0) then {true} else {false}; -_number = abs _number; - -if (_number >= 10000) exitWith { - [ - "", - "\AGM_Vector\rsc\d-.paa", - "\AGM_Vector\rsc\d-.paa", - "\AGM_Vector\rsc\d-.paa", - "\AGM_Vector\rsc\d-.paa" - ] -}; - -_digit0 = ""; -_digit1 = floor (_number / 1000); -_digit2 = floor (_number / 100) - _digit1 * 10; -_digit3 = floor (_number / 10) - _digit1 * 100 - _digit2 * 10; -_digit4 = _number mod 10; - -switch (_coordinate) do { - case 0 : { - if (_isNegative) then { - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = "\AGM_Vector\rsc\dd.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit3 = ""; - _digit4 = ""; - } else { - _digit0 = "\AGM_Vector\rsc\dd.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit4 = ""; - }; - } else { - _digit0 = "\AGM_Vector\rsc\dd.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit2]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = "\AGM_Vector\rsc\d-.paa"; - _digit2 = "\AGM_Vector\rsc\d-.paa"; - _digit3 = "\AGM_Vector\rsc\d-.paa"; - _digit4 = "\AGM_Vector\rsc\d-.paa"; - }; - } else { - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = "\AGM_Vector\rsc\dA.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit3 = ""; - _digit4 = ""; - } else { - _digit0 = "\AGM_Vector\rsc\dA.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit4 = ""; - }; - } else { - _digit0 = "\AGM_Vector\rsc\dA.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit2]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = "\AGM_Vector\rsc\d-.paa"; - _digit2 = "\AGM_Vector\rsc\d-.paa"; - _digit3 = "\AGM_Vector\rsc\d-.paa"; - _digit4 = "\AGM_Vector\rsc\d-.paa"; - }; - }; - }; - case 1 : { - if (_isNegative) then { - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = "\AGM_Vector\rsc\dL.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit3 = ""; - _digit4 = ""; - } else { - _digit0 = "\AGM_Vector\rsc\dL.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit4 = ""; - }; - } else { - _digit0 = "\AGM_Vector\rsc\dL.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit2]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = "\AGM_Vector\rsc\d-.paa"; - _digit2 = "\AGM_Vector\rsc\d-.paa"; - _digit3 = "\AGM_Vector\rsc\d-.paa"; - _digit4 = "\AGM_Vector\rsc\d-.paa"; - }; - } else { - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = "\AGM_Vector\rsc\dr.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit3 = ""; - _digit4 = ""; - } else { - _digit0 = "\AGM_Vector\rsc\dr.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit4 = ""; - }; - } else { - _digit0 = "\AGM_Vector\rsc\dr.paa"; - _digit1 = ""; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit2]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = "\AGM_Vector\rsc\d-.paa"; - _digit2 = "\AGM_Vector\rsc\d-.paa"; - _digit3 = "\AGM_Vector\rsc\d-.paa"; - _digit4 = "\AGM_Vector\rsc\d-.paa"; - }; - }; - }; - case 2 : { - if (_isNegative) then { - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = "\AGM_Vector\rsc\dU.paa"; - _digit1 = "\AGM_Vector\rsc\dP.paa"; - _digit2 = ""; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit4 = ""; - } else { - _digit0 = "\AGM_Vector\rsc\dU.paa"; - _digit1 = "\AGM_Vector\rsc\dP.paa"; - _digit2 = ""; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = "\AGM_Vector\rsc\dU.paa"; - _digit1 = "\AGM_Vector\rsc\dP.paa"; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit2]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = "\AGM_Vector\rsc\d-.paa"; - _digit2 = "\AGM_Vector\rsc\d-.paa"; - _digit3 = "\AGM_Vector\rsc\d-.paa"; - _digit4 = "\AGM_Vector\rsc\d-.paa"; - }; - } else { - if (_digit1 == 0) then { - if (_digit2 == 0) then { - if (_digit3 == 0) then { - _digit0 = "\AGM_Vector\rsc\dd.paa"; - _digit1 = "\AGM_Vector\rsc\dn.paa"; - _digit2 = ""; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - _digit4 = ""; - } else { - _digit0 = "\AGM_Vector\rsc\dd.paa"; - _digit1 = "\AGM_Vector\rsc\dn.paa"; - _digit2 = ""; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = "\AGM_Vector\rsc\dd.paa"; - _digit1 = "\AGM_Vector\rsc\dn.paa"; - _digit2 = format["\AGM_Vector\rsc\d%1.paa", _digit2]; - _digit3 = format["\AGM_Vector\rsc\d%1.paa", _digit3]; - _digit4 = format["\AGM_Vector\rsc\d%1.paa", _digit4]; - }; - } else { - _digit0 = ""; - _digit1 = "\AGM_Vector\rsc\d-.paa"; - _digit2 = "\AGM_Vector\rsc\d-.paa"; - _digit3 = "\AGM_Vector\rsc\d-.paa"; - _digit4 = "\AGM_Vector\rsc\d-.paa"; - }; - }; - }; -}; - -[_digit0, _digit1, _digit2, _digit3, _digit4] diff --git a/addons/vector/functions/_settings.sqf b/addons/vector/functions/_settings.sqf deleted file mode 100644 index 5ff16d4b3e..0000000000 --- a/addons/vector/functions/_settings.sqf +++ /dev/null @@ -1,186 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlVectorCrosshair", "_ctrlDigit0", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_ctrlDigitE4", "_isFeet", "_isMil", "_time", "_theCount"]; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; -_ctrlDigitE4 = _dlgVector displayCtrl 24; - -_ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\dU.paa"; -_ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\dn.paa"; -_ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\di.paa"; -_ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dt.paa"; -_ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\d5.paa"; -_ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dE.paa"; -_ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dt.paa"; -_ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - -sleep 2; - -{_x ctrlSetText ""} forEach [ - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3 -]; - -_isMil = AGM_vectorSettings select 2; -_isFeet = AGM_vectorSettings select 3; - -if (_isMil) then { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\d6.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\d4.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\d0.paa"; -} else { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\d3.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\d6.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\do.paa"; -}; -if (_isFeet) then { - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dt.paa"; -} else { - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\d5.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; - _ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dU.paa"; -}; - -waitUntil { - if (AGM_vectorKey select 1) then { - waitUntil { - !(AGM_vectorKey select 1) || AGM_vectorKey select 0 - }; - if !(AGM_vectorKey select 0) then { - if (_isMil) then { - if (_isFeet) then { - _isMil = false; - _isFeet = true; - } else { - _isMil = true; - _isFeet = true; - }; - } else { - if (_isFeet) then { - _isMil = false; - _isFeet = false; - } else { - _isMil = true; - _isFeet = false; - }; - }; - }; - if (_isMil) then { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\d6.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\d4.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - } else { - _ctrlDigit6 ctrlSetText "\AGM_Vector\rsc\d3.paa"; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\d6.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\do.paa"; - }; - if (_isFeet) then { - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dF.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\dE.paa"; - _ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - } else { - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\d5.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; - _ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dU.paa"; - }; - }; - AGM_vectorKey select 0 -}; - -_time = time; -waitUntil { - if (AGM_vectorKey select 1) then {_time = -1}; - !(AGM_vectorKey select 0) || time > _time + 1 -}; - -_theCount = 1; -waitUntil { - if (AGM_vectorKey select 0) then { - _theCount = _theCount + 1; - _time = time; - waitUntil {!(AGM_vectorKey select 0) || time > _time + 1}; - }; - if (AGM_vectorKey select 1) then {_time = -1}; - time > _time + 1 || {_theCount >= 5} -}; - -if (_theCount >= 5) then { - _ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d5.paa"; - _ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - _ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dq.paa"; - _ctrlDigitE4 ctrlSetText "\AGM_Vector\rsc\dr.paa"; - - AGM_vectorSettings set [2, _isMil]; - AGM_vectorSettings set [3, _isFeet]; - - sleep 2; - - {_x ctrlSetText ""} forEach [ - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3, - _ctrlDigitE1, - _ctrlDigitE2, - _ctrlDigitE3, - _ctrlDigitE4 - ]; -} else { - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText "\AGM_Vector\rsc\d0.paa"; - _ctrlDigit8 ctrlSetText "\AGM_Vector\rsc\d1.paa"; - _ctrlDigit9 ctrlSetText "\AGM_Vector\rsc\dd.paa"; - _ctrlDigit0 ctrlSetText "\AGM_Vector\rsc\dU.paa"; - _ctrlDigit1 ctrlSetText "\AGM_Vector\rsc\dn.paa"; - _ctrlDigit2 ctrlSetText "\AGM_Vector\rsc\di.paa"; - _ctrlDigit3 ctrlSetText "\AGM_Vector\rsc\dt.paa"; - - sleep 2; - - {_x ctrlSetText ""} forEach [ - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3 - ]; -}; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/_tabAzimuthKey.sqf b/addons/vector/functions/_tabAzimuthKey.sqf deleted file mode 100644 index 0d7724dabc..0000000000 --- a/addons/vector/functions/_tabAzimuthKey.sqf +++ /dev/null @@ -1,112 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -#define DELAY 0.3 - -private["_rscLayer", "_dlgVector", "_ctrlVectorCenter", "_ctrlVectorCrosshair", "_ctrlDigit0", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_ctrlDigitE4", "_allControls", "_hold", "_time", "_theCount"]; - -disableSerialization; -_rscLayer = ["AGM_Vector"] call BIS_fnc_rscLayer; -_rscLayer cutRsc ["AGM_Vector", "PLAIN", 0, false]; - -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlVectorCrosshair = _dlgVector displayCtrl 2; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; -_ctrlDigitE4 = _dlgVector displayCtrl 24; - -_allControls = [ - _ctrlVectorCenter, - _ctrlVectorCrosshair, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3, - _ctrlDigit4, - _ctrlDigit5, - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigitE1, - _ctrlDigitE2, - _ctrlDigitE3, - _ctrlDigitE4 -]; - - -if (AGM_vectorSettings select 0) then { - _ctrlVectorCrosshair ctrlShow true; - _ctrlVectorCrosshair ctrlSetText "\AGM_Vector\rsc\Vector_Crosshair.paa"; -}; - -if (AGM_vectorSettings select 1) then { - {_x ctrlSetTextColor [1, 0, 0, 1]} forEach _allControls; -}; - -_hold = true; -_time = time; - -waitUntil { - if !(AGM_vectorKey select 0) then { - _hold = false; - }; - time > _time + DELAY || {!_hold} -}; - -if (_hold) then { - if (AGM_vectorKey select 1) then { - AGM_Vector_scriptHandle = 0 spawn AGM_Vector_fnc_modeDistanceAzimuth; - } else { - AGM_Vector_scriptHandle = 0 spawn AGM_Vector_fnc_modeAzimuth; - }; -} else { - waitUntil {time > _time + DELAY}; - if (AGM_vectorKey select 0) then { - if (AGM_vectorKey select 1) then { - //L tab + (L + R) hold - waitUntil {!(AGM_vectorKey select 0)}; - AGM_isVectorReady = true; - } else { - AGM_Vector_scriptHandle = 0 spawn AGM_Vector_fnc_modeAzimuthInclination; - }; - } else { - if (AGM_vectorKey select 1) then { - //L tab + R hold - waitUntil {!(AGM_vectorKey select 0)}; - AGM_isVectorReady = true; - } else { - //L tab - waitUntil {!(AGM_vectorKey select 0)}; - - _theCount = AGM_vectorConfig select 0; - _time = AGM_vectorConfig select 1; - - if (time < _time + 1 && {_theCount <= 0}) then { - _theCount = _theCount - 1; - if (_theCount <= -5) then { - AGM_vectorConfig = [0, time]; - 0 spawn AGM_Vector_settings; - } else { - AGM_vectorConfig = [_theCount, time]; - AGM_isVectorReady = true; - }; - } else { - AGM_vectorConfig = [-1, time]; - AGM_isVectorReady = true; - }; - }; - }; -}; diff --git a/addons/vector/functions/_tabDistanceKey.sqf b/addons/vector/functions/_tabDistanceKey.sqf deleted file mode 100644 index bdd4587723..0000000000 --- a/addons/vector/functions/_tabDistanceKey.sqf +++ /dev/null @@ -1,112 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -#define DELAY 0.3 - -private["_rscLayer", "_dlgVector", "_ctrlVectorCenter", "_ctrlVectorCrosshair", "_ctrlDigit0", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_ctrlDigitE4", "_allControls", "_hold", "_time", "_theCount"]; - -disableSerialization; -_rscLayer = ["AGM_Vector"] call BIS_fnc_rscLayer; -_rscLayer cutRsc ["AGM_Vector", "PLAIN", 0, false]; - -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_ctrlVectorCrosshair = _dlgVector displayCtrl 2; -_ctrlDigit0 = _dlgVector displayCtrl 10; -_ctrlDigit1 = _dlgVector displayCtrl 11; -_ctrlDigit2 = _dlgVector displayCtrl 12; -_ctrlDigit3 = _dlgVector displayCtrl 13; -_ctrlDigit4 = _dlgVector displayCtrl 14; -_ctrlDigit5 = _dlgVector displayCtrl 15; -_ctrlDigit6 = _dlgVector displayCtrl 16; -_ctrlDigit7 = _dlgVector displayCtrl 17; -_ctrlDigit8 = _dlgVector displayCtrl 18; -_ctrlDigit9 = _dlgVector displayCtrl 19; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; -_ctrlDigitE4 = _dlgVector displayCtrl 24; - -_allControls = [ - _ctrlVectorCenter, - _ctrlVectorCrosshair, - _ctrlDigit0, - _ctrlDigit1, - _ctrlDigit2, - _ctrlDigit3, - _ctrlDigit4, - _ctrlDigit5, - _ctrlDigit6, - _ctrlDigit7, - _ctrlDigit8, - _ctrlDigit9, - _ctrlDigitE1, - _ctrlDigitE2, - _ctrlDigitE3, - _ctrlDigitE4 -]; - - -if (AGM_vectorSettings select 0) then { - _ctrlVectorCrosshair ctrlShow true; - _ctrlVectorCrosshair ctrlSetText "\AGM_Vector\rsc\Vector_Crosshair.paa"; -}; - -if (AGM_vectorSettings select 1) then { - {_x ctrlSetTextColor [1, 0, 0, 1]} forEach _allControls; -}; - -_hold = true; -_time = time; - -waitUntil { - if !(AGM_vectorKey select 1) then { - _hold = false; - }; - time > _time + DELAY || {!_hold} -}; - -if (_hold) then { - if (AGM_vectorKey select 0) then { - AGM_Vector_scriptHandle = 0 spawn AGM_Vector_fnc_modeDistanceAzimuth; - } else { - AGM_Vector_scriptHandle = 0 spawn AGM_Vector_fnc_modeDistance; - }; -} else { - waitUntil {time > _time + DELAY}; - if (AGM_vectorKey select 1) then { - if (AGM_vectorKey select 0) then { - //R tab + (L + R) hold - waitUntil {!(AGM_vectorKey select 1)}; - AGM_isVectorReady = true; - } else { - AGM_Vector_scriptHandle = 0 spawn AGM_Vector_fnc_modeDistanceHeight; - }; - } else { - if (AGM_vectorKey select 0) then { - //R tab + L hold - waitUntil {!(AGM_vectorKey select 1)}; - AGM_isVectorReady = true; - } else { - //R tab - waitUntil {!(AGM_vectorKey select 1)}; - - _theCount = AGM_vectorConfig select 0; - _time = AGM_vectorConfig select 1; - - if (time < _time + 1 && {_theCount >= 0}) then { - _theCount = _theCount + 1; - if (_theCount >= 5) then { - AGM_vectorConfig = [0, time]; - 0 spawn AGM_Vector_config; - } else { - AGM_vectorConfig = [_theCount, time]; - AGM_isVectorReady = true; - }; - } else { - AGM_vectorConfig = [1, time]; - AGM_isVectorReady = true; - }; - }; - }; -}; diff --git a/addons/vector/functions/fnc_adjustBrightness.sqf b/addons/vector/functions/fnc_adjustBrightness.sqf new file mode 100644 index 0000000000..8832329796 --- /dev/null +++ b/addons/vector/functions/fnc_adjustBrightness.sqf @@ -0,0 +1,28 @@ +// by commy2 +#include "script_component.hpp" + +private "_dlgVector"; + +disableSerialization; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); + +private "_color"; + +_color = [[1,0,0,0.5], [1,0,0,1]] select (_this select 0); + +(_dlgVector displayCtrl 1301) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1302) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1310) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1311) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1312) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1313) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1314) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1315) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1316) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1317) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1318) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1319) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1321) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1322) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1323) ctrlSetTextColor _color; +(_dlgVector displayCtrl 1324) ctrlSetTextColor _color; diff --git a/addons/vector/functions/fnc_convertToTexturesFOS.sqf b/addons/vector/functions/fnc_convertToTexturesFOS.sqf index 79fe40962f..2a93f93548 100644 --- a/addons/vector/functions/fnc_convertToTexturesFOS.sqf +++ b/addons/vector/functions/fnc_convertToTexturesFOS.sqf @@ -15,8 +15,8 @@ _number = round (_number select _coordinate); _isNegative = _number < 0; _number = abs _number; -if (_number >= 10000) exitWith { - [QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return +if (_number > 9999) exitWith { + [QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return }; private ["_digit0", "_digit1", "_digit2", "_digit3", "_digit4"]; @@ -236,4 +236,9 @@ switch (_coordinate) do { }; }; +// trap errors +if ({typeName _x == "STRING"} count [_digit0, _digit1, _digit2, _digit3, _digit4] < 5) exitWith { + [QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa)), QUOTE(PATHTOF(rsc\vector_minus.paa))] // return +}; + [_digit0, _digit1, _digit2, _digit3, _digit4] diff --git a/addons/vector/functions/fnc_nextMode.sqf b/addons/vector/functions/fnc_nextMode.sqf new file mode 100644 index 0000000000..53054e85e6 --- /dev/null +++ b/addons/vector/functions/fnc_nextMode.sqf @@ -0,0 +1,44 @@ +// by commy2 +#include "script_component.hpp" + +switch (_this select 0) do { + case ("settings"): { + switch (GVAR(configTemp)) do { + case ([false, false]): { + GVAR(configTemp) = [false, true]; + }; + case ([false, true]): { + GVAR(configTemp) = [true, true]; + }; + case ([true, true]): { + GVAR(configTemp) = [true, false]; + }; + case ([true, false]): { + GVAR(configTemp) = [false, false]; + }; + }; + + [["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText); + [["deg", "mil" ] select (GVAR(configTemp) select 1)] call FUNC(showText); + }; + + case ("config"): { + GVAR(configTemp) = GVAR(configTemp) + 1; + if (GVAR(configTemp) > 2) then {GVAR(configTemp) = 0}; + + switch (GVAR(configTemp)) do { + case (0): { + ["eret"] call FUNC(showText); + ["off"] call FUNC(showText); + }; + case (1): { + ["eret"] call FUNC(showText); + ["on"] call FUNC(showText); + }; + case (2): { + ["nigt"] call FUNC(showText); + ["on"] call FUNC(showText); + }; + }; + }; +}; diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index ec0b884ccc..884f2af128 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -7,6 +7,22 @@ Handles pressing the special vector keys. */ #include "script_component.hpp" +// set vector config settings +switch (GVAR(modeReticle)) do { + case (0): { + [false] call FUNC(adjustBrightness); + [false] call FUNC(showReticle); + }; + case (1): { + [false] call FUNC(adjustBrightness); + [true] call FUNC(showReticle); + }; + case (2): { + [true] call FUNC(adjustBrightness); + [true] call FUNC(showReticle); + }; +}; + private "_fnc_setPFH"; _fnc_setPFH = { if (GVAR(holdKeyHandler) > -1) then { @@ -14,12 +30,32 @@ _fnc_setPFH = { GVAR(holdKeyHandler) = -1; }; - GVAR(currentMode) = _this;// + GVAR(currentMode) = _this; GVAR(holdKeyHandler) = [FUNC(onKeyHold), 0, _this] call CBA_fnc_addPerFrameHandler; }; switch (_this select 0) do { case ("azimuth"): { + GVAR(keyDownTabCountDistance) = 0; + + // handle input in option menu + if (GVAR(currentMode) == "settings") exitWith { + if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith {}; + + if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then { + GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1; + } else { + GVAR(keyDownTabCountAzimuth) = 1; + }; + + GVAR(keyDownTimeAzimuth) = diag_tickTime; + }; + + if (GVAR(currentMode) == "config") exitWith { + if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; + + ["config"] call FUNC(nextMode); + }; // prevent additinal modifier input if advanced mode it set, spaghetti if (GETGVAR(isKeyDownDistance,false) && {GETGVAR(currentMode,"") in ["relative_distance", "relative_height+length"]}) exitWith {}; @@ -29,6 +65,24 @@ switch (_this select 0) do { GVAR(isKeyDownAzimuth) = true; [false] call FUNC(showP1); + // handle 5 times clicking + if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) then { + GVAR(keyDownTabCountAzimuth) = (GETGVAR(keyDownTabCountAzimuth,0)) + 1; + GVAR(keyDownTimeAzimuth) = diag_tickTime; + } else { + GVAR(keyDownTabCountAzimuth) = 1; + }; + + // open settings menu + if (GVAR(keyDownTabCountAzimuth) == 5) exitWith { + GVAR(keyDownTimeMenu) = diag_tickTime; + GVAR(keyDownTimeAzimuth) = diag_tickTime; + GVAR(keyDownTabCountAzimuth) = 0; + GVAR(configTemp) = [GVAR(useFeet), GVAR(useMil)]; + ["settings"] call FUNC(showText); + "settings" call _fnc_setPFH; + }; + if (diag_tickTime < GVAR(keyDownTimeAzimuth) + 0.5) exitWith { "azimuth+inclination" call _fnc_setPFH; }; @@ -52,6 +106,26 @@ switch (_this select 0) do { }; case ("distance"): { + GVAR(keyDownTabCountAzimuth) = 0; + + // handle input in option menu + if (GVAR(currentMode) == "config") exitWith { + if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; + + if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) then { + GVAR(keyDownTabCountDistance) = (GETGVAR(keyDownTabCountDistance,0)) + 1; + } else { + GVAR(keyDownTabCountDistance) = 1; + }; + + GVAR(keyDownTimeDistance) = diag_tickTime; + }; + + if (GVAR(currentMode) == "settings") exitWith { + if (diag_tickTime < GVAR(keyDownTimeMenu) + 0.5) exitWith {}; + + ["settings"] call FUNC(nextMode); + }; // prevent additinal modifier input if advanced mode it set, spaghetti if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance", "fall_of_short"]}) exitWith {}; @@ -66,6 +140,24 @@ switch (_this select 0) do { GVAR(isKeyDownDistance) = true; [false] call FUNC(showP1); + // handle 5 times clicking + if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) then { + GVAR(keyDownTabCountDistance) = (GETGVAR(keyDownTabCountDistance,0)) + 1; + GVAR(keyDownTimeDistance) = diag_tickTime; + } else { + GVAR(keyDownTabCountDistance) = 1; + }; + + // open config menu + if (GVAR(keyDownTabCountDistance) == 5) exitWith { + GVAR(keyDownTimeMenu) = diag_tickTime; + GVAR(keyDownTimeDistance) = diag_tickTime; + GVAR(keyDownTabCountDistance) = 0; + GVAR(configTemp) = GVAR(modeReticle); + ["config"] call FUNC(showText); + "config" call _fnc_setPFH; + }; + if (diag_tickTime < GVAR(keyDownTimeDistance) + 0.5) exitWith { "height+distance" call _fnc_setPFH; }; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index dded828d26..57e76d57ea 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -7,6 +7,16 @@ PFH executed while holding a vector key down. */ #include "script_component.hpp" +if (currentWeapon ACE_player != "ACE_Vector") exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + + GVAR(currentMode) = ""; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; +}; + switch (_this select 0) do { case ("azimuth"): { @@ -77,9 +87,14 @@ switch (_this select 0) do { case ("azimuth+inclination"): { + private "_isReady"; + _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + [false] call FUNC(showCenter); - call FUNC(showAzimuthInclination); + if (_isReady) then { + call FUNC(showAzimuthInclination); + }; if (!GVAR(isKeyDownAzimuth)) then { [_this select 1] call CBA_fnc_removePerFrameHandler; @@ -206,6 +221,113 @@ switch (_this select 0) do { }; -}; + case ("settings"): { + if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith { + GVAR(keyDownTimeAzimuth) = diag_tickTime; + }; -//systemChat str (_this select 0); + [["meter", "feet"] select (GVAR(configTemp) select 0)] call FUNC(showText); + [["deg", "mil" ] select (GVAR(configTemp) select 1)] call FUNC(showText); + + if (GVAR(keyDownTabCountAzimuth) >= 5) exitWith { + GVAR(useFeet) = GVAR(configTemp) select 0; + GVAR(useMil) = GVAR(configTemp) select 1; + + ["clear_left"] call FUNC(showText); + ["clear_right"] call FUNC(showText); + ["stor"] call FUNC(showText); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + GVAR(currentMode) = ""; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + + if (GVAR(keyDownTabCountAzimuth) > 0 && {diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5}) exitWith { + + ["clear_left"] call FUNC(showText); + ["clear_right"] call FUNC(showText); + ["old_settings"] call FUNC(showText); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + GVAR(currentMode) = ""; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + }; + + case ("config"): { + if (diag_tickTime < GVAR(keyDownTimeMenu) + 1) exitWith { + GVAR(keyDownTimeDistance) = diag_tickTime; + }; + + switch (GVAR(configTemp)) do { + case (0): { + ["eret"] call FUNC(showText); + ["off"] call FUNC(showText); + }; + case (1): { + ["eret"] call FUNC(showText); + ["on"] call FUNC(showText); + }; + case (2): { + ["nigt"] call FUNC(showText); + ["on"] call FUNC(showText); + }; + }; + + if (GVAR(keyDownTabCountDistance) >= 5) exitWith { + GVAR(modeReticle) = GVAR(configTemp); + + ["clear_left"] call FUNC(showText); + ["clear_right"] call FUNC(showText); + ["stor"] call FUNC(showText); + + // set new config settings + switch (GVAR(configTemp)) do { + case (0): { + [false] call FUNC(adjustBrightness); + [false] call FUNC(showReticle); + }; + case (1): { + [false] call FUNC(adjustBrightness); + [true] call FUNC(showReticle); + }; + case (2): { + [true] call FUNC(adjustBrightness); + [true] call FUNC(showReticle); + }; + }; + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + GVAR(currentMode) = ""; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + + if (GVAR(keyDownTabCountDistance) > 0 && {diag_tickTime > GVAR(keyDownTimeDistance) + 0.5}) exitWith { + + ["clear_left"] call FUNC(showText); + ["clear_right"] call FUNC(showText); + ["old_config"] call FUNC(showText); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + GVAR(currentMode) = ""; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + }; + +}; diff --git a/addons/vector/functions/fnc_showP1.sqf b/addons/vector/functions/fnc_showP1.sqf index 54cbd203f4..6d7baf7412 100644 --- a/addons/vector/functions/fnc_showP1.sqf +++ b/addons/vector/functions/fnc_showP1.sqf @@ -16,8 +16,10 @@ if (_this select 0) then { (_dlgVector displayCtrl 1321) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa)); (_dlgVector displayCtrl 1322) ctrlSetText QUOTE(PATHTOF(rsc\vector_minus.paa)); (_dlgVector displayCtrl 1323) ctrlSetText QUOTE(PATHTOF(rsc\vector_p.paa)); + (_dlgVector displayCtrl 1324) ctrlSetText ""; } else { (_dlgVector displayCtrl 1321) ctrlSetText ""; (_dlgVector displayCtrl 1322) ctrlSetText ""; (_dlgVector displayCtrl 1323) ctrlSetText ""; + (_dlgVector displayCtrl 1324) ctrlSetText ""; }; diff --git a/addons/vector/functions/fnc_showReticle.sqf b/addons/vector/functions/fnc_showReticle.sqf new file mode 100644 index 0000000000..a3c07010dc --- /dev/null +++ b/addons/vector/functions/fnc_showReticle.sqf @@ -0,0 +1,10 @@ +/* + +by commy2 + +Shows or hides the electronic reticle. + +*/ +#include "script_component.hpp" + +((GETUVAR(ACE_dlgVector,displayNull)) displayCtrl 1302) ctrlSetText (["", QUOTE(PATHTOF(rsc\vector_crosshair.paa))] select (_this select 0)); diff --git a/addons/vector/functions/fnc_showText.sqf b/addons/vector/functions/fnc_showText.sqf new file mode 100644 index 0000000000..33e1c4766f --- /dev/null +++ b/addons/vector/functions/fnc_showText.sqf @@ -0,0 +1,155 @@ +// by commy2 +#include "script_component.hpp" + +private "_dlgVector"; + +disableSerialization; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); + +switch (_this select 0) do { + case ("config"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_c.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_g.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText ""; + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("settings"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_u.paa)); + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_5.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("nigt"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_g.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + }; + + case ("eret"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa)); + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_r.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + }; + + case ("on"): { + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText ""; + (_dlgVector displayCtrl 1313) ctrlSetText ""; + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("off"): { + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText ""; + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("deg"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_3.paa)); + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_6.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_0.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_degree.paa)); + }; + + case ("mil"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText QUOTE(PATHTOF(rsc\vector_6.paa)); + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_4.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_0.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_0.paa)); + }; + + case ("meter"): { + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_5.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_minus.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_u.paa)); + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("feet"): { + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_e.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("stor"): { + (_dlgVector displayCtrl 1321) ctrlSetText QUOTE(PATHTOF(rsc\vector_5.paa)); + (_dlgVector displayCtrl 1322) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + (_dlgVector displayCtrl 1323) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1324) ctrlSetText QUOTE(PATHTOF(rsc\vector_r.paa)); + }; + + case ("old_config"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_d.paa)); + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_c.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_f.paa)); + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("old_settings"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText QUOTE(PATHTOF(rsc\vector_o.paa)); + (_dlgVector displayCtrl 1318) ctrlSetText QUOTE(PATHTOF(rsc\vector_1.paa)); + (_dlgVector displayCtrl 1319) ctrlSetText QUOTE(PATHTOF(rsc\vector_d.paa)); + (_dlgVector displayCtrl 1310) ctrlSetText QUOTE(PATHTOF(rsc\vector_u.paa)); + (_dlgVector displayCtrl 1311) ctrlSetText QUOTE(PATHTOF(rsc\vector_n.paa)); + (_dlgVector displayCtrl 1312) ctrlSetText QUOTE(PATHTOF(rsc\vector_i.paa)); + (_dlgVector displayCtrl 1313) ctrlSetText QUOTE(PATHTOF(rsc\vector_t.paa)); + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("clear_left"): { + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText ""; + (_dlgVector displayCtrl 1318) ctrlSetText ""; + (_dlgVector displayCtrl 1319) ctrlSetText ""; + }; + + case ("clear_right"): { + (_dlgVector displayCtrl 1310) ctrlSetText ""; + (_dlgVector displayCtrl 1311) ctrlSetText ""; + (_dlgVector displayCtrl 1312) ctrlSetText ""; + (_dlgVector displayCtrl 1313) ctrlSetText ""; + (_dlgVector displayCtrl 1314) ctrlSetText ""; + }; + + case ("clear_stor"): { + (_dlgVector displayCtrl 1321) ctrlSetText ""; + (_dlgVector displayCtrl 1322) ctrlSetText ""; + (_dlgVector displayCtrl 1323) ctrlSetText ""; + (_dlgVector displayCtrl 1324) ctrlSetText ""; + }; +}; diff --git a/addons/vector/rsc/_vector_degree.paa b/addons/vector/rsc/_vector_degree.paa deleted file mode 100644 index 80a2242612..0000000000 Binary files a/addons/vector/rsc/_vector_degree.paa and /dev/null differ diff --git a/addons/vector/rsc/_vector_i.paa b/addons/vector/rsc/vector_i.paa similarity index 100% rename from addons/vector/rsc/_vector_i.paa rename to addons/vector/rsc/vector_i.paa diff --git a/addons/vector/rsc/_vector_q.paa b/addons/vector/rsc/vector_o.paa similarity index 100% rename from addons/vector/rsc/_vector_q.paa rename to addons/vector/rsc/vector_o.paa diff --git a/addons/vector/rsc/_vector_t.paa b/addons/vector/rsc/vector_t.paa similarity index 100% rename from addons/vector/rsc/_vector_t.paa rename to addons/vector/rsc/vector_t.paa diff --git a/addons/vehicles/CfgEventHandlers.hpp b/addons/vehicles/CfgEventHandlers.hpp index ccc1e1b7ce..049b154088 100644 --- a/addons/vehicles/CfgEventHandlers.hpp +++ b/addons/vehicles/CfgEventHandlers.hpp @@ -5,6 +5,12 @@ class Extended_PreInit_EventHandlers { }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + class Extended_Engine_EventHandlers { class Car { class ACE_EngineStartDelay { diff --git a/addons/vehicles/README.md b/addons/vehicles/README.md new file mode 100644 index 0000000000..fe26f297df --- /dev/null +++ b/addons/vehicles/README.md @@ -0,0 +1,12 @@ +ace_vehicles +============ + +Various tweaks to vehicle and vehicle weapon configs. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [KoffeinFlummi](https://github.com/KoffeinFlummi) +- [commy2](https://github.com/commy2) diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf new file mode 100644 index 0000000000..efff70306f --- /dev/null +++ b/addons/vehicles/XEH_postInit.sqf @@ -0,0 +1,25 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_SpeedLimiter", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player == driver vehicle ACE_player && + {vehicle ACE_player isKindOf 'Car' || + {vehicle ACE_player isKindOf 'Tank'}}) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player] call FUNC(speedLimiter); + true + }, + [211, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/vehicles/config.cpp b/addons/vehicles/config.cpp index e9543e9b94..a3641a7b5b 100644 --- a/addons/vehicles/config.cpp +++ b/addons/vehicles/config.cpp @@ -16,15 +16,3 @@ class CfgPatches { #include "CfgAmmo.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" - -class ACE_Default_Keys { - class speedLimiter { - displayName = "$STR_ACE_SpeedLimiter"; - condition = QUOTE(_player == driver _vehicle && {_vehicle isKindOf 'Car' || {_vehicle isKindOf 'Tank'}}); - statement = QUOTE([ARR_2(_player, _vehicle)] call FUNC(speedLimiter)); - key = 211; - shift = 0; - control = 0; - alt = 0; - }; -}; diff --git a/addons/weaponselect/README.md b/addons/weaponselect/README.md new file mode 100644 index 0000000000..2292140816 --- /dev/null +++ b/addons/weaponselect/README.md @@ -0,0 +1,12 @@ +ace_weaponselect +================ + +Adds the ability to quickly select weapons using the number keys. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) diff --git a/addons/weather/$PBOPREFIX$ b/addons/weather/$PBOPREFIX$ new file mode 100644 index 0000000000..5be32c2e87 --- /dev/null +++ b/addons/weather/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\weather \ No newline at end of file diff --git a/addons/weather/CfgEventhandlers.hpp b/addons/weather/CfgEventhandlers.hpp new file mode 100644 index 0000000000..c3f1f2ba0b --- /dev/null +++ b/addons/weather/CfgEventhandlers.hpp @@ -0,0 +1,12 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_preClientInit)); + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + serverInit = QUOTE(call COMPILE_FILE(XEH_PostServerInit)); + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/weather/CfgWorlds.hpp b/addons/weather/CfgWorlds.hpp new file mode 100644 index 0000000000..ed932654f7 --- /dev/null +++ b/addons/weather/CfgWorlds.hpp @@ -0,0 +1,19 @@ +class CfgWorlds { + class CAWorld; + + class Stratis: CAWorld { + // Source: http://www.iten-online.ch/klima/europa/griechenland/limnos.htm + ACE_TempDay[] = {10, 10, 12, 16, 21, 26, 29, 28, 25, 20, 15, 11}; + ACE_TempNight[] = {4, 4, 6, 8, 13, 17, 20, 20, 16, 12, 8, 6}; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Limnos,Greece + ACE_Humidity[] = {78, 77, 78, 74, 71, 60, 59, 61, 65, 72, 79, 80}; + }; + + class Altis: CAWorld { + // Source: http://www.iten-online.ch/klima/europa/griechenland/limnos.htm + ACE_TempDay[] = {10, 10, 12, 16, 21, 26, 29, 28, 25, 20, 15, 11}; + ACE_TempNight[] = {4, 4, 6, 8, 13, 17, 20, 20, 16, 12, 8, 6}; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Limnos,Greece + ACE_Humidity[] = {78, 77, 78, 74, 71, 60, 59, 61, 65, 72, 79, 80}; + }; +}; diff --git a/addons/weather/README.md b/addons/weather/README.md new file mode 100644 index 0000000000..c5b210c70d --- /dev/null +++ b/addons/weather/README.md @@ -0,0 +1,13 @@ +ace_weather +=========== + +Fixes weather synchronisation across clients. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [commy2](https://github.com/commy2) +- [esteldunedain](https://github.com/esteldunedain) +- [walterpearce](https://github.com/walterpearce) diff --git a/addons/weather/XEH_postInit.sqf b/addons/weather/XEH_postInit.sqf new file mode 100644 index 0000000000..7a97a1a788 --- /dev/null +++ b/addons/weather/XEH_postInit.sqf @@ -0,0 +1,75 @@ +//XEH_postInit.sqf +//#define DEBUG_MODE_FULL +#include "script_component.hpp" +"ACE_WIND_PARAMS" addPublicVariableEventHandler { GVAR(wind_period_start_time) = time; }; +"ACE_RAIN_PARAMS" addPublicVariableEventHandler { GVAR(rain_period_start_time) = time; }; +"ACE_MISC_PARAMS" addPublicVariableEventHandler { + if !(isServer) then { + 30 setLightnings (ACE_MISC_PARAMS select 0); + 30 setRainbow (ACE_MISC_PARAMS select 1); + 30 setFog (ACE_MISC_PARAMS select 2); + }; +}; + + +// Update Wind +simulWeatherSync; +_fnc_updateWind = { + ACE_wind = [] call FUNC(getWind); + setWind [ACE_wind select 0, ACE_wind select 1, true]; + 2 setGusts 0; + + // Set waves: 0 when no wind, 1 when wind >= 16 m/s + 1 setWaves (((vectorMagnitude ACE_wind) / 16.0) min 1.0); + + //systemChat format ["w:%1 %2,ACE_w:%1 %2, w", [wind select 0, wind select 1, ACE_wind select 0, ACE_wind select 1]]; +}; +[_fnc_updateWind, 1, []] call CBA_fnc_addPerFrameHandler; + + +// Update Rain +_fnc_updateRain = { + if(GVAR(enableRain)) then { + if(!isNil "ACE_RAIN_PARAMS" && {!isNil QGVAR(rain_period_start_time)}) then { + _oldStrength = ACE_RAIN_PARAMS select 0; + _rainStrength = ACE_RAIN_PARAMS select 1; + _transitionTime = ACE_RAIN_PARAMS select 2; + _periodPosition = (time - GVAR(rain_period_start_time)) min _transitionTime; + _periodPercent = (_periodPosition/_transitionTime) min 1; + + 0 setRain ((_periodPercent*(_rainStrength-_oldStrength))+_oldStrength); + }; + }; +}; +[_fnc_updateRain, 2, []] call CBA_fnc_addPerFrameHandler; + + +// Update Temperature +_fnc_updateTemperature = { + _time = daytime; + _month = date select 1; + + // Temperature + _hourlyCoef = -0.5 * sin(360 * ((3 + (date select 3))/24 + (date select 4)/1440)); + + GVAR(currentTemperature) = (GVAR(TempDay) select (_month - 1)) * (1 - _hourlyCoef) + (GVAR(TempNight) select (_month - 1)) * _hourlyCoef; + GVAR(currentTemperature) = GVAR(currentTemperature) + GVAR(currentTemperature) - 2 * humidity - 4 * overcast; + GVAR(currentTemperature) = round(GVAR(currentTemperature) * 10) / 10; + + // Humidity + GVAR(currentHumidity) = (GVAR(Humidity) select _month) / 100; + + if (rain > 0 && overcast > 0.7) then { + GVAR(currentHumidity) = 1; + } else { + _avgTemperature = ((GVAR(TempDay) select (_month - 1)) + (GVAR(TempNight) select (_month - 1))) / 2; + _pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature)); + _PS2 = 6.112 * exp((17.62 * GVAR(currentTemperature)) / (243.12 + GVAR(currentTemperature))); + GVAR(currentHumidity) = GVAR(currentHumidity) * _PS1 / _PS2; + }; + GVAR(currentHumidity) = 0 max GVAR(currentHumidity) min 1; + + // @todo: take altitude and humidity into account + GVAR(currentRelativeDensity) = (273.15 + 20) / (273.15 + GVAR(currentTemperature)); +}; +[_fnc_updateTemperature, 20, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/weather/XEH_postServerInit.sqf b/addons/weather/XEH_postServerInit.sqf new file mode 100644 index 0000000000..cfe35e6009 --- /dev/null +++ b/addons/weather/XEH_postServerInit.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +[FUNC(serverController), 60] call cba_fnc_addPerFrameHandler; diff --git a/addons/weather/XEH_preClientInit.sqf b/addons/weather/XEH_preClientInit.sqf new file mode 100644 index 0000000000..81b6f09fe6 --- /dev/null +++ b/addons/weather/XEH_preClientInit.sqf @@ -0,0 +1,17 @@ +#include "script_component.hpp" + + +FUNC(KEEPTIME) = { + if((count GVAR(WINDSPEED)) > 0) then { + private ["_wind", "_p", "_str"]; + _wind = ACE_wind; + + _p = _wind call CBA_fnc_vect2polar; + _str = format["Wind: %1 at %2m/s (%3MPH)\n%4", floor(_p select 1), floor(_p select 0), floor((_p select 0)*2.23693629), GVAR(WINDSPEED)]; + TRACE_2("Wind",_wind,_str); + }; +}; + +#ifdef DEBUG_MODE_FULL + [FUNC(KEEPTIME), 0.0, []] call CBA_fnc_addPerFrameHandler; +#endif diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf new file mode 100644 index 0000000000..f542c522f3 --- /dev/null +++ b/addons/weather/XEH_preInit.sqf @@ -0,0 +1,45 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +ADDON = false; +LOG(MSG_INIT); + +PREP(serverController); +PREP(getMapData); +PREP(getWind); + + + +// Rain variables +GVAR(enableRain) = true; +GVAR(rain_next_period) = -1; +GVAR(rain_period_count) = 0; +GVAR(rain_initial_rain) = 0; +if(overcast >= 0.7) then { + GVAR(rain_initial_rain) = (random ((overcast-0.7)/0.3)); +}; +GVAR(current_rain) = GVAR(rain_initial_rain); +GVAR(rain_current_range) = -1+(random 2); +GVAR(overcast_multiplier) = 1; + +// Wind Variables +ACE_wind = [0, 0, 0]; +GVAR(wind_initial_dir) = (random 360); +GVAR(wind_initial_speed) = (overcast*5)+(random (overcast*5)) max 1; +GVAR(wind_mean_speed) = GVAR(wind_initial_speed); +GVAR(wind_mean_dir) = GVAR(wind_initial_dir); +GVAR(wind_current_speed) = GVAR(wind_initial_speed); +GVAR(wind_current_dir) = GVAR(wind_initial_dir); +GVAR(wind_current_range_speed) = -1+(random 2); +GVAR(wind_current_range_dir) = -1+(random 2); +GVAR(wind_next_period) = -1; //ceil((2+random(5))/(GVAR(overcast_multiplier)/10)); +GVAR(wind_next_major_period) = -1; +GVAR(wind_period_count) = 0; +GVAR(wind_major_period_count) = 0; +GVAR(wind_total_time) = 0; +GVAR(wind_period_start_time) = time; + +// Init weather variables, in case they are needed before postInit +call FUNC(getMapData); + +ADDON = true; diff --git a/addons/weather/config.cpp b/addons/weather/config.cpp new file mode 100644 index 0000000000..dc3faecf5f --- /dev/null +++ b/addons/weather/config.cpp @@ -0,0 +1,24 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {};// "ACE_Kestrel4500" }; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"q1184", "Rocko", "CAA-Picard"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventhandlers.hpp" + +#include "CfgWorlds.hpp" + +/*class ACE_Parameters_Numeric { + GVAR(XXXX) = 100; +}; + +class ACE_Parameters_Boolean { + GVAR(XXXX) = 0; +};*/ diff --git a/addons/weather/functions/fnc_getMapData.sqf b/addons/weather/functions/fnc_getMapData.sqf new file mode 100644 index 0000000000..c610b07f59 --- /dev/null +++ b/addons/weather/functions/fnc_getMapData.sqf @@ -0,0 +1,88 @@ +/* + * Author: Ruthberg, CAA-Picard + * + * Get the weather data for the current map + * + * Argument: + * None + * + * Return value: + * None + */ +#include "script_component.hpp" + +// Check if the weather data is defined in the map config +if (isArray (configFile >> "CfgWorlds" >> worldName >> "ACE_TempDay")) exitWith { + GVAR(TempDay) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_TempDay"); + GVAR(TempNight) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_TempNight"); + GVAR(Humidity) = getArray (configFile >> "CfgWorlds" >> worldName >> "ACE_Humidity"); +}; + +// Check if the map is among the most popular +if (toLower worldName in ["chernarus", "bootcamp_acr", "woodland_acr", "utes"]) then { + // Source: http://www.iten-online.ch/klima/europa/tschechien/prag.htm + GVAR(TempDay) = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; + GVAR(TempNight) = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Prague,Czech-Republic + GVAR(Humidity) = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; +}; + +if (toLower worldName in ["takistan", "zargabad", "mountains_acr", "shapur_baf", "provinggrounds_pmc"]) exitWith { + // Source: http://www.iten-online.ch/klima/asien/afghanistan/kabul.htm + GVAR(TempDay) = [4.5, 5.5, 12.5, 19.2, 24.4, 30.2, 32.1, 32, 28.5, 22.4, 15, 8.3]; + GVAR(TempNight) = [-7.1, -5.7, 0.7, 6, 8.8, 12.4, 15.3, 14.3, 9.4, 3.9, -1.2, -4.7]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Kabul,Afghanistan + GVAR(Humidity) = [68, 69, 62, 60, 49, 37, 38, 39, 40, 41, 56, 61]; +}; + +if (toLower worldName in ["fallujah"]) exitWith { + // Source: http://www.iten-online.ch/klima/asien/irak/bagdad.htm + GVAR(TempDay) = [16, 19, 23, 29, 36, 41, 43, 43, 40, 33, 24, 17]; + GVAR(TempNight) = [4, 6, 10, 15, 20, 23, 25, 25, 21, 16, 10, 5]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Bagdad,Iraq + GVAR(Humidity) = [69, 60, 55, 50, 36, 23, 21, 22, 29, 38, 58, 68]; +}; + +if (toLower worldName in ["fata", "Abbottabad"]) exitWith { + // Source: http://www.iten-online.ch/klima/asien/pakistan/zhob.htm + GVAR(TempDay) = [12.4, 15.8, 20.8, 26.9, 32.8, 37, 36.8, 35.9, 33.8, 28.2, 22.2, 16.2]; + GVAR(TempNight) = [-0.6, 2.4, 7.4, 13.1, 18.2, 22.8, 23.8, 22.9, 19.2, 12, 5.6, 1.2]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Zhob,Pakistan + GVAR(Humidity) = [50, 40, 42, 40, 30, 30, 50, 49, 40, 32, 38, 41]; +}; + +if (worldName in ["sfp_wamako"]) exitWith { + // Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm + GVAR(TempDay) = [33.4, 35, 38.4, 41.5, 41.4, 40, 35.6, 32.9, 35.8, 38.2, 36.4, 33.1]; + GVAR(TempNight) = [14.9, 16.3, 20.4, 23.7, 25.8, 24.8, 23.1, 22, 22.6, 21.6, 18.6, 15.3]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Tahoua,Niger + GVAR(Humidity) = [68, 60, 57, 50, 32, 22, 20, 21, 25, 38, 58, 69]; +}; + +if (worldName in ["sfp_sturko"]) exitWith { + // Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm + GVAR(TempDay) = [2.2, 2.4, 5.1, 10.2, 16.1, 20.1, 21.1, 20.9, 17.2, 12.7, 7.4, 3.9]; + GVAR(TempNight) = [-2, -2.3, -0.7, 2.6, 7.1, 11.4, 13.1, 12.7, 10, 6.9, 3.1, -0.1]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,karlskrona,Sweden + GVAR(Humidity) = [86, 85, 80, 72, 68, 69, 74, 77, 79, 81, 86, 88]; +}; + +if (worldName in ["Bornholm"]) exitWith { + // Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm + GVAR(TempDay) = [1.9, 1.7, 3.8, 8.1, 14, 18.1, 19.6, 19.8, 16.2, 11.9, 7.3, 3.9]; + GVAR(TempNight) = [-1.6, -2.1, -0.7, 1.7, 6.2, 10.7, 13, 13.1, 10.6, 7.2, 3.5, 0.1]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,allinge,Denmark + GVAR(Humidity) = [85, 84, 80, 76, 69, 69, 76, 77, 79, 81, 86, 86]; +}; +if (worldName in ["Imrali"]) exitWith { + // Source: http://www.iten-online.ch/klima/europa/tuerkei/bursa.htm + GVAR(TempDay) = [9.3, 10.7, 13.6, 18.8, 23.5, 28.2, 30.3, 30.2, 27, 21.4, 16.5, 11.8]; + GVAR(TempNight) = [1.4, 2.4, 3.7, 7.1, 10.9, 14.3, 16.5, 16.3, 13, 9.5, 6, 3.8]; + // Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Bursa,Turkey + GVAR(Humidity) = [78, 75, 70, 70, 71, 61, 58, 59, 63, 69, 77, 76]; +}; + +// Assume default values +GVAR(TempDay) = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2]; +GVAR(TempNight) = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2]; +GVAR(Humidity) = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82]; diff --git a/addons/weather/functions/fnc_getWind.sqf b/addons/weather/functions/fnc_getWind.sqf new file mode 100644 index 0000000000..e25d53309d --- /dev/null +++ b/addons/weather/functions/fnc_getWind.sqf @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +_return = [0,0,0]; +if(!isNil "ACE_WIND_PARAMS") then { + _dir = ACE_WIND_PARAMS select 0; + _dirRange = (ACE_WIND_PARAMS select 1) - (ACE_WIND_PARAMS select 0); + _spd = ACE_WIND_PARAMS select 2; + _spdRange = (ACE_WIND_PARAMS select 3) - (ACE_WIND_PARAMS select 2); + _period = ACE_WIND_PARAMS select 4; + + _periodPosition = (time - GVAR(wind_period_start_time)) min _period; + _periodPercent = _periodPosition/_period; + _spdInc = _spdRange * _periodPercent; + _dirInc = _dirRange * _periodPercent; + _spd = (_spd + _spdInc); + _dir = _dir + _dirInc; + if (_dir > 360) then {_dir = _dir - 360}; + if (_dir < 0) then {_dir = _dir + 360}; + + _return = [_spd * sin _dir, _spd * cos _dir, 0]; +}; +_return; \ No newline at end of file diff --git a/addons/weather/functions/fnc_serverController.sqf b/addons/weather/functions/fnc_serverController.sqf new file mode 100644 index 0000000000..7646475e81 --- /dev/null +++ b/addons/weather/functions/fnc_serverController.sqf @@ -0,0 +1,87 @@ +#include "script_component.hpp" + +// Rain simulation +if(GVAR(rain_period_count) > GVAR(rain_next_period)) then { + + if(overcast >= 0.7) then { + _lastRain = GVAR(current_rain); + _rainOverCast = ((overcast-0.7)/0.3); + GVAR(rain_next_period) = ceil((1+random(10))/GVAR(overcast_multiplier)); + + GVAR(current_rain) = (GVAR(current_rain)+(((GVAR(current_rain)))*((_rainOverCast*(GVAR(overcast_multiplier)))/8)*GVAR(rain_current_range))); + GVAR(current_rain) = (GVAR(current_rain) max 0.01) min 1; + + _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20))+1; + GVAR(rain_current_range) = -1+(random 2); + + ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; + TRACE_4("",_lastRain,_rainOverCast,_transitionTime, overcast); + } else { + GVAR(current_rain) = 0; + _lastRain = GVAR(current_rain); + _rainOverCast = 1; + _transitionTime = (_rainOverCast*5)+(random (_rainOverCast*20))+1; + + ACE_RAIN_PARAMS = [_lastRain, GVAR(current_rain), _transitionTime]; + TRACE_4("",_lastRain,_rainOverCast,_transitionTime, overcast); + }; + + GVAR(rain_period_start_time) = time; + publicVariable "ACE_RAIN_PARAMS"; +}; + +// Wind simulation +if(GVAR(wind_period_count) > GVAR(wind_next_period)) then { + _startDir = GVAR(wind_current_dir); + _startSpeed = GVAR(wind_current_speed); + GVAR(wind_current_dir) = (GVAR(wind_current_dir)+(((GVAR(wind_current_dir)))*((overcast*(GVAR(overcast_multiplier)))/8)*GVAR(wind_current_range_dir))); + + GVAR(wind_current_speed) = (GVAR(wind_current_speed)+(((GVAR(wind_current_speed)))*(overcast*(GVAR(overcast_multiplier))/12)*GVAR(wind_current_range_speed))); + GVAR(wind_current_speed) = GVAR(wind_current_speed) max 0.01; + + if(GVAR(wind_current_dir) < 0) then { + GVAR(wind_current_dir) = GVAR(wind_current_dir)+360; + }; + GVAR(wind_current_dir) = GVAR(wind_current_dir) % 360; + + GVAR(wind_current_range_speed) = (-1)+(random 2); + + GVAR(wind_current_range_dir) = (-1)+(random 2); + + GVAR(wind_next_period) = ceil((2+random(5))/(GVAR(overcast_multiplier))); + GVAR(wind_period_count) = 0; + + _gustCount = floor(random(GVAR(wind_next_period)*(overcast*((GVAR(overcast_multiplier)^3))))); + + _time = GVAR(wind_next_period)*60; + _gusts = []; + if(_gustCount > 0) then { + _maxInterval = _time/_gustCount; + for "_i" from 0 to _gustCount-1 do { + _gustTime = (random (3 min _maxInterval)); + _timeTillGust = (_maxInterval*_i)+(random (_maxInterval - _gustTime)); + _gustSpeed = (random 1); + _gustDir = (GVAR(wind_current_dir)+(GVAR(wind_current_dir)*(-1+(random 2))))*(overcast*(GVAR(overcast_multiplier))); + _gusts set[(count _gusts), [_timeTillGust, _gustTime, _gustSpeed, _gustDir]]; + }; + }; + + GVAR(wind_total_time) = GVAR(wind_total_time) + GVAR(wind_next_period); + + ACE_WIND_PARAMS = [_startDir, + GVAR(wind_current_dir), + _startSpeed, + GVAR(wind_current_speed), + _time, + _gusts]; + + GVAR(wind_period_start_time) = time; + publicVariable "ACE_WIND_PARAMS"; +}; + +// Sync misc. parameters +ACE_MISC_PARAMS = [lightnings, rainbow, fogParams]; +publicVariable "ACE_MISC_PARAMS"; + +GVAR(rain_period_count) = GVAR(rain_period_count) + 1; +GVAR(wind_period_count) = GVAR(wind_period_count) + 1; \ No newline at end of file diff --git a/addons/weather/functions/script_component.hpp b/addons/weather/functions/script_component.hpp new file mode 100644 index 0000000000..e1916225e8 --- /dev/null +++ b/addons/weather/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\weather\script_component.hpp" \ No newline at end of file diff --git a/addons/weather/script_component.hpp b/addons/weather/script_component.hpp new file mode 100644 index 0000000000..abfe607257 --- /dev/null +++ b/addons/weather/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT weather +#include "\z\ace\addons\main\script_mod.hpp" +//#define DEBUG_ENABLED_WEATHER +#ifdef DEBUG_ENABLED_WEATHER + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_WEATHER + #define DEBUG_SETTINGS DEBUG_SETTINGS_WEATHER +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/wep_dragon/README.md b/addons/wep_dragon/README.md new file mode 100644 index 0000000000..4031d33f8d --- /dev/null +++ b/addons/wep_dragon/README.md @@ -0,0 +1,12 @@ +ace_wep_dragon +============== + +Adds the Dragon AT launcher. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [walterpearce](https://github.com/walterpearce) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/wep_javelin/README.md b/addons/wep_javelin/README.md new file mode 100644 index 0000000000..18bd8c6b3f --- /dev/null +++ b/addons/wep_javelin/README.md @@ -0,0 +1,12 @@ +ace_wep_javelin +=============== + +Adds the Javelin AT launcher. + + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [walterpearce](https://github.com/walterpearce) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/wep_javelin/XEH_pre_init.sqf b/addons/wep_javelin/XEH_pre_init.sqf index 8682a8a2e9..f826c6cf93 100644 --- a/addons/wep_javelin/XEH_pre_init.sqf +++ b/addons/wep_javelin/XEH_pre_init.sqf @@ -1,4 +1,7 @@ #include "script_component.hpp" PREP(fired); -PREP(onGetLockedTarget); \ No newline at end of file +PREP(onGetLockedTarget); + +PREP(translateToWeaponSpace); +PREP(translateToModelSpace); \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_fired.sqf b/addons/wep_javelin/functions/fnc_fired.sqf index df4f45e17e..d576975c96 100644 --- a/addons/wep_javelin/functions/fnc_fired.sqf +++ b/addons/wep_javelin/functions/fnc_fired.sqf @@ -6,19 +6,44 @@ PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); FUNC(guidance_Javelin_LOBL_HI_PFH) = { TRACE_1("enter", _this); + private["_pitch", "_yaw", "_wentTerminal", "_target", "_targetPos", "_curVelocity", "_missile" ]; _args = _this select 0; //PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); _shooter = _args select 0; _missile = _args select 6; + + if((count _this) > 2) then { + _wentTerminal = _this select 2; + } else { + _this set[2, false]; + _wentTerminal = false; + }; + + if((count _this) > 3) then { + _targets = _this select 3; + _target = _targets select 0; + _targetPos = _targets select 1; + } else { + _this set[3, [GVAR(currentTarget),GVAR(currentTargetPos)] ]; + _target = GVAR(currentTarget); + _targetPos = GVAR(currentTargetPos); + }; + _curVelocity = velocity _missile; - if(!alive _missile || isNull _missile || isNull _shooter) exitWith { + if(!alive _missile || isNull _missile) exitWith { [(_this select 1)] call cba_fnc_removePerFrameHandler; }; - TRACE_2("Setting launch parameters", GVAR(currentTarget), GVAR(currentTargetPos)); - _target = GVAR(currentTarget); + _launchPos = _shooter getVariable [QGVAR(launchPos), nil]; + if(isNil "_launchPos") then { + TRACE_1("Setting launch parameters", ""); + _launchPos = getPosASL _shooter; + _shooter setVariable [QGVAR(launchPos), _launchPos, false]; + _shooter setVariable [QGVAR(launchTime), diag_tickTime, false]; + }; + _addHeight = [0,0,0]; if(!isNil "_target") then { @@ -28,37 +53,28 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = { _missilePos = getPosASL _missile; // player sideChat "G!"; - _targetPos = GVAR(currentTargetPos); - + TRACE_4("Phase Check", _launchPos, _missilePos, _targetPos, (_missilePos distance _targetPos)); if((count _targetPos) > 0) then { - _distanceToTarget = _missilePos vectorDistance _targetPos; + _distanceToTarget = [(_missilePos select 0), (_missilePos select 1), (_targetPos select 2)] vectorDistance _targetPos; - _defPitch = 0.05; + _defPitch = 0.25; - if((_launchPos distance _missilePos) < 400 && (_targetPos distance _missilePos) > 400) then { - _addHeight = [0,0,(_targetPos select 2) + ((_launchPos distance _targetPos)*2)]; + if( (_missilePos select 2) < (_targetPos select 2) + 160 && !_wentTerminal) then { + _addHeight = [0,0,(_targetPos select 2) + ( (_distanceToTarget * 2) + 160)]; TRACE_1("Climb phase", _addHeight); - //_defPitch = 0.1; } else { - // Covered half the distance, go terminal - if((_missilePos distance _targetPos) < (_launchPos distance _targetPos) / 2) then { - TRACE_1("TERMINAL", ""); - } else { - if((_missilePos select 2) > (_targetPos select 2)) then { - _heightDiff = (_missilePos select 2) - (_targetPos select 2); - TRACE_1("Coasting", _heightDiff); - _addHeight = [0,0, _heightDiff]; - }; - }; + _wentTerminal = true; + _this set[2, _wentTerminal]; + TRACE_1("TERMINAL", ""); }; _targetPos = _targetPos vectorAdd _addHeight; _defYaw = 0.0035; - _targetVectorSeeker = [_missile, [_xVec, _yVec, _zVec], _targetPos] call FUNC(translateToWeaponSpace); _yaw = 0.0; + TRACE_5("", _missile, _xVec, _yVec, _zVec, _targetPos); if((_targetVectorSeeker select 0) < 0) then { _yaw = -_defYaw; } else { @@ -75,6 +91,9 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = { _pitch = _defPitch; }; }; + + TRACE_3("", _targetVectorSeeker, _pitch, _yaw); + #ifdef DEBUG_MODE_FULL drawLine3D [(ASLtoATL _targetPos) vectorAdd _addHeight, ASLtoATL _targetPos, [0,1,0,1]]; @@ -95,9 +114,11 @@ FUNC(guidance_Javelin_LOBL_HI_PFH) = { #endif if(accTime > 0) then { + TRACE_5("", _xVec, _yVec, _zVec, _yaw, _pitch); _outVector = [_missile, [_xVec, _yVec, _zVec], [_yaw, 1/accTime, _pitch]] call FUNC(translateToModelSpace); _vectorTo = _missilePos vectorFromTo _outVector; + TRACE_3("", _missile, _outVector, _vectorTo); _missile setVectorDirAndUp [_vectorTo, vectorUp _missile]; }; @@ -116,7 +137,7 @@ FUNC(guidance_Javelin_LOBL_HI) = { }; if(!local _shooter) exitWith { false }; -if(_weapon == "launch_B_Titan_short_F") then { +if(_ammo == "M_Titan_AT") then { _fireMode = _shooter getVariable ["ACE_FIRE_SELECTION", ACE_DEFAULT_FIRE_SELECTION]; switch (_fireMode select 0) do { diff --git a/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf b/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf new file mode 100644 index 0000000000..1e2e930ac7 --- /dev/null +++ b/addons/wep_javelin/functions/fnc_translateToModelSpace.sqf @@ -0,0 +1,16 @@ +_object = _this select 0; +_origin = getPosASL _object; +_matrix = _this select 1; +_xVec = _matrix select 0; +_yVec = _matrix select 1; +_zVec = _matrix select 2; + +_offset = _this select 2; + +_x = _offset select 0; +_y = _offset select 1; +_z = _offset select 2; + +_out = (((_xVec vectorMultiply _x) vectorAdd (_yVec vectorMultiply _y)) vectorAdd (_zVec vectorMultiply _z)) vectorAdd _origin; + +_out; \ No newline at end of file diff --git a/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf new file mode 100644 index 0000000000..d74fa17fa1 --- /dev/null +++ b/addons/wep_javelin/functions/fnc_translateToWeaponSpace.sqf @@ -0,0 +1,23 @@ + +_object = _this select 0; +_origin = getPosASL _object; +_matrix = _this select 1; +_xVec = _matrix select 0; +_yVec = _matrix select 1; +_zVec = _matrix select 2; + +_offset = _this select 2; + +_offset = _offset vectorDiff _origin; + +_x = _offset select 0; +_y = _offset select 1; +_z = _offset select 2; + +_out = [ + ((_xVec select 0)*_x) + ((_xVec select 1)*_y) + ((_xVec select 2)*_z), + ((_yVec select 0)*_x) + ((_yVec select 1)*_y) + ((_yVec select 2)*_z), + ((_zVec select 0)*_x) + ((_zVec select 1)*_y) + ((_zVec select 2)*_z) + ]; + +_out; \ No newline at end of file diff --git a/extras/blank/XEH_preInit.sqf b/extras/blank/XEH_preInit.sqf index 802b74fd63..69abb46fa9 100644 --- a/extras/blank/XEH_preInit.sqf +++ b/extras/blank/XEH_preInit.sqf @@ -1,3 +1,7 @@ #include "script_component.hpp" +ADDON = false; + PREP(empty); + +ADDON = true; diff --git a/tools/build.bat b/tools/build.bat index 32973803dc..05294fd579 100644 --- a/tools/build.bat +++ b/tools/build.bat @@ -1,4 +1,5 @@ pushd ..\addons\ +del /q /f *.pbo for /D %%i in (*.*) do ( makepbo -NUP -@=z\addons\ace\%%i %%i ace_%%i.pbo if %errorlevel% neq 0 exit /b %errorlevel% diff --git a/tools/maintainers.py b/tools/maintainers.py new file mode 100755 index 0000000000..b3b4e3aec5 --- /dev/null +++ b/tools/maintainers.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 + +import os +import sys + +def get_all_paths(root): + path = os.path.join(root, "addons") + fpaths = [] + for f in os.listdir(path): + fpath = os.path.join(path, f, "README.md") + if not os.path.exists(fpath): + fpaths.append(fpath) + return fpaths + +def add_readme(path): + name = os.path.split(os.path.dirname(path))[-1] + name = "ace_"+name + print("\n# COMPONENT: {}".format(name)) + + description = input("Desc: ") + + maintainers = [ + "KoffeinFlummi", + "commy2", + "esteldunedain", + "CorruptedHeart", + "PabstMirror", + "bux578", + "Glowbal", + "walterpearce", + "NouberNou" + ] + for (i, m) in enumerate(maintainers): + print("({}) {}".format(i, m), end="") + if i+1 < len(maintainers): + print(", ", end="") + else: + print("") + mstring = input("Maintainers: ") + + content = name + "\n" + "=" * len(name) + "\n\n" + content += description + "\n\n\n" + content += "## Maintainers\n\n" + content += "The people responsible for merging changes to this component or answering potential questions.\n\n" + for i in mstring.split(","): + mname = maintainers[int(i)] + content += "- [{}](https://github.com/{})\n".format(mname, mname) + + f = open(path, "w") + f.write(content) + f.close() + +def main(): + projectroot = os.path.realpath(__file__) + projectroot = os.path.dirname(os.path.dirname(projectroot)) + + paths = get_all_paths(projectroot) + print(len(paths)) + + for path in paths: + add_readme(path) + +if __name__ == "__main__": + main() diff --git a/tools/rename_fn.py b/tools/rename_fn.py old mode 100644 new mode 100755 diff --git a/tools/stringtableduplicates.py b/tools/stringtableduplicates.py old mode 100644 new mode 100755