diff --git a/TO_MERGE/agm/Backpacks/config.cpp b/TO_MERGE/agm/Backpacks/config.cpp deleted file mode 100644 index c93e0c5f89..0000000000 --- a/TO_MERGE/agm/Backpacks/config.cpp +++ /dev/null @@ -1,62 +0,0 @@ -class CfgPatches { - class AGM_Backpacks { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core, AGM_Interaction}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"bux", "commy2"}; - authorUrl = "https://github.com/commy2/"; - }; -}; - -class CfgFunctions { - class AGM_Backpacks { - class AGM_Backpacks { - file = "\AGM_Backpacks\functions"; - class getBackpackAssignedUnit; - class isBackpack; - class openInventory; - }; - }; -}; - -class Extended_InventoryOpened_EventHandlers { - class CAManBase { - class AGM_Backpacks_openInventory { - clientInventoryOpened = "if (_this select 0 == AGM_player) then {_this call AGM_Backpacks_fnc_openInventory};"; - }; - }; -}; - -class CfgVehicles { - class Man; - class CAManBase: Man { - class AGM_SelfActions { - class AGM_Equipment { - class AGM_LockBackpack { - displayName = "$STR_AGM_Backpacks_LockBackpack"; - condition = "[backpackContainer _player] call AGM_Backpacks_fnc_isBackpack && {!((backpackContainer _player) getVariable ['AGM_LockedInventory', false])}"; - statement = "(backpackContainer _player) setVariable ['AGM_LockedInventory', true, true]"; - showDisabled = 0; - priority = 2.5; - icon = ""; // @todo - hotkey = "L"; - enableInside = 1; - }; - class AGM_UnlockBackpack { - displayName = "$STR_AGM_Backpacks_UnlockBackpack"; - condition = "[backpackContainer _player] call AGM_Backpacks_fnc_isBackpack && {(backpackContainer _player) getVariable ['AGM_LockedInventory', false]}"; - statement = "(backpackContainer _player) setVariable ['AGM_LockedInventory', false, true]"; - showDisabled = 0; - priority = 2.5; - icon = ""; // @todo - hotkey = "L"; - enableInside = 1; - }; - }; - }; - }; -}; diff --git a/TO_MERGE/agm/Backpacks/functions/fn_openInventory.sqf b/TO_MERGE/agm/Backpacks/functions/fn_openInventory.sqf deleted file mode 100644 index 8e584be19b..0000000000 --- a/TO_MERGE/agm/Backpacks/functions/fn_openInventory.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: bux, commy2 - * - * Handle the open inventory event. Don't open the inventory if it's locked and display message. - * - * Argument: - * Input from "InventoryOpened" eventhandler - * - * Return value: - * Don't open the inventory dialog? (Bool) - */ - -private ["_target", "_isBackpack", "_isLocked", "_return"]; - -_target = _this select 1; - -_isBackpack = [_target] call AGM_Backpacks_fnc_isBackpack; -_isLocked = _target getVariable ["AGM_LockedInventory", false]; - -_return = false; -if (_isBackpack) then { - // target is a backpack - private "_unit"; - _unit = [_target] call AGM_Backpacks_fnc_getBackpackAssignedUnit; - - if (!alive _unit || {_unit getVariable ["AGM_isUnconscious", false]}) exitWith {}; - - if (_isLocked) then { - // target is a locked backpack - [format [localize "STR_AGM_Backpacks_BackpackLocked", [_unit] call AGM_Core_fnc_getName]] call AGM_Core_fnc_displayTextStructured; - _return = true; - } else { - // target is a not-locked backpack - if (_unit getVariable ["AGM_LockedInventory", false]) then { - [localize "STR_AGM_Backpacks_InventoryLocked"] call AGM_Core_fnc_displayTextStructured; - _return = true; - }; - }; -} else { - // target is not a backpack - if (_isLocked) then { - [localize "STR_AGM_Backpacks_InventoryLocked"] call AGM_Core_fnc_displayTextStructured; - _return = true; - }; -}; -_return diff --git a/TO_MERGE/agm/Difficulties/config.cpp b/TO_MERGE/agm/Difficulties/config.cpp deleted file mode 100644 index 1f52136ca7..0000000000 --- a/TO_MERGE/agm/Difficulties/config.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -class CfgPatches { - class AGM_Difficulties { - 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 CfgDifficulties { - class Mercenary { - class Flags { - armor[] = {0,0}; - friendlyTag[] = {0,0}; - enemyTag[] = {0,0}; - mineTag[] = {0,0}; - hud[] = {0,1};//{1,1}; - hudPerm[] = {0,0}; - hudWp[] = {0,0}; - hudWpPerm[] = {0,0}; - autoSpot[] = {0,1}; - map[] = {0,0}; - weaponCursor[] = {0,1};//{1,1}; - autoGuideAT[] = {0,0}; - clockIndicator[] = {0,0}; - 3rdPersonView[] = {0,0}; - autoAim[] = {0,0}; - unlimitedSaves[] = {0,0}; - deathMessages[] = {0,1};//{1,1}; - netStats[] = {0,1};//{1,1}; - vonID[] = {0,1}; - cameraShake[] = {1,0}; - hudGroupInfo[] = {0,0}; - extendetInfoType[] = {0,0}; - roughLanding[] = {0,0}; - windEnabled[] = {1,0}; - autoTrimEnabled[] = {0,0}; - stressDamageEnabled[] = {1,0}; - }; - }; -}; diff --git a/TO_MERGE/agm/GForces/clientInit.sqf b/TO_MERGE/agm/GForces/clientInit.sqf deleted file mode 100644 index 5b10456164..0000000000 --- a/TO_MERGE/agm/GForces/clientInit.sqf +++ /dev/null @@ -1,94 +0,0 @@ -#define AVERAGEDURATION 6 -#define INTERVAL 0.25 -#define MAXVIRTUALG 5.4 - -if !(hasInterface) exitWith {}; - -AGM_GForces = []; -AGM_GForces_Index = 0; - -AGM_GForces_CC = ppEffectCreate ["ColorCorrections", 4215]; -AGM_GForces_CC ppEffectEnable true; -AGM_GForces_CC ppEffectForceInNVG true; -AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; -AGM_GForces_CC ppEffectCommit 0.4; - -0 spawn { - while {True} do { - _player = AGM_player; - - if !((vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)) then { - AGM_GForces = []; - AGM_GForces_Index = 0; - waitUntil {sleep 5; (vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)}; - }; - - _oldVel = velocity (vehicle _player); - sleep INTERVAL; - _newVel = velocity (vehicle _player); - - _accel = ((_newVel vectorDiff _oldVel) vectorMultiply (1 / INTERVAL)) vectorAdd [0, 0, 9.8]; - AGM_GForce_Current = (_accel vectorDotProduct vectorUp (vehicle _player)) / 9.8; - - // Cap maximum G's to +- 10 to avoid g-effects when the update is low fps. - AGM_GForce_Current = (AGM_GForce_Current max -10) min 10; - - AGM_GForces set [AGM_GForces_Index, AGM_GForce_Current]; - AGM_GForces_Index = (AGM_GForces_Index + 1) % round (AVERAGEDURATION / INTERVAL); - }; -}; - - -/* - * source: http://en.wikipedia.org/wiki/G-LOC - * untrained persons without gsuit will fall unconscious between 4 and 6G - * pilots in gsuits will sustain up to 9G - * a person is for average 12 seconds unconscious - * after being unconscious, a person is unable to do simple tasks for average 15 seconds - * - * _upTolerance converts the effective 9G of a pilot to virtual 5.4G (= 0.8*0.75*9G) - * pilots with gsuit will get unconscious at an _average of 9G - * normal men without gsuit will get unconscious at an _average of 5.4G - */ - -0 spawn { - while {True} do { - sleep INTERVAL; - _player = AGM_player; - - _average = 0; - if (count AGM_GForces > 0) then { - _sum = 0; - { - _sum = _sum + _x; - } forEach AGM_GForces; - _average = _sum / (count AGM_GForces); - }; - - _downTolerance = _player getVariable ["AGM_GForceCoef", - getNumber (configFile >> "CfgVehicles" >> (typeOf _player) >> "AGM_GForceCoef")]; - _upTolerance = _downTolerance * getNumber (configFile >> "CfgWeapons" >> (uniform _player) >> "AGM_GForceCoef"); - - ["GForces", [_average, _upTolerance], {format ["_g _avgG _avgG*_upTol: %1, %2, %3", AGM_GForce_Current, _this select 0, (_this select 0) * (_this select 1)]}] call AGM_Debug_fnc_log; - - if (((_average * _upTolerance) > MAXVIRTUALG) and {isClass (configFile >> "CfgPatches" >> "AGM_Medical") and {!(_player getVariable ["AGM_isUnconscious", false])}}) then { - [_player, (10 + floor(random 5))] call AGM_Medical_fnc_knockOut; - }; - - if ((abs _average > 2) and !(_player getVariable ["AGM_isUnconscious", false])) then { - if (_average > 0) then { - _strength = 1.2 - (((_average - 2) * _upTolerance) / (MAXVIRTUALG - 2)); - AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[_strength,_strength,0,0,0,0.1,0.5]]; - addCamShake [((abs _average) - 2) / 3, 1, 15]; - } else { - _strength = 1.2 - ((((-1 * _average) - 2) * _downTolerance) / (MAXVIRTUALG - 2)); - AGM_GForces_CC ppEffectAdjust [1,1,0,[1,0.2,0.2,1],[0,0,0,0],[1,1,1,1],[_strength,_strength,0,0,0,0.1,0.5]]; - addCamShake [((abs _average) - 2) / 5, 1, 15]; - }; - } else { - AGM_GForces_CC ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; - }; - - AGM_GForces_CC ppEffectCommit INTERVAL; - }; -}; diff --git a/TO_MERGE/agm/GForces/config.cpp b/TO_MERGE/agm/GForces/config.cpp deleted file mode 100644 index b5fe1e12c5..0000000000 --- a/TO_MERGE/agm/GForces/config.cpp +++ /dev/null @@ -1,56 +0,0 @@ -class CfgPatches { - class AGM_GForces { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_GForces { - clientInit = "call compile preprocessFileLineNumbers '\AGM_GForces\clientInit.sqf'"; - }; -}; - -class CfgWeapons { - class ItemCore; - class Uniform_Base: ItemCore { - AGM_GForceCoef = 1; - }; - - class U_B_PilotCoveralls: Uniform_Base { - AGM_GForceCoef = 0.8; - }; - class U_I_pilotCoveralls: Uniform_Base { - AGM_GForceCoef = 0.8; - }; - class U_O_PilotCoveralls: Uniform_Base { - AGM_GForceCoef = 0.8; - }; -}; - -class CfgVehicles { - class Man; - class CAManBase: Man { - AGM_GForceCoef = 1; - }; - - class B_Soldier_05_f; - class B_Pilot_F: B_Soldier_05_f { - AGM_GForceCoef = 0.75; - }; - class I_Soldier_04_F; - class I_pilot_F: I_Soldier_04_F { - AGM_GForceCoef = 0.75; - }; - class O_helipilot_F; - class O_Pilot_F: O_helipilot_F { - AGM_GForceCoef = 0.75; - }; -}; diff --git a/TO_MERGE/agm/Grenades/AGM_M84.p3d b/TO_MERGE/agm/Grenades/AGM_M84.p3d deleted file mode 100644 index 0e27ead30c..0000000000 Binary files a/TO_MERGE/agm/Grenades/AGM_M84.p3d and /dev/null differ diff --git a/TO_MERGE/agm/Grenades/AGM_M84_thrown.p3d b/TO_MERGE/agm/Grenades/AGM_M84_thrown.p3d deleted file mode 100644 index 504752d39f..0000000000 Binary files a/TO_MERGE/agm/Grenades/AGM_M84_thrown.p3d and /dev/null differ diff --git a/TO_MERGE/agm/Grenades/clientInit.sqf b/TO_MERGE/agm/Grenades/clientInit.sqf deleted file mode 100644 index 343bf82863..0000000000 --- a/TO_MERGE/agm/Grenades/clientInit.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 - -AGM_Flashbang_CC = ppEffectCreate ["ColorCorrections", 4265]; -AGM_Flashbang_CC ppEffectForceInNVG true; diff --git a/TO_MERGE/agm/Grenades/config.cpp b/TO_MERGE/agm/Grenades/config.cpp deleted file mode 100644 index 2a24483a18..0000000000 --- a/TO_MERGE/agm/Grenades/config.cpp +++ /dev/null @@ -1,272 +0,0 @@ -class CfgPatches { - class AGM_Grenades { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"commy2", "KoffeinFlummi"}; - authorUrl = "https://github.com/commy2/"; - }; -}; - -class CfgFunctions { - class AGM_Grenades { - class AGM_Grenades { - file = "\AGM_Grenades\functions"; - class flashbangEffect; - class nextMode; - class throwGrenade; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Grenades { - clientInit = "call compile preprocessFileLineNumbers '\AGM_Grenades\clientInit.sqf'"; - }; -}; - -class Extended_FiredBIS_EventHandlers { - class CAManBase { - class AGM_Grenades_ThrowGrenade { - clientFiredBIS = "if (_this select 0 == AGM_player) then {_this call AGM_Grenades_fnc_throwGrenade;};"; - }; - }; -}; - -class AGM_Core_Default_Keys { - class switchGrenadeMode { - displayName = "$STR_AGM_Grenades_SwitchGrenadeMode"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "call AGM_Grenades_fnc_nextMode"; - key = 9;//34; - shift = 0; - control = 0; - alt = 0;//1; - }; -}; - -class CfgAmmo { - class FlareCore; - class FlareBase: FlareCore { - intensity = 20000; - flareSize = 12; - }; - class F_40mm_White: FlareBase { - intensity = 40000; - flareSize = 12; - }; - class F_20mm_White: FlareBase { - intensity = 20000; - flareSize = 12; - }; - class F_Signal_Green: FlareBase { - intensity = 20000; - flareSize = 12; - }; - class Flare_82mm_AMOS_White: FlareCore { - intensity = 80000; - flareSize = 12; - }; - - class F_20mm_Red: F_20mm_White {}; - class F_20mm_Green: F_20mm_White {}; - class F_20mm_Yellow: F_20mm_White {}; - - class AGM_F_Hand_White: F_20mm_White { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; - timeToLive = 60; - }; - class AGM_F_Hand_Red: F_20mm_Red { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; - timeToLive = 60; - }; - class AGM_F_Hand_Green: F_20mm_Green { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; - timeToLive = 60; - }; - class AGM_F_Hand_Yellow: F_20mm_Yellow { - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; - timeToLive = 60; - }; - - - class AGM_G_M84: F_20mm_Yellow { - useFlare = 0; - flareSize = 0; - intensity = 0; - grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; - soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; - SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; - SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; - SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; - SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; - SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; - timeToLive = 60; - fuseDistance = 2.3; - model = "agm_grenades\agm_m84_thrown.p3d"; - }; -}; - -class CfgMagazines { - class HandGrenade; - class AGM_HandFlare_Base: HandGrenade { - value = 2; - nameSoundWeapon = "smokeshell"; - nameSound = "smokeshell"; - mass = 4; - initSpeed = 22; - }; - class AGM_HandFlare_White: AGM_HandFlare_Base { - ammo = "AGM_F_Hand_White"; - displayname = "$STR_AGM_Grenades_M127A1_White_Name"; - descriptionshort = "$STR_AGM_Grenades_M127A1_White_Description"; - displayNameShort = "$STR_AGM_Grenades_M127A1_White_NameShort"; - model = "\A3\weapons_f\ammo\flare_white"; - picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; - }; - class AGM_HandFlare_Red: AGM_HandFlare_Base { - ammo = "AGM_F_Hand_Red"; - displayname = "$STR_AGM_Grenades_M127A1_Red_Name"; - descriptionshort = "$STR_AGM_Grenades_M127A1_Red_Description"; - displayNameShort = "$STR_AGM_Grenades_M127A1_Red_NameShort"; - model = "\A3\weapons_f\ammo\flare_red"; - picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; - }; - class AGM_HandFlare_Green: AGM_HandFlare_Base { - ammo = "AGM_F_Hand_Green"; - displayname = "$STR_AGM_Grenades_M127A1_Green_Name"; - descriptionshort = "$STR_AGM_Grenades_M127A1_Green_Description"; - displayNameShort = "$STR_AGM_Grenades_M127A1_Green_NameShort"; - model = "\A3\weapons_f\ammo\flare_green"; - picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; - }; - class AGM_HandFlare_Yellow: AGM_HandFlare_Base { - ammo = "AGM_F_Hand_Yellow"; - displayname = "$STR_AGM_Grenades_M127A1_Yellow_Name"; - descriptionshort = "$STR_AGM_Grenades_M127A1_Yellow_Description"; - displayNameShort = "$STR_AGM_Grenades_M127A1_Yellow_NameShort"; - model = "\A3\weapons_f\ammo\flare_yellow"; - picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; - }; - class AGM_M84: HandGrenade { - ammo = "AGM_G_M84"; - displayname = "$STR_AGM_Grenades_M84_Name"; - descriptionshort = "$STR_AGM_Grenades_M84_Description"; - displayNameShort = "M84"; - model = "agm_grenades\agm_m84.p3d"; - picture = "\agm_grenades\UI\agm_m84_x_ca.paa"; - }; - - class 3Rnd_UGL_FlareGreen_F; - class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F { - ammo = "F_40mm_Green"; - initSpeed = 120; - }; - class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { - ammo = "F_40mm_Red"; - initSpeed = 120; - }; -}; - -class CfgWeapons { - class GrenadeLauncher; - - class Throw: GrenadeLauncher { - muzzles[] += {"AGM_HandFlare_WhiteMuzzle", "AGM_HandFlare_RedMuzzle", "AGM_HandFlare_GreenMuzzle", "AGM_HandFlare_YellowMuzzle", "AGM_M84Muzzle"}; - class ThrowMuzzle; - class AGM_HandFlare_WhiteMuzzle: ThrowMuzzle { - magazines[] = {"AGM_HandFlare_White"}; - }; - class AGM_HandFlare_RedMuzzle: ThrowMuzzle { - magazines[] = {"AGM_HandFlare_Red"}; - }; - class AGM_HandFlare_GreenMuzzle: ThrowMuzzle { - magazines[] = {"AGM_HandFlare_Green"}; - }; - class AGM_HandFlare_YellowMuzzle: ThrowMuzzle { - magazines[] = {"AGM_HandFlare_Yellow"}; - }; - class AGM_M84Muzzle: ThrowMuzzle { - magazines[] = {"AGM_M84"}; - }; - }; -}; - -#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ -}; - -class CfgVehicles { - class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class Box_NATO_Support_F; - - class Box_NATO_Grenades_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_HandFlare_White,12) - MACRO_ADDITEM(AGM_HandFlare_Green,12) - MACRO_ADDITEM(AGM_M84,12) - }; - }; - - class Box_East_Grenades_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_HandFlare_Yellow,12) - MACRO_ADDITEM(AGM_HandFlare_Red,12) - MACRO_ADDITEM(AGM_M84,12) - }; - }; - - class Box_IND_Grenades_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_HandFlare_Yellow,12) - MACRO_ADDITEM(AGM_HandFlare_Green,12) - MACRO_ADDITEM(AGM_M84,12) - }; - }; - - class AGM_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(AGM_HandFlare_White,12) - MACRO_ADDITEM(AGM_HandFlare_Red,12) - MACRO_ADDITEM(AGM_HandFlare_Green,12) - MACRO_ADDITEM(AGM_HandFlare_Yellow,12) - MACRO_ADDITEM(AGM_M84,12) - }; - }; -}; diff --git a/TO_MERGE/agm/Grenades/data/agm_m84.rvmat b/TO_MERGE/agm/Grenades/data/agm_m84.rvmat deleted file mode 100644 index 68a9e35141..0000000000 Binary files a/TO_MERGE/agm/Grenades/data/agm_m84.rvmat and /dev/null differ diff --git a/TO_MERGE/agm/Grenades/functions/fn_flashbangEffect.sqf b/TO_MERGE/agm/Grenades/functions/fn_flashbangEffect.sqf deleted file mode 100644 index 97d448c6f2..0000000000 --- a/TO_MERGE/agm/Grenades/functions/fn_flashbangEffect.sqf +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Creates the flashbang effect locally/knocks out AI units. - * - * Arguments: - * 0: The unit (Object) - * 1: The grenade (Object) - * - * Return Value: - * None - */ - -_this spawn { - _unit = _this select 0; - _grenade = _this select 1; - - if (damage _unit >= 1) exitWith {}; - - _strength = 1 - ((_unit distance _grenade) min 15) / 15; - - if !(isPlayer _unit) exitWith { - _unit disableAI "MOVE"; - _unit disableAI "ANIM"; - _unit disableAI "AUTOTARGET"; - _unit disableAI "TARGET"; - _unit disableAI "FSM"; - _unit setSkill (skill _unit / 50); - - sleep (7 * _strength); - - _unit enableAI "MOVE"; - _unit enableAI "ANIM"; - _unit enableAI "AUTOTARGET"; - _unit enableAI "TARGET"; - _unit enableAI "FSM"; - _unit setSkill (skill _unit * 50); - }; - - // is there line of sight to the grenade? - _posGrenade = getPosASL _grenade; - _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground - if (lineIntersects [_posGrenade, getPosASL _unit, _grenade, _unit]) then { - _strength = _strength / 10; - }; - - // beeeeeeeeeeeeeeeeeeeeeeeeeeeeep - if (isClass (configFile >> "CfgPatches" >> "AGM_Hearing") and _strength > 0) then { - [_unit, 0.5 + (_strength / 2)] call AGM_Hearing_fnc_earRinging; - }; - - // account for people looking away by slightly - // reducing the effect for visual effects. - _posUnit = getPos _unit; - _posGrenade = getPos _grenade; - _angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1)); - _angleGrenade = (_angleGrenade + 360) % 360; - - _angleView = (eyeDirection player select 0) atan2 (eyeDirection player select 1); - _angleView = (_angleView + 360) % 360; - - _angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180); - _angleDiff = ((_angleDiff - 45) max 0); - - _strength = _strength - _strength * (_angleDiff / 135); - - // create flash to illuminate environment - _light = "#lightpoint" createVehicleLocal getPos _grenade; - _light setLightBrightness 200; - _light setLightAmbient [1,1,1]; - _light setLightColor [1,1,1]; - _light setLightDayLight true; - - // blind player - if (_strength > 0.1) then { - AGM_Flashbang_CC ppEffectEnable true; - AGM_Flashbang_CC ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; - AGM_Flashbang_CC ppEffectCommit 0.01; - }; - - sleep 0.1; - deleteVehicle _light; - sleep (7 * _strength); - - if (_strength > 0.1) then { - AGM_Flashbang_CC ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; - AGM_Flashbang_CC ppEffectCommit (10 * _strength); - - sleep (10 * _strength); - - AGM_Flashbang_CC ppEffectEnable false; - }; -}; diff --git a/TO_MERGE/agm/Grenades/functions/fn_nextMode.sqf b/TO_MERGE/agm/Grenades/functions/fn_nextMode.sqf deleted file mode 100644 index b3a1445dc4..0000000000 --- a/TO_MERGE/agm/Grenades/functions/fn_nextMode.sqf +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Author: commy2 - * - * Select the next throwing mode and display message. - * - * Argument: - * Nothing - * - * Return value: - * Nothing - */ - -private ["_mode", "_hint"]; - -_mode = missionNamespace getVariable ["AGM_Grenades_Mode", 0]; - -if (_mode == 4) then { - _mode = 0; -} else { - _mode = _mode + 1; -}; - -// ROLL GRENADE DOESN'T WORK RIGHT NOW -if (_mode == 3) then { - _mode = 4; -}; - -_hint = [ - localize "STR_AGM_Grenades_NormalThrow", - localize "STR_AGM_Grenades_HighThrow", - localize "STR_AGM_Grenades_PreciseThrow", - localize "STR_AGM_Grenades_RollGrenade", - localize "STR_AGM_Grenades_DropGrenade" -] select _mode; - -[_hint] call AGM_Core_fnc_displayTextStructured; - -AGM_Grenades_Mode = _mode; diff --git a/TO_MERGE/agm/Grenades/functions/fn_throwGrenade.sqf b/TO_MERGE/agm/Grenades/functions/fn_throwGrenade.sqf deleted file mode 100644 index ab5e7a1cfd..0000000000 --- a/TO_MERGE/agm/Grenades/functions/fn_throwGrenade.sqf +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Author: commy2 - * - * Adjust the grenades throwing direction and speed to the selected throwing mode. - * - * Argument: - * input from "Fired" eventhandler - * - * Return value: - * Nothing - */ - -private ["_unit", "_weapon", "_projectile"]; - -_unit = _this select 0; -_weapon = _this select 1; -_projectile = _this select 6; - -if (_weapon != "Throw") exitWith {}; - -private "_mode"; - -_mode = missionNamespace getVariable ["AGM_Grenades_Mode", 0]; - -if (_mode != 0) then { - private "_velocity"; - - _velocity = velocity _projectile; - - switch (_mode) do { - //high throw - case 1 : { - _velocity = [ - 0.5 * (_velocity select 0), - 0.5 * (_velocity select 1), - [0, 0, 0] distance (_velocity vectorMultiply 0.5) - ]; - }; - //precise throw - case 2 : { - _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); - }; - //roll grande - case 3 : { - //@todo - }; - //drop grenade - case 4 : { - _velocity = [0, 0, 0]; - }; - }; - - _projectile setVelocity _velocity; -}; - -if (typeOf _projectile == "AGM_G_M84") then { - _this spawn { - _projectile = _this select 6; - - sleep getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance"); - - if (alive _projectile) then { - playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; - - _affected = _projectile nearEntities ["CAManBase", 50]; - { - [[_x, _projectile], "AGM_Grenades_fnc_flashbangEffect", _x] call AGM_Core_fnc_execRemoteFnc; - } forEach _affected; - }; - }; -}; diff --git a/TO_MERGE/agm/Grenades/texHeaders.bin b/TO_MERGE/agm/Grenades/texHeaders.bin deleted file mode 100644 index 718d6490fc..0000000000 Binary files a/TO_MERGE/agm/Grenades/texHeaders.bin and /dev/null differ diff --git a/TO_MERGE/agm/Map/MapControls.hpp b/TO_MERGE/agm/Map/MapControls.hpp deleted file mode 100644 index 69e41098c8..0000000000 --- a/TO_MERGE/agm/Map/MapControls.hpp +++ /dev/null @@ -1,87 +0,0 @@ - class controls { - class ButtonPlayer: RscActiveText { - text = ""; - w = 0; - h = 0; - sizeEx = 0; - onButtonClick = ""; - }; - class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ColorBlack: RscButton { - idc = 36732; - x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.2,0.2,1}; - colorBackgroundActive[] = {0,0,0,1}; - colorFocused[] = {0,0,0,1}; - onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlack""]"; - }; - class ColorRed: RscButton { - idc = 36733; - x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.2,0.2,1}; - colorBackgroundActive[] = {1,0,0,1}; - colorFocused[] = {1,0,0,1}; - onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorRed""]"; - }; - class ColorGreen: RscButton { - idc = 36734; - x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.8,0.2,1}; - colorBackgroundActive[] = {0,1,0,1}; - colorFocused[] = {0,1,0,1}; - onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorGreen""]"; - }; - class ColorBlue: RscButton { - idc = 36735; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.2,0.8,1}; - colorBackgroundActive[] = {0,0,1,1}; - colorFocused[] = {0,0,1,1}; - onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorBlue""]"; - }; - class ColorYellow: RscButton { - idc = 36736; - x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.8,0.2,1}; - colorBackgroundActive[] = {1,1,0,1}; - colorFocused[] = {1,1,0,1}; - onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorYellow""]"; - }; - class ColorWhite: RscButton { - idc = 36737; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.8,0.8,1}; - colorBackgroundActive[] = {1,1,1,1}; - colorFocused[] = {1,1,1,1}; - onButtonClick = "missionNamespace setVariable [""AGM_Map_drawColor"", ""ColorWhite""]"; - }; - }; diff --git a/TO_MERGE/agm/Map/clientInit.sqf b/TO_MERGE/agm/Map/clientInit.sqf deleted file mode 100644 index 66a5d7a110..0000000000 --- a/TO_MERGE/agm/Map/clientInit.sqf +++ /dev/null @@ -1,154 +0,0 @@ -// by CAA-Picard - -if (!hasInterface) exitWith{}; - -[] spawn { - while {true} do { - sleep 5; - _markers = []; - - while {AGM_Map_BFT_Enabled and {(!isNil "AGM_player") and {alive AGM_player}}} do { - - _groups = []; - _playerSide = call AGM_Core_fnc_playerSide; - - if (AGM_Map_BFT_HideAiGroups) then { - _groups = [allGroups, {side _this == _playerSide}] call AGM_Core_fnc_filter; - } else { - _groups = [allGroups, { - _anyPlayers = { - [_x] call AGM_Core_fnc_isPlayer - } count units _this; - (side _this == _playerSide) && _anyPlayers > 0 - }] call AGM_Core_fnc_filter; - }; - - { - deleteMarkerLocal _x; - } forEach _markers; - _markers = []; - - for "_i" from 0 to (count _groups - 1) do { - _group1 = _groups select _i; - - _markerType = [_group1] call AGM_Core_fnc_getMarkerType; - - _colour = format ["Color%1", side _group1]; - - _marker = createMarkerLocal [format ["AGM_BFT_%1", _i], [(getPos leader _group1) select 0, (getPos leader _group1) select 1]]; - _marker setMarkerTypeLocal _markerType; - _marker setMarkerColorLocal _colour; - _marker setMarkerTextLocal (groupID _group1); - - _markers pushBack _marker; - }; - - sleep AGM_Map_BFT_Interval; - }; - - // Delete markers as soon as the player dies - { - deleteMarkerLocal _x; - } forEach _markers; - }; -}; - -[] spawn { - // Init variables - AGM_Map_mapToolsShown = 0; - AGM_Map_pos = [0,0]; - AGM_Map_angle = 0; - AGM_Map_dragging = false; - AGM_Map_rotating = false; - AGM_Map_mapGpsShow = true; - AGM_Map_drawing = false; - AGM_Map_tempLineMarker = []; - AGM_Map_lineMarkers = []; - - AGM_Map_drawColor = "ColorBlack"; - AGM_Map_drawingControls = [36732, 36733, 36734, 36735, 36736, 36737]; - - AGM_Map_fnc_installEvents = { - _d = _this; - diag_log format ["Installing EH in display %1", _d]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call AGM_Map_fnc_handleMouseMove;}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call AGM_Map_fnc_handleMouseButton;}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call AGM_Map_fnc_handleMouseButton}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call AGM_Map_fnc_updateMapToolMarkers;}]; - (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call AGM_Map_fnc_handleKeyDown;}]; - }; - - // Wait until the briefing map is detected - // display = 37 for SP - // display = 52 for host server on MP; - // display = 53 for MP clients) - waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; - - if (isNull findDisplay 12) then { - // Install event handlers on the map control of the briefing screen (control = 51) - AGM_Map_syncMarkers = true; - if (!isNull findDisplay 52) then { - 52 call AGM_Map_fnc_installEvents; - } else { - if (!isNull findDisplay 53) then { - 53 call AGM_Map_fnc_installEvents; - } else { - 37 call AGM_Map_fnc_installEvents; - }; - }; - } else { - // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing - AGM_Map_syncMarkers = false; - { - _x call AGM_Map_fnc_addLineMarker; - } forEach AGM_Map_serverLineMarkers; - }; - - // Wait until the main map display is detected (display = 12) - waitUntil { !isNull findDisplay 12 }; - // Install event handlers on the map control and display (control = 51) - AGM_Map_syncMarkers = false; - 12 call AGM_Map_fnc_installEvents; - - // Update the size and rotation of map tools - [] call AGM_Map_fnc_updateMapToolMarkers; - - while {true} do { - waitUntil {visibleMap}; - - // Show and update map tools if required - [] call AGM_Map_fnc_updateMapToolMarkers; - // Show GPS if required - [AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps; - - // Update visibility of maptools and gps, handling inventory changes - [] spawn { - while {visibleMap} do { - // Show/Hide draw buttons - if ("AGM_MapTools" in items player) then { - { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach AGM_Map_drawingControls; - } else { - { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach AGM_Map_drawingControls; - if (AGM_Map_drawing) then { - call AGM_Map_fnc_cancelDrawing; - }; - }; - sleep 1; - }; - }; - - waitUntil {!visibleMap}; - - // Hide GPS - [false] call AGM_Map_fnc_openMapGps; - // Hide Map tools - deleteMarkerLocal "AGM_MapToolFixed"; - deleteMarkerLocal "AGM_MapToolRotatingNormal"; - deleteMarkerLocal "AGM_MapToolRotatingSmall"; - AGM_Map_mapToolFixed = nil; - AGM_Map_mapToolRotatingNormal = nil; - AGM_Map_mapToolRotatingSmall = nil; - // Cancel drawing - call AGM_Map_fnc_cancelDrawing; - }; -}; diff --git a/TO_MERGE/agm/Map/config.cpp b/TO_MERGE/agm/Map/config.cpp deleted file mode 100644 index b136849ea3..0000000000 --- a/TO_MERGE/agm/Map/config.cpp +++ /dev/null @@ -1,423 +0,0 @@ -class CfgPatches { - class AGM_Map { - units[] = {}; - weapons[] = {"AGM_MapTools"}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core, AGM_Interaction}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi","CAA-Picard"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - }; -}; - -class CfgFunctions { - class AGM_Map { - class AGM_Map { - file = "AGM_Map\functions"; - class addLineMarker; - class blueForceTracking; - class calculateMapScale; - class cancelDrawing; - class canDraw; - class canUseMapTools; - class canUseMapGPS; - class copyMapMarkers; - class handleKeyDown; - class handleMouseButton; - class handleMouseMove; - class handleMouseZChanged; - class isInsideMapTool; - class openMapGps; - class removeLineMarker; - class sendMapMarkers; - class updateMapToolMarkers; - class updateLineMarker; - }; - }; -}; - -class Extended_PreInit_EventHandlers { - class AGM_Map { - serverInit = "call compile preprocessFileLineNumbers '\AGM_Map\serverInit.sqf'"; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Map { - clientInit = "call compile preprocessFileLineNumbers 'AGM_Map\clientInit.sqf'"; - }; -}; - -class CfgWeapons { - class AGM_ItemCore; - class InventoryItem_Base_F; - - class AGM_MapTools: AGM_ItemCore { - displayName = "$STR_AGM_MapTools_Name"; - descriptionShort = "$STR_AGM_MapTools_Description"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - picture = "\AGM_Map\UI\maptool_item.paa"; - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 1; - }; - }; -}; - -#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ -}; - -class CfgVehicles { - - class Man; - class CAManBase: Man { - class AGM_SelfActions { - - class AGM_MapTools { - displayName = "$STR_AGM_Map_MapTools_Menu"; - condition = "(call AGM_Map_fnc_canUseMapTools) || (call AGM_Map_fnc_canUseMapGPS)"; - statement = ""; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 0; - priority = 100; - subMenu[] = {"AGM_MapTools", 1}; - enableInside = 1; - - class AGM_MapToolsHide { - displayName = "$STR_AGM_Map_MapToolsHide"; - condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown > 0}"; - statement = "AGM_Map_mapToolsShown = 0; [] call AGM_Map_fnc_updateMapToolMarkers"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 1; - priority = 5; - enableInside = 1; - }; - class AGM_MapToolsShowNormal { - displayName = "$STR_AGM_Map_MapToolsShowNormal"; - condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 1}"; - statement = "AGM_Map_mapToolsShown = 1; [] call AGM_Map_fnc_updateMapToolMarkers"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 1; - priority = 4; - enableInside = 1; - }; - class AGM_MapToolsShowSmall { - displayName = "$STR_AGM_Map_MapToolsShowSmall"; - condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 2}"; - statement = "AGM_Map_mapToolsShown = 2; [] call AGM_Map_fnc_updateMapToolMarkers"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 1; - priority = 3; - enableInside = 1; - }; - class AGM_MapToolsAlignNorth { - displayName = "$STR_AGM_Map_MapToolsAlignNorth"; - condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 0}"; - statement = "AGM_Map_angle = 0; [] call AGM_Map_fnc_updateMapToolMarkers"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 1; - priority = 2; - enableInside = 1; - }; - class AGM_MapToolsAlignCompass { - displayName = "$STR_AGM_Map_MapToolsAlignCompass"; - condition = "(call AGM_Map_fnc_canUseMapTools) && {AGM_Map_mapToolsShown != 0} && {(""ItemCompass"" in assignedItems player) || {""ItemGPS"" in assignedItems player}}"; - statement = "AGM_Map_angle = getDir player; [] call AGM_Map_fnc_updateMapToolMarkers"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 1; - priority = 1; - enableInside = 1; - }; - class AGM_MapGpsShow { - displayName = "$STR_AGM_Map_MapGpsShow"; - condition = "(call AGM_Map_fnc_canUseMapGPS) && {!AGM_Map_mapGpsShow}"; - statement = "AGM_Map_mapGpsShow = true; [AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 0; - priority = 0; - enableInside = 1; - }; - class AGM_MapGpsHide { - displayName = "$STR_AGM_Map_MapGpsHide"; - condition = "(call AGM_Map_fnc_canUseMapGPS) && AGM_Map_mapGpsShow"; - statement = "AGM_Map_mapGpsShow = false; [AGM_Map_mapGpsShow] call AGM_Map_fnc_openMapGps"; - exceptions[] = {"AGM_Drag_isNotDragging", "AGM_Core_notOnMap"}; - showDisabled = 0; - priority = 0; - enableInside = 1; - }; - }; - }; - - class AGM_Actions { - class AGM_CopyMap { - displayName = "$STR_AGM_Map_CopyMap"; - condition = "isPlayer AGM_Interaction_Target && {""ItemMap"" in assignedItems player} && {""AGM_MapTools"" in items player} && {""ItemMap"" in assignedItems AGM_Interaction_Target}"; - statement = "[player, ""AGM_Map_fnc_sendMapMarkers"", AGM_Interaction_Target] call AGM_Core_fnc_execRemoteFnc"; - showDisabled = 0; - priority = -1; - }; - }; - }; - - class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class FIA_Box_Base_F; - - class Box_NATO_Support_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_MapTools,12) - }; - }; - - class Box_East_Support_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_MapTools,12) - }; - }; - - class Box_IND_Support_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_MapTools,12) - }; - }; - - class Box_FIA_Support_F: FIA_Box_Base_F { - class TransportItems { - MACRO_ADDITEM(AGM_MapTools,12) - }; - }; - - class AGM_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(AGM_MapTools,12) - }; - }; - - class Module_F; - class AGM_ModuleBlueForceTracking: Module_F { - author = "AGM Team"; - category = "AGM"; - displayName = "Blue Force Tracking"; - function = "AGM_Map_fnc_blueForceTracking"; - scope = 2; - isGlobal = 1; - icon = "\AGM_Map\UI\IconBFTracking_ca.paa"; - class Arguments { - class Interval { - displayName = "Interval"; - description = "How often the markers should be refreshed (in seconds)"; - defaultValue = 1; - }; - class HideAiGroups { - displayName = "Hide AI groups?"; - description = "Hide markers for 'AI only' groups?"; - typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1; }; - }; - }; - }; - }; -}; - -class RscControlsGroup; -class RscActiveText; -class RscPicture; -class RscText; -class RscObject; -class RscButton; -class RscButtonMenuOK; -class RscButtonMenuCancel; -class RscButtonMenu; -class RscEdit; - -class RscMapControl { - sizeExGrid = 0.032; -}; - -// REGULAR MAP -class RscDisplayMainMap { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" - }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; -}; - -// DIARY -class RscDisplayDiary { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - class controls { - class ButtonPlayer: RscActiveText { - text = ""; - w = 0; - h = 0; - sizeEx = 0; - onButtonClick = ""; - }; - class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - }; - }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; -}; - -// BRIEFING SCREEN -class RscDisplayGetReady: RscDisplayMainMap { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" - }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; -}; -class RscDisplayClientGetReady: RscDisplayGetReady { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" - }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; -}; -class RscDisplayServerGetReady: RscDisplayGetReady { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" - }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; - }; - }; -}; - -// MARKERS -class CfgMarkers { - class Flag; - - // Reenable NATO symbols ... - class b_unknown: Flag {scope = 2;}; - - // ... and disable all the useless ones - // If you think that some of these are needed, create an issue; But until - // there's a better way to place markers, there should be only the most - // important markers here. - // Keep in mind that all of these can still be placed in the editor. - class b_hq: b_unknown {scope = 1;}; - class b_installation: b_unknown {scope = 1;}; - class b_maint: b_unknown {scope = 1;}; - class b_med: b_unknown {scope = 1;}; - class b_service: b_unknown {scope = 1;}; - class b_support: b_unknown {scope = 1;}; - - class n_unknown: b_unknown {}; - class n_hq: n_unknown {scope = 1;}; - class n_installation: n_unknown {scope = 1;}; - class u_installation: n_unknown {scope = 1;}; // i have no idea... - class n_maint: n_unknown {scope = 1;}; - class n_med: n_unknown {scope = 1;}; - class n_service: n_unknown {scope = 1;}; - class n_support: n_unknown {scope = 1;}; - - class o_unknown: b_unknown {}; - class o_hq: o_unknown {scope = 1;}; - class o_installation: o_unknown {scope = 1;}; - class o_maint: o_unknown {scope = 1;}; - class o_med: o_unknown {scope = 1;}; - class o_service: o_unknown {scope = 1;}; - class o_support: o_unknown {scope = 1;}; - - // disable all civy markers (harbor etc.) - class c_unknown: b_unknown {scope = 1;}; - - // disable quantity indicators (fire team/squad/platoon ...) - class group_0: b_unknown {scope = 1;}; - - - class AGM_MapToolFixed { - name = "MapToolFixed"; - icon = "\AGM_Map\data\mapToolFixed.paa"; - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class AGM_MapToolRotatingNormal { - name = "MapToolRotating"; - icon = "\AGM_Map\data\mapToolRotatingNormal.paa"; - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class AGM_MapToolRotatingSmall { - name = "MapToolRotating"; - icon = "\AGM_Map\data\mapToolRotatingSmall.paa"; - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; -}; - -class AGM_Parameters_Numeric { - AGM_Map_BFT_Interval = 1; -}; -class AGM_Parameters_Boolean { - AGM_Map_EveryoneCanDrawOnBriefing = 1; - AGM_Map_BFT_Enabled = 0; - AGM_Map_BFT_HideAiGroups = 0; -}; - -#include "MapGpsUI.hpp" diff --git a/TO_MERGE/agm/Map/functions/fn_blueForceTracking.sqf b/TO_MERGE/agm/Map/functions/fn_blueForceTracking.sqf deleted file mode 100644 index efef0ac96c..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_blueForceTracking.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Initializes the blue force tracking module. - * - * Arguments: - * Whatever the module provides. (I dunno.) - * - * Return Value: - * None - */ - -if !(hasInterface) exitWith {}; - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -_logic spawn { - waitUntil {alive player}; - - AGM_Map_BFT_Enabled = true; - [_this, "AGM_Map_BFT_Interval", "Interval"] call AGM_Core_fnc_readNumericParameterFromModule; - [_this, "AGM_Map_BFT_HideAiGroups", "HideAiGroups"] call AGM_Core_fnc_readBooleanParameterFromModule; - - diag_log text "[AGM]: Blue Force Tracking Module initialized."; -}; diff --git a/TO_MERGE/agm/Map/functions/fn_canDraw.sqf b/TO_MERGE/agm/Map/functions/fn_canDraw.sqf deleted file mode 100644 index 088252a7e1..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_canDraw.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by CAA-Picard - -(missionNameSpace getVariable ["AGM_Map_syncMarkers", true] && {AGM_Map_EveryoneCanDrawOnBriefing}) || -{(!isNull player) && {"AGM_MapTools" in items player}} diff --git a/TO_MERGE/agm/Map/functions/fn_canUseMapGPS.sqf b/TO_MERGE/agm/Map/functions/fn_canUseMapGPS.sqf deleted file mode 100644 index 344ab3b8c7..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_canUseMapGPS.sqf +++ /dev/null @@ -1,5 +0,0 @@ -// by CAA-Picard - -visibleMap && -{alive player} && -{"ItemGPS" in assignedItems player} diff --git a/TO_MERGE/agm/Map/functions/fn_canUseMapTools.sqf b/TO_MERGE/agm/Map/functions/fn_canUseMapTools.sqf deleted file mode 100644 index 5a5562261b..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_canUseMapTools.sqf +++ /dev/null @@ -1,8 +0,0 @@ -// by CAA-Picard - -visibleMap && -{alive player} && -{"ItemMap" in assignedItems player} && -{"AGM_MapTools" in items player} && -{!AGM_Map_dragging} && -{!AGM_Map_rotating} diff --git a/TO_MERGE/agm/Map/functions/fn_cancelDrawing.sqf b/TO_MERGE/agm/Map/functions/fn_cancelDrawing.sqf deleted file mode 100644 index 053dfd9f51..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_cancelDrawing.sqf +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Author: CAA-Picard - * - * Cancel the drawing of the current line marker - * - * Argument: - * None - * - * Return value: - * Nothing - */ - -AGM_Map_drawing = false; -if (count AGM_Map_tempLineMarker > 0) then { - deleteMarkerLocal (AGM_Map_tempLineMarker select 0); -}; -AGM_Map_tempLineMarker = []; diff --git a/TO_MERGE/agm/Map/functions/fn_copyMapMarkers.sqf b/TO_MERGE/agm/Map/functions/fn_copyMapMarkers.sqf deleted file mode 100644 index d3b62fa9cb..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_copyMapMarkers.sqf +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Author: CAA-Picard - * - * Copy markers to mapd - * - * Argument: - * 0: Array of markers to copy (Array) - * - * Return value: - * Return - */ - -_lineMarkers = _this; - -{ - _marker = _x; - - if (({(_x select 0) == (_marker select 0)} count AGM_Map_lineMarkers) == 0) then { - _marker call AGM_Map_fnc_addLineMarker; - }; -} forEach _lineMarkers; diff --git a/TO_MERGE/agm/Map/functions/fn_handleMouseButton.sqf b/TO_MERGE/agm/Map/functions/fn_handleMouseButton.sqf deleted file mode 100644 index 05e957f6ba..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_handleMouseButton.sqf +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Author: CAA-Picard - * - * Handle mouse buttons. - * - * Argument: - * 0: 1 if mouse down down, 0 if mouse button up (Number) - * 1: Parameters of the mouse button event - * - * Return value: - * Boolean, true if event was handled - */ - -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; - -_dir = _this select 0; -_params = _this select 1; -_control = _params select 0; -_button = _params select 1; -_screenPos = [_params select 2, _params select 3]; -_shiftKey = _params select 4; -_ctrlKey = _params select 5; -_altKey = _params select 6; -_handled = false; - -// If it's not a left button event, exit -if (_button != 0) exitWith {}; - -// If releasing -if (_dir != 1 && (AGM_Map_dragging or AGM_Map_rotating)) exitWith { - AGM_Map_dragging = false; - AGM_Map_rotating = false; - _handled = true; - _handled -}; - -// If clicking -if (_dir == 1) exitWith { - - if !(call AGM_Map_fnc_canDraw) exitWith {_handled = false;}; - - // Transform mouse screen position to coordinates - _pos = _control ctrlMapScreenToWorld _screenPos; - _pos set [count _pos, 0]; - - if (AGM_Map_drawing) exitWith { - // Already drawing -> Add tempLineMarker to permanent list - if (AGM_Map_syncMarkers) then { - deleteMarkerLocal (AGM_Map_tempLineMarker select 0); - [AGM_Map_tempLineMarker, "AGM_Map_fnc_addLineMarker", 2] call AGM_Core_fnc_execRemoteFnc; - // Log who drew on the briefing screen - (text format ["[AGM] Server: Player %1 drew on the briefing screen", name player]) call AGM_Core_fnc_serverLog; - } else { - AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker; - AGM_Map_lineMarkers pushBack (+AGM_Map_tempLineMarker); - }; - AGM_Map_tempLineMarker = []; - AGM_Map_drawing = false; - _handled = true; - }; - - if (_altKey) exitWith { - // Start drawing - AGM_Map_drawing = true; - // Create tempLineMarker - _gui = format ["%1%2%3%4", random (100), random (100), random (100), random (100)]; - AGM_Map_tempLineMarker = [_gui, + _pos, + _pos, AGM_Map_drawColor]; - _marker = createMarkerLocal [_gui, [0,0]]; - AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker; - _handled = true; - }; - - AGM_Map_dragging = false; - AGM_Map_rotating = false; - - // If no map tool marker then exit - if (isNil "AGM_Map_mapToolFixed") exitWith {_handled = false;}; - - // Check if clicking the maptool - if (_pos call AGM_Map_fnc_isInsideMapTool) exitWith { - // Store data for dragging - AGM_Map_startPos = + AGM_Map_pos; - AGM_Map_startDragPos = + _pos; - if (_ctrlKey) then { - // Store data for rotating - AGM_Map_startAngle = + AGM_Map_angle; - AGM_Map_startDragAngle = (180 + ((AGM_Map_startDragPos select 0) - (AGM_Map_startPos select 0)) atan2 ((AGM_Map_startDragPos select 1) - (AGM_Map_startPos select 1)) mod 360); - // Start rotating - AGM_Map_rotating = true; - } else { - // Start dragging - AGM_Map_dragging = true; - }; - _handled = true; - }; -}; - -_handled diff --git a/TO_MERGE/agm/Map/functions/fn_handleMouseMove.sqf b/TO_MERGE/agm/Map/functions/fn_handleMouseMove.sqf deleted file mode 100644 index 7fcb7c8046..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_handleMouseMove.sqf +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Author: CAA-Picard - * - * Handle mouse movement over the map tool. - * - * Argument: - * 0: Map Control - * 1: Mouse position on screen coordinates - * - * Return value: - * Boolean, true if event was handled - */ - -private ["_control", "_pos"]; - -_control = _this select 0; -_pos = [_this select 1, _this select 2]; -AGM_Map_mousePos = _control ctrlMapScreenToWorld _pos; -AGM_Map_mousePos set [count AGM_Map_mousePos, 0]; - -// If cannot draw then exit -if !(call AGM_Map_fnc_canDraw) exitWith { - // If was drawing, cancel - if (AGM_Map_drawing) then { - call AGM_Map_fnc_cancelDrawing; - }; - false -}; - -// Handle drawing -if (AGM_Map_drawing) exitWith { - AGM_Map_tempLineMarker set [2, AGM_Map_mousePos]; - AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker; - false -}; - -// Handle Map tools -if (isNil "AGM_Map_mapToolFixed") exitWith {false}; - -// Translation -if (AGM_Map_dragging) exitWith { - AGM_Map_pos set [0, (AGM_Map_startPos select 0) + (AGM_Map_mousePos select 0) - (AGM_Map_startDragPos select 0)]; - AGM_Map_pos set [1, (AGM_Map_startPos select 1) + (AGM_Map_mousePos select 1) - (AGM_Map_startDragPos select 1)]; - - // Update the size and rotation of the maptool - [] call AGM_Map_fnc_updateMapToolMarkers; - true -}; - -// Rotation -if (AGM_Map_rotating) exitWith { - // Get new angle - _angle = (180 + ((AGM_Map_mousePos select 0) - (AGM_Map_startPos select 0)) atan2 ((AGM_Map_mousePos select 1) - (AGM_Map_startPos select 1)) mod 360); - AGM_Map_angle = AGM_Map_startAngle + _angle - AGM_Map_startDragAngle; - - // Update the size and rotation of the maptool - [] call AGM_Map_fnc_updateMapToolMarkers; - true -}; - -false diff --git a/TO_MERGE/agm/Map/functions/fn_handleMouseZChanged.sqf b/TO_MERGE/agm/Map/functions/fn_handleMouseZChanged.sqf deleted file mode 100644 index 2eadfe124b..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_handleMouseZChanged.sqf +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Author: CAA-Picard - * - * Handle mouse wheel. - * - * Argument: - * 0: Control - * 1: Scroll Amount - * - * Return value: - * Boolean, true if event was handled - */ - -private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; - -_control = _this select 0; -_dir = _this select 1; -diag_log "Scroll"; -diag_log _this; -_handled = false; - -// If drawing, change line color -if (count AGM_Map_tempLineMarker > 0) then { - AGM_Map_drawColor = if (_dir > 0) then {AGM_Map_drawColor + 1} else {AGM_Map_drawColor - 1}; - if (AGM_Map_drawColor >= count AGM_Map_drawColors) then { - AGM_Map_drawColor = AGM_Map_drawColor - count AGM_Map_drawColors; - }; - if (AGM_Map_drawColor < 0) then { - AGM_Map_drawColor = AGM_Map_drawColor + count AGM_Map_drawColors; - }; - AGM_Map_tempLineMarker set [3, AGM_Map_drawColor]; - AGM_Map_tempLineMarker call AGM_Map_fnc_updateLineMarker; - - _handled = true; -}; -_handled diff --git a/TO_MERGE/agm/Map/functions/fn_openMapGps.sqf b/TO_MERGE/agm/Map/functions/fn_openMapGps.sqf deleted file mode 100644 index fa3459198f..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_openMapGps.sqf +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Author: CAA-Picard - * - * Opens or closes the gps on the map screen, showing coordinates - * - * Argument: - * 0: Open GPS? (Boolean) - * - * Return value: - * Nothing - */ - - -_open = _this select 0; -_isOpen = !(isNull (uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull])); - -if (_open && {"ItemGPS" in assignedItems player} && {!_isOpen}) then { - ("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutRsc ["RscAGM_MapGps","PLAIN"]; - - // Spawn a thread to update gps display - [] spawn { - disableSerialization; - while {!(isNull (uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull]))} do { - if !("ItemGPS" in assignedItems player) exitWith {}; - - _mapGpsDisplay = uiNamespace getVariable ['AGM_Map_mapGpsDisplay', displayNull]; - _ctrl = _mapGpsDisplay displayCtrl 913590; - _ctrl ctrlSetText str(round(getDir player)); - _ctrl = _mapGpsDisplay displayCtrl 913591; - _ctrl ctrlSetText str(round((getPosASL player) select 2)); - _ctrl = _mapGpsDisplay displayCtrl 913592; - _ctrl ctrlSetText mapGridPosition player; - - sleep 0.5; - }; - ("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; - }; - -} else { - ("AGM_mapGpsLayer" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; -}; - diff --git a/TO_MERGE/agm/Map/functions/fn_removeLineMarker.sqf b/TO_MERGE/agm/Map/functions/fn_removeLineMarker.sqf deleted file mode 100644 index 5985e6a53e..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_removeLineMarker.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: CAA-Picard - * - * Remove the line marker - * - * Argument: - * 0: Marker Name (string) - * - * Return value: - * Return - */ - - _name = _this select 0; - - deleteMarkerLocal _name; -{ - if ((_x select 0) == _name) exitWith { - AGM_Map_lineMarkers = AGM_Map_lineMarkers - [_x]; - }; -} forEach AGM_Map_lineMarkers; - -if (isServer && AGM_Map_syncMarkers) then { - { - if ((_x select 0) == _name) exitWith { - AGM_Map_serverLineMarkers = AGM_Map_serverLineMarkers - [_x]; - publicVariable "AGM_Map_serverLineMarkers"; - }; - } forEach AGM_Map_serverLineMarkers; -}; diff --git a/TO_MERGE/agm/Map/functions/fn_sendMapMarkers.sqf b/TO_MERGE/agm/Map/functions/fn_sendMapMarkers.sqf deleted file mode 100644 index 4bc3f9a97a..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_sendMapMarkers.sqf +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Author: CAA-Picard - * - * Send Map markers to other player - * - * Argument: - * 0: Target player (Unit) - * - * Return value: - * Return - */ - -[AGM_Map_lineMarkers, "AGM_Map_fnc_copyMapMarkers", _this] call AGM_Core_fnc_execRemoteFnc; diff --git a/TO_MERGE/agm/Map/functions/fn_updateMapToolMarkers.sqf b/TO_MERGE/agm/Map/functions/fn_updateMapToolMarkers.sqf deleted file mode 100644 index 25f9cf0691..0000000000 --- a/TO_MERGE/agm/Map/functions/fn_updateMapToolMarkers.sqf +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Author: CAA-Picard - * - * Update the map tool markers, position, size, rotation and visibility. - * - * Argument: - * None - * - * Return value: - * Nothing - */ - -#define TEXTURE_WIDTH_IN_M 6205 -#define CENTER_OFFSET_Y_PERC 0.1606 -#define CONSTANT_SCALE 0.2 - -// If markers exist and they should'nt, delete them -if (!("AGM_MapTools" in items player) || {AGM_Map_mapToolsShown == 0}) then { - // If markers exist, delete them - if (!isNil "AGM_Map_mapToolFixed") then { - deleteMarkerLocal "AGM_MapToolFixed"; - AGM_Map_mapToolFixed = nil; - }; -}; -if (!("AGM_MapTools" in items player) || {AGM_Map_mapToolsShown != 1}) then { - if (!isNil "AGM_Map_mapToolRotatingNormal") then { - deleteMarkerLocal "AGM_MapToolRotatingNormal"; - AGM_Map_mapToolRotatingNormal = nil; - }; -}; -if (!("AGM_MapTools" in items player) || {AGM_Map_mapToolsShown != 2}) then { - if (!isNil "AGM_Map_mapToolRotatingSmall") then { - deleteMarkerLocal "AGM_MapToolRotatingSmall"; - AGM_Map_mapToolRotatingSmall = nil; - }; -}; - -if (!("AGM_MapTools" in items player)|| {AGM_Map_mapToolsShown == 0}) exitWith {}; - -// If markers don't exist and should, create them -if (isNil "AGM_Map_mapToolFixed") then { - AGM_Map_mapToolFixed = createMarkerLocal ["AGM_MapToolFixed", AGM_Map_pos]; - "AGM_MapToolFixed" setMarkerType "AGM_MapToolFixed"; -}; -if ((isNil "AGM_Map_mapToolRotatingNormal") && {AGM_Map_mapToolsShown == 1}) then { - AGM_Map_mapToolRotatingNormal = createMarkerLocal ["AGM_MapToolRotatingNormal", AGM_Map_pos]; - "AGM_MapToolRotatingNormal" setMarkerType "AGM_MapToolRotatingNormal"; -}; -if ((isNil "AGM_Map_mapToolRotatingSmall") && {AGM_Map_mapToolsShown == 2}) then { - AGM_Map_mapToolRotatingSmall = createMarkerLocal ["AGM_MapToolRotatingSmall", AGM_Map_pos]; - "AGM_MapToolRotatingSmall" setMarkerType "AGM_MapToolRotatingSmall"; -}; - -_rotatingMarker = ["AGM_MapToolRotatingNormal", "AGM_MapToolRotatingSmall"] select (AGM_Map_mapToolsShown - 1); -_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (AGM_Map_mapToolsShown - 1); - -// Update scale of both parts -_scale = _textureWidth * CONSTANT_SCALE * (call AGM_Map_fnc_calculateMapScale); -"AGM_MapToolFixed" setMarkerSizeLocal [_scale,_scale]; -_rotatingMarker setMarkerSizeLocal [_scale,_scale]; - -// Position of the fixed part -_xPos = AGM_Map_pos select 0; -_yPos = (AGM_Map_pos select 1) + _textureWidth * CENTER_OFFSET_Y_PERC; -"AGM_MapToolFixed" setMarkerPosLocal [_xPos,_yPos]; - -// Position and rotation of the rotating part -_xPos = (AGM_Map_pos select 0) + sin(AGM_Map_angle) * _textureWidth * CENTER_OFFSET_Y_PERC; -_yPos = (AGM_Map_pos select 1) + cos(AGM_Map_angle) * _textureWidth * CENTER_OFFSET_Y_PERC; -_rotatingMarker setMarkerPosLocal [_xPos,_yPos]; -_rotatingMarker setMarkerDirLocal AGM_Map_angle; diff --git a/TO_MERGE/agm/Map/serverInit.sqf b/TO_MERGE/agm/Map/serverInit.sqf deleted file mode 100644 index 842e311dc9..0000000000 --- a/TO_MERGE/agm/Map/serverInit.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by CAA-Picard - -AGM_Map_serverLineMarkers = []; -publicVariable "AGM_Map_serverLineMarkers"; diff --git a/TO_MERGE/agm/Movement/UI/IconFatigue_ca.paa b/TO_MERGE/agm/Movement/UI/IconFatigue_ca.paa deleted file mode 100644 index c1cf3fb92f..0000000000 Binary files a/TO_MERGE/agm/Movement/UI/IconFatigue_ca.paa and /dev/null differ diff --git a/TO_MERGE/agm/Movement/clientInit.sqf b/TO_MERGE/agm/Movement/clientInit.sqf deleted file mode 100644 index e7d39b60f9..0000000000 --- a/TO_MERGE/agm/Movement/clientInit.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 - -//0 spawn compile preprocessFileLineNumbers "\AGM_Movement\fatigue.sqf"; -0 spawn compile preprocessFileLineNumbers "\AGM_Movement\showWeight.sqf"; diff --git a/TO_MERGE/agm/Movement/config.cpp b/TO_MERGE/agm/Movement/config.cpp deleted file mode 100644 index 689d482a2e..0000000000 --- a/TO_MERGE/agm/Movement/config.cpp +++ /dev/null @@ -1,223 +0,0 @@ -// PATCH CONFIG -class CfgPatches { - class AGM_Movement { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.10; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"commy2", "KoffeinFlummi", "Tachii"}; - authorUrl = "https://github.com/commy2/"; - }; -}; - -class CfgFunctions { - class AGM_Movement { - class AGM_Movement { - file = "AGM_Movement\functions"; - class blinking; - class canClimb; - class climb; - class fatigueModule; - class heartbeat; - class getWeight; - class handleClimb; - class recoil; - class stumble; - class vision; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Movement { - clientInit = "call compile preprocessFileLineNumbers '\AGM_Movement\clientInit.sqf'"; - }; -}; - -class AGM_Core_Default_Keys { - class climb { - displayName = "$STR_AGM_Movement_Climb"; - condition = "_player == _vehicle"; - statement = "[_player] call AGM_Movement_fnc_climb"; - key = 47; - shift = 0; - control = 1; - alt = 0; - }; -}; - -/*class CfgInventoryGlobalVariable { - maxSoldierLoad = 1200; -};*/ - -class CfgFatigue { - MinValue1 = 0.2; - MinValue2 = 0.8; - NormalRunSpeed = 7.2; - TiredRunSpeedLimit = 0.8; - FrequencyMin = 0.2; - FrequencyMax = 1.0; - TotalLoadCoef = 1.1; - MaxDuty = 10; -}; - -class CfgSounds { - class AGM_Heartbeat { - name = "AGM_Heartbeat"; - sound[] = {"AGM_Movement\sounds\heartbeat.ogg",1,1}; - titles[] = {}; - }; -}; - -class AGM_Core_Options { - class useImperial { - displayName = "$STR_AGM_Movement_UseImperial"; - default = 0; - }; -}; - -// leaving this for compatibility -class CfgVehicles { - class Module_F; - class AGM_ModuleFatigue: Module_F { - author = "AGM Team"; - category = "AGM"; - displayName = "Fatigue System"; - function = "AGM_Movement_fnc_fatigueModule"; - scope = 2; - isGlobal = 1; - icon = "\AGM_Movement\UI\IconFatigue_ca.paa"; - class Arguments { - class CoefFatigue { - displayName = "Getting Tired Coef."; - description = "Multiplier for the rate of getting tired. Default: 1"; - defaultValue = 1; - }; - class CoefRecover { - displayName = "Recover Coef."; - description = "Multiplier for the time to rest after getting tired. Default: 1"; - defaultValue = 1; - }; - }; - }; -}; - -class CfgMovesBasic { - class ManActions { - AGM_Climb = "AGM_Climb"; - }; - - class Actions { - class RifleStandActionsNoAdjust; - class RifleLowStandActionsNoAdjust; - - // WEAPON RAISED - RUNNING - class RifleStandActionsRunF: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandActionsRunFL: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandActionsRunFR: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - // WEAPON RAISED - SPRINTING - class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - // WEAPON LOWERED - RUNNING - class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust { - getOver = "AovrPercMrunSrasWrflDf"; - }; - }; -}; - -class CfgMovesMaleSdr: CfgMovesBasic { - class StandBase; - class States { - // better slow walk with lowered rifle animation - class AmovPercMstpSrasWrflDnon; - class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon { - InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02}; - }; - - class AmovPercMstpSlowWrflDnon; - class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon { - speed = 0.3; //0.206897; - file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2"; - leftHandIKCurve[] = {1}; - }; - class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf { - leftHandIKCurve[] = {}; - }; - - // enable optics in prone left and right stance - class AidlPpneMstpSrasWrflDnon_G0S; - class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S { - enableOptics = 1; - }; - class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S { - enableOptics = 1; - }; - class AadjPpneMstpSrasWrflDup; - class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup { - enableOptics = 1; - }; - - class AidlPpneMstpSrasWpstDnon_G0S; - class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S { - enableOptics = 2; - }; - class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S { - enableOptics = 2; - }; - class AadjPpneMstpSrasWpstDup; - class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup { - enableOptics = 2; - }; - - // climb animation - class AmovPercMstpSnonWnonDnon: StandBase { - ConnectTo[] += {"AGM_Climb",0.02}; - }; - - class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium; - class AGM_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium { - canReload = 0; - forceAim = 1; - }; - }; -}; diff --git a/TO_MERGE/agm/Movement/fatigue.sqf b/TO_MERGE/agm/Movement/fatigue.sqf deleted file mode 100644 index fc248a17ed..0000000000 --- a/TO_MERGE/agm/Movement/fatigue.sqf +++ /dev/null @@ -1,55 +0,0 @@ -// by commy2 - -#define THRESHOLD_1 0.8 -#define THRESHOLD_2 0.9 -#define THRESHOLD_3 0.99 - -// init onEachFrame EH -AGM_UpdatePlayerFatigue_EHID = ["AGM_UpdatePlayerFatigue", "onEachFrame", { - _player = AGM_player; - - // calc new fatigue - _fatigue = getFatigue _player; - _fatigueOld = _player getVariable ["AGM_Fatigue", getFatigue _player]; - - if (_fatigue > _fatigueOld) then { - _fatigue = _fatigueOld + (missionNamespace getVariable ["AGM_Fatigue_CoefFatigue", 1]) * (_fatigue - _fatigueOld) max 0 min 1; - } else { - _fatigue = _fatigueOld - (missionNamespace getVariable ["AGM_Fatigue_CoefRecover", 1]) * (_fatigueOld - _fatigue) max 0 min 1; - }; - - _player setFatigue _fatigue; - _player setVariable ["AGM_Fatigue", _fatigue]; - - ["Fatigue", _player, {getFatigue _this}] call AGM_Debug_fnc_log; -}] call BIS_fnc_addStackedEventHandler; - -// init script ehids -_handleRecoil = scriptNull; -_handleBlinking = scriptNull; -_handleHeartbeat = scriptNull; -_handleStumble = scriptNull; - -// apply fatigue effects -while {true} do { - _fatigue = getFatigue AGM_player; - - if (_fatigue > THRESHOLD_1) then { - if (scriptDone _handleHeartbeat) then { - _handleHeartbeat = call AGM_Movement_fnc_heartbeat; - }; - if (_fatigue > THRESHOLD_2) then { - if (scriptDone _handleBlinking) then { - _handleBlinking = call AGM_Movement_fnc_blinking; - }; - - if (_fatigue > THRESHOLD_3) then { - if (scriptDone _handleStumble) then { - _handleStumble = call AGM_Movement_fnc_stumble; - }; - }; - }; - }; - - sleep 0.5; -}; diff --git a/TO_MERGE/agm/Movement/functions/fn_blinking.sqf b/TO_MERGE/agm/Movement/functions/fn_blinking.sqf deleted file mode 100644 index 6d28e87e66..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_blinking.sqf +++ /dev/null @@ -1,23 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - if (!isTouchingGround player) exitWith {}; - - _ppEffect = ppEffectCreate ["ColorCorrections", 1240]; - _ppEffect ppEffectEnable true; - _ppEffect ppEffectForceInNVG true; - _ppEffect ppEffectAdjust [0, -1, 0, [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]; - _ppEffect ppEffectCommit 0.2; - sleep 0.2; - - _ppEffect ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [1, 1, 1, 1], [0.5, 0.5, 0.5, 0.5]]; - _ppEffect ppEffectCommit 0.2; - sleep 0.2; - - _ppEffect ppEffectEnable false; - ppEffectDestroy _ppEffect; - sleep 2 + random 2; -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/functions/fn_climb.sqf b/TO_MERGE/agm/Movement/functions/fn_climb.sqf deleted file mode 100644 index 05f7e61606..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_climb.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// by commy2 - -private "_unit"; - -_unit = _this select 0; - -if !([_unit] call AGM_Movement_fnc_canClimb) exitWith { - [localize "STR_AGM_Movement_CanNotClimb"] call AGM_Core_fnc_displayTextStructured; -}; - -if !(_unit getVariable ["AGM_isClimbInit", false]) then { - _unit addEventHandler ["AnimDone", { - if (local (_this select 0) && {_this select 1 == "AGM_Climb"}) then {_this call AGM_Movement_fnc_handleClimb}; - }]; - - _unit setVariable ["AGM_isClimbInit", true]; -}; - -[_unit] call AGM_Core_fnc_fixLoweredRifleAnimation; -[_unit, "AmovPercMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation; -[_unit, "AGM_Climb", 0] call AGM_Core_fnc_doAnimation; diff --git a/TO_MERGE/agm/Movement/functions/fn_fatigueModule.sqf b/TO_MERGE/agm/Movement/functions/fn_fatigueModule.sqf deleted file mode 100644 index 9e9ab34759..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_fatigueModule.sqf +++ /dev/null @@ -1,14 +0,0 @@ -// by commy2 - -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; - -if !(_activated) exitWith {}; - -AGM_Fatigue_Module = true; - -AGM_Fatigue_CoefFatigue = parseNumber (_logic getVariable "CoefFatigue"); -AGM_Fatigue_CoefRecover = parseNumber (_logic getVariable "CoefRecover"); - -diag_log text "[AGM]: Fatigue Module Initialized."; diff --git a/TO_MERGE/agm/Movement/functions/fn_getWeight.sqf b/TO_MERGE/agm/Movement/functions/fn_getWeight.sqf deleted file mode 100644 index db9b286422..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_getWeight.sqf +++ /dev/null @@ -1,17 +0,0 @@ -// by commy2 - -#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046 - -private ["_unit", "_weight"]; - -_unit = _this select 0; - -_weight = loadAbs _unit * 0.1; - -if (profileNamespace getVariable ["AGM_useImperial", false]) then { - _weight = format ["%1lb", (round (_weight * 100)) / 100]; -} else { - _weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100]; -}; - -_weight diff --git a/TO_MERGE/agm/Movement/functions/fn_heartbeat.sqf b/TO_MERGE/agm/Movement/functions/fn_heartbeat.sqf deleted file mode 100644 index 260d814def..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_heartbeat.sqf +++ /dev/null @@ -1,9 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - playSound "AGM_Heartbeat"; - sleep 8; -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/functions/fn_recoil.sqf b/TO_MERGE/agm/Movement/functions/fn_recoil.sqf deleted file mode 100644 index 342453cf6d..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_recoil.sqf +++ /dev/null @@ -1,15 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - _recoilFactor = _this select 0; - _recoverThreshold = _this select 1; - - player setUnitRecoilCoefficient (_recoilFactor * unitRecoilCoefficient player); - - waitUntil {getFatigue player < _recoverThreshold}; - - player setUnitRecoilCoefficient (_recoilFactor / unitRecoilCoefficient player); -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/functions/fn_stumble.sqf b/TO_MERGE/agm/Movement/functions/fn_stumble.sqf deleted file mode 100644 index 7ca8a28bbf..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_stumble.sqf +++ /dev/null @@ -1,16 +0,0 @@ -// by commy2 - -_this spawn { - if (isTouchingGround player) then { - _animation = switch (currentWeapon player) do { - case "" : {"AmovPpneMstpSnonWnonDnon"}; - case (primaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"}; - case (secondaryWeapon player) : {"AmovPpneMstpSrasWrflDnon"}; - case (handgunWeapon player) : {"AmovPpneMstpSrasWpstDnon"}; - case (binocular player) : {"AmovPpneMstpSrasWbinDnon"}; - default {"AmovPpneMstpSnonWnonDnon"}; - }; - [player, _animation] call AGM_Core_fnc_doAnimation; - }; - sleep 6; -} diff --git a/TO_MERGE/agm/Movement/functions/fn_vision.sqf b/TO_MERGE/agm/Movement/functions/fn_vision.sqf deleted file mode 100644 index 79a88df785..0000000000 --- a/TO_MERGE/agm/Movement/functions/fn_vision.sqf +++ /dev/null @@ -1,18 +0,0 @@ -// by commy2 - -private "_script_handle"; - -_script_handle = _this spawn { - _ppEffect = ppEffectCreate ["radialBlur", 1241]; - - _ppEffect ppEffectEnable true; - _ppEffect ppEffectForceInNVG true; - _ppEffect ppEffectAdjust [0.01, 0.01, 0.1, 0.1]; - _ppEffect ppEffectCommit 0; - - sleep 0.5; - - _ppEffect ppEffectEnable false; - ppEffectDestroy _ppEffect; -}; -_script_handle diff --git a/TO_MERGE/agm/Movement/showWeight.sqf b/TO_MERGE/agm/Movement/showWeight.sqf deleted file mode 100644 index 2fcdff7b05..0000000000 --- a/TO_MERGE/agm/Movement/showWeight.sqf +++ /dev/null @@ -1,10 +0,0 @@ -//by commy2 - -while {true} do { - waitUntil {!isNull (findDisplay 602)}; - waitUntil { - _player = AGM_player; - findDisplay 602 displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [_player] call AGM_Core_fnc_getName, localize "STR_AGM_Movement_Weight", [_player] call AGM_Movement_fnc_getWeight]; - isNull (findDisplay 602) - }; -}; diff --git a/TO_MERGE/agm/Movement/sounds/Heartbeat.ogg b/TO_MERGE/agm/Movement/sounds/Heartbeat.ogg deleted file mode 100644 index 2e370a566e..0000000000 Binary files a/TO_MERGE/agm/Movement/sounds/Heartbeat.ogg and /dev/null differ diff --git a/TO_MERGE/agm/SafeMode/clientInit.sqf b/TO_MERGE/agm/SafeMode/clientInit.sqf deleted file mode 100644 index 22440928b8..0000000000 --- a/TO_MERGE/agm/SafeMode/clientInit.sqf +++ /dev/null @@ -1,5 +0,0 @@ - -// by commy2 - -//["Soldier", {_player = AGM_player; if (currentWeapon _player in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) then {[false] call AGM_SafeMode_setSafeModeVisual}] call AGM_Core_fnc_addInfoDisplayEventHandler; - //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" \ No newline at end of file diff --git a/TO_MERGE/agm/SafeMode/config.cpp b/TO_MERGE/agm/SafeMode/config.cpp deleted file mode 100644 index c8360c341d..0000000000 --- a/TO_MERGE/agm/SafeMode/config.cpp +++ /dev/null @@ -1,46 +0,0 @@ -// PATCH CONFIG -class CfgPatches { - class AGM_SafeMode { - 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_SafeMode { - class AGM_SafeMode { - file = "AGM_SafeMode\functions"; - class firstMode; - class lockSafety; - class playChangeFiremodeSound; - class setSafeModeVisual; - class unlockSafety; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_SafeMode { - clientInit = "call compile preprocessFileLineNumbers '\AGM_SafeMode\clientInit.sqf';"; - }; -}; - -class AGM_Core_Default_Keys { - class safeWeapon { - displayName = "$STR_AGM_SafeMode_SafeMode"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player, currentWeapon _player, currentMuzzle _player] call AGM_SafeMode_fnc_lockSafety"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 41; - shift = 0; - control = 1; - alt = 0; - }; -}; diff --git a/TO_MERGE/agm/SafeMode/functions/fn_lockSafety.sqf b/TO_MERGE/agm/SafeMode/functions/fn_lockSafety.sqf deleted file mode 100644 index cca54b51ab..0000000000 --- a/TO_MERGE/agm/SafeMode/functions/fn_lockSafety.sqf +++ /dev/null @@ -1,65 +0,0 @@ -// by commy2 - -private ["_unit", "_weapon", "_muzzle", "_safedWeapons"]; - -_unit = _this select 0; -_weapon = _this select 1; -_muzzle = _this select 2; - -// don't immediately switch back -if (inputAction "nextWeapon" > 0) exitWith {}; - -_safedWeapons = _unit getVariable ["AGM_SafeMode_safedWeapons", []]; - -if (_weapon in _safedWeapons) exitWith { - _this call AGM_SafeMode_fnc_unlockSafety; -}; - -_safedWeapons pushBack _weapon; - -_unit setVariable ["AGM_SafeMode_safedWeapons", _safedWeapons]; - -if (_unit getVariable ["AGM_SafeWeapon_actionID", -1] == -1) then { - private ["_condition", "_statement", "_id"]; - - _condition = { - if ( - [_this select 1] call AGM_Core_fnc_canUseWeapon - && { - if (currentMuzzle (_this select 1) in ((_this select 1) getVariable ["AGM_SafeMode_safedWeapons", []])) then { - if (inputAction "nextWeapon" > 0) exitWith { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call AGM_SafeMode_fnc_unlockSafety; - false - }; - true - } else {false} - } - ) then { - // player hud - [false] call AGM_SafeMode_fnc_setSafeModeVisual; - true - } else { - // player hud - [true] call AGM_SafeMode_fnc_setSafeModeVisual; - false - } - }; - - _statement = { - [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call AGM_SafeMode_fnc_unlockSafety; - }; - - //_id = [_unit, format ["%1", localize "STR_AGM_SafeMode_TakeOffSafety"], "DefaultAction", _condition, {}, {true}, _statement, 10] call AGM_Core_fnc_addActionMenuEventHandler; - _id = [_unit, "DefaultAction", _condition, {}] call AGM_Core_fnc_addActionEventHandler; - - _unit setVariable ["AGM_SafeWeapon_actionID", _id]; -}; - -_unit selectWeapon _muzzle;//_weapon - -// play fire mode selector sound -[_unit, _weapon, _muzzle] call AGM_SafeMode_fnc_playChangeFiremodeSound; - -private "_picture"; -_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); -[localize "STR_AGM_SafeMode_PutOnSafety", _picture] call AGM_Core_fnc_displayTextPicture; diff --git a/TO_MERGE/agm/Scopes/clientInit.sqf b/TO_MERGE/agm/Scopes/clientInit.sqf deleted file mode 100644 index 106121cc8b..0000000000 --- a/TO_MERGE/agm/Scopes/clientInit.sqf +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Initializes vars needed for scope adjustment and watches for scope changes. - * - * Arguments: - * None - * - * Return Value: - * None - */ -AGM_Scopes_fadeScript = scriptNull; - -// show overlay after changing weapon/optic -0 spawn { - _layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer; - while {True} do { - waitUntil {[AGM_player, 0,0] call AGM_Scopes_fnc_canAdjustScope}; - _layer cutRsc ["AGM_Scope_Zeroing", "PLAIN", 0, false]; - sleep 3; - _layer cutFadeOut 2; - - _weapon = currentWeapon AGM_player; - _optics = [AGM_player] call AGM_Scopes_fnc_getOptics; - waitUntil {sleep 0.05; !(_optics isEqualTo ([AGM_player] call AGM_Scopes_fnc_getOptics)) or (currentWeapon AGM_player != _weapon)}; - }; -}; - -// instantly hide when scoping in -0 spawn { - _layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer; - while {True} do { - waitUntil {sleep 0.05; cameraView == "GUNNER"}; - if !(isNull AGM_Scopes_fadeScript) then { - terminate AGM_Scopes_fadeScript; - }; - _layer cutText ["", "PLAIN", 0]; - }; -}; diff --git a/TO_MERGE/agm/Scopes/config.cpp b/TO_MERGE/agm/Scopes/config.cpp deleted file mode 100644 index c521d53df7..0000000000 --- a/TO_MERGE/agm/Scopes/config.cpp +++ /dev/null @@ -1,238 +0,0 @@ -class CfgPatches { - class AGM_Scopes { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi"; - }; -}; - -class CfgFunctions { - class AGM_Scopes { - class AGM_Scopes { - file = "AGM_Scopes\functions"; - class adjustScope; - class canAdjustScope; - class firedEH; - class getOptics; - class hideZeroing; - class inventoryCheck; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_Scopes { - clientInit = "call compile preprocessFileLineNumbers '\AGM_Scopes\clientInit.sqf';"; - }; -}; - -class Extended_Fired_EventHandlers { - class CAManBase { - class AGM_Scopes { - clientFired = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_firedEH};"; - }; - }; -}; - -class Extended_Take_EventHandlers { - class CAManBase { - class AGM_Scopes { - clientTake = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class Extended_Put_EventHandlers { - class CAManBase { - class AGM_Scopes { - clientPut = "if (_this select 0 == AGM_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class Extended_InitPost_EventHandlers { - class CAManBase { - class AGM_Scopes { - init = "if (_this select 0 == call AGM_Core_fnc_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class Extended_Respawn_EventHandlers { - class CAManBase { - class AGM_Scopes { - respawn = "if (_this select 0 == call AGM_Core_fnc_player) then {_this call AGM_Scopes_fnc_inventoryCheck};"; - }; - }; -}; - -class AGM_Core_Default_Keys { - class adjustScopeUp { - displayName = "$STR_AGM_Scopes_AdjustUp"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0, 0.1] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, 0, 0.1] call AGM_Scopes_fnc_adjustScope;"; - allowHolding = 1; - key = 201; - shift = 0; - control = 0; - alt = 0; - }; - class adjustScopeDown: adjustScopeUp { - displayName = "$STR_AGM_Scopes_AdjustDown"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0, -0.1] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, 0, -0.1] call AGM_Scopes_fnc_adjustScope;"; - key = 209; - }; - class adjustScopeLeft: adjustScopeUp { - displayName = "$STR_AGM_Scopes_AdjustLeft"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, -0.1, 0] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, -0.1, 0] call AGM_Scopes_fnc_adjustScope;"; - key = 209; - control = 1; - }; - class adjustScopeRight: adjustScopeLeft { - displayName = "$STR_AGM_Scopes_AdjustRight"; - condition = "[_player] call AGM_Scopes_fnc_inventoryCheck; [_player, 0.1, 0] call AGM_Scopes_fnc_canAdjustScope"; - statement = "[_player, 0.1, 0] call AGM_Scopes_fnc_adjustScope;"; - key = 201; - }; -}; - -class CfgSounds { - class AGM_Sound_Click; - class AGM_Scopes_Click_1: AGM_Sound_Click { - sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 3, 2, 200}; - }; - class AGM_Scopes_Click_2: AGM_Scopes_Click_1 { - sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 3.3, 1.8, 200}; - }; - class AGM_Scopes_Click_3: AGM_Scopes_Click_1 { - sound[] = {"\AGM_Scopes\sounds\agm_scopes_click.wav", 2.8, 2.3, 200}; - }; -}; - -class CfgWeapons { - class ItemCore; - class InventoryOpticsItem_Base_F; - - class optic_LRPS: ItemCore { - AGM_ScopeAdjust_Horizontal[] = {-50,50}; - AGM_ScopeAdjust_Vertical[] = {-70,70}; - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip { - discreteDistance[] = {1}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - - class optic_SOS: ItemCore { - AGM_ScopeAdjust_Horizontal[] = {-50,50}; - AGM_ScopeAdjust_Vertical[] = {-60,60}; - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip { - discreteDistance[] = {1}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; - - class optic_DMS: ItemCore { - AGM_ScopeAdjust_Horizontal[] = {-40,40}; - AGM_ScopeAdjust_Vertical[] = {-40,40}; - class ItemInfo: InventoryOpticsItem_Base_F { - class OpticsModes { - class Snip { - discreteDistance[] = {1}; - discreteDistanceInitIndex = 0; - }; - }; - }; - }; -}; - -class RscTitles { - class AGM_Scope_Zeroing { - idd = -1; - movingEnable = 0; - enableSimulation = 1; - enableDisplay = 1; - onLoad = "_this spawn compile preprocessFileLineNumbers '\AGM_Scopes\scripts\zeroingOnLoad.sqf'; uiNamespace setVariable ['AGM_Scope_Debug', _this];"; - duration = 1e+011; - fadein = 0; - fadeout = 0; - name = "AGM_Scope_Zeroing"; - class RscPicture; - class RscText; - class controls { - class AGM_Scope_Zeroing_BG: RscPicture { - idc = 925001; - type = 0; - text = "AGM_Scopes\UI\scopes_bg.paa"; - style = 48 + 0x800; - scale = 1; - sizeEx = 1; - font = "PuristaMedium"; - colorText[] = {1,1,1,1}; - colorBackground[] = {1,1,1,1}; - shadow = 1; - - x = (0.5-0.4/2) * safezoneW + safezoneX; - y = 0 * safezoneH + safezoneY; - w = 0.4 * safezoneW; - h = 0.3 * safezoneH; - }; - class AGM_Scope_Zeroing_Vertical: RscText { - idc = 925002; - type = 0; - style = 2; - sizeEx = 0.04; - lineSpacing = 1; - font = "PuristaMedium"; - text = ""; - colorText[] = {1,1,1, 0.9}; - colorBackground[] = {1,0,0, 0}; - shadow = 0; - - x = (0.5-0.4/2 + 0.45*0.4) * safezoneW + safezoneX; - y = (0 + 0.19*0.3) * safezoneH + safezoneY; - w = 0.04 * safezoneW; - h = 0.025 * safezoneH; - }; - class AGM_Scope_Zeroing_Horizontal: RscText { - idc = 925003; - type = 0; - style = 0; - sizeEx = 0.04; - lineSpacing = 1; - font = "PuristaMedium"; - text = ""; - colorText[] = {1,1,1, 0.9}; - colorBackground[] = {1,0,0, 0}; - shadow = 0; - - x = (0.5-0.4/2 + 0.6*0.4) * safezoneW + safezoneX; - y = (0 + 0.47*0.3) * safezoneH + safezoneY; - w = 0.04 * safezoneW; - h = 0.025 * safezoneH; - }; - }; - }; -}; - -class RscInGameUI { - class RscUnitInfo; - class RscWeaponZeroing: RscUnitInfo { - onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['AGM_dlgWeaponZeroing', _this select 0];"; - }; -}; diff --git a/TO_MERGE/agm/Scopes/functions/fn_adjustScope.sqf b/TO_MERGE/agm/Scopes/functions/fn_adjustScope.sqf deleted file mode 100644 index 0b70913365..0000000000 --- a/TO_MERGE/agm/Scopes/functions/fn_adjustScope.sqf +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Author: KoffeinFlummi - * - * Changes the adjustment for the current scope - * - * Arguments: - * 0: Horizontal adjustment - * 1: Vertical adjustment - * - * Return Value: - * True - */ - -private ["_unit", "_weapons", "_zeroing", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_hint"]; - -_unit = _this select 0; - -_weapons = [ - primaryWeapon _unit, - secondaryWeapon _unit, - handgunWeapon _unit -]; - -if (isNil "AGM_Scopes_Adjustment") then { - AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]]; -}; - -_zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon _unit)); -_zeroing set [0, (round (((_zeroing select 0) + (_this select 1)) * 10)) / 10]; -_zeroing set [1, (round (((_zeroing select 1) + (_this select 2)) * 10)) / 10]; - -AGM_Scopes_Adjustment set [_weapons find (currentWeapon _unit), _zeroing]; - -playSound (["AGM_Scopes_Click_1", "AGM_Scopes_Click_2", "AGM_Scopes_Click_3"] select floor random 3); - -// slightly rotate the player if looking through optic -if (cameraView == "GUNNER") then { - _pitchbankyaw = [_unit] call AGM_Core_fnc_getPitchBankYaw; - // these are not exact mil-to-degree conversions, but instead chosen - // to minimize the effect of rounding errors - _pitch = (_pitchbankyaw select 0) + ((_this select 2) * -0.04); - _bank = _pitchbankyaw select 1; - _yaw = (_pitchbankyaw select 2) + ((_this select 1) * -0.04); - [_unit, _pitch, _bank, _yaw] call AGM_Core_fnc_setPitchBankYaw; -}; - -_display = uiNamespace getVariable ["AGM_Scopes_ZeroingDisplay", displayNull]; -if !(isNull _display) then { - _vertical = _display displayCtrl 925002; - _horizontal = _display displayCtrl 925003; - _vertical ctrlSetText (str (_zeroing select 1)); - _horizontal ctrlSetText (str (_zeroing select 0)); -}; - -if (!isNull (missionNamespace getVariable ["AGM_Scopes_fadeScript", scriptNull])) then { - terminate AGM_Scopes_fadeScript; -}; -if (cameraView != "GUNNER") then { - AGM_Scopes_fadeScript = 0 spawn { - _layer = ["AGM_Scope_Zeroing"] call BIS_fnc_rscLayer; - _layer cutRsc ["AGM_Scope_Zeroing", "PLAIN", 0, false]; - sleep 3; - _layer cutFadeOut 2; - }; -}; - -true diff --git a/TO_MERGE/agm/Scopes/functions/fn_hideZeroing.sqf b/TO_MERGE/agm/Scopes/functions/fn_hideZeroing.sqf deleted file mode 100644 index 9013a4155c..0000000000 --- a/TO_MERGE/agm/Scopes/functions/fn_hideZeroing.sqf +++ /dev/null @@ -1,25 +0,0 @@ -// by commy2 - -private ["_state", "_ctrl"]; - -_state = _this select 0; - -disableSerialization; -_ctrl = (uiNamespace getVariable ['AGM_dlgWeaponZeroing', displayNull]) displayCtrl 168; - -if (_state) then { - _ctrl ctrlSetPosition [0,0,0,0]; -} else { - private "_config"; - - _config = configFile >> "RscInGameUI" >> "RscWeaponZeroing" >> "CA_Zeroing"; - - _ctrl ctrlSetPosition [ - getNumber (_config >> "x"), - getNumber (_config >> "y"), - getNumber (_config >> "w"), - getNumber (_config >> "h") - ]; -}; - -_ctrl ctrlCommit 0; diff --git a/TO_MERGE/agm/Scopes/functions/fn_inventoryCheck.sqf b/TO_MERGE/agm/Scopes/functions/fn_inventoryCheck.sqf deleted file mode 100644 index 008b204598..0000000000 --- a/TO_MERGE/agm/Scopes/functions/fn_inventoryCheck.sqf +++ /dev/null @@ -1,21 +0,0 @@ -// by KoffeinFlummi / commy2 - -private "_new"; - -_new = _this call AGM_Scopes_fnc_getOptics; - -if (isNil "AGM_Scopes_Optics") then { - AGM_Scopes_Optics = ["", "", ""]; -}; - -if (isNil "AGM_Scopes_Adjustment") then { - AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]]; -}; - -{ - if (_new select _forEachIndex != _x) then { - AGM_Scopes_Adjustment set [_forEachIndex, [0,0]]; - }; -} forEach AGM_Scopes_Optics; - -AGM_Scopes_Optics = _new; diff --git a/TO_MERGE/agm/Scopes/scripts/zeroingOnLoad.sqf b/TO_MERGE/agm/Scopes/scripts/zeroingOnLoad.sqf deleted file mode 100644 index d74c1b4d5f..0000000000 --- a/TO_MERGE/agm/Scopes/scripts/zeroingOnLoad.sqf +++ /dev/null @@ -1,18 +0,0 @@ -disableSerialization; - -_display = _this select 0; -uiNamespace setVariable ["AGM_Scopes_ZeroingDisplay", _display]; -_vertical = _display displayCtrl 925002; -_horizontal = _display displayCtrl 925003; - -_weapons = [ - primaryWeapon player, - secondaryWeapon player, - handgunWeapon player -]; - -if ((currentWeapon player) in _weapons) then { - _zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon player)); - _horizontal ctrlSetText (str (_zeroing select 0)); - _vertical ctrlSetText (str (_zeroing select 1)); -}; diff --git a/TO_MERGE/agm/Smallarms/config.cpp b/TO_MERGE/agm/Smallarms/config.cpp deleted file mode 100644 index b01cbb04a9..0000000000 --- a/TO_MERGE/agm/Smallarms/config.cpp +++ /dev/null @@ -1,530 +0,0 @@ -// SEE LICENSE.TXT FOR LICENSING INFORMATION - -class CfgPatches { - class AGM_Smallarms { - units[] = {}; - weapons[] = {}; //{"AGM_acc_flashlight_tls"}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"TaoSensai", "KoffeinFlummi"}; - authorUrl = "https://github.com/Taosenai/tmr"; - }; -}; - -// EVERYTHING BELOW BELONGS TO TAOSENSAI - -////////////////////////////////////////////////////// -// TMR strings update for weapons and magazines: -// 1. Change displayname to match TMR standards. -// 3. Add displaynameshort to TMR standards. -////////////////////////////////////////////////////// - -class CfgMagazines { - class CA_Magazine; - - // Magazine updates: - // 1. Update all magazines with tracer mix to use 1 in 5 mix. Full tracer mags should not be changed! - // 2. Remove tracers at bottom of magazine. - // 3. Do string updates. - - // 5.56mm //////////////////////////////////// - - class 30Rnd_556x45_Stanag : CA_Magazine { - displayname = "5.56mm 30Rnd Mag"; - displaynameshort = "5.56mm"; - - tracersEvery = 0; - lastRoundsTracer = 0; - }; - - class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { - displayname = "5.56mm 30Rnd Tracer Mag"; - displaynameshort = "5.56mm"; - }; - - class 30Rnd_556x45_Stanag_Tracer_Green: 30Rnd_556x45_Stanag { - displayname = "5.56mm 30Rnd Tracer Mag"; - displaynameshort = "5.56mm"; - }; - - class 30Rnd_556x45_Stanag_Tracer_Yellow: 30Rnd_556x45_Stanag { - displayname = "5.56mm 30Rnd Tracer Mag"; - displaynameshort = "5.56mm"; - }; - - class 20Rnd_556x45_UW_mag: 30Rnd_556x45_Stanag { - displayname = "5.56mm 20Rnd MEA Mag"; - displaynameshort = "5.56mm MEA"; - }; - - // 6.5mm ////////////////////////////////////////// - - class 30Rnd_65x39_caseless_mag : CA_Magazine { // MX!! - displayname = "6.5mm 30Rnd Mag"; - displaynameshort = "6.5mm"; - - tracersEvery = 0; - lastRoundsTracer = 0; - }; - - class 30Rnd_65x39_caseless_mag_Tracer : 30Rnd_65x39_caseless_mag { // MX!! - displayname = "6.5mm 30Rnd Tracer Mag"; - displaynameshort = "6.5mm Tracer"; - }; - - class 30Rnd_65x39_caseless_green : 30Rnd_65x39_caseless_mag { // Katiba!! - displayname = "6.5mm 30Rnd Mag"; - displaynameshort = "6.5mm"; - - tracersEvery = 0; - lastRoundsTracer = 0; - }; - - class 30Rnd_65x39_caseless_green_Tracer : 30Rnd_65x39_caseless_green { // Katiba!! - displayname = "6.5mm 30Rnd Tracer Magazine"; - displaynameshort = "6.5mm Tracer"; - }; - - class 100Rnd_65x39_caseless_mag : CA_Magazine { - displayname = "6.5mm 100Rnd Mag"; - displaynameshort = "6.5mm"; - - tracersEvery = 5; - lastRoundsTracer = 3; - }; - - class 100Rnd_65x39_caseless_mag_Tracer : 100Rnd_65x39_caseless_mag { - displayname = "6.5mm 100Rnd Tracer Mag"; - displaynameshort = "6.5mm Tracer"; - }; - - class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag { - displayname = "6.5mm 200Rnd Box"; - displaynameshort = "6.5mm"; - - tracersEvery = 5; - lastRoundsTracer = 3; - }; - class 200Rnd_65x39_cased_Box_Tracer: 200Rnd_65x39_cased_Box { - displayname = "6.5mm 200Rnd Tracer Box"; - displaynameshort = "6.5mm Tracer"; - }; - - // 7.62mm ////////////////////////////////////////// - - class 20Rnd_762x51_Mag: CA_Magazine { - displayname = "7.62mm 20Rnd Mag"; - displaynameshort = "7.62mm"; - }; - - class 150Rnd_762x51_Box : CA_Magazine { - displayname = "7.62mm 150Rnd Box"; - - tracersEvery = 5; - lastRoundsTracer = 3; - }; - - class 150Rnd_762x51_Box_Tracer : 150Rnd_762x51_Box { - displayname = "7.62mm 150Rnd Tracer Box"; - }; - - // Anti-materiel /////////////////////////////// - - class 7Rnd_408_Mag: CA_Magazine { - displayname = ".408 7Rnd Mag"; - }; - - class 5Rnd_127x108_Mag: CA_Magazine { - displayname = "12.7mm 5Rnd Mag"; - }; - - // SMG & Pistol //////////////////////////// - - class 30Rnd_9x21_Mag : CA_Magazine { - displayname = "9mm 30Rnd Mag"; - displaynameshort = "9mm"; - - lastRoundsTracer = 0; - }; - - class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag { - displayname = "9mm 17Rnd Mag"; - displaynameshort = "9mm"; - - count = 17; - }; - - class 30Rnd_45ACP_Mag_SMG_01 : 30Rnd_9x21_Mag { - displayname = ".45 25Rnd Mag"; - displaynameshort = ".45"; - - picture = "\A3\weapons_f\data\ui\M_30Rnd_9x21_CA.paa"; - - count = 25; - - tracersEvery = 0; - lastRoundsTracer = 0; - }; - - class 9Rnd_45ACP_Mag : 30Rnd_45ACP_Mag_SMG_01 { - displayname = ".45 8Rnd Mag"; - displaynameshort = ".45"; - - count = 8; - }; - - class 30Rnd_45ACP_Mag_SMG_01_Tracer_Green: 30Rnd_45ACP_Mag_SMG_01 { - displayname = ".45 25Rnd Tracer Mag"; - }; -}; - -class Mode_SemiAuto; -class Mode_Burst; -class Mode_FullAuto; - -// config inheritance of weapon slot info v1.32 -class SlotInfo; -class CowsSlot: SlotInfo {}; -class PointerSlot: SlotInfo { - //compatibleItems[] = {"acc_flashlight","acc_pointer_IR", "AGM_acc_flashlight_tls"}; -}; - -class CfgWeapons { - - // config inheritance of weapon slot info v1.32 for launchers - class Launcher; - class Launcher_Base_F: Launcher { - class WeaponSlotsInfo {}; - }; - - // config inheritance of weapon slot info v1.32 for assault rifles - class RifleCore; - class Rifle: RifleCore { - class WeaponSlotsInfo { - class MuzzleSlot: SlotInfo {}; - class CowsSlot: CowsSlot {}; - class PointerSlot: PointerSlot {}; - }; - }; - class Rifle_Base_F: Rifle {}; - class Rifle_Long_Base_F: Rifle_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo {}; - }; - - // config inheritance of weapon slot info v1.32 for handguns - class PistolCore; - class Pistol: PistolCore { - class WeaponSlotsInfo { - class CowsSlot: SlotInfo {}; - }; - }; - class Pistol_Base_F: Pistol { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: SlotInfo {}; - }; - }; - - /////////////////////////////////////////////////////////////////////////////// - //////////// SMALL ARMS WEAPONS /////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - // Weapon updates: - // 1. Do string update. - // 2. Fix magazine compatibility as needed. - // 3. Fix firing modes as needed. - // 4. Fix accessory compatibility as needed. - - // Grenade launchers ///////////////////////////////////// - // Updated strings are in weapon configs. - class GrenadeLauncher; - class UGL_F : GrenadeLauncher {}; - - // MXs //////////////////////////////////////////////////// - - class arifle_MX_Base_F : Rifle_Base_F { - //magazines[] = {"30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "100Rnd_65x39_caseless_mag", "100Rnd_65x39_caseless_mag_Tracer"}; - - // http://www.bushmaster.com/acr/#/intro - // 800 rpm (whatever, fictional lol) - - //class Single : Mode_SemiAuto {}; - class Single : Mode_SemiAuto { - reloadTime = 0.075; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.075; - }; - }; - - class arifle_MX_SW_F : arifle_MX_Base_F { - modes[] = {"Single", "manual", "close", "short", "medium", "far_optic1", "far_optic2"}; - - //class Single : Single {}; - //class manual : FullAuto {}; - }; - - // Katibas //////////////////////////////////////////////////// - - class arifle_katiba_Base_F : Rifle_Base_F { - // http://world.guns.ru/assault/iran/khaybar-kh2002-e.html - // 800 rpm - - class Single : Mode_SemiAuto { - reloadTime = 0.075; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.075; - }; - }; - - // SDAR ////////////////////////////////////////////////// - - class SDAR_base_F : Rifle_Base_F { - modes[] = {"Single", "FullAuto"}; // Leave in the imaginary full-auto mode because, whatever. - }; - - // Tavor TRG //////////////////////////////////////////////// - - class Tavor_base_F : Rifle_Base_F { - // http://www.israel-weapon.com/files/brochure_2012/IWI_TAVOR_AR.pdf - // 700 ~1000 rpm (850) - class Single : Mode_SemiAuto { - reloadTime = 0.07; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.07; - }; - }; - - // Mk20 (F2000) ////////////////////////////////////////////////// - - class mk20_base_F : Rifle_Base_F { - // http://www.fnherstal.com/primary-menu/products-capabilities/rifles/technical-data/product/182/232/182/1/_/fn-f2000R-standard.html - // 850 rpm - class Single : Mode_SemiAuto { - reloadTime = 0.07; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.07; - }; - }; - - // SMG Vermin //////////////////////////////////////////////////// - - class SMG_01_Base : Rifle_Base_F { - // http://kriss-usa.com/pdf/operatormanual/ - // 1200 rpm - class Single : Mode_SemiAuto { - reloadTime = 0.05; - }; - - class Burst : Mode_Burst { - burst = 2; - reloadTime = 0.05; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.05; - }; - }; - - // SMG Scorpion //////////////////////////////////////////////////// - - class SMG_02_base_F : Rifle_Base_F { - //http://www.czub.cz/zbrojovka/cz-manual/Instruction-Manual-Scorpion-EVO-3-A1_en.pdf - // 1150 rpm - - class Single : Mode_SemiAuto { - // http://www.stengg.com/upload/915fGdhTi3ggnnGQGGL.pdf - // 900-1100 rpm (1000rpm) - reloadTime = 0.052; - }; - - class Burst : Mode_Burst { - reloadTime = 0.052; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.052; - }; - }; - - // SMG PDW2000 /////////////////////////////////////////////////// - - class pdw2000_base_F: Rifle_Base_F { - magazines[] = {"30Rnd_9x21_Mag"}; - - modes[] = {"Single", "FullAuto"}; // No burst on this thing - - class Single : Mode_SemiAuto { - // http://www.stengg.com/upload/915fGdhTi3ggnnGQGGL.pdf - // 900-1100 rpm (1000rpm) - reloadTime = 0.06; - }; - - class FullAuto: Mode_FullAuto { - reloadTime = 0.06; - }; - }; - - // Pistols ////////////////////////////////////////////// - - class hgun_P07_F : Pistol_Base_F { - magazines[] = {"16Rnd_9x21_Mag"}; - }; - - class hgun_Rook40_F : Pistol_Base_F { - magazines[] = {"16Rnd_9x21_Mag"}; - }; - - /*class hgun_ACPC2_F: Pistol_Base_F {}; - class hgun_Pistol_heavy_01_F: Pistol_Base_F {}; - class hgun_Pistol_heavy_02_F: Pistol_Base_F {};*/ - - // LMGs ////////////////////////////////////////////// - - class LMG_Mk200_F : Rifle_Long_Base_F { - modes[] = {"manual", "Single", "close", "short", "medium", "far_optic1", "far_optic2"}; - - class manual : Mode_FullAuto { - // http://www.defensereview.com/kac-stoner-lmg-belt-fed-5-56mm-nato-lightweight-light-machine-gun-squad-automatic-weapon-lmgsaw-displayed-at-sofic-2010/ - // 550 rpm - reloadTime = 0.109; - }; - - // Add semi-auto mode. - // Inherit from 'manual' for sound reasons. - class Single : manual { - reloadTime = 0.109; - dispersion = 0.00175; // radians. Equal to 6 MOA. - autofire = 0; - burst = 1; - displayname = "Semi"; - texturetype = "semi"; - showToPlayer = 1; - }; - }; - - class LMG_Zafir_F: Rifle_Long_Base_F { - modes[] = {"FullAuto", "Single", "close", "short", "medium", "far_optic1", "far_optic2"}; - - class FullAuto : Mode_FullAuto { - reloadTime = 0.070; // 850 RPM on gas position 1 - }; - }; - - // Sniper and anti-materiel rifles ///////////////////////////////// - - class EBR_base_F : Rifle_Long_Base_F { - // EMR/EBR is typically issued semi-auto AFAIK - modes[] = {"Single", "single_close_optics1", "single_medium_optics1", "single_far_optics1"}; - cursor = "arifle"; - }; - - class LRR_base_F : Rifle_Long_Base_F { - cursor = "arifle"; - }; - - class GM6_base_F : Rifle_Long_Base_F { - cursor = "arifle"; - - // Fuck your balancing, BI. - class Single : Mode_SemiAuto { - // 250 rpm is probably the limit of the finger on a heavy bullpup trigger like this thing must have. - reloadTime = 0.24; - }; - }; - - /////////////////////////////////////////////////////////////////////////////// - //////////// WEAPON ATTACHMENTS /////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// - - - - - class ItemCore; - class InventoryItem_Base_F; - class InventoryMuzzleItem_Base_F; - class InventoryFlashLightItem_Base_F; - - class AGM_acc_flashlight_tls: ItemCore { - author = "$STR_A3_Bohemia_Interactive"; - _generalMacro = "AGM_acc_flashlight_tls"; - scope = 1; //2; - displayName = "$STR_A3_cfgWeapons_acc_flashlight0";// - descriptionUse = "$STR_A3_cfgWeapons_use_flashlight0";// - picture = "\A3\weapons_F\Data\UI\gear_accv_flashlight_tls_ca.paa"; - model = "\A3\weapons_f\acc\accv_flashlight_TLS_F"; - descriptionShort = "$STR_A3_cfgWeapons_acc_flashlight1";// - class ItemInfo: InventoryFlashLightItem_Base_F { - mass = 4; - class FlashLight { - color[] = {180,156,120}; - ambient[] = {0.9,0.78,0.6}; - intensity = 20; - size = 1; - innerAngle = 20; - outerAngle = 80; - coneFadeCoef = 5; - position = "flash dir"; - direction = "flash"; - useFlare = 1; - flareSize = 1.4; - flareMaxDistance = "100.0f"; - dayLight = 0; - class Attenuation { - start = 0.5; - constant = 0; - linear = 0; - quadratic = 1.1; - hardLimitStart = 20; - hardLimitEnd = 30; - }; - scale[] = {0}; - }; - }; - inertia = 0.1; - }; -}; - -#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ - name = #ITEM; \ - count = COUNT; \ -}; - -/*class CfgVehicles { - class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - - class Box_NATO_Support_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_acc_flashlight_tls,5) - }; - }; - - class Box_East_Support_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_acc_flashlight_tls,5) - }; - }; - - class Box_IND_Support_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(AGM_acc_flashlight_tls,5) - }; - }; - - class AGM_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(AGM_acc_flashlight_tls,2) - }; - }; -};*/ diff --git a/TO_MERGE/agm/WeaponSelect/clientInit.sqf b/TO_MERGE/agm/WeaponSelect/clientInit.sqf deleted file mode 100644 index 42a1e347d6..0000000000 --- a/TO_MERGE/agm/WeaponSelect/clientInit.sqf +++ /dev/null @@ -1,49 +0,0 @@ -// by CAA-Picard, commy2 - -AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true; -AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""; -AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""; - -// Collect frag and other muzzles separately -with uiNamespace do { - if (isNil "AGM_WeaponSelect_FragMuzzles") then { - AGM_WeaponSelect_FragMuzzles = []; - AGM_WeaponSelect_NonFragMuzzles = []; - AGM_WeaponSelect_AllMuzzles = []; - - AGM_WeaponSelect_FragMagazines = []; - AGM_WeaponSelect_NonFragMagazines = []; - AGM_WeaponSelect_AllMagazines = []; - - { - _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); - _magazine = _magazines select 0; - - _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo"); - _explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive"); - - if (_explosive == 0) then { - AGM_WeaponSelect_NonFragMuzzles pushBack _x; - AGM_WeaponSelect_NonFragMagazines pushBack _magazines; - } else { - AGM_WeaponSelect_FragMuzzles pushBack _x; - AGM_WeaponSelect_FragMagazines pushBack _magazines; - }; - AGM_WeaponSelect_AllMuzzles pushBack _x; - AGM_WeaponSelect_AllMagazines pushBack _magazines; - } forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); - }; -}; - -AGM_WeaponSelect_FragMuzzles = uiNamespace getVariable "AGM_WeaponSelect_FragMuzzles"; -AGM_WeaponSelect_NonFragMuzzles = uiNamespace getVariable "AGM_WeaponSelect_NonFragMuzzles"; -AGM_WeaponSelect_AllMuzzles = uiNamespace getVariable "AGM_WeaponSelect_AllMuzzles"; -AGM_WeaponSelect_FragMagazines = uiNamespace getVariable "AGM_WeaponSelect_FragMagazines"; -AGM_WeaponSelect_NonFragMagazines = uiNamespace getVariable "AGM_WeaponSelect_NonFragMagazines"; -AGM_WeaponSelect_AllMagazines = uiNamespace getVariable "AGM_WeaponSelect_AllMagazines"; - -//AGM_WeaponSelect_AllMuzzlesCount = count AGM_WeaponSelect_AllMuzzles; - -// hide grenade count if none is selected -[uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -["Soldier", {[_this select 0, call AGM_WeaponSelect_fnc_getSelectedGrenade != ""] call AGM_WeaponSelect_fnc_toggleGrenadeCount}] call AGM_Core_fnc_addInfoDisplayEventHandler; //@todo addEventHandler infoDisplayChanged with select 1 == "Soldier" diff --git a/TO_MERGE/agm/WeaponSelect/config.cpp b/TO_MERGE/agm/WeaponSelect/config.cpp deleted file mode 100644 index ee9ee2ab11..0000000000 --- a/TO_MERGE/agm/WeaponSelect/config.cpp +++ /dev/null @@ -1,234 +0,0 @@ -class CfgPatches { - class AGM_WeaponSelect { - units[] = {}; - weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {AGM_Core}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; - author[] = {"commy2", "KoffeinFlummi", "CAA-Picard"}; - authorUrl = "https://github.com/commy2/"; - }; -}; - -class CfgFunctions { - class AGM_WeaponSelect { - class AGM_WeaponSelect { - file = "\AGM_WeaponSelect\functions"; - class actionThrow; - class actionThrowCondition; - class countMagazinesForGrenadeMuzzle; - class displayGrenadeTypeAndNumber; - class findNextGrenadeMagazine; - class findNextGrenadeMuzzle; - class fireSmokeLauncher; - class getSelectedGrenade; - class getWeaponModes; - class getWeaponMuzzles; - class playChangeFiremodeSound; - class putWeaponAway; - class selectGrenadeAll; - class selectGrenadeFrag; - class selectGrenadeOther; - class selectWeaponMode; - class selectWeaponMuzzle; - class selectWeaponVehicle; - class selectMagazineVehicle; - class setNextGrenadeMuzzle; - class throwGrenade; - class toggleGrenadeCount; - }; - }; -}; - -class Extended_PostInit_EventHandlers { - class AGM_WeaponSelect { - clientInit = "call compile preprocessFileLineNumbers '\AGM_WeaponSelect\clientInit.sqf';"; - }; -}; - -class Extended_Init_EventHandlers { - class CAManBase { - class AGM_WeaponSelect_ThrowGrenade { - clientInit = "_this call compile preprocessFileLineNumbers '\AGM_WeaponSelect\initActions.sqf';"; - }; - }; -}; -class Extended_Respawn_EventHandlers { - class CAManBase { - class AGM_WeaponSelect_ThrowGrenade { - respawn = "[_this, ""{_this call compile preprocessFileLineNumbers '\AGM_WeaponSelect\initActions.sqf';}""] call AGM_Core_fnc_execRemoteFnc;"; - }; - }; -}; - -class Extended_FiredBIS_EventHandlers { - class CAManBase { - class AGM_WeaponSelect_ThrowGrenade { - clientFiredBIS = "if (_this select 0 == AGM_player) then {_this call AGM_WeaponSelect_fnc_throwGrenade;};"; - }; - }; -}; - -class AGM_Core_Default_Keys { - class selectPistol { - displayName = "$STR_AGM_WeaponSelect_SelectPistol"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player, handgunWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 2; - shift = 0; - control = 0; - alt = 0; - }; - class selectRifle { - displayName = "$STR_AGM_WeaponSelect_SelectRifle"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player, primaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 3; - shift = 0; - control = 0; - alt = 0; - }; - class selectLauncher { - displayName = "$STR_AGM_WeaponSelect_SelectLauncher"; - condition = "_player == _vehicle"; - statement = "[_player, secondaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMode"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 5; - shift = 0; - control = 0; - alt = 0; - }; - /*class selectPistolMuzzle { - displayName = "Select Pistol Muzzle"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player, handgunWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - disabled = 1; - key = 7; - shift = 0; - control = 0; - alt = 0; - };*/ - class selectRifleMuzzle { - displayName = "$STR_AGM_WeaponSelect_SelectRifleMuzzle"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player, primaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 4; - shift = 0; - control = 0; - alt = 0; - }; - /*class selectLauncherMuzzle { - displayName = "Select Launcher Muzzle"; - condition = "_player == _vehicle"; - statement = "[_player, secondaryWeapon _player] call AGM_WeaponSelect_fnc_selectWeaponMuzzle"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - disabled = 1; - key = 8; - shift = 0; - control = 0; - alt = 0; - };*/ - class selectBinocular { - displayName = "$STR_AGM_WeaponSelect_SelectBinocular"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player, binocular _player] call AGM_WeaponSelect_fnc_selectWeaponMode"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 6; - shift = 0; - control = 0; - alt = 0; - }; - class selectGrenadeFrag { - displayName = "$STR_AGM_WeaponSelect_SelectGrenadeFrag"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player] call AGM_WeaponSelect_fnc_selectGrenadeFrag"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 7; - shift = 0; - control = 0; - alt = 0; - }; - class selectGrenadeOther { - displayName = "$STR_AGM_WeaponSelect_SelectGrenadeOther"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player] call AGM_WeaponSelect_fnc_selectGrenadeOther"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 8; - shift = 0; - control = 0; - alt = 0; - }; - class holsterWeapon { - displayName = "$STR_AGM_WeaponSelect_HolsterWeapon"; - condition = "[_player] call AGM_Core_fnc_canUseWeapon"; - statement = "[_player] call AGM_WeaponSelect_fnc_putWeaponAway"; - exceptions[] = {"AGM_Interaction_isNotEscorting"}; - key = 11; - shift = 0; - control = 0; - alt = 0; - }; - - class engineOn { - displayName = "$STR_AGM_WeaponSelect_EngineOn"; - condition = "_player != _vehicle && {_player == driver _vehicle} && {!isEngineOn _vehicle}"; - statement = "_vehicle engineOn true"; - key = 3; - shift = 0; - control = 0; - alt = 0; - }; - class engineOff { - displayName = "$STR_AGM_WeaponSelect_EngineOff"; - condition = "_player != _vehicle && {_player == driver _vehicle} && {isEngineOn _vehicle}"; - statement = "_vehicle engineOn false"; - key = 2; - shift = 0; - control = 0; - alt = 0; - }; - - class selectMaingun { - displayName = "$STR_AGM_WeaponSelect_SelectMainGun"; - condition = "_player != _vehicle"; - statement = "[_player, _vehicle, 0] call AGM_WeaponSelect_fnc_selectWeaponVehicle"; - key = 4; - shift = 0; - control = 0; - alt = 0; - }; - class selectMachineGun { - displayName = "$STR_AGM_WeaponSelect_SelectMachineGun"; - condition = "_player != _vehicle"; - statement = "[_player, _vehicle, 1] call AGM_WeaponSelect_fnc_selectWeaponVehicle"; - key = 5; - shift = 0; - control = 0; - alt = 0; - }; - class selectMissile { - displayName = "$STR_AGM_WeaponSelect_SelectMissiles"; - condition = "_player != _vehicle"; - statement = "[_player, _vehicle, 2] call AGM_WeaponSelect_fnc_selectWeaponVehicle"; - key = 6; - shift = 0; - control = 0; - alt = 0; - }; - - class fireSmokeLauncher { - displayName = "$STR_AGM_WeaponSelect_FireSmokeLauncher"; - condition = "_player != _vehicle && {_player == commander _vehicle}"; - statement = "[_vehicle] call AGM_WeaponSelect_fnc_fireSmokeLauncher"; - key = 10; - shift = 0; - control = 0; - alt = 0; - }; -}; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_actionThrow.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_actionThrow.sqf deleted file mode 100644 index d4488e57f8..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_actionThrow.sqf +++ /dev/null @@ -1,4 +0,0 @@ -// by commy2 - -_text = [localize "STR_AGM_WeaponSelect_NoGrenadeSelected", [1,0,0]] call AGM_Core_fnc_stringToColoredText; -[composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_actionThrowCondition.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_actionThrowCondition.sqf deleted file mode 100644 index e0343d04e6..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_actionThrowCondition.sqf +++ /dev/null @@ -1,32 +0,0 @@ -// by commy2 - -_muzzle = call AGM_WeaponSelect_fnc_getSelectedGrenade; - -_isInput = inputAction "CycleThrownItems" > 0; -if !(_isInput isEqualTo (missionNamespace getVariable ["AGM_WeaponSelect_CycleThrownItemsState", false])) then { - if (_isInput) then { - if (_muzzle == "") then { - [_this select 1] spawn AGM_WeaponSelect_fnc_selectGrenadeAll; - } else { - [_this select 1] spawn AGM_WeaponSelect_fnc_selectGrenadeAll;// - }; - }; - AGM_WeaponSelect_CycleThrownItemsState = _isInput; -}; - -if !([_this select 1] call AGM_Core_fnc_canUseWeapon) exitWith {false}; - -if (_muzzle == "") exitWith {["All"] call AGM_WeaponSelect_fnc_findNextGrenadeMagazine != ""}; - -// fix auto muzzle swap after entering or leaving a vehicle -if (_this select 0 != missionNamespace getVariable ["AGM_WeaponSelect_CurrentGrenadeMuzzleVehicle", objNull]) then { - [_this select 1, _muzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle; - AGM_WeaponSelect_CurrentGrenadeMuzzleVehicle = _this select 0; -}; - -if ((_this select 1) ammo _muzzle == 0) exitWith { - if (AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag) then {AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""} else {AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""}; - [uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount; - true -}; -false diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_countMagazinesForGrenadeMuzzle.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_countMagazinesForGrenadeMuzzle.sqf deleted file mode 100644 index b9a7e06bea..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_countMagazinesForGrenadeMuzzle.sqf +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Author: CAA-Picard - * - * Count how many grenade magazines the unit has on the uniform and vest. - * - * Argument: - * 0: Muzzle name - * - * Return value: - * 0: Number of magazines - * 1: First magazine name - */ - -private ["_player", "_muzzle"]; - -_player = _this select 0; -_muzzle = _this select 1; - -_uniformMags = getMagazineCargo uniformContainer _player; -_vestMags = getMagazineCargo vestContainer _player; -_backPackMags = getMagazineCargo backpackContainer _player; - -_numberOfMagazines = 0; -_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines" ); -_firstMagazine = _magazineClasses select 0; -{ - _indexInUniform = (_uniformMags select 0) find _x; - if (_indexInUniform > -1) then { - _numberOfMagazines = _numberOfMagazines + ((_uniformMags select 1) select _indexInUniform); - _firstMagazine = _x; - }; - _indexInVest = (_vestMags select 0) find _x; - if (_indexInVest > -1) then { - _numberOfMagazines = _numberOfMagazines + ((_vestMags select 1) select _indexInVest); - _firstMagazine = _x; - }; - _indexInBackpack = (_backpackMags select 0) find _x; - if (_indexInBackpack > -1) then { - _numberOfMagazines = _numberOfMagazines + ((_backpackMags select 1) select _indexInBackpack); - _firstMagazine = _x; - }; -} forEach _magazineClasses; - -[_numberOfMagazines, _firstMagazine] diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_findNextGrenadeMagazine.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_findNextGrenadeMagazine.sqf deleted file mode 100644 index 485e30f789..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_findNextGrenadeMagazine.sqf +++ /dev/null @@ -1,32 +0,0 @@ -// by commy2 - -private ["_scope", "_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMagazine"]; - -_scope = _this select 0; //"All", "Frag" or "NonFrag" - -_allMags = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Magazines", _scope], []]; -_allMuzzles = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Muzzles", _scope], []]; - -_magazines = magazines AGM_player; - -_start = [AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag; -_index = _allMuzzles find _start; - -scopeName "SearchMain"; - -_nextMagazine = ""; -for "_index" from (_index + 1) to (count _allMuzzles - 1) do { - { - if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"}; - } count _magazines; -}; - -if (_nextMagazine != "") exitWith {_nextMagazine}; - -for "_index" from 0 to _index do { - { - if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"}; - } count _magazines; -}; - -_nextMagazine diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_findNextGrenadeMuzzle.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_findNextGrenadeMuzzle.sqf deleted file mode 100644 index 56dcf1a207..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_findNextGrenadeMuzzle.sqf +++ /dev/null @@ -1,32 +0,0 @@ -// by commy2 - -private ["_scope", "_allMags", "_allMuzzles", "_magazines", "_start", "_index", "_nextMuzzle"]; - -_scope = _this select 0; //"All", "Frag" or "NonFrag" - -_allMags = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Magazines", _scope], []]; -_allMuzzles = missionNamespace getVariable [format ["AGM_WeaponSelect_%1Muzzles", _scope], []]; - -_magazines = magazines AGM_player; - -_start = [AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag; -_index = _allMuzzles find _start; - -scopeName "SearchMain"; - -_nextMuzzle = ""; -for "_index" from (_index + 1) to (count _allMuzzles - 1) do { - { - if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"}; - } count _magazines; -}; - -if (_nextMuzzle != "") exitWith {_nextMuzzle}; - -for "_index" from 0 to _index do { - { - if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"}; - } count _magazines; -}; - -_nextMuzzle diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_fireSmokeLauncher.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_fireSmokeLauncher.sqf deleted file mode 100644 index e5836589e8..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_fireSmokeLauncher.sqf +++ /dev/null @@ -1,37 +0,0 @@ -// by commy2 - -private ["_vehicle", "_turret", "_weapons"]; - -_vehicle = _this select 0; - -_turret = [typeOf _vehicle] call AGM_Core_fnc_getTurretCommander; - -_weapons = _vehicle weaponsTurret _turret; - -if ( - count _weapons > 1 - || {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ... -) then { - //This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead. - - private "_index"; - - // avoid infinite loop - if !("SmokeLauncher" in _weapons) exitWith {}; - - _index = 0; - while { - _vehicle currentWeaponTurret _turret != "SmokeLauncher" - } do { - [commander _vehicle, _vehicle, _index] call AGM_WeaponSelect_fnc_selectWeaponVehicle; - _index = _index + 1; - }; -} else { - // fire away! - - private "_logic"; - - _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; - _logic action ["useWeapon", _vehicle, commander _vehicle, 0]; - deleteVehicle _logic; -}; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_getSelectedGrenade.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_getSelectedGrenade.sqf deleted file mode 100644 index 317366a8ff..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_getSelectedGrenade.sqf +++ /dev/null @@ -1,3 +0,0 @@ -// by commy2 - -[AGM_WeaponSelect_CurrentGrenadeMuzzleOther, AGM_WeaponSelect_CurrentGrenadeMuzzleFrag] select AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeAll.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeAll.sqf deleted file mode 100644 index 1676dfcaa8..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeAll.sqf +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Author: CAA-Picard, commy2 - * - * Cycle through all grenades. - * - * Argument: - * None - * - * Return value: - * None - */ - -private ["_player", "_nextMuzzle"]; - -_player = _this select 0; - -_nextMuzzle = ["All"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle; - -if (_nextMuzzle != "") then { - - - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = AGM_WeaponSelect_AllMagazines select (AGM_WeaponSelect_AllMuzzles find _nextMuzzle); - reverse _magazines; - - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player; - - // There is a muzzle with magazines --> cycle to it - [_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle; - - [_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber; - - [uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -} else { - // There is a no muzzle with magazines --> select nothing - AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""; AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""; - - _text = [localize "STR_AGM_WeaponSelect_NoGrenadesLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText; - [composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured; - - [uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -}; - -if (_nextMuzzle in AGM_WeaponSelect_FragMuzzles) then { - AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = _nextMuzzle; - AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true; -} else { - AGM_WeaponSelect_CurrentGrenadeMuzzleOther = _nextMuzzle; - AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = false; -}; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeFrag.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeFrag.sqf deleted file mode 100644 index 2798bc57db..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeFrag.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Author: CAA-Picard, commy2 - * - * Cycle through frags. - * - * Argument: - * None - * - * Return value: - * None - */ - -private ["_player", "_nextMuzzle"]; - -_player = _this select 0; - -_nextMuzzle = ["Frag"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle; - -if (_nextMuzzle != "") then { - AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = _nextMuzzle; - - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = AGM_WeaponSelect_FragMagazines select (AGM_WeaponSelect_FragMuzzles find _nextMuzzle); - reverse _magazines; - - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player; - - // There is a muzzle with magazines --> cycle to it - [_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle; - - [_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber; - - [uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -} else { - // There is a no muzzle with magazines --> select nothing - AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""; - - _text = [localize "STR_AGM_WeaponSelect_NoFragsLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText; - [composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured; - - [uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -}; - -AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = true; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeOther.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeOther.sqf deleted file mode 100644 index 99290cc2d0..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectGrenadeOther.sqf +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Author: CAA-Picard, commy2 - * - * Cycle through non explosive grenades. - * - * Argument: - * None - * - * Return value: - * None - */ - -private ["_player", "_nextMuzzle"]; - -_player = _this select 0; - -_nextMuzzle = ["NonFrag"] call AGM_WeaponSelect_fnc_findNextGrenadeMuzzle; - -if (_nextMuzzle != "") then { - AGM_WeaponSelect_CurrentGrenadeMuzzleOther = _nextMuzzle; - - private ["_magazines", "_magazine", "_count", "_return"]; - _magazines = AGM_WeaponSelect_NonFragMagazines select (AGM_WeaponSelect_NonFragMuzzles find _nextMuzzle); - reverse _magazines; - - _magazine = ""; - _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _player; - - // There is a muzzle with magazines --> cycle to it - [_player, _nextMuzzle] call AGM_WeaponSelect_fnc_setNextGrenadeMuzzle; - - [_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber; - - [uiNamespace getVariable "AGM_dlgSoldier", true] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -} else { - // There is a no muzzle with magazines --> select nothing - AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""; - - _text = [localize "STR_AGM_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call AGM_Core_fnc_stringToColoredText; - [composeText [lineBreak, _text]] call AGM_Core_fnc_displayTextStructured; - - [uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -}; - -AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag = false; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectMagazineVehicle.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectMagazineVehicle.sqf deleted file mode 100644 index 51feec8e26..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectMagazineVehicle.sqf +++ /dev/null @@ -1,52 +0,0 @@ -// by commy2 - -private ["_vehicle", "_index", "_turret", "_weapon", "_magazine"]; - -_vehicle = _this select 0; -_index = _this select 1; - -_turret = [player] call AGM_Core_fnc_getTurretIndex; - -/* WIP - - - -_weapon = currentWeapon _vehicle; - - -_weapons = _vehicle weaponsTurret _turret; -_magazines = _vehicle magazinesTurret _turret; - - - - -vehicle player loadMagazine [[0], "cannon_120mm", "32Rnd_120mm_APFSDS_shells_Tracer_Red"] - - - - - -["cannon_105mm","LMG_M200"] - - - - - -vehicle player loadMagazine [[0,0], "SmokeLauncher", "SmokeLauncherMag"] - - - - - -player action ["SwitchMagazine", vehicle player, player, 1]; - - -*/ - - - - - - - - diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponMode.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponMode.sqf deleted file mode 100644 index f520cea519..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponMode.sqf +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Author: commy2 - * - * The player will select the specified weapon or will change to the next firing mode if the weapon was already selected. - * - * Argument: - * 0: A weapon (String) - * - * Return value: - * None. - */ - -private ["_player", "_weapon", "_muzzles", "_modes", "_count", "_index", "_muzzle", "_mode"]; - -_player = _this select 0; -_weapon = _this select 1; - -if (_weapon == "") exitWith {}; - -if (currentWeapon _player != _weapon) exitWith { - _player selectWeapon _weapon; -}; - -// unlock safety -if (_weapon in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) exitWith { - [_player, _weapon, _weapon] call AGM_SafeMode_fnc_unlockSafety; -}; - -_muzzles = [_weapon] call AGM_WeaponSelect_fnc_getWeaponMuzzles; -_modes = [_weapon] call AGM_WeaponSelect_fnc_getWeaponModes; - -_count = count _modes; -_index = (_modes find currentWeaponMode _player) + 1; -if (_index > _count - 1) then {_index = 0}; - -_muzzle = _muzzles select 0; -_mode = _modes select _index; - -_index = 0; -while { - _index < 100 && {currentMuzzle _player != _muzzle || {currentWeaponMode _player != _mode}} -} do { - _player action ["SwitchWeapon", _player, _player, _index]; - _index = _index + 1; -}; - -// play fire mode selector sound -[_player, _weapon] call AGM_WeaponSelect_fnc_playChangeFiremodeSound; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponMuzzle.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponMuzzle.sqf deleted file mode 100644 index d643366e25..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponMuzzle.sqf +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Author: commy2 - * - * The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle. - * - * Argument: - * 0: A weapon (String) - * - * Return value: - * None. - */ - -private ["_player", "_weapon", "_muzzles", "_count", "_index", "_muzzle"]; - -_player = _this select 0; -_weapon = _this select 1; - -if (_weapon == "") exitWith {}; - -_muzzles = [_weapon] call AGM_WeaponSelect_fnc_getWeaponMuzzles; - -if (currentWeapon _player != _weapon) exitWith { - if (count _muzzles > 1) then { - - // unlock safety - /*if (_weapon in (_player getVariable ["AGM_SafeMode_safedWeapons", []])) exitWith { - [_player, _weapon, _muzzles select 1] call AGM_SafeMode_fnc_unlockSafety; - };*/ - - _player selectWeapon (_muzzles select 1); - }; -}; - -_count = count _muzzles; -_index = (_muzzles find currentMuzzle _player) + 1; -if (_index > _count - 1) then {_index = 1}; - -_muzzle = _muzzles select _index; - -_index = 0; -while { - _index < 100 && {currentMuzzle _player != _muzzle} -} do { - _player action ["SwitchWeapon", _player, _player, _index]; - _index = _index + 1; -}; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponVehicle.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponVehicle.sqf deleted file mode 100644 index bb8d03f03d..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_selectWeaponVehicle.sqf +++ /dev/null @@ -1,37 +0,0 @@ -// by commy2 - -private ["_player", "_vehicle", "_index", "_turret", "_weapons", "_weapon"]; - -_player = _this select 0; -_vehicle = _this select 1; -_index = _this select 2; - -_turret = [_player] call AGM_Core_fnc_getTurretIndex; - -if (_turret isEqualTo [] && {_player == driver _vehicle}) then { - _weapons = weapons _vehicle; - if (_index > count _weapons - 1) exitWith {}; - - _weapon = _weapons select _index; - - _index = 0; - while { - _index < 100 && {currentWeapon _vehicle != _weapon} - } do { - _player action ["SwitchWeapon", _vehicle, _player, _index]; - _index = _index + 1; - }; -} else { - _weapons = _vehicle weaponsTurret _turret; - if (_index > count _weapons - 1) exitWith {}; - - _weapon = _weapons select _index; - - _index = 0; - while { - _index < 100 && {_vehicle currentWeaponTurret _turret != _weapon} - } do { - _player action ["SwitchWeapon", _vehicle, _player, _index]; - _index = _index + 1; - }; -}; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_setNextGrenadeMuzzle.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_setNextGrenadeMuzzle.sqf deleted file mode 100644 index 3a029324bc..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_setNextGrenadeMuzzle.sqf +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Author: CAA-Picard - * - * Select the next grenade muzzle to throw. - * - * Argument: - * muzzle name - * - * Return value: - * None - * - */ - -private ["_player", "_muzzle"]; - -_player = _this select 0; -_muzzle = _this select 1; - -_uniformMags = getMagazineCargo uniformContainer _player; -_vestMags = getMagazineCargo vestContainer _player; -_backPackMags = getMagazineCargo backpackContainer _player; - -_uniformMagsToRemove = []; -_vestMagsToRemove = []; -_backPackMagsToRemove = []; - -_firstMagazine = ""; - -// Collect which magazines to remove -_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); -{ - _muzzleName = _x; - _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzleName >> "magazines" ); - if (_muzzle != _muzzleName) then { - { - _index = (_uniformMags select 0) find _x; - if (_index > -1) then { - _uniformMagsToRemove = _uniformMagsToRemove + [[_x, (_uniformMags select 1) select _index]]; - }; - _index = (_vestMags select 0) find _x; - if (_index > -1) then { - _vestMagsToRemove = _vestMagsToRemove + [[_x, (_vestMags select 1) select _index]]; - }; - _index = (_backpackMags select 0) find _x; - if (_index > -1) then { - _backpackMagsToRemove = _backpackMagsToRemove + [[_x, (_backpackMags select 1) select _index]]; - }; - } forEach _muzzleMagazines; - } else { - { - _index = (_uniformMags select 0) find _x; - if (_index > -1) then { - _firstMagazine = _x; - }; - _index = (_vestMags select 0) find _x; - if (_index > -1) then { - _firstMagazine = _x; - }; - _index = (_backpackMags select 0) find _x; - if (_index > -1) then { - _firstMagazine = _x; - }; - } forEach _muzzleMagazines; - }; -} forEach _throwMuzzleNames; - -// Remove all magazines except those we are switching to --> this breaks the selector -{ - for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do { - _player removeItem (_x select 0); - }; -} forEach _uniformMagsToRemove; -{ - for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do { - _player removeItem (_x select 0); - }; -} forEach _vestMagsToRemove; -{ - for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do { - _player removeItem (_x select 0); - }; -} forEach _backPackMagsToRemove; - -// Readd magazines -{ - for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do { - _player addItemToUniform (_x select 0); - }; -} forEach _uniformMagsToRemove; -{ - for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do { - _player addItemToVest (_x select 0); - }; -} forEach _vestMagsToRemove; -{ - for [{_i=0},{_i < (_x select 1)}, {_i = _i + 1}] do { - _player addItemToBackpack (_x select 0); - }; -} forEach _backPackMagsToRemove; - diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_throwGrenade.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_throwGrenade.sqf deleted file mode 100644 index d93620da76..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_throwGrenade.sqf +++ /dev/null @@ -1,19 +0,0 @@ -// by commy2 - -private ["_unit", "_weapon", "_magazine"]; - -_unit = _this select 0; -_weapon = _this select 1; -_magazine = _this select 5; - -if (_weapon != "Throw") exitWith {}; - -private "_count"; -_count = {_x == _magazine} count magazines _unit; - -[_magazine, _count] call AGM_WeaponSelect_fnc_displayGrenadeTypeAndNumber; - -if (_count == 0) then { - if (AGM_WeaponSelect_CurrentGrenadeMuzzleIsFrag) then {AGM_WeaponSelect_CurrentGrenadeMuzzleFrag = ""} else {AGM_WeaponSelect_CurrentGrenadeMuzzleOther = ""}; - [uiNamespace getVariable "AGM_dlgSoldier", false] call AGM_WeaponSelect_fnc_toggleGrenadeCount; -}; diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_toggleGrenadeCount.sqf b/TO_MERGE/agm/WeaponSelect/functions/fn_toggleGrenadeCount.sqf deleted file mode 100644 index 1e7a8c4b4b..0000000000 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_toggleGrenadeCount.sqf +++ /dev/null @@ -1,23 +0,0 @@ -// by commy2 - -private ["_dlg", "_show"]; - -_dlg = _this select 0; -_show = _this select 1; - -if (_show) then { - private "_config"; - - _config = configFile >> "RscInGameUI" >> "RscUnitInfo" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_GrenadeCount"; - (_dlg displayCtrl 151) ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; - - _config = configFile >> "RscInGameUI" >> "RscUnitInfo" >> "WeaponInfoControlsGroupLeft" >> "controls" >> "CA_GrenadeType"; - (_dlg displayCtrl 152) ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")]; - -} else { - (_dlg displayCtrl 151) ctrlSetPosition [0,0,0,0]; - (_dlg displayCtrl 152) ctrlSetPosition [0,0,0,0]; -}; - -(_dlg displayCtrl 151) ctrlCommit 0; -(_dlg displayCtrl 152) ctrlCommit 0; diff --git a/TO_MERGE/agm/WeaponSelect/initActions.sqf b/TO_MERGE/agm/WeaponSelect/initActions.sqf deleted file mode 100644 index 1ac3bfed73..0000000000 --- a/TO_MERGE/agm/WeaponSelect/initActions.sqf +++ /dev/null @@ -1,25 +0,0 @@ -// by commy2 - -private ["_unit", "_id"]; - -_unit = _this select 0; - -/*_id = [ - _unit, - format ["%1", localize "STR_AGM_WeaponSelect_ReadyGrenade"], - "Throw", - AGM_WeaponSelect_fnc_actionThrowCondition, - AGM_WeaponSelect_fnc_actionThrow, - {true}, - {[_this select 1] call AGM_WeaponSelect_fnc_selectGrenadeAll}, - 2 -] call AGM_Core_fnc_addActionMenuEventHandler;*/ - -_id = [ - _unit, - "Throw", - AGM_WeaponSelect_fnc_actionThrowCondition, - AGM_WeaponSelect_fnc_actionThrow -] call AGM_Core_fnc_addActionEventHandler; - -_unit setVariable ["AGM_WeaponSelect_ThrowActionID", _id]; diff --git a/addons/attach/config.cpp b/addons/attach/config.cpp index e3db2b64e6..4143f6eb44 100644 --- a/addons/attach/config.cpp +++ b/addons/attach/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {"ACE_IR_Strobe_Item"}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common", "ace_interaction"}; - version = "0.95"; - versionStr = "0.95"; - versionAr[] = {0,95,0}; author[] = {"KoffeinFlummi", "eRazeri", "CAA-Picard"}; authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; }; }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index c3fa195190..59b5d7734e 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -19,9 +19,8 @@ if (_currentVersion != _previousVersion) then { 0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); -//add network event handlers -"ACEg" addPublicVariableEventHandler { _this call FUNC(_handletNetEvent); }; -"ACEc" addPublicVariableEventHandler { _this call FUNC(_handletNetEvent); }; +"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; +"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); }; // everything that only player controlled machines need, goes below this if (!hasInterface) exitWith {}; @@ -100,6 +99,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); ["playerVisionModeChanged", [ACE_player, _newPlayerVisionMode]] call FUNC(localEvent); }; + // "inventoryDisplayChanged" event + _newInventoryDisplayIsOpen = !(isNull findDisplay 602); + if !(_newInventoryDisplayIsOpen isEqualTo GVAR(OldInventoryDisplayIsOpen)) then { + // Raise ACE event locally + GVAR(OldInventoryDisplayIsOpen) = _newInventoryDisplayIsOpen; + ["inventoryDisplayChanged", [ACE_player, _newInventoryDisplayIsOpen]] call FUNC(localEvent); + }; + // "zeusDisplayChanged" event _newZeusDisplayIsOpen = !(isNull findDisplay 312); if !(_newZeusDisplayIsOpen isEqualTo GVAR(OldZeusDisplayIsOpen)) then { diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index e15792b0d8..a4e4f9bd22 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -31,6 +31,7 @@ PREP(displayTextPicture); PREP(displayTextStructured); PREP(doAnimation); PREP(endRadioTransmission); +PREP(execNextFrame); PREP(execPersistentFnc); PREP(execRemoteFnc); PREP(executePersistent); @@ -119,6 +120,7 @@ PREP(toBitmask); PREP(toHex); PREP(toNumber); PREP(unmuteUnit); +PREP(waitAndExecute); // ACE_Debug PREP(exportConfig); diff --git a/addons/common/functions/fnc_execNextFrame.sqf b/addons/common/functions/fnc_execNextFrame.sqf new file mode 100644 index 0000000000..58c6ced4f3 --- /dev/null +++ b/addons/common/functions/fnc_execNextFrame.sqf @@ -0,0 +1,34 @@ +/* + * Author: CAA-Picard + * + * Executes a code on the next frame + * + * Argument: + * 0: Code to execute (Code) + * 1: Parameters to run the code with (Array) + * + * Return value: + * PFH handler ID + */ +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_func,_params); + +[ + { + EXPLODE_2_PVT(_this,_params,_pfhId); + EXPLODE_2_PVT(_params,_delayedExecParams,_startFrame); + EXPLODE_2_PVT(_delayedExecParams,_func,_funcParams); + + // Exit if we are still on the same frame + if (diag_frameno == _startFrame) exitWith {}; + + // Remove the PFH + [_pfhId] call cba_fnc_removePerFrameHandler; + + // Execute the function + _funcParams call _func; + }, + _interval, + [_this, diag_frameno] +] call CBA_fnc_addPerFrameHandler diff --git a/addons/common/functions/fnc_waitAndExecute.sqf b/addons/common/functions/fnc_waitAndExecute.sqf new file mode 100644 index 0000000000..7b106cc0c1 --- /dev/null +++ b/addons/common/functions/fnc_waitAndExecute.sqf @@ -0,0 +1,36 @@ +/* + * Author: CAA-Picard + * + * Executes a code once with a given game time delay, using a PFH + * + * Argument: + * 0: Code to execute (Code) + * 1: Parameters to run the code with (Array) + * 2: Delay in seconds before executing the code (Number) + * 3: Interval of time in which the execution is evaluated, 0 means every frame (Number) + * + * Return value: + * PFH handler ID + */ +#include "script_component.hpp" + +EXPLODE_4_PVT(_this,_func,_params,_delay,_interval); + +[ + { + EXPLODE_2_PVT(_this,_params,_pfhId); + EXPLODE_2_PVT(_params,_delayedExecParams,_startTime); + EXPLODE_3_PVT(_delayedExecParams,_func,_funcParams,_delay); + + // Exit if the time was not reached yet + if (time < _startTime + _delay) exitWith {}; + + // Remove the PFH + [_pfhId] call cba_fnc_removePerFrameHandler; + + // Execute the function + _funcParams call _func; + }, + _interval, + [_this, time] +] call CBA_fnc_addPerFrameHandler diff --git a/addons/difficulties/$PBOPREFIX$ b/addons/difficulties/$PBOPREFIX$ new file mode 100644 index 0000000000..6280fc4731 --- /dev/null +++ b/addons/difficulties/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\difficulties \ No newline at end of file diff --git a/addons/difficulties/CfgDifficulties.hpp b/addons/difficulties/CfgDifficulties.hpp new file mode 100644 index 0000000000..a65d31f1a5 --- /dev/null +++ b/addons/difficulties/CfgDifficulties.hpp @@ -0,0 +1,33 @@ + +class CfgDifficulties { + class Mercenary { + class Flags { + armor[] = {0,0}; + friendlyTag[] = {0,0}; + enemyTag[] = {0,0}; + mineTag[] = {0,0}; + hud[] = {0,1};//{1,1}; + hudPerm[] = {0,0}; + hudWp[] = {0,0}; + hudWpPerm[] = {0,0}; + autoSpot[] = {0,1}; + map[] = {0,0}; + weaponCursor[] = {0,1};//{1,1}; + autoGuideAT[] = {0,0}; + clockIndicator[] = {0,0}; + 3rdPersonView[] = {0,0}; + autoAim[] = {0,0}; + unlimitedSaves[] = {0,0}; + deathMessages[] = {0,1};//{1,1}; + netStats[] = {0,1};//{1,1}; + vonID[] = {0,1}; + cameraShake[] = {1,0}; + hudGroupInfo[] = {0,0}; + extendetInfoType[] = {0,0}; + roughLanding[] = {0,0}; + windEnabled[] = {1,0}; + autoTrimEnabled[] = {0,0}; + stressDamageEnabled[] = {1,0}; + }; + }; +}; diff --git a/addons/difficulties/config.cpp b/addons/difficulties/config.cpp new file mode 100644 index 0000000000..34784706a0 --- /dev/null +++ b/addons/difficulties/config.cpp @@ -0,0 +1,15 @@ +#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 "CfgDifficulties.hpp" diff --git a/addons/difficulties/script_component.hpp b/addons/difficulties/script_component.hpp new file mode 100644 index 0000000000..bac2935aa7 --- /dev/null +++ b/addons/difficulties/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT difficulties +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_DIFFICULTIES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_DIFFICULTIES + #define DEBUG_SETTINGS DEBUG_ENABLED_DIFFICULTIES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/disposable/config.cpp b/addons/disposable/config.cpp index 49ae873674..be2b52735a 100644 --- a/addons/disposable/config.cpp +++ b/addons/disposable/config.cpp @@ -4,11 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2"}; authorUrl = "https://github.com/commy2/"; - // VERSION_CONFIG @todo + VERSION_CONFIG; }; }; diff --git a/addons/explosives/config.cpp b/addons/explosives/config.cpp index 48697d913d..8bf463c9f4 100644 --- a/addons/explosives/config.cpp +++ b/addons/explosives/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {"ACE_Clacker", "ACE_DefusalKit", "ACE_M26_Clacker", "ACE_DeadManSwitch"}; - requiredVersion = 0.60; - requiredAddons[] = {ace_common, ace_interaction}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; author[] = {"Garth 'L-H' de Wet"}; authorUrl = "http://garth.snakebiteink.co.za/"; + VERSION_CONFIG; }; }; diff --git a/addons/explosives/functions/fnc_startTimer.sqf b/addons/explosives/functions/fnc_startTimer.sqf index 08177b447f..e5c8bdee75 100644 --- a/addons/explosives/functions/fnc_startTimer.sqf +++ b/addons/explosives/functions/fnc_startTimer.sqf @@ -16,22 +16,12 @@ [_explosive, 10] call ACE_Explosives_fnc_startTimer; */ #include "script_component.hpp" + +EXPLODE_2_PVT(_this,_explosive,_delay); + [{ - private ["_explosive", "_params", "_pfhId", "_placeTime", "_fuseTime"]; - _params = _this select 0; - _pfhId = _this select 1; - - _placeTime = _params select 1; - _fuseTime = _params select 0 select 1; - - // Skip first execution - if (diag_tickTime < _placeTime + _fuseTime / 2) exitWith {}; - - _explosive = (_params select 0) select 0; + _explosive = _this; if (!isNull _explosive) then { [_explosive, -1, [_explosive, 0], true] call FUNC(detonateExplosive); }; - - // Remove the PFH - [_pfhId] call cba_fnc_removePerFrameHandler; -},_this select 1, [_this, diag_tickTime]] call CBA_fnc_addPerFrameHandler; +}, _explosive, _delay, 0] call EFUNC(common,waitAndExecute); \ No newline at end of file diff --git a/addons/fcs/XEH_clientInit.sqf b/addons/fcs/XEH_clientInit.sqf index 527e5a9d36..61b30f65ae 100644 --- a/addons/fcs/XEH_clientInit.sqf +++ b/addons/fcs/XEH_clientInit.sqf @@ -3,3 +3,76 @@ GVAR(enabled) = True; GVAR(time) = 0; GVAR(position) = [0,0,0]; + +// Add keybinds +["ACE3", + localize "STR_ACE_FCS_LaseTarget", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(!GVAR(enabled) && {call FUNC(canUseRangefinder) || FUNC(canUseFCS)}) exitWith {false}; + + // Statement + [vehicle ACE_player] call FUNC(keyDown); + true + }, + [15, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_FCS_LaseTarget", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; + + // Statement + [vehicle ACE_player] call FUNC(keyUp); + true + }, + [15, [false, false, false]], + false, + "keyup" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_FCS_AdjustRangeUp", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + + // Statement + [vehicle ACE_player, 50] call FUNC(adjustRange); + true + }, + [201, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_FCS_AdjustRangeDown", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; + + // Statement + [vehicle ACE_player, -50] call FUNC(adjustRange); + true + }, + [209, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/fcs/config.cpp b/addons/fcs/config.cpp index e1ebaa2888..e1e8ac8901 100644 --- a/addons/fcs/config.cpp +++ b/addons/fcs/config.cpp @@ -4,47 +4,16 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {ace_common, ace_interaction}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; author[] = {"KoffeinFlummi","BadGuy (simon84)"}; authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" -class ACE_Default_Keys { - class laseTarget { - displayName = $STR_ACE_FCS_LaseTarget; - condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS)); - statement = QUOTE([_vehicle] call FUNC(keyDown)); - conditionUp = QUOTE(GVAR(enabled) && FUNC(canUseFCS)); - statementUp = QUOTE([_vehicle] call FUNC(keyUp)); - key = 15; - shift = 0; - control = 0; - alt = 0; - }; - class adjustRangeUp { - displayName = $STR_ACE_FCS_AdjustRangeUp; - condition = QUOTE(call FUNC(canUseRangefinder) || FUNC(canUseFCS)); - statement = QUOTE([_vehicle, 50] call FUNC(adjustRange)); - key = 201; - shift = 0; - control = 0; - alt = 0; - allowHolding = 1; - }; - class adjustRangeDown: adjustRangeUp { - displayName = $STR_ACE_FCS_AdjustRangeDown; - statement = QUOTE([_vehicle, -50] call FUNC(adjustRange)); - key = 209; - }; -}; - class CfgVehicles { class All { class Turrets; diff --git a/addons/fcs/functions/fnc_keyUp.sqf b/addons/fcs/functions/fnc_keyUp.sqf index 2621455916..c95460e65b 100644 --- a/addons/fcs/functions/fnc_keyUp.sqf +++ b/addons/fcs/functions/fnc_keyUp.sqf @@ -17,8 +17,6 @@ private ["_ammoType", "_viewDiff", "_posArrival", "_airFriction", "_timeToLive", _vehicle = _this select 0; _distance = call FUNC(getRange); -if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {}; - _magazines = magazines _vehicle; if (_distance == 0) then { diff --git a/addons/frag/config.cpp b/addons/frag/config.cpp index acde4575b2..98a159a78e 100644 --- a/addons/frag/config.cpp +++ b/addons/frag/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "A3_Misc_F", "A3_Weapons_F" }; - version = VERSION; author[] = {"Nou"}; + VERSION_CONFIG; }; }; diff --git a/addons/gforces/$PBOPREFIX$ b/addons/gforces/$PBOPREFIX$ new file mode 100644 index 0000000000..215e681d94 --- /dev/null +++ b/addons/gforces/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\hearing \ No newline at end of file diff --git a/addons/gforces/CfgEventHandlers.hpp b/addons/gforces/CfgEventHandlers.hpp new file mode 100644 index 0000000000..eefe61652b --- /dev/null +++ b/addons/gforces/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 { + clientInit = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; diff --git a/addons/gforces/CfgVehicles.hpp b/addons/gforces/CfgVehicles.hpp new file mode 100644 index 0000000000..6075614e62 --- /dev/null +++ b/addons/gforces/CfgVehicles.hpp @@ -0,0 +1,19 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + AGM_GForceCoef = 1; + }; + + class B_Soldier_05_f; + class B_Pilot_F: B_Soldier_05_f { + AGM_GForceCoef = 0.55; + }; + class I_Soldier_04_F; + class I_pilot_F: I_Soldier_04_F { + AGM_GForceCoef = 0.55; + }; + class O_helipilot_F; + class O_Pilot_F: O_helipilot_F { + AGM_GForceCoef = 0.55; + }; +}; diff --git a/addons/gforces/CfgWeapons.hpp b/addons/gforces/CfgWeapons.hpp new file mode 100644 index 0000000000..ddd7fda3ab --- /dev/null +++ b/addons/gforces/CfgWeapons.hpp @@ -0,0 +1,16 @@ +class CfgWeapons { + class ItemCore; + class Uniform_Base: ItemCore { + AGM_GForceCoef = 1; + }; + + class U_B_PilotCoveralls: Uniform_Base { + AGM_GForceCoef = 0.8; + }; + class U_I_pilotCoveralls: Uniform_Base { + AGM_GForceCoef = 0.8; + }; + class U_O_PilotCoveralls: Uniform_Base { + AGM_GForceCoef = 0.8; + }; +}; \ No newline at end of file diff --git a/addons/gforces/XEH_postInit.sqf b/addons/gforces/XEH_postInit.sqf new file mode 100644 index 0000000000..7a0d4a559c --- /dev/null +++ b/addons/gforces/XEH_postInit.sqf @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Setup ppEffect +GVAR(GForces_CC) = ppEffectCreate ["ColorCorrections", 4215]; +GVAR(GForces_CC) ppEffectEnable true; +GVAR(GForces_CC) ppEffectForceInNVG true; +GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; +GVAR(GForces_CC) ppEffectCommit 0.4; + +GVAR(lastUpdateTime) = 0; +GVAR(oldVel) = [0,0,0]; + +[FUNC(pfhUpdateGForces), 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/gforces/XEH_preInit.sqf b/addons/gforces/XEH_preInit.sqf new file mode 100644 index 0000000000..ce10f592bb --- /dev/null +++ b/addons/gforces/XEH_preInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +PREP(pfhUpdateGForces); + +GVAR(GForces) = []; +GVAR(GForces_Index) = 0; diff --git a/addons/gforces/config.cpp b/addons/gforces/config.cpp new file mode 100644 index 0000000000..e81b034fd9 --- /dev/null +++ b/addons/gforces/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"KoffeinFlummi", "CAA-Picard"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +#include "CfgWeapons.hpp" + +#include "CfgVehicles.hpp" diff --git a/addons/gforces/functions/fnc_pfhUpdateGForces.sqf b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf new file mode 100644 index 0000000000..f1c1dfc5bc --- /dev/null +++ b/addons/gforces/functions/fnc_pfhUpdateGForces.sqf @@ -0,0 +1,91 @@ +// by KoffeinFlummi and CAA-Picard +#include "script_component.hpp" + +EXPLODE_2_PVT(_this,_params,_pfhId); + +_interval = time - GVAR(lastUpdateTime); + +// Update the g-forces at constant game time intervals +if (_interval < INTERVAL) exitWith {}; + +if (isNull ACE_player) exitWith {}; + +if !(alive ACE_player) exitWith {}; + +GVAR(lastUpdateTime) = time; + +/*if !(vehicle ACE_player isKindOf "Air") exitWith { + GVAR(GForces) = []; + GVAR(GForces_Index) = 0; + waitUntil {sleep 5; (vehicle _player isKindOf "Air") or ((getPos _player select 2) > 5)}; +};*/ + +_newVel = velocity (vehicle ACE_player); + +_accel = ((_newVel vectorDiff GVAR(oldVel)) vectorMultiply (1 / INTERVAL)) vectorAdd [0, 0, 9.8]; +_currentGForce = (_accel vectorDotProduct vectorUp (vehicle ACE_player)) / 9.8; + +// Cap maximum G's to +- 10 to avoid g-effects when the update is low fps. +_currentGForce = (_currentGForce max -10) min 10; + +GVAR(GForces) set [GVAR(GForces_Index), _currentGForce]; +GVAR(GForces_Index) = (GVAR(GForces_Index) + 1) % round (AVERAGEDURATION / INTERVAL); +GVAR(oldVel) = _newVel; + +/* Source: https://github.com/KoffeinFlummi/AGM/issues/1774#issuecomment-70341573 +* +* For untrained people without g-suits: +* GLOC: 5G for 6 s +* RedOut: 2.5G for 6 s +* +* For trained jet pilots without g-suits: +* GLOC: 9G for 6 s +* RedOut: 4.5G +* +* For trained jet pilots with g-suits: +* GLOC: 10.5G for 6 s +* RedOut: 4.5G +* +* Effects and camera shake start 30% the limit value, and build gradually +*/ + +_average = 0; +if (count GVAR(GForces) > 0) then { + _sum = 0; + { + _sum = _sum + _x; + } forEach GVAR(GForces); + _average = _sum / (count GVAR(GForces)); +}; + +_classCoef = ACE_player getVariable ["ACE_GForceCoef", + getNumber (configFile >> "CfgVehicles" >> (typeOf ACE_player) >> "AGM_GForceCoef")]; +_suitCoef = getNumber (configFile >> "CfgWeapons" >> (uniform ACE_player) >> "AGM_GForceCoef"); + +_gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG; +_gRedOut = MINVIRTUALG / _classCoef; + +["GForces", [], {format ["_g _gBO _coef: %1, %2, %3", _average, _gBlackOut, 2 * ((1.0 - ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) ^ 2) max 0) ]}] call EFUNC(common,log); + +// @todo: Sort the interaction with medical +if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then { + [ACE_player, (10 + floor(random 5))] call EFUNC(medical,knockOut); +}; + +GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[10,10,0,0,0,0.1,0.5]]; + +if !(ACE_player getVariable ["ACE_isUnconscious", false]) then { + if (_average > 0.30 * _gBlackOut) then { + _strength = ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) max 0; + GVAR(GForces_CC) ppEffectAdjust [1,1,0,[0,0,0,1],[0,0,0,0],[1,1,1,1],[2*(1-_strength),2*(1-_strength),0,0,0,0.1,0.5]]; + addCamShake [_strength, 1, 15]; + } else { + if (_average < -0.30 * _gRedOut) then { + _strength = ((abs _average - 0.30 * _gRedOut) / (0.70 * _gRedOut)) max 0; + GVAR(GForces_CC) ppEffectAdjust [1,1,0,[1,0.2,0.2,1],[0,0,0,0],[1,1,1,1],[2*(1-_strength),2*(1-_strength),0,0,0,0.1,0.5]]; + addCamShake [_strength / 1.5, 1, 15]; + }; + }; +}; + +GVAR(GForces_CC) ppEffectCommit INTERVAL; diff --git a/addons/gforces/functions/script_component.hpp b/addons/gforces/functions/script_component.hpp new file mode 100644 index 0000000000..4d0ee63e05 --- /dev/null +++ b/addons/gforces/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\gforces\script_component.hpp" \ No newline at end of file diff --git a/addons/gforces/script_component.hpp b/addons/gforces/script_component.hpp new file mode 100644 index 0000000000..bd52732420 --- /dev/null +++ b/addons/gforces/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT gforces +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_GFORCES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_GFORCES + #define DEBUG_SETTINGS DEBUG_SETTINGS_GFORCES +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" + +#define AVERAGEDURATION 6 +#define INTERVAL 0.20 +#define MAXVIRTUALG 5.0 +#define MINVIRTUALG 2.5 diff --git a/addons/grenades/$PBOPREFIX$ b/addons/grenades/$PBOPREFIX$ new file mode 100644 index 0000000000..f43501a506 --- /dev/null +++ b/addons/grenades/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\grenades \ No newline at end of file diff --git a/addons/grenades/CfgAmmo.hpp b/addons/grenades/CfgAmmo.hpp new file mode 100644 index 0000000000..7b0a24740d --- /dev/null +++ b/addons/grenades/CfgAmmo.hpp @@ -0,0 +1,89 @@ +class CfgAmmo { + class FlareCore; + class FlareBase: FlareCore { + intensity = 20000; + flareSize = 12; + }; + class F_40mm_White: FlareBase { + intensity = 40000; + flareSize = 12; + }; + class F_20mm_White: FlareBase { + intensity = 20000; + flareSize = 12; + }; + class F_Signal_Green: FlareBase { + intensity = 20000; + flareSize = 12; + }; + class Flare_82mm_AMOS_White: FlareCore { + intensity = 80000; + flareSize = 12; + }; + + class F_20mm_Red: F_20mm_White {}; + class F_20mm_Green: F_20mm_White {}; + class F_20mm_Yellow: F_20mm_White {}; + + class ACE_F_Hand_White: F_20mm_White { + grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; + soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; + SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; + SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; + SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; + SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; + timeToLive = 60; + }; + class ACE_F_Hand_Red: F_20mm_Red { + grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; + soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; + SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; + SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; + SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; + SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; + timeToLive = 60; + }; + class ACE_F_Hand_Green: F_20mm_Green { + grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; + soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; + SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; + SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; + SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; + SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; + timeToLive = 60; + }; + class ACE_F_Hand_Yellow: F_20mm_Yellow { + grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; + soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; + SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; + SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; + SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; + SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; + timeToLive = 60; + }; + + class ACE_G_M84: F_20mm_Yellow { + useFlare = 0; + flareSize = 0; + intensity = 0; + grenadeBurningSound[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + grenadeFireSound[] = {"SmokeShellSoundHit1",0.25,"SmokeShellSoundHit2",0.25,"SmokeShellSoundHit3",0.5}; + soundTrigger[] = {"SmokeShellSoundLoop1",0.5,"SmokeShellSoundLoop2",0.5}; + SmokeShellSoundHit1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_1",1.25893,1,100}; + SmokeShellSoundHit2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_2",1.25893,1,100}; + SmokeShellSoundHit3[] = {"A3\Sounds_F\weapons\smokeshell\smoke_3",1.25893,1,100}; + SmokeShellSoundLoop1[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop1",0.125893,1,70}; + SmokeShellSoundLoop2[] = {"A3\Sounds_F\weapons\smokeshell\smoke_loop2",0.125893,1,70}; + timeToLive = 60; + fuseDistance = 2.3; + model = PATHTOF(models\ACE_m84_thrown.p3d); + }; +}; diff --git a/addons/grenades/CfgEventHandlers.hpp b/addons/grenades/CfgEventHandlers.hpp new file mode 100644 index 0000000000..02f1ac5553 --- /dev/null +++ b/addons/grenades/CfgEventHandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); + }; +}; + +class Extended_FiredBIS_EventHandlers { + class CAManBase { + class ADDON { + clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) ); + }; + }; +}; diff --git a/addons/grenades/CfgMagazines.hpp b/addons/grenades/CfgMagazines.hpp new file mode 100644 index 0000000000..5775302d2c --- /dev/null +++ b/addons/grenades/CfgMagazines.hpp @@ -0,0 +1,60 @@ +class CfgMagazines { + class HandGrenade; + class ACE_HandFlare_Base: HandGrenade { + value = 2; + nameSoundWeapon = "smokeshell"; + nameSound = "smokeshell"; + mass = 4; + initSpeed = 22; + }; + class ACE_HandFlare_White: ACE_HandFlare_Base { + ammo = "ACE_F_Hand_White"; + displayname = "$STR_ACE_Grenades_M127A1_White_Name"; + descriptionshort = "$STR_ACE_Grenades_M127A1_White_Description"; + displayNameShort = "$STR_ACE_Grenades_M127A1_White_NameShort"; + model = "\A3\weapons_f\ammo\flare_white"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_white_ca.paa"; + }; + class ACE_HandFlare_Red: ACE_HandFlare_Base { + ammo = "ACE_F_Hand_Red"; + displayname = "$STR_ACE_Grenades_M127A1_Red_Name"; + descriptionshort = "$STR_ACE_Grenades_M127A1_Red_Description"; + displayNameShort = "$STR_ACE_Grenades_M127A1_Red_NameShort"; + model = "\A3\weapons_f\ammo\flare_red"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_red_ca.paa"; + }; + class ACE_HandFlare_Green: ACE_HandFlare_Base { + ammo = "ACE_F_Hand_Green"; + displayname = "$STR_ACE_Grenades_M127A1_Green_Name"; + descriptionshort = "$STR_ACE_Grenades_M127A1_Green_Description"; + displayNameShort = "$STR_ACE_Grenades_M127A1_Green_NameShort"; + model = "\A3\weapons_f\ammo\flare_green"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_green_ca.paa"; + }; + class ACE_HandFlare_Yellow: ACE_HandFlare_Base { + ammo = "ACE_F_Hand_Yellow"; + displayname = "$STR_ACE_Grenades_M127A1_Yellow_Name"; + descriptionshort = "$STR_ACE_Grenades_M127A1_Yellow_Description"; + displayNameShort = "$STR_ACE_Grenades_M127A1_Yellow_NameShort"; + model = "\A3\weapons_f\ammo\flare_yellow"; + picture = "\A3\Weapons_F\Data\UI\gear_flare_yellow_ca.paa"; + }; + class ACE_M84: HandGrenade { + ammo = "ACE_G_M84"; + displayname = "$STR_ACE_Grenades_M84_Name"; + descriptionshort = "$STR_ACE_Grenades_M84_Description"; + displayNameShort = "M84"; + model = PATHTOF(models\ACE_m84.p3d); + picture = PATHTOF(UI\ACE_m84_x_ca.paa); + }; + + class 3Rnd_UGL_FlareGreen_F; + class 6Rnd_GreenSignal_F: 3Rnd_UGL_FlareGreen_F { + ammo = "F_40mm_Green"; + initSpeed = 120; + }; + class 6Rnd_RedSignal_F: 6Rnd_GreenSignal_F { + ammo = "F_40mm_Red"; + initSpeed = 120; + }; +}; diff --git a/addons/grenades/CfgVehicles.hpp b/addons/grenades/CfgVehicles.hpp new file mode 100644 index 0000000000..9a0164e24f --- /dev/null +++ b/addons/grenades/CfgVehicles.hpp @@ -0,0 +1,45 @@ +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ + }; + +class CfgVehicles { + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class Box_NATO_Support_F; + + class Box_NATO_Grenades_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_HandFlare_White,12) + MACRO_ADDITEM(ACE_HandFlare_Green,12) + MACRO_ADDITEM(ACE_M84,12) + }; + }; + + class Box_East_Grenades_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_HandFlare_Yellow,12) + MACRO_ADDITEM(ACE_HandFlare_Red,12) + MACRO_ADDITEM(ACE_M84,12) + }; + }; + + class Box_IND_Grenades_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_HandFlare_Yellow,12) + MACRO_ADDITEM(ACE_HandFlare_Green,12) + MACRO_ADDITEM(ACE_M84,12) + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_HandFlare_White,12) + MACRO_ADDITEM(ACE_HandFlare_Red,12) + MACRO_ADDITEM(ACE_HandFlare_Green,12) + MACRO_ADDITEM(ACE_HandFlare_Yellow,12) + MACRO_ADDITEM(ACE_M84,12) + }; + }; +}; diff --git a/addons/grenades/CfgWeapons.hpp b/addons/grenades/CfgWeapons.hpp new file mode 100644 index 0000000000..fa28ca4ef0 --- /dev/null +++ b/addons/grenades/CfgWeapons.hpp @@ -0,0 +1,23 @@ +class CfgWeapons { + class GrenadeLauncher; + + class Throw: GrenadeLauncher { + muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"}; + class ThrowMuzzle; + class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle { + magazines[] = {"ACE_HandFlare_White"}; + }; + class ACE_HandFlare_RedMuzzle: ThrowMuzzle { + magazines[] = {"ACE_HandFlare_Red"}; + }; + class ACE_HandFlare_GreenMuzzle: ThrowMuzzle { + magazines[] = {"ACE_HandFlare_Green"}; + }; + class ACE_HandFlare_YellowMuzzle: ThrowMuzzle { + magazines[] = {"ACE_HandFlare_Yellow"}; + }; + class ACE_M84Muzzle: ThrowMuzzle { + magazines[] = {"ACE_M84"}; + }; + }; +}; diff --git a/TO_MERGE/agm/Grenades/UI/agm_m84_x_ca.paa b/addons/grenades/UI/ace_m84_x_ca.paa similarity index 100% rename from TO_MERGE/agm/Grenades/UI/agm_m84_x_ca.paa rename to addons/grenades/UI/ace_m84_x_ca.paa diff --git a/addons/grenades/XEH_postInitClient.sqf b/addons/grenades/XEH_postInitClient.sqf new file mode 100644 index 0000000000..5f5b569050 --- /dev/null +++ b/addons/grenades/XEH_postInitClient.sqf @@ -0,0 +1,13 @@ +// by commy2 + +#include "script_component.hpp" + +GVAR(flashbangPPEffectCC) = ppEffectCreate ["ColorCorrections", 4265]; +GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; + +["ACE3", +localize "STR_ACE_Grenades_SwitchGrenadeMode", +{_this call FUNC(nextMode)}, +[9, [false, false, false]], //8 key +false, +"keydown"] call cba_fnc_registerKeybind; diff --git a/addons/grenades/XEH_preInit.sqf b/addons/grenades/XEH_preInit.sqf new file mode 100644 index 0000000000..e83aeaae6b --- /dev/null +++ b/addons/grenades/XEH_preInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +PREP(flashbangEffectStages); +PREP(flashbangExplosionEH); +PREP(flashbangThrownFuze); +PREP(nextMode); +PREP(throwGrenade); + +["flashbangExplosion", { _this call DFUNC(flashbangExplosionEH) }] call EFUNC(common,addEventHandler); diff --git a/addons/grenades/config.cpp b/addons/grenades/config.cpp new file mode 100644 index 0000000000..74d1038ecc --- /dev/null +++ b/addons/grenades/config.cpp @@ -0,0 +1,19 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2", "KoffeinFlummi"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgAmmo.hpp" +#include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/grenades/functions/fnc_flashbangEffectStages.sqf b/addons/grenades/functions/fnc_flashbangEffectStages.sqf new file mode 100644 index 0000000000..c2ee7a6841 --- /dev/null +++ b/addons/grenades/functions/fnc_flashbangEffectStages.sqf @@ -0,0 +1,57 @@ +/* +* Author: KoffeinFlummi, Pabst Mirror +* +* Handles the different stages of the flash bang effect recovery +* +* Arguments: +* ARRAY[ +* 0-ARRAY - PARAMS: +* 0: NUMBER - Stage, controls a case statement +* 1: NUMBER - Time To Wait Until +* 2: VARIES - Stage's Variable +* 1-NUMBER perFrame handle +* Return Value: +* None +*/ + +#include "script_component.hpp" + +private ["_stage", "_waitUntilTime"]; + +_stage = (_this select 0) select 0; +_waitUntilTime = (_this select 0) select 1; + +if (_waitUntilTime > time) exitWith {}; + +//remove frameEH +[(_this select 1)] call cba_fnc_removePerFrameHandler; + +switch (_stage) do { + case(EFFECT_STAGE_RESETAI): { + private "_unit"; + _unit = (_this select 0) select 2; + _unit enableAI "MOVE"; + _unit enableAI "ANIM"; + _unit enableAI "AUTOTARGET"; + _unit enableAI "TARGET"; + _unit enableAI "FSM"; + _unit setSkill (skill _unit * 50); + }; + case(EFFECT_STAGE_DELETELIGHT): { + private "_light"; + _light = (_this select 0) select 2; + deleteVehicle _light; + }; + case(EFFECT_STAGE_PARTIALRECOVERY): { + private "_strength"; + _strength = (_this select 0) select 2; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; + GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength); + }; + case(EFFECT_STAGE_FULLRECOVERY): { + GVAR(flashbangPPEffectCC) ppEffectEnable false; + }; + default { + TRACE_1("EffectStage Bad Stage", _stage); + }; +}; diff --git a/addons/grenades/functions/fnc_flashbangExplosionEH.sqf b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf new file mode 100644 index 0000000000..1ef7ea1484 --- /dev/null +++ b/addons/grenades/functions/fnc_flashbangExplosionEH.sqf @@ -0,0 +1,85 @@ +/* +* Author: KoffeinFlummi +* +* Creates the flashbang effect and knock out AI units. +* +* Arguments: +* 0: The grenade (Object) +* +* Return Value: +* None +*/ + +#include "script_component.hpp" + +private ["_grenade", "_affected", "_strength", "_posGrenade", "_posUnit", "_angleGrenade", "_angleView", "_angleDiff", "_light"]; + +_grenade = _this select 0; + +_affected = _grenade nearEntities ["CAManBase", 50]; + +{ + if ((local _x) && {alive _x}) then { + + _strength = 1 - ((_x distance _grenade) min 15) / 15; + + if (_x != ACE_player) then { + //must be AI + _x disableAI "MOVE"; + _x disableAI "ANIM"; + _x disableAI "AUTOTARGET"; + _x disableAI "TARGET"; + _x disableAI "FSM"; + _x setSkill ((skill _x) / 50); + + [FUNC(flashbangEffectStages), 0, [EFFECT_STAGE_RESETAI, (time + (7 * _strength)), _x]] call CBA_fnc_addPerFrameHandler; + } else { + //Do effects for player + // is there line of sight to the grenade? + _posGrenade = getPosASL _grenade; + _posGrenade set [2, (_posGrenade select 2) + 0.2]; // compensate for grenade glitching into ground + if (lineIntersects [_posGrenade, getPosASL _x, _grenade, _x]) then { + _strength = _strength / 10; + }; + + // beeeeeeeeeeeeeeeeeeeeeeeeeeeeep + if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") and _strength > 0) then { + [_x, 0.5 + (_strength / 2)] call EFUNC(hearing,earRinging); + }; + + // account for people looking away by slightly + // reducing the effect for visual effects. + _posUnit = getPos _x; + _posGrenade = getPos _grenade; + _angleGrenade = ((_posGrenade select 0) - (_posUnit select 0)) atan2 ((_posGrenade select 1) - (_posUnit select 1)); + _angleGrenade = (_angleGrenade + 360) % 360; + + _angleView = (eyeDirection player select 0) atan2 (eyeDirection player select 1); + _angleView = (_angleView + 360) % 360; + + _angleDiff = 180 - abs (abs (_angleGrenade - _angleView) - 180); + _angleDiff = ((_angleDiff - 45) max 0); + + _strength = _strength - _strength * (_angleDiff / 135); + + // create flash to illuminate environment + _light = "#lightpoint" createVehicleLocal getPos _grenade; + _light setLightBrightness 200; + _light setLightAmbient [1,1,1]; + _light setLightColor [1,1,1]; + _light setLightDayLight true; + + [FUNC(flashbangEffectStages), 0, [EFFECT_STAGE_DELETELIGHT, (time + (0.1)), _light]] call CBA_fnc_addPerFrameHandler; + + // blind player + if (_strength > 0.1) then { + GVAR(flashbangPPEffectCC) ppEffectEnable true; + GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]]; + GVAR(flashbangPPEffectCC) ppEffectCommit 0.01; + + [FUNC(flashbangEffectStages), 0, [EFFECT_STAGE_PARTIALRECOVERY, (time + (7 * _strength)), _strength]] call CBA_fnc_addPerFrameHandler; + [FUNC(flashbangEffectStages), 0, [ EFFECT_STAGE_FULLRECOVERY, (time + (17 * _strength))]] call CBA_fnc_addPerFrameHandler; + }; + }; + }; +} forEach _affected; diff --git a/addons/grenades/functions/fnc_flashbangThrownFuze.sqf b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf new file mode 100644 index 0000000000..aec10301ab --- /dev/null +++ b/addons/grenades/functions/fnc_flashbangThrownFuze.sqf @@ -0,0 +1,18 @@ +//Waits for the grenade fuze to trigger and 'explode' + +#include "script_component.hpp" + +_projectile = (_this select 0) select 0; +_waitUntilTime = (_this select 0) select 1; + +if (_waitUntilTime > time) exitWith {}; + +//remove frameEH +[(_this select 1)] call cba_fnc_removePerFrameHandler; + +if (alive _projectile) then { + playSound3D ["A3\Sounds_F\weapons\Explosion\explosion_mine_1.wss", _projectile, false, getPosASL _projectile, 5, 1.2, 400]; + + _affected = _projectile nearEntities ["CAManBase", 50]; + ["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent); +}; diff --git a/addons/grenades/functions/fnc_nextMode.sqf b/addons/grenades/functions/fnc_nextMode.sqf new file mode 100644 index 0000000000..da8392b6ab --- /dev/null +++ b/addons/grenades/functions/fnc_nextMode.sqf @@ -0,0 +1,44 @@ +/* + * Author: commy2 + * + * Select the next throwing mode and display message. + * + * Argument: + * Nothing + * + * Return value: + * Nothing + */ + +#include "script_component.hpp" + +private ["_mode", "_hint"]; + +if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; + +_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; + +if (_mode == 4) then { + _mode = 0; +} else { + _mode = _mode + 1; +}; + +// ROLL GRENADE DOESN'T WORK RIGHT NOW +if (_mode == 3) then { + _mode = 4; +}; + +_hint = [ + localize "STR_ACE_Grenades_NormalThrow", + localize "STR_ACE_Grenades_HighThrow", + localize "STR_ACE_Grenades_PreciseThrow", + localize "STR_ACE_Grenades_RollGrenade", + localize "STR_ACE_Grenades_DropGrenade" +] select _mode; + +[_hint] call EFUNC(common,displayTextStructured); + +GVAR(currentThrowMode) = _mode; + +true diff --git a/addons/grenades/functions/fnc_throwGrenade.sqf b/addons/grenades/functions/fnc_throwGrenade.sqf new file mode 100644 index 0000000000..e725ebd426 --- /dev/null +++ b/addons/grenades/functions/fnc_throwGrenade.sqf @@ -0,0 +1,61 @@ +/* +* Author: commy2 +* +* Adjust the grenades throwing direction and speed to the selected throwing mode. +* +* Argument: +* input from "Fired" eventhandler +* +* Return value: +* Nothing +*/ + +#include "script_component.hpp" + +private ["_unit", "_weapon", "_projectile", "_mode", "_fuzeTime"]; + +_unit = _this select 0; +_weapon = _this select 1; +_projectile = _this select 6; + +if (_unit != ACE_player) exitWith {}; +if (_weapon != "Throw") exitWith {}; + +_mode = missionNamespace getVariable [QGVAR(currentThrowMode), 0]; + +if (_mode != 0) then { + private "_velocity"; + + _velocity = velocity _projectile; + + switch (_mode) do { + //high throw + case 1 : { + _velocity = [ + 0.5 * (_velocity select 0), + 0.5 * (_velocity select 1), + [0, 0, 0] distance (_velocity vectorMultiply 0.5) + ]; + }; + //precise throw + case 2 : { + _velocity = (_unit weaponDirection _weapon) vectorMultiply (vectorMagnitude _velocity); + }; + //roll grande + case 3 : { + //@todo + }; + //drop grenade + case 4 : { + _velocity = [0, 0, 0]; + }; + }; + + _projectile setVelocity _velocity; +}; + +if (typeOf _projectile == "ACE_G_M84") then { + _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "fuseDistance"); + // _fuzeTime = getNumber (configFile >> "CfgAmmo" >> typeOf _projectile >> "explosionTime"); //@toDo pretty sure this should be explosionTime not fuseDistance + [FUNC(flashbangThrownFuze), 0, [_projectile, (time + _fuzeTime)]] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/grenades/functions/script_component.hpp b/addons/grenades/functions/script_component.hpp new file mode 100644 index 0000000000..e6a44b8a20 --- /dev/null +++ b/addons/grenades/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\grenades\script_component.hpp" \ No newline at end of file diff --git a/addons/grenades/models/ACE_M84.p3d b/addons/grenades/models/ACE_M84.p3d new file mode 100644 index 0000000000..e24ff37880 Binary files /dev/null and b/addons/grenades/models/ACE_M84.p3d differ diff --git a/addons/grenades/models/ACE_M84_thrown.p3d b/addons/grenades/models/ACE_M84_thrown.p3d new file mode 100644 index 0000000000..0b206cfada Binary files /dev/null and b/addons/grenades/models/ACE_M84_thrown.p3d differ diff --git a/addons/grenades/script_component.hpp b/addons/grenades/script_component.hpp new file mode 100644 index 0000000000..f3d89216ba --- /dev/null +++ b/addons/grenades/script_component.hpp @@ -0,0 +1,19 @@ +#define COMPONENT grenades +#include "\z\ace\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL + +#ifdef DEBUG_ENABLED_GRENADES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_GRENADES + #define DEBUG_SETTINGS DEBUG_SETTINGS_GRENADES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define EFFECT_STAGE_RESETAI 0 +#define EFFECT_STAGE_DELETELIGHT 1 +#define EFFECT_STAGE_PARTIALRECOVERY 2 +#define EFFECT_STAGE_FULLRECOVERY 3 diff --git a/TO_MERGE/agm/Grenades/stringtable.xml b/addons/grenades/stringtable.xml similarity index 91% rename from TO_MERGE/agm/Grenades/stringtable.xml rename to addons/grenades/stringtable.xml index 526a3dbf1b..1129d44271 100644 --- a/TO_MERGE/agm/Grenades/stringtable.xml +++ b/addons/grenades/stringtable.xml @@ -1,8 +1,8 @@ - + - + Switch Grenade Mode Granaten-Modus wechseln Cambiar modo de granada @@ -14,7 +14,7 @@ Cambia tipo di granata Alternar Modo de Granada - + Normal Throw Normaler Wurf Lanzamiento normal @@ -26,7 +26,7 @@ Lancio normale Arremesso Normal - + High Throw Hoher Wurf Lanzamiento alto @@ -38,7 +38,7 @@ Lancio verso l'alto Arremesso Alto - + Precise Throw Präziser Wurf Lanzamiento preciso @@ -50,7 +50,7 @@ Lancio preciso Arremesso Preciso - + Roll Grenade Granate rollen Rodar granada @@ -62,7 +62,7 @@ Fai rotolare la granata Rolar Granada - + Drop Grenade Granate fallenlassen Soltar granada @@ -74,7 +74,7 @@ Lascia la granata Largar Granada - + M84 Stun Grenade M84 Blendgranate Granada aturdidora M84 @@ -86,7 +86,7 @@ Granata Stordente M84 M84 granada de atordoamento - + Also known as flashbang. Causes immediate flash blindness, deafness, tinnitus, and inner ear disturbance. Verursacht temporäre Blind- und Taubheit. Produce de manera inmediata ceguera, sordera, tinitus y afecta el oído interior. @@ -98,7 +98,7 @@ Anche conosciuta come flashbang. Causa accecamento immediato, sensazioni di sposatezza, mancanza d'equilibrio e disturbi al timpano. Um tipo de granada não-letal destinado a confundir, desorientar e distrair uma potencial ameaça. - + M127A1 Hand Held Signal (White) M127A1 Leuchtmittel (Weiß) M127A1 Světlice (Bílá) @@ -110,7 +110,7 @@ Bengala M127A1 (Blanca) M127A1 Feux à main (Blanc) - + M127A1 Hand Held Signal (Red) M127A1 Leuchtmittel (Rot) M127A1 Světlice (Červená) @@ -122,7 +122,7 @@ Bengala M127A1 (Roja) M127A1 Feux à main (Rouge) - + M127A1 Hand Held Signal (Green) M127A1 Leuchtmittel (Grün) M127A1 Světlice (Zelená) @@ -134,7 +134,7 @@ Bengala M127A1 (Verde) M127A1 Feux à main (Vert) - + M127A1 Hand Held Signal (Yellow) M127A1 Leuchtmittel (Gelb) M127A1 Světlice (Žlutá) @@ -146,7 +146,7 @@ Bengala M127A1 (Amarilla) M127A1 Feux à main (Jaune) - + White Hand Flare Weiße Leuchtkugel, wird wie eine Granate geworfen. Světlice (Bílá) @@ -158,7 +158,7 @@ Bengala (Blanca) Feux à main (Blanc) - + Red Hand Flare Rote Leuchtkugel, wird wie eine Granate geworfen. Světlice (Červená) @@ -170,7 +170,7 @@ Bengala (Roja) Feux à main (Rouge) - + Green Hand Flare Grüne Leuchtkugel, wird wie eine Granate geworfen. Světlice (Zelená) @@ -182,7 +182,7 @@ Bengala (Verde) Feux à main (Vert) - + Yellow Hand Flare Gelbe Leuchtkugel, wird wie eine Granate geworfen. Světlice Žlutá @@ -194,7 +194,7 @@ Bengala (Amarilla) Feux à main (Jaune) - + M127A1 (White) M127A1 (Weiß) M127A1 (Bílá) @@ -206,7 +206,7 @@ M127A1 (Белый) M127A1 (Blanca) - + M127A1 (Red) M127A1 (Rot) M127A1 (Červená) @@ -218,7 +218,7 @@ M127A1 (Красный) M127A1 (Roja) - + M127A1 (Green) M127A1 (Grün) M127A1 (Zelená) @@ -230,7 +230,7 @@ M127A1 (Зелёный) M127A1 (Verde) - + M127A1 (Yellow) M127A1 (Gelb) M127A1 (Žlutá) diff --git a/addons/grenades/textures/ace_m84.rvmat b/addons/grenades/textures/ace_m84.rvmat new file mode 100644 index 0000000000..e668125e70 --- /dev/null +++ b/addons/grenades/textures/ace_m84.rvmat @@ -0,0 +1,92 @@ +ambient[] = {1.0,1.0,1.0,1.0}; +diffuse[] = {1.0,1.0,1.0,1.0}; +forcedDiffuse[] = {0.0,0.0,0.0,0.0}; +emmisive[] = {0.0,0.0,0.0,1.0}; +specular[] = {0.1,0.1,0.1,1.0}; +specularPower = 95; +PixelShaderID = "Super"; +VertexShaderID = "Super"; +class Stage1 +{ + texture = "z\ace\addons\grenades\textures\ace_m84_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[] = {0,9,0}; + up[] = {4.5,0,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; +class Stage3 +{ + texture = "#(argb,8,8,3)color(0.5,0.5,0.5,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 = "z\ace\addons\grenades\textures\ace_m84_smdi.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; +class Stage6 +{ + texture = "#(ai,16,2,2)fresnel(10.4,8.3)"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,1}; + pos[] = {0,0,0}; + }; +}; +class Stage7 +{ + texture = "a3\data_f\env_land_co.paa"; + uvSource = "tex"; + class uvTransform + { + aside[] = {1,0,0}; + up[] = {0,1,0}; + dir[] = {0,0,0}; + pos[] = {0,0,0}; + }; +}; \ No newline at end of file diff --git a/TO_MERGE/agm/Grenades/data/agm_m84_co.paa b/addons/grenades/textures/ace_m84_co.paa similarity index 100% rename from TO_MERGE/agm/Grenades/data/agm_m84_co.paa rename to addons/grenades/textures/ace_m84_co.paa diff --git a/TO_MERGE/agm/Grenades/data/agm_m84_nohq.paa b/addons/grenades/textures/ace_m84_nohq.paa similarity index 100% rename from TO_MERGE/agm/Grenades/data/agm_m84_nohq.paa rename to addons/grenades/textures/ace_m84_nohq.paa diff --git a/TO_MERGE/agm/Grenades/data/agm_m84_smdi.paa b/addons/grenades/textures/ace_m84_smdi.paa similarity index 100% rename from TO_MERGE/agm/Grenades/data/agm_m84_smdi.paa rename to addons/grenades/textures/ace_m84_smdi.paa diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index d3382ea26e..9279b6b954 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -24,28 +24,28 @@ GVAR(newStrength) = GVAR(newStrength) max _strength; if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith {}; -_fnc_removeEarRinging = { - // Skip first execution - if (diag_tickTime < 1 + ((_this select 0) select 0)) exitWith {}; - - GVAR(isEarRingingPlaying) = false; - [(_this select 1)] call cba_fnc_removePerFrameHandler; -}; if (profileNamespace getVariable [QGVAR(DisableEarRinging), false]) exitWith {}; if (_strength > 0.75) exitWith { playSound "ACE_EarRinging_Heavy"; GVAR(isEarRingingPlaying) = true; - [_fnc_removeEarRinging, 7.0, [diag_tickTime] ] call CBA_fnc_addPerFrameHandler; + [ + {GVAR(isEarRingingPlaying) = false;}, [], 7.0, 0.25 + ] call EFUNC(common,waitAndExecute); }; if (_strength > 0.5) exitWith { playSound "ACE_EarRinging_Medium"; GVAR(isEarRingingPlaying) = true; - [_fnc_removeEarRinging, 5.0, [diag_tickTime] ] call CBA_fnc_addPerFrameHandler; + [ + {GVAR(isEarRingingPlaying) = false;}, [], 5.0, 0.25 + ] call EFUNC(common,waitAndExecute); }; if (_strength > 0.2) exitWith { playSound "ACE_EarRinging_Weak"; GVAR(isEarRingingPlaying) = true; - [_fnc_removeEarRinging, 3.0, [diag_tickTime] ] call CBA_fnc_addPerFrameHandler; + GVAR(isEarRingingPlaying) = true; + [ + {GVAR(isEarRingingPlaying) = false;}, [], 3.0, 0.25 + ] call EFUNC(common,waitAndExecute); }; diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index 7cea7a63d9..3b82fc60f4 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = { VERSION_AR }; author[] = {"commy2", "KoffeinFlummi", "CAA-Picard", "bux578"}; authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; }; }; @@ -99,16 +97,16 @@ class ACE_Parameters_Boolean { }; class ACE_canInteractConditions { - class ACE_Interaction_isNotEscorting { + class GVAR(isNotEscorting) { condition = QUOTE( !(_player getVariable ['ACE_isEscorting', false]) ); }; - class ACE_Interaction_isNotCaptive { + class GVAR(isNotCaptive) { condition = QUOTE( !(_player getVariable ['ACE_isCaptive', false]) ); }; - class ACE_Interaction_isNotSurrendering { + class GVAR(isNotSurrendering) { condition = QUOTE( !(_player getVariable ['ACE_isSurrender', false]) ); }; - class ACE_Interaction_isNotSwimming { + class GVAR(isNotSwimming) { condition = QUOTE( !underwater _player ); }; }; diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index 8b6d33b71f..e933cc40a4 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.6; - requiredAddons[] = {ace_common}; - version = VERSION; - versionStr = VERSION; - versionAr[] = {VERSIONAR}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; author[] = {"Pabst Mirror"}; authorUrl = "https://github.com/PabstMirror/"; + VERSION_CONFIG; }; }; diff --git a/addons/laser/config.cpp b/addons/laser/config.cpp index 6fec248637..711bd743b6 100644 --- a/addons/laser/config.cpp +++ b/addons/laser/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/laserpointer/$PBOPREFIX$ b/addons/laserpointer/$PBOPREFIX$ new file mode 100644 index 0000000000..dd910bd307 --- /dev/null +++ b/addons/laserpointer/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\laserpointer \ No newline at end of file diff --git a/addons/laserpointer/CfgEventHandlers.hpp b/addons/laserpointer/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0cd959a047 --- /dev/null +++ b/addons/laserpointer/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/laserpointer/CfgVehicles.hpp b/addons/laserpointer/CfgVehicles.hpp new file mode 100644 index 0000000000..c98d0626c2 --- /dev/null +++ b/addons/laserpointer/CfgVehicles.hpp @@ -0,0 +1,42 @@ + +#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_acc_pointer_red,4); + }; + }; + + class EAST_Box_Base; + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_acc_pointer_green,4); + }; + }; + + class IND_Box_Base; + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_acc_pointer_green,4); + }; + }; + + class FIA_Box_Base_F; + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_acc_pointer_red,4); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_acc_pointer_red,4); + MACRO_ADDITEM(ACE_acc_pointer_green,4); + }; + }; +}; diff --git a/addons/laserpointer/CfgWeapons.hpp b/addons/laserpointer/CfgWeapons.hpp new file mode 100644 index 0000000000..364f4b2168 --- /dev/null +++ b/addons/laserpointer/CfgWeapons.hpp @@ -0,0 +1,62 @@ + +class SlotInfo; +class PointerSlot: SlotInfo { + compatibleItems[] += {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; +}; + +class CfgWeapons { + class ItemCore; + class InventoryFlashLightItem_Base_F; + + class ACE_acc_pointer_red: ItemCore { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_acc_pointer_red"; + scope = 2; + displayName = "$STR_ACE_Laserpointer_red"; + descriptionUse = "$STR_ACE_Laserpointer_useLaser"; + picture = "\A3\weapons_F\Data\UI\gear_accv_pointer_CA.paa"; + model = "\A3\weapons_f\acc\accv_pointer_F"; + descriptionShort = "$STR_ACE_Laserpointer_Description"; + + class ItemInfo: InventoryFlashLightItem_Base_F { + mass = 6; + + class Pointer {}; + + class FlashLight { + color[] = {0,0,0}; + ambient[] = {0,0,0}; + intensity = 0; + size = 0; + innerAngle = 0; + outerAngle = 0; + coneFadeCoef = 5; + position = "flash dir"; + direction = "flash"; + useFlare = 0; + flareSize = 0; + flareMaxDistance = "100.0f"; + dayLight = 0; + + class Attenuation { + start = 0; + constant = 0; + linear = 0; + quadratic = 0; + hardLimitStart = 0; + hardLimitEnd = 0; + }; + + scale[] = {0}; + }; + }; + + inertia = 0.1; + }; + + class ACE_acc_pointer_green: ACE_acc_pointer_red { + author = "$STR_ACE_Common_ACETeam"; + _generalMacro = "ACE_acc_pointer_green"; + displayName = "$STR_ACE_Laserpointer_green"; + }; +}; diff --git a/addons/laserpointer/XEH_postInit.sqf b/addons/laserpointer/XEH_postInit.sqf new file mode 100644 index 0000000000..58c47e3de2 --- /dev/null +++ b/addons/laserpointer/XEH_postInit.sqf @@ -0,0 +1,23 @@ +// by commy2 +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +GVAR(nearUnits) = []; + +// @todo. Maybe move to common? +[{ + private "_nearUnits"; + _nearUnits = nearestObjects [positionCameraToWorld [0,0,0], ["CAManBase"], 50]; + + if (count _nearUnits > 10) then { + _nearUnits resize 10; + }; + + GVAR(nearUnits) = _nearUnits; + +} , 5, []] call CBA_fnc_addPerFrameHandler; + +addMissionEventHandler ["Draw3D", { + call FUNC(onDraw); +}]; diff --git a/addons/laserpointer/XEH_preInit.sqf b/addons/laserpointer/XEH_preInit.sqf new file mode 100644 index 0000000000..3a89535f2e --- /dev/null +++ b/addons/laserpointer/XEH_preInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +PREP(drawLaserpoint); +PREP(onDraw); diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp new file mode 100644 index 0000000000..32357b31ef --- /dev/null +++ b/addons/laserpointer/config.cpp @@ -0,0 +1,17 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"AGM_acc_pointer_red","AGM_acc_pointer_green"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2"}; + authorUrl = "https://github.com/commy2"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/laserpointer/functions/fnc_drawLaserpoint.sqf b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf new file mode 100644 index 0000000000..626e0e3abc --- /dev/null +++ b/addons/laserpointer/functions/fnc_drawLaserpoint.sqf @@ -0,0 +1,127 @@ +// by commy2 and CAA-Picard +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_unit,_range,_isGreen); + +_p0Pos = _unit modelToWorld (_unit selectionPosition "righthand"); + +// Convert _p0Pos to ASL +_p0 = + _p0Pos; +if (!surfaceIsWater _p0) then { + _p0 = ATLtoASL _p0; +}; + +// Find a system of orthogonal reference vectors +// _v1 points in the direction of the weapon +// _v2 points to the right of the weapon +// _v3 points to the top side of the weapon +_v1 = _unit weaponDirection currentWeapon _unit; +_v2 = vectorNormalized (_v1 vectorCrossProduct [0,0,1]); +_v3 = _v2 vectorCrossProduct _v1; + +// Offset over the 3 reference axis +// This offset could eventually be configured by weapon in the config +_offV1 = 0.31; +_offV2 = 0; +_offV3 = 0.08; + +// Offset _p0, the start of the laser +_p0 = _p0 vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); +_p0Pos = _p0Pos vectorAdd (_v1 vectorMultiply _offV1) vectorAdd (_v3 vectorMultiply _offV3) vectorAdd (_v2 vectorMultiply _offV2); +// Calculate _p1, the potential end of the laser +_p1 = _p0 vectorAdd (_v1 vectorMultiply _range); + +//Debugaaa = lineIntersectsObjs [_p0, _p1, objNull, _unit, false, 2]; + +_fnc_getDistanceToTerrain = { + private "_distance"; + + _pX = + _p0; + _line = [_p0, _pX]; + + _distance = _this; + _iteration = _distance; + + while { + _iteration > 0.05 / 2 + } do { + _iteration = _iteration / 2; + + _pX = _p0 vectorAdd (_v1 vectorMultiply _distance); + + _line set [1, _pX]; + + _distance = _distance + (([1, -1] select (lineIntersects (_line + [_unit]) || {terrainIntersectASL _line})) * _iteration); + + if (_distance > _this) exitWith {_distance = _this}; + }; + + _distance +}; + +// Get distance to nearest object or terrain (excluding men) +_distance = _range call _fnc_getDistanceToTerrain; + +// Find all men potentially intercepted by the ray +_intermediatePos = _p0 vectorAdd (_v1 vectorMultiply _distance/2); +if (!surfaceIsWater _intermediatePos) then { + _intermediatePos = ASLtoATL _intermediatePos; +}; +_units = nearestObjects [_intermediatePos, ["Man"], _distance/2]; + +_units deleteAt (_units find _unit); + +_fnc_doesIntersectWithMan = { + _pX = _p0 vectorAdd (_v1 vectorMultiply (_this select 1)); + if (!surfaceIsWater _pX) then { + _pX = ASLtoATL _pX; + }; + count ([_this select 0, "FIRE"] intersect [_p0Pos, _pX]) > 0 +}; + +// Test intersection with nearby men +{ + if ([_x, _distance] call _fnc_doesIntersectWithMan) then { + _distance = _distance min ((_unit distance _x) - _offV1); + }; +} forEach _units; + +//systemChat str _distance; +if (_distance < 0.5) exitWith {}; + +_pL = _p0 vectorAdd (_v1 vectorMultiply _distance); +_pL2 = _p0 vectorAdd (_v1 vectorMultiply (_distance - 0.5)); + +// Convert _pL to pos +if (!surfaceIsWater _pL) then { + _pL = ASLtoATL _pL; +}; + +drawLine3D [ + _p0Pos, + _pL, + [[1,0,0,1], [0,1,0,1]] select _isGreen +]; + +_size = 2 * (_range - (positionCameraToWorld [0,0,0] distance _pL)) / _range; + +_camPos = positionCameraToWorld [0,0,0.2]; +if (count ([_unit, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; +if (count ([ACE_player, "FIRE"] intersect [_camPos, _pL]) > 0) exitWith {}; + +// Convert _camPos to ASL +if (!surfaceIsWater _camPos) then { _camPos = ATLtoASL _camPos; }; +if ( terrainIntersectASL [_camPos, _pL2]) exitWith {}; +if ( lineIntersects [_camPos, _pL2]) exitWith {}; + +drawIcon3D [ + format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen], + [[1,0.25,0.25,0.5*_brightness], [0.25,1,0.25,0.5*_brightness]] select _isGreen, + _pL, + _size, + _size, + 45, + "", + 0, + 0.05 +]; diff --git a/addons/laserpointer/functions/fnc_onDraw.sqf b/addons/laserpointer/functions/fnc_onDraw.sqf new file mode 100644 index 0000000000..6fa7275531 --- /dev/null +++ b/addons/laserpointer/functions/fnc_onDraw.sqf @@ -0,0 +1,34 @@ +// by commy2 +#include "script_component.hpp" + +_brightness = 2 - call EFUNC(common,ambientBrightness); +_isIR = currentVisionMode ACE_player; + +if (_isIR == 2) exitWith {}; + +_isIR = _isIR == 1; + +{ + _weapon = currentWeapon _x; + + _laser = switch (_weapon) do { + case (""): {""}; + case (primaryWeapon _x): { + primaryWeaponItems _x select 1; + }; + case (secondaryWeapon _x): { + secondaryWeaponItems _x select 1; + }; + case (handgunWeapon _x): { + handgunItems _x select 1; + }; + default {""}; + }; + + _laserID = ["ACE_acc_pointer_red", "ACE_acc_pointer_green"] find _laser; + + if (_laserID > -1 && {_x isFlashlightOn _weapon}) then { + [_x, 30, _laserID == 1 || _isIR] call FUNC(drawLaserpoint); + }; + +} forEach GVAR(nearUnits); diff --git a/addons/laserpointer/functions/script_component.hpp b/addons/laserpointer/functions/script_component.hpp new file mode 100644 index 0000000000..727c32539f --- /dev/null +++ b/addons/laserpointer/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\laserpointer\script_component.hpp" \ No newline at end of file diff --git a/addons/laserpointer/script_component.hpp b/addons/laserpointer/script_component.hpp new file mode 100644 index 0000000000..34c689cbbf --- /dev/null +++ b/addons/laserpointer/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT laserpointer +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_LASERPOINTER + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_LASERPOINTER + #define DEBUG_SETTINGS DEBUG_ENABLED_LASERPOINTER +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/laserpointer/stringtable.xml b/addons/laserpointer/stringtable.xml new file mode 100644 index 0000000000..1da46607d4 --- /dev/null +++ b/addons/laserpointer/stringtable.xml @@ -0,0 +1,33 @@ + + + + + + Laser Pointer (red) + Laserpointer (rot) + + + Laser Pointer (green) + Laserpointer (grün) + + + + Emits visible light. + Strahlt sichtbares Licht aus. + + + + <t color='#9cf953'>Use: </t>Turn Laser ON/OFF + <t color='#9cf953'>Use: </t>Turn Laser ON/OFF + <t color='#9cf953'>Použití: </t>Zapnout/vypnout laser + <t color='#9cf953'>Utiliser : </t>laser on/off + <t color='#9cf953'>Benutzen: </t>Laser EIN/AUS + <t color='#9cf953'>Uso: </t>Laser ON/OFF + <t color='#9cf953'>Użyj: </t>wł./wył. lasera + <t color='#9cf953'>Uso: </t>Ativar/Desativar laser + <t color='#9cf953'>Использовать: </t>вкл/выкл лазер + <t color='#9cf953'>Usar: </t>encender/apagar láser + + + + diff --git a/addons/lockbackpacks/$PBOPREFIX$ b/addons/lockbackpacks/$PBOPREFIX$ new file mode 100644 index 0000000000..012a3f3cd5 --- /dev/null +++ b/addons/lockbackpacks/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\lockbackpacks \ No newline at end of file diff --git a/addons/lockbackpacks/CfgEventHandlers.hpp b/addons/lockbackpacks/CfgEventHandlers.hpp new file mode 100644 index 0000000000..9a26e6f614 --- /dev/null +++ b/addons/lockbackpacks/CfgEventHandlers.hpp @@ -0,0 +1,14 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_InventoryOpened_EventHandlers { + class CAManBase { + class GVAR(onOpenInventory) { + clientInventoryOpened = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(onOpenInventory)};); + }; + }; +}; diff --git a/addons/lockbackpacks/CfgVehicles.hpp b/addons/lockbackpacks/CfgVehicles.hpp new file mode 100644 index 0000000000..5517d81525 --- /dev/null +++ b/addons/lockbackpacks/CfgVehicles.hpp @@ -0,0 +1,31 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class ACE_LockBackpack { + displayName = "$STR_ACE_LockBackpacks_LockBackpack"; + condition = QUOTE([backpackContainer _player] call FUNC(isBackpack) && {!((backpackContainer _player) getVariable [ARR_2('ACE_LockedInventory', false)])}); + statement = QUOTE((backpackContainer _player) setVariable [ARR_3('ACE_LockedInventory', true, true)];); + showDisabled = 0; + priority = 2.5; + icon = ""; // @todo + hotkey = "L"; + enableInside = 1; + }; + + class ACE_UnlockBackpack { + displayName = "$STR_ACE_LockBackpacks_UnlockBackpack"; + condition = QUOTE([backpackContainer _player] call FUNC(isBackpack) && {(backpackContainer _player) getVariable [ARR_2('ACE_LockedInventory', false)]}); + statement = QUOTE((backpackContainer _player) setVariable [ARR_3('ACE_LockedInventory', false, true)];); + showDisabled = 0; + priority = 2.5; + icon = ""; // @todo + hotkey = "L"; + enableInside = 1; + }; + }; + }; + }; +}; diff --git a/addons/lockbackpacks/XEH_preInit.sqf b/addons/lockbackpacks/XEH_preInit.sqf new file mode 100644 index 0000000000..77b8885da4 --- /dev/null +++ b/addons/lockbackpacks/XEH_preInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +PREP(getBackpackAssignedUnit); +PREP(isBackpack); +PREP(onOpenInventory); diff --git a/addons/lockbackpacks/config.cpp b/addons/lockbackpacks/config.cpp new file mode 100644 index 0000000000..0224b4b237 --- /dev/null +++ b/addons/lockbackpacks/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_interaction"}; + author[] = {"bux","commy2"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/TO_MERGE/agm/Backpacks/functions/fn_getBackpackAssignedUnit.sqf b/addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf similarity index 77% rename from TO_MERGE/agm/Backpacks/functions/fn_getBackpackAssignedUnit.sqf rename to addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf index afe95ef578..562dc84da2 100644 --- a/TO_MERGE/agm/Backpacks/functions/fn_getBackpackAssignedUnit.sqf +++ b/addons/lockbackpacks/functions/fnc_getBackpackAssignedUnit.sqf @@ -9,6 +9,7 @@ * Return value: * Unit that has the backpack equipped. (Object) */ +#include "script_component.hpp" private ["_backpack", "_unit"]; @@ -16,6 +17,6 @@ _backpack = _this select 0; _unit = objNull; { - if (backpackContainer _x == _backpack) exitWith {_unit = _x}; + if (backpackContainer _x == _backpack) exitWith {_unit = _x}; } forEach (allUnits + allDeadMen); _unit diff --git a/TO_MERGE/agm/Backpacks/functions/fn_isBackpack.sqf b/addons/lockbackpacks/functions/fnc_isBackpack.sqf similarity index 88% rename from TO_MERGE/agm/Backpacks/functions/fn_isBackpack.sqf rename to addons/lockbackpacks/functions/fnc_isBackpack.sqf index 7413a1d5dd..b1d55f9ce6 100644 --- a/TO_MERGE/agm/Backpacks/functions/fn_isBackpack.sqf +++ b/addons/lockbackpacks/functions/fnc_isBackpack.sqf @@ -9,13 +9,14 @@ * Return value: * Boolean (Bool) */ +#include "script_component.hpp" private ["_backpack", "_config"]; _backpack = _this select 0; if (typeName _backpack == "OBJECT") then { - _backpack = typeOf _backpack; + _backpack = typeOf _backpack; }; _config = configFile >> "CfgVehicles" >> _backpack; diff --git a/addons/lockbackpacks/functions/fnc_onOpenInventory.sqf b/addons/lockbackpacks/functions/fnc_onOpenInventory.sqf new file mode 100644 index 0000000000..9305bf3de7 --- /dev/null +++ b/addons/lockbackpacks/functions/fnc_onOpenInventory.sqf @@ -0,0 +1,47 @@ +/* + * Author: bux, commy2 + * + * Handle the open inventory event. Don't open the inventory if it's locked and display message. + * + * Argument: + * Input from "InventoryOpened" eventhandler + * + * Return value: + * Don't open the inventory dialog? (Bool) + */ +#include "script_component.hpp" + +private ["_target", "_isBackpack", "_isLocked", "_return"]; + +_target = _this select 1; + +_isBackpack = [_target] call FUNC(isBackpack); +_isLocked = _target getVariable ["ACE_LockedInventory", false]; + +_return = false; +if (_isBackpack) then { + // target is a backpack + private "_unit"; + _unit = [_target] call FUNC(getBackpackAssignedUnit); + + if (!alive _unit || {_unit getVariable ["ACE_isUnconscious", false]}) exitWith {}; + + if (_isLocked) then { + // target is a locked backpack + [format [localize "STR_ACE_LockBackpacks_BackpackLocked", [_unit] call EFUNC(common,getName)]] call EFUNC(common,displayTextStructured); + _return = true; + } else { + // target is a not-locked backpack + if (_unit getVariable ["ACE_LockedInventory", false]) then { + [localize "STR_ACE_LockBackpacks_InventoryLocked"] call EFUNC(common,displayTextStructured); + _return = true; + }; + }; +} else { + // target is not a backpack + if (_isLocked) then { + [localize "STR_ACE_LockBackpacks_InventoryLocked"] call EFUNC(common,displayTextStructured); + _return = true; + }; +}; +_return diff --git a/addons/lockbackpacks/functions/script_component.hpp b/addons/lockbackpacks/functions/script_component.hpp new file mode 100644 index 0000000000..1ad43dc2cc --- /dev/null +++ b/addons/lockbackpacks/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\lockbackpacks\script_component.hpp" \ No newline at end of file diff --git a/addons/lockbackpacks/script_component.hpp b/addons/lockbackpacks/script_component.hpp new file mode 100644 index 0000000000..4275a6e7fd --- /dev/null +++ b/addons/lockbackpacks/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT lockbackpacks +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_LOCKBACKPACKS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_LOCKBACKPACKS + #define DEBUG_SETTINGS DEBUG_ENABLED_LOCKBACKPACKS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/TO_MERGE/agm/Backpacks/stringtable.xml b/addons/lockbackpacks/stringtable.xml similarity index 87% rename from TO_MERGE/agm/Backpacks/stringtable.xml rename to addons/lockbackpacks/stringtable.xml index 4ec5aedee5..85cd7f77d3 100644 --- a/TO_MERGE/agm/Backpacks/stringtable.xml +++ b/addons/lockbackpacks/stringtable.xml @@ -1,8 +1,8 @@  - - - + + + Take (Ventral) Aufnehmen (Am Bauch) Coger (Mochila delantera) @@ -14,7 +14,7 @@ Pegar (Mochila Ventral) Prendi - + Take Off Backpack Rucksack ablegen Dejar mochila @@ -26,7 +26,7 @@ Retirar Mochila Togliere zaino - + Lock Backpack Rucksack verschließen Verrouiller le sac à dos @@ -36,7 +36,7 @@ Táska zárolása Запереть рюкзак - + Unlock Backpack Rucksack aufschließen Déverouiller le sac à dos @@ -46,7 +46,7 @@ Táska nyitása Отпереть рюкзак - + Backpack of %1 is locked Der Rucksack von %1 ist verschlossen Le sac à dos de %1 est verroullé @@ -56,7 +56,7 @@ %1 táskája zárolva Рюкзак %1 заперт - + Inventory is locked Das Inventar ist verschlossen L'inventaire est verrouillé diff --git a/addons/map/$PBOPREFIX$ b/addons/map/$PBOPREFIX$ new file mode 100644 index 0000000000..11a24a58d8 --- /dev/null +++ b/addons/map/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\map \ No newline at end of file diff --git a/addons/map/CfgEventHandlers.hpp b/addons/map/CfgEventHandlers.hpp new file mode 100644 index 0000000000..23d60e02da --- /dev/null +++ b/addons/map/CfgEventHandlers.hpp @@ -0,0 +1,12 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + serverInit = QUOTE( call COMPILE_FILE(XEH_preInitServer) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); + }; +}; diff --git a/addons/map/CfgMarkers.hpp b/addons/map/CfgMarkers.hpp new file mode 100644 index 0000000000..d6281a4a6e --- /dev/null +++ b/addons/map/CfgMarkers.hpp @@ -0,0 +1,67 @@ +// MARKERS +class CfgMarkers { + class Flag; + + // Reenable NATO symbols ... + class b_unknown: Flag {scope = 2;}; + + // ... and disable all the useless ones + // If you think that some of these are needed, create an issue; But until + // there's a better way to place markers, there should be only the most + // important markers here. + // Keep in mind that all of these can still be placed in the editor. + class b_hq: b_unknown {scope = 1;}; + class b_installation: b_unknown {scope = 1;}; + class b_maint: b_unknown {scope = 1;}; + class b_med: b_unknown {scope = 1;}; + class b_service: b_unknown {scope = 1;}; + class b_support: b_unknown {scope = 1;}; + + class n_unknown: b_unknown {}; + class n_hq: n_unknown {scope = 1;}; + class n_installation: n_unknown {scope = 1;}; + class u_installation: n_unknown {scope = 1;}; // i have no idea... + class n_maint: n_unknown {scope = 1;}; + class n_med: n_unknown {scope = 1;}; + class n_service: n_unknown {scope = 1;}; + class n_support: n_unknown {scope = 1;}; + + class o_unknown: b_unknown {}; + class o_hq: o_unknown {scope = 1;}; + class o_installation: o_unknown {scope = 1;}; + class o_maint: o_unknown {scope = 1;}; + class o_med: o_unknown {scope = 1;}; + class o_service: o_unknown {scope = 1;}; + class o_support: o_unknown {scope = 1;}; + + // disable all civy markers (harbor etc.) + class c_unknown: b_unknown {scope = 1;}; + + // disable quantity indicators (fire team/squad/platoon ...) + class group_0: b_unknown {scope = 1;}; + + + class ACE_MapToolFixed { + name = "MapToolFixed"; + icon = PATHTOF(data\mapToolFixed.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; + + class ACE_MapToolRotatingNormal { + name = "MapToolRotating"; + icon = PATHTOF(data\mapToolRotatingNormal.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; + + class ACE_MapToolRotatingSmall { + name = "MapToolRotating"; + icon = PATHTOF(data\mapToolRotatingSmall.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; +}; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp new file mode 100644 index 0000000000..6c2d4a1ee1 --- /dev/null +++ b/addons/map/CfgVehicles.hpp @@ -0,0 +1,159 @@ +#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ + }; + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + + class ACE_MapTools { + displayName = "$STR_ACE_Map_MapTools_Menu"; + condition = QUOTE((call FUNC(canUseMapTools) || {call FUNC(canUseMapGPS)})); + statement = ""; + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 100; + subMenu[] = {"ACE_MapTools", 1}; + enableInside = 1; + + class ACE_MapToolsHide { + displayName = "$STR_ACE_Map_MapToolsHide"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); + statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 5; + enableInside = 1; + }; + class ACE_MapToolsShowNormal { + displayName = "$STR_ACE_Map_MapToolsShowNormal"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); + statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 4; + enableInside = 1; + }; + class ACE_MapToolsShowSmall { + displayName = "$STR_ACE_Map_MapToolsShowSmall"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); + statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 3; + enableInside = 1; + }; + class ACE_MapToolsAlignNorth { + displayName = "$STR_ACE_Map_MapToolsAlignNorth"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); + statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 2; + enableInside = 1; + }; + class ACE_MapToolsAlignCompass { + displayName = "$STR_ACE_Map_MapToolsAlignCompass"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); + statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 1; + enableInside = 1; + }; + class ACE_MapGpsShow { + displayName = "$STR_ACE_Map_MapGpsShow"; + condition = QUOTE((call FUNC(canUseMapGPS) && {!GVAR(mapGpsShow)})); + statement = QUOTE(GVAR(mapGpsShow) = true; [GVAR(mapGpsShow)] call FUNC(openMapGps)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 0; + enableInside = 1; + }; + class ACE_MapGpsHide { + displayName = "$STR_ACE_Map_MapGpsHide"; + condition = QUOTE((call FUNC(canUseMapGPS) && {GVAR(mapGpsShow)})); + statement = QUOTE(GVAR(mapGpsShow) = false; [GVAR(mapGpsShow)] call FUNC(openMapGps)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 0; + enableInside = 1; + }; + }; + }; + + class ACE_Actions { + class ACE_CopyMap { + displayName = "$STR_ACE_Map_CopyMap"; + condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); + showDisabled = 0; + priority = -1; + }; + }; + }; + + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class FIA_Box_Base_F; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12) + }; + }; + + class Module_F; + class ACE_ModuleBlueForceTracking: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Blue Force Tracking"; + function = QFUNC(blueForceTrackingModule); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconBFTracking_ca.paa); + class Arguments { + class Interval { + displayName = "Interval"; + description = "How often the markers should be refreshed (in seconds)"; + defaultValue = 1; + }; + class HideAiGroups { + displayName = "Hide AI groups?"; + description = "Hide markers for 'AI only' groups?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; }; + class No { name = "No"; value = 0; default = 1; }; + }; + }; + }; + }; +}; diff --git a/addons/map/CfgWeapons.hpp b/addons/map/CfgWeapons.hpp new file mode 100644 index 0000000000..fa6d0897c5 --- /dev/null +++ b/addons/map/CfgWeapons.hpp @@ -0,0 +1,15 @@ +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_MapTools: ACE_ItemCore { + displayName = "$STR_ACE_MapTools_Name"; + descriptionShort = "$STR_ACE_MapTools_Description"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + picture = PATHTOF(UI\maptool_item.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + }; + }; +}; diff --git a/addons/map/MapControls.hpp b/addons/map/MapControls.hpp new file mode 100644 index 0000000000..3255cb7929 --- /dev/null +++ b/addons/map/MapControls.hpp @@ -0,0 +1,93 @@ +class controls { + class ButtonPlayer: RscActiveText { + text = ""; + w = 0; + h = 0; + sizeEx = 0; + onButtonClick = ""; + }; + class CA_PlayerName: RscText { + x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfilePicture: RscPicture { + x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfileBackground: RscText { + x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class Separator1: RscPicture { + x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ColorBlack: RscButton { + idc = 36732; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.2,0.2,1}; + colorBackgroundActive[] = {0,0,0,1}; + colorFocused[] = {0,0,0,1}; + onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorBlack""]"; + // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),"ColorBlack")]); + }; + class ColorRed: RscButton { + idc = 36733; + x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.2,0.2,1}; + colorBackgroundActive[] = {1,0,0,1}; + colorFocused[] = {1,0,0,1}; + onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorRed""]"; + // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),QUOTE(ColorRed))]); + }; + class ColorGreen: RscButton { + idc = 36734; + x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.8,0.2,1}; + colorBackgroundActive[] = {0,1,0,1}; + colorFocused[] = {0,1,0,1}; + onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorGreen""]"; + // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),"ColorGreen")]); + }; + class ColorBlue: RscButton { + idc = 36735; + x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.2,0.8,1}; + colorBackgroundActive[] = {0,0,1,1}; + colorFocused[] = {0,0,1,1}; + onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorBlue""]"; + // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorBlue")]); + }; + class ColorYellow: RscButton { + idc = 36736; + x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.8,0.2,1}; + colorBackgroundActive[] = {1,1,0,1}; + colorFocused[] = {1,1,0,1}; + onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorYellow""]"; + // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorYellow")]); + }; + class ColorWhite: RscButton { + idc = 36737; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.8,0.8,1}; + colorBackgroundActive[] = {1,1,1,1}; + colorFocused[] = {1,1,1,1}; + onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorWhite""]"; + // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorWhite")]); + }; +}; diff --git a/TO_MERGE/agm/Map/MapGpsUI.hpp b/addons/map/MapGpsUI.hpp similarity index 87% rename from TO_MERGE/agm/Map/MapGpsUI.hpp rename to addons/map/MapGpsUI.hpp index 9bbc4f0d5a..e21b8db0a1 100644 --- a/TO_MERGE/agm/Map/MapGpsUI.hpp +++ b/addons/map/MapGpsUI.hpp @@ -13,13 +13,14 @@ #define Y_gps safeZoneY + safeZoneH - 1.2 * H_gps class RscTitles { - class RscAGM_MapGps { + class RscACE_MapGps { idd = 9855; movingEnable = 1; duration = 3600; fadein = 0; fadeout = 0; - onLoad = "uiNamespace setVariable ['AGM_Map_mapGpsDisplay', _this select 0];"; + // onLoad = QUOTE(uiNamespace setVariable [ARR_2(QGVAR(ui_mapGpsDisplay), _this select 0)];); + onLoad = "uiNamespace setVariable ['ACE_map_ui_mapGpsDisplay', _this select 0];"; //@todo cbaify this //onUnLoad = "_this call onRscLoad"; class controls { class back:RscPicture { @@ -27,7 +28,7 @@ class RscTitles { y = Y_gps; w = W_gps; h = H_gps; - text = "\AGM_Map\UI\mapGps.paa"; + text = PATHTOF(UI\mapGps.paa); colorBackground[] = {1, 1, 1, 1}; }; class heading: RscText{ diff --git a/TO_MERGE/agm/Map/UI/IconBFTracking_ca.paa b/addons/map/UI/IconBFTracking_ca.paa similarity index 100% rename from TO_MERGE/agm/Map/UI/IconBFTracking_ca.paa rename to addons/map/UI/IconBFTracking_ca.paa diff --git a/TO_MERGE/agm/Map/UI/mapGps.paa b/addons/map/UI/mapGps.paa similarity index 100% rename from TO_MERGE/agm/Map/UI/mapGps.paa rename to addons/map/UI/mapGps.paa diff --git a/TO_MERGE/agm/Map/UI/maptool_item.paa b/addons/map/UI/maptool_item.paa similarity index 100% rename from TO_MERGE/agm/Map/UI/maptool_item.paa rename to addons/map/UI/maptool_item.paa diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf new file mode 100644 index 0000000000..24b906e61c --- /dev/null +++ b/addons/map/XEH_postInitClient.sqf @@ -0,0 +1,71 @@ +// by CAA-Picard + +#include "script_component.hpp" + +if (!hasInterface) exitWith{}; + +// Init variables +GVAR(mapVisableLastFrame) = false; +GVAR(mapGpsShow) = true; + +GVAR(mapTool_Shown) = 0; +GVAR(mapTool_pos) = [0,0]; +GVAR(mapTool_angle) = 0; +GVAR(mapTool_isDragging) = false; +GVAR(mapTool_isRotating) = false; + +GVAR(drawing_isDrawing) = false; +GVAR(drawing_tempLineMarker) = []; +GVAR(drawing_lineMarkers) = []; +GVAR(drawing_drawColor) = "ColorBlack"; +GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; + +//Probably need this spawn, because CBA_fnc_addPerFrameHandler doesn't work durring breifing. +[] spawn { + _fnc_installMapEvents = { + _d = _this; + diag_log format ["Installing EH in display %1", _d]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; + (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; + }; + + // Wait until the briefing map is detected + // display = 37 for SP + // display = 52 for host server on MP; + // display = 53 for MP clients) + waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; + + if (isNull findDisplay 12) then { + // Install event handlers on the map control of the briefing screen (control = 51) + GVAR(drawing_syncMarkers) = true; + if (!isNull findDisplay 52) then { + 52 call _fnc_installMapEvents; + } else { + if (!isNull findDisplay 53) then { + 53 call _fnc_installMapEvents; + } else { + 37 call _fnc_installMapEvents; + }; + }; + } else { + // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing + GVAR(drawing_syncMarkers) = false; + { + _x call FUNC(addLineMarker); + } forEach GVAR(drawing_serverLineMarkers); + }; + + // Wait until the main map display is detected (display = 12) + waitUntil { !isNull findDisplay 12 }; + // Install event handlers on the map control and display (control = 51) + GVAR(drawing_syncMarkers) = false; + 12 call _fnc_installMapEvents; + + // Update the size and rotation of map tools + [] call FUNC(updateMapToolMarkers); + + [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf new file mode 100644 index 0000000000..b13b0ca384 --- /dev/null +++ b/addons/map/XEH_preInit.sqf @@ -0,0 +1,31 @@ +#include "script_component.hpp" + +PREP(addLineMarker); +PREP(blueForceTrackingModule); +PREP(blueForceTrackingUpdate); +PREP(calculateMapScale); +PREP(cancelDrawing); +PREP(canDraw); +PREP(canUseMapTools); +PREP(canUseMapGPS); +PREP(copyMapReceiveMarkers); +PREP(copyMapRemoteSend); +PREP(copyMapStart); +PREP(handleKeyDown); +PREP(handleMouseButton); +PREP(handleMouseMove); +PREP(handleMouseZChanged); +PREP(isInsideMapTool); +PREP(mapStateUpdater); +PREP(openMapGps); +PREP(openMapGpsUpdate); +PREP(removeLineMarker); +PREP(updateMapToolMarkers); +PREP(updateLineMarker); + +//Add Event Handlers: +["drawing_removeLineMarker", FUNC(removeLineMarker) ] call EFUNC(common,addEventHandler); +["drawing_addLineMarker", FUNC(addLineMarker) ] call EFUNC(common,addEventHandler); + +["drawing_requestMarkers", FUNC(copyMapRemoteSend) ] call EFUNC(common,addEventHandler); +["drawing_sendbackMarkers", FUNC(copyMapReceiveMarkers) ] call EFUNC(common,addEventHandler); diff --git a/addons/map/XEH_preInitServer.sqf b/addons/map/XEH_preInitServer.sqf new file mode 100644 index 0000000000..1614e9a340 --- /dev/null +++ b/addons/map/XEH_preInitServer.sqf @@ -0,0 +1,6 @@ +// by CAA-Picard + +#include "script_component.hpp" + +GVAR(drawing_serverLineMarkers) = []; +publicVariable QGVAR(drawing_serverLineMarkers); diff --git a/addons/map/config.cpp b/addons/map/config.cpp new file mode 100644 index 0000000000..c9980458db --- /dev/null +++ b/addons/map/config.cpp @@ -0,0 +1,145 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_MapTools"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; + author[] = {"KoffeinFlummi","CAA-Picard"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; +}; + +class RscControlsGroup; +class RscActiveText; +class RscPicture; +class RscText; +class RscObject; +class RscButton; +class RscButtonMenuOK; +class RscButtonMenuCancel; +class RscButtonMenu; +class RscEdit; + +class ACE_Parameters_Numeric { + GVAR(BFT_Interval) = 1; +}; +class ACE_Parameters_Boolean { + GVAR(EveryoneCanDrawOnBriefing) = 1; + GVAR(BFT_Enabled) = 0; + GVAR(BFT_HideAiGroups) = 0; +}; + +#include "MapGpsUI.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMarkers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" + + +class RscMapControl { + sizeExGrid = 0.032; +}; + +// REGULAR MAP +class RscDisplayMainMap { + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; + }; +}; + +// DIARY +class RscDisplayDiary { + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + class controls { + class ButtonPlayer: RscActiveText { + text = ""; + w = 0; + h = 0; + sizeEx = 0; + onButtonClick = ""; + }; + class CA_PlayerName: RscText { + x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfilePicture: RscPicture { + x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfileBackground: RscText { + x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class Separator1: RscPicture { + x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + }; + }; + }; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; + }; +}; + +// BRIEFING SCREEN +class RscDisplayGetReady: RscDisplayMainMap { + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; + }; +}; +class RscDisplayClientGetReady: RscDisplayGetReady { + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; + }; +}; +class RscDisplayServerGetReady: RscDisplayGetReady { + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; + }; +}; diff --git a/TO_MERGE/agm/Map/data/mapToolFixed.paa b/addons/map/data/mapToolFixed.paa similarity index 100% rename from TO_MERGE/agm/Map/data/mapToolFixed.paa rename to addons/map/data/mapToolFixed.paa diff --git a/TO_MERGE/agm/Map/data/mapToolRotatingNormal.paa b/addons/map/data/mapToolRotatingNormal.paa similarity index 100% rename from TO_MERGE/agm/Map/data/mapToolRotatingNormal.paa rename to addons/map/data/mapToolRotatingNormal.paa diff --git a/TO_MERGE/agm/Map/data/mapToolRotatingSmall.paa b/addons/map/data/mapToolRotatingSmall.paa similarity index 100% rename from TO_MERGE/agm/Map/data/mapToolRotatingSmall.paa rename to addons/map/data/mapToolRotatingSmall.paa diff --git a/TO_MERGE/agm/Map/functions/fn_addLineMarker.sqf b/addons/map/functions/fnc_addLineMarker.sqf similarity index 65% rename from TO_MERGE/agm/Map/functions/fn_addLineMarker.sqf rename to addons/map/functions/fnc_addLineMarker.sqf index 7d2d5edea2..24446c18a6 100644 --- a/TO_MERGE/agm/Map/functions/fn_addLineMarker.sqf +++ b/addons/map/functions/fnc_addLineMarker.sqf @@ -13,10 +13,12 @@ * Return */ - _name = _this select 0; - _startPos = _this select 1; - _difPos = (_this select 2) vectorDiff _startPos ; - _color = _this select 3; +#include "script_component.hpp" + +_name = _this select 0; +_startPos = _this select 1; +_difPos = (_this select 2) vectorDiff _startPos ; +_color = _this select 3; _marker = createMarkerLocal [_name, _startPos]; _name setMarkerShapeLocal "RECTANGLE"; @@ -32,9 +34,9 @@ if (_mag > 0) then { _name setMarkerDirLocal 0; }; -AGM_Map_lineMarkers pushBack (+_this); +GVAR(drawing_lineMarkers) pushBack (+_this); -if (isServer && AGM_Map_syncMarkers) then { - AGM_Map_serverLineMarkers pushBack (+_this); - publicVariable "AGM_Map_serverLineMarkers"; +if (isServer && GVAR(drawing_syncMarkers)) then { + GVAR(drawing_serverLineMarkers) pushBack (+_this); + publicVariable QGVAR(drawing_serverLineMarkers); }; diff --git a/addons/map/functions/fnc_blueForceTrackingModule.sqf b/addons/map/functions/fnc_blueForceTrackingModule.sqf new file mode 100644 index 0000000000..3951473026 --- /dev/null +++ b/addons/map/functions/fnc_blueForceTrackingModule.sqf @@ -0,0 +1,32 @@ +/* +* Author: KoffeinFlummi +* +* Initializes the blue force tracking module. +* +* Arguments: +* Whatever the module provides. (I dunno.) +* +* Return Value: +* None +*/ + +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +GVAR(BFT_Enabled) = true; +[_logic, QGVAR(BFT_Interval), "Interval"] call EFUNC(common,readNumericParameterFromModule); +[_logic, QGVAR(BFT_HideAiGroups), "HideAiGroups"] call EFUNC(common,readBooleanParameterFromModule); + +diag_log text "[ACE]: Blue Force Tracking Module initialized."; +TRACE_2("[ACE]: Blue Force Tracking Module initialized.",GVAR(BFT_Interval), GVAR(BFT_HideAiGroups)); + +//start BFT: +GVAR(BFT_markers) = []; +[FUNC(blueForceTrackingUpdate), GVAR(BFT_Interval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf new file mode 100644 index 0000000000..b2619155c2 --- /dev/null +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +// Delete last set of markers (always) +{ + deleteMarkerLocal _x; +} forEach GVAR(BFT_markers); + + +if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then { + + _groupsToDrawMarkers = []; + _playerSide = call EFUNC(common,playerSide); + + if (GVAR(BFT_HideAiGroups)) then { + _groupsToDrawMarkers = [allGroups, {side _this == _playerSide}] call EFUNC(common,filter); + } else { + _groupsToDrawMarkers = [allGroups, { + _anyPlayers = { + [_x] call EFUNC(common,isPlayer); + } count units _this; + (side _this == _playerSide) && _anyPlayers > 0 + }] call EFUNC(common,filter); + }; + + + { + _markerType = [_x] call EFUNC(common,getMarkerType); + + _colour = format ["Color%1", side _x]; + + _marker = createMarkerLocal [format ["ACE_BFT_%1", _i], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; + _marker setMarkerTypeLocal _markerType; + _marker setMarkerColorLocal _colour; + _marker setMarkerTextLocal (groupID _x); + + GVAR(BFT_markers) pushBack _marker; + } forEach _groupsToDrawMarkers; +}; diff --git a/TO_MERGE/agm/Map/functions/fn_calculateMapScale.sqf b/addons/map/functions/fnc_calculateMapScale.sqf similarity index 91% rename from TO_MERGE/agm/Map/functions/fn_calculateMapScale.sqf rename to addons/map/functions/fnc_calculateMapScale.sqf index baf7f5884b..3c3fc33d53 100644 --- a/TO_MERGE/agm/Map/functions/fn_calculateMapScale.sqf +++ b/addons/map/functions/fnc_calculateMapScale.sqf @@ -10,6 +10,8 @@ * Return */ +#include "script_component.hpp" + _pos = ((finddisplay 12) displayctrl 51) ctrlMapScreenToWorld [0.5, 0.5]; _screenOffset = ((finddisplay 12) displayctrl 51) posWorldToScreen [(_pos select 0) + 100, (_pos select 1)]; diff --git a/addons/map/functions/fnc_canDraw.sqf b/addons/map/functions/fnc_canDraw.sqf new file mode 100644 index 0000000000..2c3cc68e21 --- /dev/null +++ b/addons/map/functions/fnc_canDraw.sqf @@ -0,0 +1,6 @@ +// by CAA-Picard + +#include "script_component.hpp" + +(missionNameSpace getVariable [QGVAR(drawing_syncMarkers), true] && {GVAR(EveryoneCanDrawOnBriefing)}) || +{(!isNull ACE_player) && {"ACE_MapTools" in items ACE_player}} diff --git a/addons/map/functions/fnc_canUseMapGPS.sqf b/addons/map/functions/fnc_canUseMapGPS.sqf new file mode 100644 index 0000000000..af6840f7fa --- /dev/null +++ b/addons/map/functions/fnc_canUseMapGPS.sqf @@ -0,0 +1,7 @@ +// by CAA-Picard + +#include "script_component.hpp" + +visibleMap && +{alive ACE_player} && +{"ItemGPS" in (assignedItems ACE_player)} diff --git a/addons/map/functions/fnc_canUseMapTools.sqf b/addons/map/functions/fnc_canUseMapTools.sqf new file mode 100644 index 0000000000..f06408d929 --- /dev/null +++ b/addons/map/functions/fnc_canUseMapTools.sqf @@ -0,0 +1,10 @@ +// by CAA-Picard + +#include "script_component.hpp" + +visibleMap && +{alive ACE_player} && +{"ItemMap" in (assignedItems ACE_player)} && +{"ACE_MapTools" in (items ACE_player)} && +{!GVAR(mapTool_isDragging)} && +{!GVAR(mapTool_isRotating)} diff --git a/addons/map/functions/fnc_cancelDrawing.sqf b/addons/map/functions/fnc_cancelDrawing.sqf new file mode 100644 index 0000000000..1cd9f4fa77 --- /dev/null +++ b/addons/map/functions/fnc_cancelDrawing.sqf @@ -0,0 +1,19 @@ +/* + * Author: CAA-Picard + * + * Cancel the drawing of the current line marker + * + * Argument: + * None + * + * Return value: + * Nothing + */ + +#include "script_component.hpp" + +GVAR(drawing_isDrawing) = false; +if (count GVAR(drawing_tempLineMarker) > 0) then { + deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); +}; +GVAR(drawing_tempLineMarker) = []; diff --git a/addons/map/functions/fnc_copyMapReceiveMarkers.sqf b/addons/map/functions/fnc_copyMapReceiveMarkers.sqf new file mode 100644 index 0000000000..dcae05c572 --- /dev/null +++ b/addons/map/functions/fnc_copyMapReceiveMarkers.sqf @@ -0,0 +1,23 @@ +/* + * Author: CAA-Picard + * + * Copy recieved markers to map + * + * Argument: + * 0: Array of markers to copy (Array) + * + * Return value: + * Return + */ + +#include "script_component.hpp" + +PARAMS_1(_lineMarkers); + +{ + _marker = _x; + //Add marker if we don't already have it + if (({(_x select 0) == (_marker select 0)} count GVAR(drawing_lineMarkers)) == 0) then { + _marker call FUNC(addLineMarker); + }; +} forEach _lineMarkers; diff --git a/addons/map/functions/fnc_copyMapRemoteSend.sqf b/addons/map/functions/fnc_copyMapRemoteSend.sqf new file mode 100644 index 0000000000..27e0a61b72 --- /dev/null +++ b/addons/map/functions/fnc_copyMapRemoteSend.sqf @@ -0,0 +1,17 @@ +/* + * Author: CAA-Picard + * + * Send Map markers to other player + * + * Argument: + * 0: Target player (Unit) + * + * Return value: + * Return + */ + +#include "script_component.hpp" + +PARAMS_1(_requester); + +["drawing_sendbackMarkers", _requester, [GVAR(drawing_lineMarkers)]] call EFUNC(common,targetEvent); diff --git a/addons/map/functions/fnc_copyMapStart.sqf b/addons/map/functions/fnc_copyMapStart.sqf new file mode 100644 index 0000000000..d3a1efaa80 --- /dev/null +++ b/addons/map/functions/fnc_copyMapStart.sqf @@ -0,0 +1,23 @@ +/* + * Author: CAA-Picard + * + * Send request to remote player + * + * Argument: + * 0: Player (Unit) + * 0: Target player (Unit) + * + * Code Chain: + * START: copyMapStart: triggers event drawing_requestMarkers on remote + * handeled by: copyMapRemoteSend: triggers event "drawing_sendbackMarkers" on origin + * handeled by: copyMapReceiveMarkers + * + * Return value: + * Return + */ + +#include "script_component.hpp" + +PARAMS_1(_player,_target); + +["drawing_requestMarkers", _target, [_player]] call EFUNC(common,targetEvent); diff --git a/TO_MERGE/agm/Map/functions/fn_handleKeyDown.sqf b/addons/map/functions/fnc_handleKeyDown.sqf similarity index 78% rename from TO_MERGE/agm/Map/functions/fn_handleKeyDown.sqf rename to addons/map/functions/fnc_handleKeyDown.sqf index aa831bbbbf..0dfc4d895e 100644 --- a/TO_MERGE/agm/Map/functions/fn_handleKeyDown.sqf +++ b/addons/map/functions/fnc_handleKeyDown.sqf @@ -14,6 +14,8 @@ * Boolean, true if event was handled */ +#include "script_component.hpp" + private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; _display = _this select 0; @@ -28,21 +30,21 @@ _handled = false; // If pressed Esc while drawing if (_code == DIK_ESCAPE) exitWith { - if (AGM_Map_drawing) then { - call AGM_Map_fnc_cancelDrawing; + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); _handled = true; }; }; if (_code == DIK_DELETE) exitWith { - if (AGM_Map_drawing) then { - call AGM_Map_fnc_cancelDrawing; + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); _handled = true; } else { // Check if a line marker needs to be deleted { - _relPos = AGM_Map_mousePos vectorDiff (_x select 1); + _relPos = GVAR(mousePosition) vectorDiff (_x select 1); _diffVector = (_x select 2) vectorDiff (_x select 1); _magDiffVector = vectorMagnitude _diffVector; if (_magDiffVector == 0) then { @@ -57,16 +59,15 @@ if (_code == DIK_DELETE) exitWith { _lambdaTrasAbs = vectorMagnitude (_relPos vectorDiff (_diffVector vectorMultiply _lambdaLong)); if (_lambdaLong >= 0 && _lambdaLong <= _magDiffVector && _lambdaTrasAbs <= 5) exitWith { // Delete the line marker - if (AGM_Map_syncMarkers) then { - [[_x select 0], "AGM_Map_fnc_removeLineMarker", 2] call AGM_Core_fnc_execRemoteFnc; + if (GVAR(drawing_syncMarkers)) then { + ["drawing_removeLineMarker", [_x select 0]] call EFUNC(common,globalEvent); } else { deleteMarkerLocal (_x select 0); - AGM_Map_lineMarkers = AGM_Map_lineMarkers - [_x]; + GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; }; _handled = true; - }; - } forEach AGM_Map_lineMarkers; + } forEach GVAR(drawing_lineMarkers); }; }; diff --git a/addons/map/functions/fnc_handleMouseButton.sqf b/addons/map/functions/fnc_handleMouseButton.sqf new file mode 100644 index 0000000000..0a1309d456 --- /dev/null +++ b/addons/map/functions/fnc_handleMouseButton.sqf @@ -0,0 +1,102 @@ +/* + * Author: CAA-Picard + * + * Handle mouse buttons. + * + * Argument: + * 0: 1 if mouse down down, 0 if mouse button up (Number) + * 1: Parameters of the mouse button event + * + * Return value: + * Boolean, true if event was handled + */ + +#include "script_component.hpp" + +private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; + +_dir = _this select 0; +_params = _this select 1; +_control = _params select 0; +_button = _params select 1; +_screenPos = [_params select 2, _params select 3]; +_shiftKey = _params select 4; +_ctrlKey = _params select 5; +_altKey = _params select 6; +_handled = false; + + +// If it's not a left button event, exit +if (_button != 0) exitWith {}; + +// If releasing +if (_dir != 1 && (GVAR(mapTool_isDragging) or GVAR(mapTool_isRotating))) exitWith { + GVAR(mapTool_isDragging) = false; + GVAR(mapTool_isRotating) = false; + _handled = true; + _handled +}; + +// If clicking +if (_dir == 1) exitWith { + + if !(call FUNC(canDraw)) exitWith {_handled = false;}; + + // Transform mouse screen position to coordinates + _pos = _control ctrlMapScreenToWorld _screenPos; + _pos set [count _pos, 0]; + + if (GVAR(drawing_isDrawing)) exitWith { + // Already drawing -> Add tempLineMarker to permanent list + if (GVAR(drawing_syncMarkers)) then { + deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0); + // [GVAR(drawing_tempLineMarker), "FUNC(addLineMarker)", 2] call EFUNC(common,execRemoteFnc); + ["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent); + // Log who drew on the briefing screen + (text format ["[ACE] Server: Player %1 drew on the briefing screen", name player]) call EFUNC(common,serverLog); + } else { + GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); + GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker)); + }; + GVAR(drawing_tempLineMarker) = []; + GVAR(drawing_isDrawing) = false; + _handled = true; + }; + + if (_altKey) exitWith { + // Start drawing + GVAR(drawing_isDrawing) = true; + // Create tempLineMarker + _gui = format ["%1%2%3%4", random (100), random (100), random (100), random (100)]; + GVAR(drawing_tempLineMarker) = [_gui, + _pos, + _pos, GVAR(drawing_drawColor)]; + _marker = createMarkerLocal [_gui, [0,0]]; + GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); + _handled = true; + }; + + GVAR(mapTool_isDragging) = false; + GVAR(mapTool_isRotating) = false; + + // If no map tool marker then exit + if (isNil QGVAR(mapTool_markerRotatingFixed)) exitWith {_handled = false;}; + + // Check if clicking the maptool + if (_pos call FUNC(isInsideMapTool)) exitWith { + // Store data for dragging + GVAR(mapTool_startPos) = + GVAR(mapTool_pos); + GVAR(mapTool_startDragPos) = + _pos; + if (_ctrlKey) then { + // Store data for rotating + GVAR(mapTool_startAngle) = + GVAR(mapTool_angle); + GVAR(mapTool_startDragAngle) = (180 + ((GVAR(mapTool_startDragPos) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mapTool_startDragPos) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); + // Start rotating + GVAR(mapTool_isRotating) = true; + } else { + // Start dragging + GVAR(mapTool_isDragging) = true; + }; + _handled = true; + }; +}; + +_handled diff --git a/addons/map/functions/fnc_handleMouseMove.sqf b/addons/map/functions/fnc_handleMouseMove.sqf new file mode 100644 index 0000000000..aac19ba883 --- /dev/null +++ b/addons/map/functions/fnc_handleMouseMove.sqf @@ -0,0 +1,63 @@ +/* + * Author: CAA-Picard + * + * Handle mouse movement over the map tool. + * + * Argument: + * 0: Map Control + * 1: Mouse position on screen coordinates + * + * Return value: + * Boolean, true if event was handled + */ + +#include "script_component.hpp" + +private ["_control", "_pos"]; + +_control = _this select 0; +_pos = [_this select 1, _this select 2]; +GVAR(mousePosition) = _control ctrlMapScreenToWorld _pos; +GVAR(mousePosition) set [2, 0]; //convert 2d pos to 3d + +// If cannot draw then exit +if !(call FUNC(canDraw)) exitWith { + // If was drawing, cancel + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + }; + false +}; + +// Handle drawing +if (GVAR(drawing_isDrawing)) exitWith { + GVAR(drawing_tempLineMarker) set [2, GVAR(mousePosition)]; + GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker); + false +}; + +// Handle Map tools +if (isNil QGVAR(mapTool_markerRotatingFixed)) exitWith {false}; + +// Translation +if (GVAR(mapTool_isDragging)) exitWith { + GVAR(mapTool_pos) set [0, (GVAR(mapTool_startPos) select 0) + (GVAR(mousePosition) select 0) - (GVAR(mapTool_startDragPos) select 0)]; + GVAR(mapTool_pos) set [1, (GVAR(mapTool_startPos) select 1) + (GVAR(mousePosition) select 1) - (GVAR(mapTool_startDragPos) select 1)]; + + // Update the size and rotation of the maptool + [] call FUNC(updateMapToolMarkers); + true +}; + +// Rotation +if (GVAR(mapTool_isRotating)) exitWith { + // Get new angle + _angle = (180 + ((GVAR(mousePosition) select 0) - (GVAR(mapTool_startPos) select 0)) atan2 ((GVAR(mousePosition) select 1) - (GVAR(mapTool_startPos) select 1)) mod 360); + GVAR(mapTool_angle) = GVAR(mapTool_startAngle) + _angle - GVAR(mapTool_startDragAngle); + + // Update the size and rotation of the maptool + [] call FUNC(updateMapToolMarkers); + true +}; + +false diff --git a/addons/map/functions/fnc_handleMouseZChanged.sqf b/addons/map/functions/fnc_handleMouseZChanged.sqf new file mode 100644 index 0000000000..3f68512d4d --- /dev/null +++ b/addons/map/functions/fnc_handleMouseZChanged.sqf @@ -0,0 +1,43 @@ +/* + * Author: CAA-Picard + * + * Handle mouse wheel. + * + * Argument: + * 0: Control + * 1: Scroll Amount + * + * Return value: + * Boolean, true if event was handled + */ + +#include "script_component.hpp" + +private ["_dir", "_params", "_control", "_button", "_screenPos", "_shiftKey", "_ctrlKey", "_handled", "_pos"]; + +_control = _this select 0; +_dir = _this select 1; +diag_log "Scroll"; +diag_log _this; +_handled = false; + +// If drawing, change line color + + +//@todo AGM bug: +// ACE_Map_drawColors is never defined + +/* if (count GVAR(drawing_tempLineMarker) > 0) then { + ACE_Map_drawColor = if (_dir > 0) then {ACE_Map_drawColor + 1} else {ACE_Map_drawColor - 1}; + if (ACE_Map_drawColor >= count ACE_Map_drawColors) then { + ACE_Map_drawColor = ACE_Map_drawColor - count ACE_Map_drawColors; + }; + if (ACE_Map_drawColor < 0) then { + ACE_Map_drawColor = ACE_Map_drawColor + count ACE_Map_drawColors; + }; + GVAR(drawing_tempLineMarker) set [3, ACE_Map_drawColor]; + GVAR(drawing_tempLineMarker) call ACE_Map_fnc_updateLineMarker; + + _handled = true; +}; */ +_handled diff --git a/TO_MERGE/agm/Map/functions/fn_isInsideMapTool.sqf b/addons/map/functions/fnc_isInsideMapTool.sqf similarity index 79% rename from TO_MERGE/agm/Map/functions/fn_isInsideMapTool.sqf rename to addons/map/functions/fnc_isInsideMapTool.sqf index 2015eb2f5b..98b88651a6 100644 --- a/TO_MERGE/agm/Map/functions/fn_isInsideMapTool.sqf +++ b/addons/map/functions/fnc_isInsideMapTool.sqf @@ -11,17 +11,19 @@ * Boolean */ +#include "script_component.hpp" + #define TEXTURE_WIDTH_IN_M 6205 #define DIST_BOTTOM_TO_CENTER_PERC -0.33 #define DIST_TOP_TO_CENTER_PERC 0.65 #define DIST_LEFT_TO_CENTER_PERC 0.30 -if (AGM_Map_mapToolsShown == 0) exitWith {false}; -_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (AGM_Map_mapToolsShown - 1); +if (GVAR(mapTool_Shown) == 0) exitWith {false}; +_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); _pos = [_this select 0, _this select 1, 0]; -_relPos = _pos vectorDiff [AGM_Map_pos select 0, AGM_Map_pos select 1, 0]; -_dirVector = [sin(AGM_Map_angle), cos(AGM_Map_angle), 0]; +_relPos = _pos vectorDiff [GVAR(mapTool_pos) select 0, GVAR(mapTool_pos) select 1, 0]; +_dirVector = [sin(GVAR(mapTool_angle)), cos(GVAR(mapTool_angle)), 0]; // Projection of the relative position over the longitudinal axis of the map tool _lambdaLong = _dirVector vectorDotProduct _relPos; diff --git a/addons/map/functions/fnc_mapStateUpdater.sqf b/addons/map/functions/fnc_mapStateUpdater.sqf new file mode 100644 index 0000000000..efc5efb956 --- /dev/null +++ b/addons/map/functions/fnc_mapStateUpdater.sqf @@ -0,0 +1,40 @@ + +#include "script_component.hpp" + +if (visibleMap) then { + // Show/Hide draw buttons + if ("ACE_MapTools" in items ACE_player) then { + { ((finddisplay 12) displayctrl _x) ctrlShow true; } forEach GVAR(drawing_controls); + } else { + { ((finddisplay 12) displayctrl _x) ctrlShow false; } forEach GVAR(drawing_controls); + if (GVAR(drawing_isDrawing)) then { + call FUNC(cancelDrawing); + }; + }; +}; + +//When Map is Closed: +if (GVAR(mapVisableLastFrame) && (!visibleMap)) then { + GVAR(mapVisableLastFrame) = false; + // Hide GPS + [false] call FUNC(openMapGps); + // Hide Map tools + deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED; + deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL; + deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL; + GVAR(mapTool_markerRotatingFixed) = nil; + GVAR(mapTool_markerRotatingNormal) = nil; + GVAR(mapTool_markerRotatingSmall) = nil; + // Cancel drawing + call FUNC(cancelDrawing); +}; + +//When Map is Opened: +if ((!GVAR(mapVisableLastFrame)) && (visibleMap)) then { + //todo: "mapOpened" Event???? + GVAR(mapVisableLastFrame) = true; + // Show and update map tools if required + [] call FUNC(updateMapToolMarkers); + // Show GPS if required + [GVAR(mapGpsShow)] call FUNC(openMapGps); +}; diff --git a/addons/map/functions/fnc_openMapGps.sqf b/addons/map/functions/fnc_openMapGps.sqf new file mode 100644 index 0000000000..c89416401b --- /dev/null +++ b/addons/map/functions/fnc_openMapGps.sqf @@ -0,0 +1,25 @@ +/* +* Author: CAA-Picard +* +* Opens or closes the gps on the map screen, showing coordinates +* +* Argument: +* 0: Open GPS? (Boolean) +* +* Return value: +* Nothing +*/ + +#include "script_component.hpp" + +_shouldOpenGps = _this select 0; +_isOpen = !(isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])); + +if (_shouldOpenGps && {"ItemGPS" in assignedItems ACE_player} && {!_isOpen}) then { + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutRsc ["RscACE_MapGps","PLAIN"]; + + [FUNC(openMapGpsUpdate), 0.5, []] call CBA_fnc_addPerFrameHandler; //update bearing/altitude every 0.5 sec (ticktime) +} else { + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; +}; + diff --git a/addons/map/functions/fnc_openMapGpsUpdate.sqf b/addons/map/functions/fnc_openMapGpsUpdate.sqf new file mode 100644 index 0000000000..ea022b4cf2 --- /dev/null +++ b/addons/map/functions/fnc_openMapGpsUpdate.sqf @@ -0,0 +1,18 @@ +//CAA-Picard +//update gps display + +#include "script_component.hpp" + +if ((!("ItemGPS" in assigneditems ACE_player)) || {isNull (uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull])}) exitWith { + ("RscACE_MapGps" call BIS_fnc_rscLayer) cutText ["","PLAIN"]; //close GPS RSC + [(_this select 1)] call CBA_fnc_removePerFrameHandler; //remove frameHandler +}; +disableSerialization; + +_mapGpsDisplay = uiNamespace getVariable [QGVAR(ui_mapGpsDisplay), displayNull]; +_ctrl = _mapGpsDisplay displayCtrl 913590; +_ctrl ctrlSetText str(round(getDir player)); //set Heading +_ctrl = _mapGpsDisplay displayCtrl 913591; +_ctrl ctrlSetText str(round((getPosASL player) select 2)); //set Altitude +_ctrl = _mapGpsDisplay displayCtrl 913592; +_ctrl ctrlSetText mapGridPosition player; //set grid cords diff --git a/addons/map/functions/fnc_removeLineMarker.sqf b/addons/map/functions/fnc_removeLineMarker.sqf new file mode 100644 index 0000000000..124d4b031c --- /dev/null +++ b/addons/map/functions/fnc_removeLineMarker.sqf @@ -0,0 +1,31 @@ +/* + * Author: CAA-Picard + * + * Remove the line marker + * + * Argument: + * 0: Marker Name (string) + * + * Return value: + * Return + */ + +#include "script_component.hpp" + + _name = _this select 0; + + deleteMarkerLocal _name; +{ + if ((_x select 0) == _name) exitWith { + GVAR(drawing_lineMarkers) = GVAR(drawing_lineMarkers) - [_x]; + }; +} forEach GVAR(drawing_lineMarkers); + +if (isServer && GVAR(drawing_syncMarkers)) then { + { + if ((_x select 0) == _name) exitWith { + GVAR(drawing_serverLineMarkers) = GVAR(drawing_serverLineMarkers) - [_x]; + publicVariable QGVAR(drawing_serverLineMarkers); + }; + } forEach GVAR(drawing_serverLineMarkers); +}; diff --git a/TO_MERGE/agm/Map/functions/fn_updateLineMarker.sqf b/addons/map/functions/fnc_updateLineMarker.sqf similarity index 90% rename from TO_MERGE/agm/Map/functions/fn_updateLineMarker.sqf rename to addons/map/functions/fnc_updateLineMarker.sqf index 45d3797b2f..34c8be2a04 100644 --- a/TO_MERGE/agm/Map/functions/fn_updateLineMarker.sqf +++ b/addons/map/functions/fnc_updateLineMarker.sqf @@ -13,6 +13,8 @@ * Return */ +#include "script_component.hpp" + _name = _this select 0; _startPos = _this select 1; _difPos = (_this select 2) vectorDiff _startPos ; @@ -20,7 +22,7 @@ _name setMarkerShapeLocal "RECTANGLE"; _name setMarkerAlphaLocal 1; -_name setMarkerColorLocal AGM_Map_drawColor; +_name setMarkerColorLocal GVAR(drawing_drawColor); _name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5)); _mag = vectorMagnitude _difPos; if (_mag > 0) then { diff --git a/addons/map/functions/fnc_updateMapToolMarkers.sqf b/addons/map/functions/fnc_updateMapToolMarkers.sqf new file mode 100644 index 0000000000..a167a8eb45 --- /dev/null +++ b/addons/map/functions/fnc_updateMapToolMarkers.sqf @@ -0,0 +1,73 @@ +/* + * Author: CAA-Picard + * + * Update the map tool markers, position, size, rotation and visibility. + * + * Argument: + * None + * + * Return value: + * Nothing + */ + +#include "script_component.hpp" + +#define TEXTURE_WIDTH_IN_M 6205 +#define CENTER_OFFSET_Y_PERC 0.1606 +#define CONSTANT_SCALE 0.2 + +// If markers exist and they should'nt, delete them +if (!("ACE_MapTools" in items ACE_player) || {GVAR(mapTool_Shown) == 0}) then { + // If markers exist, delete them + if (!isNil QGVAR(mapTool_markerRotatingFixed)) then { + deleteMarkerLocal MARKERNAME_MAPTOOL_FIXED; + GVAR(mapTool_markerRotatingFixed) = nil; + }; +}; +if (!("ACE_MapTools" in items ACE_player) || {GVAR(mapTool_Shown) != 1}) then { + if (!isNil QGVAR(mapTool_markerRotatingNormal)) then { + deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGNORMAL; + GVAR(mapTool_markerRotatingNormal) = nil; + }; +}; +if (!("ACE_MapTools" in items ACE_player) || {GVAR(mapTool_Shown) != 2}) then { + if (!isNil QGVAR(mapTool_markerRotatingSmall)) then { + deleteMarkerLocal MARKERNAME_MAPTOOL_ROTATINGSMALL; + GVAR(mapTool_markerRotatingSmall) = nil; + }; +}; + +if (!("ACE_MapTools" in items ACE_player)|| {GVAR(mapTool_Shown) == 0}) exitWith {}; + +// If markers don't exist and should, create them +if (isNil QGVAR(mapTool_markerRotatingFixed)) then { + GVAR(mapTool_markerRotatingFixed) = createMarkerLocal [MARKERNAME_MAPTOOL_FIXED, GVAR(mapTool_pos)]; + MARKERNAME_MAPTOOL_FIXED setMarkerType MARKERNAME_MAPTOOL_FIXED; +}; +if ((isNil QGVAR(mapTool_markerRotatingNormal)) && {GVAR(mapTool_Shown) == 1}) then { + GVAR(mapTool_markerRotatingNormal) = createMarkerLocal [MARKERNAME_MAPTOOL_ROTATINGNORMAL, GVAR(mapTool_pos)]; + MARKERNAME_MAPTOOL_ROTATINGNORMAL setMarkerType MARKERNAME_MAPTOOL_ROTATINGNORMAL; +}; +if ((isNil QGVAR(mapTool_markerRotatingSmall)) && {GVAR(mapTool_Shown) == 2}) then { + GVAR(mapTool_markerRotatingSmall) = createMarkerLocal [MARKERNAME_MAPTOOL_ROTATINGSMALL, GVAR(mapTool_pos)]; + MARKERNAME_MAPTOOL_ROTATINGSMALL setMarkerType MARKERNAME_MAPTOOL_ROTATINGSMALL; +}; + +_rotatingMarker = [MARKERNAME_MAPTOOL_ROTATINGNORMAL, MARKERNAME_MAPTOOL_ROTATINGSMALL] select (GVAR(mapTool_Shown) - 1); +_textureWidth = [TEXTURE_WIDTH_IN_M, TEXTURE_WIDTH_IN_M / 2] select (GVAR(mapTool_Shown) - 1); + +// Update scale of both parts +_scale = _textureWidth * CONSTANT_SCALE * (call FUNC(calculateMapScale)); +MARKERNAME_MAPTOOL_FIXED setMarkerSizeLocal [_scale,_scale]; +_rotatingMarker setMarkerSizeLocal [_scale,_scale]; + +// Position of the fixed part +_xPos = GVAR(mapTool_pos) select 0; +_yPos = (GVAR(mapTool_pos) select 1) + _textureWidth * CENTER_OFFSET_Y_PERC; +MARKERNAME_MAPTOOL_FIXED setMarkerPosLocal [_xPos,_yPos]; + +// Position and rotation of the rotating part +_xPos = (GVAR(mapTool_pos) select 0) + sin(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; +_yPos = (GVAR(mapTool_pos) select 1) + cos(GVAR(mapTool_angle)) * _textureWidth * CENTER_OFFSET_Y_PERC; +_rotatingMarker setMarkerPosLocal [_xPos,_yPos]; +_rotatingMarker setMarkerDirLocal GVAR(mapTool_angle); diff --git a/addons/map/functions/script_component.hpp b/addons/map/functions/script_component.hpp new file mode 100644 index 0000000000..a9d4b1f265 --- /dev/null +++ b/addons/map/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\map\script_component.hpp" diff --git a/addons/map/script_component.hpp b/addons/map/script_component.hpp new file mode 100644 index 0000000000..0c8f7429ab --- /dev/null +++ b/addons/map/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT map +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MAP + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAP + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAP +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" + + +#define MARKERNAME_MAPTOOL_FIXED "ACE_MapToolFixed" +#define MARKERNAME_MAPTOOL_ROTATINGNORMAL "ACE_MapToolRotatingNormal" +#define MARKERNAME_MAPTOOL_ROTATINGSMALL "ACE_MapToolRotatingSmall" diff --git a/TO_MERGE/agm/Map/stringtable.xml b/addons/map/stringtable.xml similarity index 93% rename from TO_MERGE/agm/Map/stringtable.xml rename to addons/map/stringtable.xml index c70a07c64e..afc6c2cec2 100644 --- a/TO_MERGE/agm/Map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -1,8 +1,8 @@  - + - + Map Tools Herramientas de mapa Outils de navigation @@ -14,7 +14,7 @@ Térképészeti eszközök Инструменты карты - + The Map Tools allow you to measure distances and angles on the map. Las herramientas de mapa permiten medir distancias y ángulos en el mapa. Les outils de navigation permettent de mesurer des distances et des angles sur la carte. @@ -26,7 +26,7 @@ A térképészeti eszközökkel távolságokat és szögeket tud mérni a térképen. Картографические инструменты позволяют измерять расстояния и углы на карте. - + Map Tools >> Herramientas de mapa >> Outils de navigation >> @@ -38,7 +38,7 @@ Térképészeti eszközök >> Инструменты карты >> - + Hide Map Tool Verstecke Kartenwerkzeug Ocultar herr. de mapa @@ -50,7 +50,7 @@ Schovat pomůcku k mapě Скрыть инструменты - + Show Normal Map Tool Zeige Kartenwerkzeug (normal) Mostrar herr. de mapa normal @@ -62,7 +62,7 @@ Zobrazit normální pomůcku k mapě Показать инструменты (средн. размер) - + Show Small Map Tool Zeige Kartenwerkzeug (klein) Mostrar herr. de mapa pequeñas @@ -74,7 +74,7 @@ Zobrazit malou pomůcku k mapě Показать инструменты (малый размер) - + Align Map Tool to North Kartenwerkzeug nach Norden ausrichten Alinear herr. de mapa al norte @@ -86,7 +86,7 @@ Srovnat pomůcku k mapě na sever Выровнять инструменты на север - + Align Map Tool to Compass Kartenwerkzeug am Kompass ausrichten Alinear herr. de mapa a la brújula @@ -98,7 +98,7 @@ Srovnat pomůcku k mapě ke kompasu Выровнять инструменты по компасу - + Show GPS on Map Zeige GPS auf der Karte Mostrar el GPS sobre el mapa @@ -110,7 +110,7 @@ Zobrazit GPS na mapě Показать GPS на карте - + Hide GPS on Map Verstecke GPS auf der Karte Ocultar el GPS del mapa @@ -122,7 +122,7 @@ Schovat GPS na mapě Скрыть GPS на карте - + Copy Map Karte kopieren Copiar mapa @@ -134,7 +134,7 @@ Térkép másolása Copiar Mapa - + Direction: %1° Drehung: %1° Direction: %1° diff --git a/addons/missileguidance/config.cpp b/addons/missileguidance/config.cpp index be4ccc5a22..6720559ccc 100644 --- a/addons/missileguidance/config.cpp +++ b/addons/missileguidance/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common", "ace_laser" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/movement/$PBOPREFIX$ b/addons/movement/$PBOPREFIX$ new file mode 100644 index 0000000000..5898817efe --- /dev/null +++ b/addons/movement/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\movement \ No newline at end of file diff --git a/addons/movement/CfgEventHandlers.hpp b/addons/movement/CfgEventHandlers.hpp new file mode 100644 index 0000000000..0cd959a047 --- /dev/null +++ b/addons/movement/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/movement/CfgFatigue.hpp b/addons/movement/CfgFatigue.hpp new file mode 100644 index 0000000000..288462ccb9 --- /dev/null +++ b/addons/movement/CfgFatigue.hpp @@ -0,0 +1,11 @@ + +class CfgFatigue { + MinValue1 = 0.2; + MinValue2 = 0.8; + NormalRunSpeed = 7.2; + TiredRunSpeedLimit = 0.8; + FrequencyMin = 0.2; + FrequencyMax = 1.0; + TotalLoadCoef = 1.1; + MaxDuty = 10; +}; diff --git a/addons/movement/CfgInventoryGlobalVariable.hpp b/addons/movement/CfgInventoryGlobalVariable.hpp new file mode 100644 index 0000000000..1210f3df58 --- /dev/null +++ b/addons/movement/CfgInventoryGlobalVariable.hpp @@ -0,0 +1,4 @@ + +class CfgInventoryGlobalVariable { + maxSoldierLoad = 1200; +}; diff --git a/addons/movement/CfgMoves.hpp b/addons/movement/CfgMoves.hpp new file mode 100644 index 0000000000..9d32d4e856 --- /dev/null +++ b/addons/movement/CfgMoves.hpp @@ -0,0 +1,117 @@ + +class CfgMovesBasic { + class ManActions { + ACE_Climb = "ACE_Climb"; + }; + + class Actions { + class RifleStandActionsNoAdjust; + class RifleLowStandActionsNoAdjust; + + // WEAPON RAISED - RUNNING + class RifleStandActionsRunF: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandActionsRunFL: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandActionsRunFR: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + // WEAPON RAISED - SPRINTING + class RifleStandEvasiveActionsF: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandEvasiveActionsFL: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleStandEvasiveActionsFR: RifleStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + // WEAPON LOWERED - RUNNING + class RifleLowStandActionsRunF: RifleLowStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleLowStandActionsRunFL: RifleLowStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + class RifleLowStandActionsRunFR: RifleLowStandActionsNoAdjust { + getOver = "AovrPercMrunSrasWrflDf"; + }; + }; +}; + +class CfgMovesMaleSdr: CfgMovesBasic { + class StandBase; + class States { + // better slow walk with lowered rifle animation + class AmovPercMstpSrasWrflDnon; + class AmovPercMrunSrasWrflDf: AmovPercMstpSrasWrflDnon { + InterpolateTo[] = {"AovrPercMrunSrasWrflDf",0.22,"AmovPercMrunSlowWrflDf",0.025,"AmovPercMwlkSrasWrflDf",0.025,"AmovPknlMrunSrasWrflDf",0.03,"AmovPercMrunSlowWrflDf_AmovPpneMstpSrasWrflDnon",0.02,"AmovPercMevaSrasWrflDf",0.025,"Unconscious",0.01,"AmovPercMtacSrasWrflDf",0.02,"AmovPercMrunSrasWrflDfl",0.02,"AmovPercMrunSrasWrflDfl_ldst",0.02,"AmovPercMrunSrasWrflDfr",0.02,"AmovPercMrunSrasWrflDfr_ldst",0.02,"AmovPercMstpSrasWrflDnon",0.02,"AmovPercMrunSrasWrflDl",0.02,"AmovPercMrunSrasWrflDbl",0.02,"AmovPercMrunSrasWrflDb",0.02,"AmovPercMrunSrasWrflDbr",0.02,"AmovPercMrunSrasWrflDr",0.02,"AmovPknlMstpSlowWrflDnon_relax",0.1,"AmovPercMrunSrasWrflDf_ldst",0.02,"AmovPercMrunSrasWrflDf",0.02}; + }; + + class AmovPercMstpSlowWrflDnon; + class AmovPercMwlkSlowWrflDf: AmovPercMstpSlowWrflDnon { + speed = 0.3; //0.206897; + file = "\A3\anims_f\Data\Anim\Sdr\Mov\Erc\Wlk\Low\Rfl\AmovPercMwlkSlowWrflDf_ver2"; + leftHandIKCurve[] = {1}; + }; + class AmovPercMwlkSlowWrflDfl: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDfr: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDb: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDbl: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDbr: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDl: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + class AmovPercMwlkSlowWrflDr: AmovPercMwlkSlowWrflDf { + leftHandIKCurve[] = {}; + }; + + // enable optics in prone left and right stance + class AidlPpneMstpSrasWrflDnon_G0S; + class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S { + enableOptics = 1; + }; + class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S { + enableOptics = 1; + }; + class AadjPpneMstpSrasWrflDup; + class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup { + enableOptics = 1; + }; + + class AidlPpneMstpSrasWpstDnon_G0S; + class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S { + enableOptics = 2; + }; + class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S { + enableOptics = 2; + }; + class AadjPpneMstpSrasWpstDup; + class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup { + enableOptics = 2; + }; + + // climb animation + class AmovPercMstpSnonWnonDnon: StandBase { + ConnectTo[] += {"ACE_Climb",0.02}; + }; + + class AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium; + class ACE_Climb: AmovPercMstpSnonWnonDnon_AcrgPknlMstpSnonWnonDnon_getInMedium { + canReload = 0; + forceAim = 1; + }; + }; +}; diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf new file mode 100644 index 0000000000..edf1991006 --- /dev/null +++ b/addons/movement/XEH_postInit.sqf @@ -0,0 +1,19 @@ +//by commy2 +#include "script_component.hpp" + +["inventoryDisplayLoaded", { + + [{ + private "_dialog"; + + _dialog = _this select 0; + + if (isNull _dialog) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + _dialog displayCtrl 111 ctrlSetText format ["%1 - %2 %3", [ACE_player] call EFUNC(common,getName), localize "STR_ACE_Movement_Weight", [ACE_player] call FUNC(getWeight)]; + + }, 0, _this select 0] call CBA_fnc_addPerFrameHandler; + +}] call EFUNC(common,addEventHandler); diff --git a/addons/movement/XEH_preInit.sqf b/addons/movement/XEH_preInit.sqf new file mode 100644 index 0000000000..e4c6a2f056 --- /dev/null +++ b/addons/movement/XEH_preInit.sqf @@ -0,0 +1,6 @@ +#include "script_component.hpp" + +PREP(getWeight); +PREP(canClimb); +PREP(climb); +PREP(handleClimb); diff --git a/addons/movement/config.cpp b/addons/movement/config.cpp new file mode 100644 index 0000000000..7137d44469 --- /dev/null +++ b/addons/movement/config.cpp @@ -0,0 +1,37 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2","KoffeinFlummi","Tachii"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgFatigue.hpp" +//#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 { + displayName = "$STR_ACE_Movement_UseImperial"; + default = 0; + }; +}; diff --git a/TO_MERGE/agm/Movement/functions/fn_canClimb.sqf b/addons/movement/functions/fnc_canClimb.sqf similarity index 95% rename from TO_MERGE/agm/Movement/functions/fn_canClimb.sqf rename to addons/movement/functions/fnc_canClimb.sqf index 271a26e221..bd62bfb768 100644 --- a/TO_MERGE/agm/Movement/functions/fn_canClimb.sqf +++ b/addons/movement/functions/fnc_canClimb.sqf @@ -1,4 +1,5 @@ // by commy2 +#include "script_component.hpp" private ["_unit", "_pos", "_dir"]; diff --git a/addons/movement/functions/fnc_climb.sqf b/addons/movement/functions/fnc_climb.sqf new file mode 100644 index 0000000000..8a2988f00f --- /dev/null +++ b/addons/movement/functions/fnc_climb.sqf @@ -0,0 +1,22 @@ +// by commy2 +#include "script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +if !([_unit] call FUNC(canClimb)) exitWith { + [localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured); +}; + +if !(_unit getVariable ["ACE_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] call EFUNC(common,fixLoweredRifleAnimation); +[_unit, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); +[_unit, "ACE_Climb", 0] call EFUNC(common,doAnimation); diff --git a/addons/movement/functions/fnc_getWeight.sqf b/addons/movement/functions/fnc_getWeight.sqf new file mode 100644 index 0000000000..9cbd7939bb --- /dev/null +++ b/addons/movement/functions/fnc_getWeight.sqf @@ -0,0 +1,16 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weight"]; + +_unit = _this select 0; + +_weight = loadAbs _unit * 0.1; + +if (profileNamespace getVariable ["ACE_useImperial", false]) then { + _weight = format ["%1lb", (round (_weight * 100)) / 100]; +} else { + _weight = format ["%1kg", (round (_weight * FACTOR_POUND_TO_KILOGRAMM * 100)) / 100]; +}; + +_weight diff --git a/TO_MERGE/agm/Movement/functions/fn_handleClimb.sqf b/addons/movement/functions/fnc_handleClimb.sqf similarity index 70% rename from TO_MERGE/agm/Movement/functions/fn_handleClimb.sqf rename to addons/movement/functions/fnc_handleClimb.sqf index 3501fbee99..a96beccc2c 100644 --- a/TO_MERGE/agm/Movement/functions/fn_handleClimb.sqf +++ b/addons/movement/functions/fnc_handleClimb.sqf @@ -1,4 +1,5 @@ // by commy2 +#include "script_component.hpp" private ["_unit", "_anim", "_pos"]; @@ -6,7 +7,7 @@ _unit = _this select 0; _anim = _this select 1; _pos = _unit modelToWorld (_unit selectionPosition "camera"); -[_unit, "AmovPknlMstpSnonWnonDnon", 2] call AGM_Core_fnc_doAnimation; +[_unit, "AmovPknlMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); _pos = _pos vectorDiff (_unit selectionPosition "camera"); diff --git a/addons/movement/functions/script_component.hpp b/addons/movement/functions/script_component.hpp new file mode 100644 index 0000000000..d33fa99b30 --- /dev/null +++ b/addons/movement/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\movement\script_component.hpp" \ No newline at end of file diff --git a/addons/movement/script_component.hpp b/addons/movement/script_component.hpp new file mode 100644 index 0000000000..9b8954bf62 --- /dev/null +++ b/addons/movement/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT movement +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MOVEMENT + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_MOVEMENT + #define DEBUG_SETTINGS DEBUG_ENABLED_MOVEMENT +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define FACTOR_POUND_TO_KILOGRAMM 1/2.2046 diff --git a/TO_MERGE/agm/Movement/stringtable.xml b/addons/movement/stringtable.xml similarity index 88% rename from TO_MERGE/agm/Movement/stringtable.xml rename to addons/movement/stringtable.xml index 505a013950..d31896acaa 100644 --- a/TO_MERGE/agm/Movement/stringtable.xml +++ b/addons/movement/stringtable.xml @@ -1,8 +1,8 @@  - + - + Show weight in lb Zeige Gewicht in Pfund Mostrar peso en libras @@ -14,7 +14,7 @@ Súly megjelenítése fontban. Показать вес в фунтах - + Weight: Gewicht: Peso: @@ -26,7 +26,7 @@ Súly: Вес: - + Climb Klettern Wspinaczka @@ -34,7 +34,7 @@ Vylézt Подняться - + Can't climb here Kann hier nicht klettern Nie możesz wspiąć się tutaj diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index c9c34195f1..04d083dc01 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_main", "ace_common", "ace_interaction" }; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = { VERSION_AR }; author[] = { "commy2", "CAA-Picard" }; authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; }; }; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 9603dc7185..b81bedc07b 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -29,9 +29,9 @@ GVAR(ppEffectMuzzleFlash) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [0, 0, 0, 1], [ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; // Setup the event handlers -["playerInventoryChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); -["playerVisionModeChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); -["zeusDisplayChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); -["cameraViewChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); -["playerVehicleChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); -["playerTurretChanged", FUNC(updatePPEffects)] call EFUNC(common,addEventHandler); +["playerInventoryChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["playerVisionModeChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["zeusDisplayChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["cameraViewChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); +["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler); diff --git a/addons/nightvision/config.cpp b/addons/nightvision/config.cpp index d5a2274b55..32c563bfb6 100644 --- a/addons/nightvision/config.cpp +++ b/addons/nightvision/config.cpp @@ -4,7 +4,7 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2", "KoffeinFlummi", "PabstMirror"}; authorUrl = "https://github.com/commy2/"; diff --git a/addons/overheating/XEH_preInit.sqf b/addons/overheating/XEH_preInit.sqf index 9b2c410ab4..fb3c53040d 100644 --- a/addons/overheating/XEH_preInit.sqf +++ b/addons/overheating/XEH_preInit.sqf @@ -3,8 +3,8 @@ PREP(checkTemperature); PREP(clearJam); PREP(cooldown); +PREP(displayTemperature); PREP(jamWeapon); PREP(overheat); -PREP(pfhDisplayTemperature); PREP(swapBarrel); PREP(swapBarrelCallback); diff --git a/addons/overheating/functions/fnc_checkTemperature.sqf b/addons/overheating/functions/fnc_checkTemperature.sqf index b2cf0f80c5..92b6d1727e 100644 --- a/addons/overheating/functions/fnc_checkTemperature.sqf +++ b/addons/overheating/functions/fnc_checkTemperature.sqf @@ -25,4 +25,4 @@ if (_action == "") then { _player playActionNow _action; // Launch a PFH that waits a sec before displaying the temperature -[FUNC(pfhDisplayTemperature), 1.0, [_player, _weapon, diag_tickTime]] call CBA_fnc_addPerFrameHandler; +[FUNC(displayTemperature), [_player, _weapon], 1.0, 0] call EFUNC(common,waitAndExecute); \ No newline at end of file diff --git a/addons/overheating/functions/fnc_pfhDisplayTemperature.sqf b/addons/overheating/functions/fnc_displayTemperature.sqf similarity index 83% rename from addons/overheating/functions/fnc_pfhDisplayTemperature.sqf rename to addons/overheating/functions/fnc_displayTemperature.sqf index 1a03069624..130eec5f39 100644 --- a/addons/overheating/functions/fnc_pfhDisplayTemperature.sqf +++ b/addons/overheating/functions/fnc_displayTemperature.sqf @@ -1,7 +1,7 @@ /* * Author: Commy2 and CAA-Picard * - * PFH that displays the weapon temperature after a slight delay + * Displays the weapon temperature * * Arguments: * 0: _player @@ -13,14 +13,7 @@ */ #include "\z\ace\addons\overheating\script_component.hpp" -EXPLODE_2_PVT(_this,_params,_pfhId); -EXPLODE_3_PVT(_params,_player,_weapon,_startTime); - -// Skip the first execution of the PFH -if (diag_tickTime < _startTime + 0.5) exitWith {}; - -// Remove the PFH on the second execution -[_pfhId] call cba_fnc_removePerFrameHandler; +EXPLODE_2_PVT(_this,_player,_weapon); // Calculate cool down of weapon since last shot private ["_string", "_overheat", "_temperature", "_time", "_barrelMass"]; diff --git a/addons/recoil/config.cpp b/addons/recoil/config.cpp index 40defea1fb..db08a49143 100644 --- a/addons/recoil/config.cpp +++ b/addons/recoil/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; - requiredAddons[] = {ace_common}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; author[] = {"KoffeinFlummi", "TaoSensai", "commy2"}; authorUrl = "https://github.com/Taosenai/tmr"; + VERSION_CONFIG; }; }; diff --git a/addons/respawn/config.cpp b/addons/respawn/config.cpp index 2391af350f..0d914df949 100644 --- a/addons/respawn/config.cpp +++ b/addons/respawn/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = { "ACE_Rallypoint_West", "ACE_Rallypoint_East", "ACE_Rallypoint_Independent", "ACE_RallypointExit_West", "ACE_RallypointExit_East", "ACE_RallypointExit_Independent" }; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_common" }; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = { VERSION_AR }; author[] = { "bux578", "commy2" }; authorUrl = "https://github.com/bux578/"; + VERSION_CONFIG; }; }; diff --git a/addons/safemode/$PBOPREFIX$ b/addons/safemode/$PBOPREFIX$ new file mode 100644 index 0000000000..361237305d --- /dev/null +++ b/addons/safemode/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\safemode \ No newline at end of file diff --git a/addons/safemode/CfgEventHandlers.hpp b/addons/safemode/CfgEventHandlers.hpp new file mode 100644 index 0000000000..eefe61652b --- /dev/null +++ b/addons/safemode/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 { + clientInit = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf new file mode 100644 index 0000000000..94e6b789bd --- /dev/null +++ b/addons/safemode/XEH_postInit.sqf @@ -0,0 +1,5 @@ + +// by commy2 + +//["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" diff --git a/addons/safemode/XEH_preInit.sqf b/addons/safemode/XEH_preInit.sqf new file mode 100644 index 0000000000..bc80c4269d --- /dev/null +++ b/addons/safemode/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +PREP(firstMode); +PREP(lockSafety); +PREP(playChangeFiremodeSound); +PREP(setSafeModeVisual); +PREP(unlockSafety); diff --git a/addons/safemode/config.cpp b/addons/safemode/config.cpp new file mode 100644 index 0000000000..d61a386e20 --- /dev/null +++ b/addons/safemode/config.cpp @@ -0,0 +1,28 @@ +#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" + +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/TO_MERGE/agm/SafeMode/functions/fn_firstMode.sqf b/addons/safemode/functions/fnc_firstMode.sqf similarity index 62% rename from TO_MERGE/agm/SafeMode/functions/fn_firstMode.sqf rename to addons/safemode/functions/fnc_firstMode.sqf index 9e5644da15..821090dd32 100644 --- a/TO_MERGE/agm/SafeMode/functions/fn_firstMode.sqf +++ b/addons/safemode/functions/fnc_firstMode.sqf @@ -1,9 +1,9 @@ // by commy2 +#include "script_component.hpp" -private ["_weapon", "_mode"]; - -_weapon = _this select 0; +EXPLODE_1_PVT(_this,_weapon); +private ["_mode"]; _mode = getArray (configFile >> "CfgWeapons" >> _weapon >> "modes") select 0; [_mode, _weapon] select (_mode == "this") diff --git a/addons/safemode/functions/fnc_lockSafety.sqf b/addons/safemode/functions/fnc_lockSafety.sqf new file mode 100644 index 0000000000..0e365fc221 --- /dev/null +++ b/addons/safemode/functions/fnc_lockSafety.sqf @@ -0,0 +1,63 @@ +// by commy2 +#include "script_component.hpp" + +EXPLODE_3_PVT(_this,_unit,_weapon,_muzzle); + +// don't immediately switch back +if (inputAction "nextWeapon" > 0) exitWith {}; + +private ["_safedWeapons"]; +_safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; + +if (_weapon in _safedWeapons) exitWith { + _this call FUNC(unlockSafety); +}; + +_safedWeapons pushBack _weapon; + +_unit setVariable [QGVAR(safedWeapons), _safedWeapons]; + +if (_unit getVariable [QGVAR(actionID), -1] == -1) then { + private ["_condition", "_statement", "_id"]; + + _condition = { + if ( + [_this select 1] call EFUNC(common,canUseWeapon) + && { + if (currentMuzzle (_this select 1) in ((_this select 1) getVariable [QGVAR(safedWeapons), []])) then { + if (inputAction "nextWeapon" > 0) exitWith { + [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + false + }; + true + } else {false} + } + ) then { + // player hud + [false] call FUNC(setSafeModeVisual); + true + } else { + // player hud + [true] call FUNC(setSafeModeVisual); + false + } + }; + + _statement = { + [_this select 1, currentWeapon (_this select 1), currentMuzzle (_this select 1)] call FUNC(unlockSafety); + }; + + //_id = [_unit, format ["%1", localize "STR_ACE_SafeMode_TakeOffSafety"], "DefaultAction", _condition, {}, {true}, _statement, 10] call EFUNC(common,addActionMenuEventHandler); + _id = [_unit, "DefaultAction", _condition, {}] call EFUNC(common,addActionEventHandler); + + _unit setVariable [QGVAR(actionID), _id]; +}; + +_unit selectWeapon _muzzle;//_weapon + +// play fire mode selector sound +[_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); + +private "_picture"; +_picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); +[localize "STR_ACE_SafeMode_PutOnSafety", _picture] call EFUNC(common,displayTextPicture); diff --git a/TO_MERGE/agm/SafeMode/functions/fn_playChangeFiremodeSound.sqf b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf similarity index 87% rename from TO_MERGE/agm/SafeMode/functions/fn_playChangeFiremodeSound.sqf rename to addons/safemode/functions/fnc_playChangeFiremodeSound.sqf index e8fecf4c13..c0b58604b9 100644 --- a/TO_MERGE/agm/SafeMode/functions/fn_playChangeFiremodeSound.sqf +++ b/addons/safemode/functions/fnc_playChangeFiremodeSound.sqf @@ -1,14 +1,13 @@ // by commy2 +#include "script_component.hpp" -private ["_unit", "_weapon", "_sound"]; - -_unit = _this select 0; -_weapon = _this select 1; +EXPLODE_2_PVT(_this,_unit,_weapon); +private ["_sound"]; _sound = getArray (configFile >> "CfgWeapons" >> _weapon >> "changeFiremodeSound"); if (count _sound == 0) exitWith { - playSound "AGM_Sound_Click"; + playSound "ACE_Sound_Click"; }; // add file extension @@ -27,7 +26,6 @@ if (count _sound < 3) then {_sound pushBack 1}; if (count _sound < 4) then {_sound pushBack 0}; private "_position"; - _position = _unit modelToWorld (_unit selectionPosition "RightHand"); _position set [2, (_position select 2) + ((getPosASLW _unit select 2) - (getPosATL _unit select 2) max 0)]; diff --git a/TO_MERGE/agm/SafeMode/functions/fn_setSafeModeVisual.sqf b/addons/safemode/functions/fnc_setSafeModeVisual.sqf similarity index 77% rename from TO_MERGE/agm/SafeMode/functions/fn_setSafeModeVisual.sqf rename to addons/safemode/functions/fnc_setSafeModeVisual.sqf index 6ea156abe5..ae449e05e8 100644 --- a/TO_MERGE/agm/SafeMode/functions/fn_setSafeModeVisual.sqf +++ b/addons/safemode/functions/fnc_setSafeModeVisual.sqf @@ -1,11 +1,12 @@ // by commy2 +#include "script_component.hpp" -private ["_show", "_control"]; - -_show = _this select 0; +EXPLODE_1_PVT(_this,_show); disableSerialization; -_control = (uiNamespace getVariable ["AGM_dlgSoldier", displayNull]) displayCtrl 187; + +private ["_control"]; +_control = (uiNamespace getVariable ["ACE_dlgSoldier", displayNull]) displayCtrl 187; if (isNull _control) exitWith {}; diff --git a/TO_MERGE/agm/SafeMode/functions/fn_unlockSafety.sqf b/addons/safemode/functions/fnc_unlockSafety.sqf similarity index 59% rename from TO_MERGE/agm/SafeMode/functions/fn_unlockSafety.sqf rename to addons/safemode/functions/fnc_unlockSafety.sqf index 89a8cc0206..341cad182f 100644 --- a/TO_MERGE/agm/SafeMode/functions/fn_unlockSafety.sqf +++ b/addons/safemode/functions/fnc_unlockSafety.sqf @@ -1,25 +1,23 @@ // by commy2 +#include "script_component.hpp" -private ["_unit", "_weapon", "_muzzle", "_safedWeapons"]; +EXPLODE_3_PVT(_this,_unit,_weapon,_muzzle); -_unit = _this select 0; -_weapon = _this select 1; -_muzzle = _this select 2; - -_safedWeapons = _unit getVariable ["AGM_SafeMode_safedWeapons", []]; +private ["_safedWeapons"]; +_safedWeapons = _unit getVariable [QGVAR(safedWeapons), []]; if (_weapon in _safedWeapons) then { _safedWeapons = _safedWeapons - [_weapon]; - _unit setVariable ["AGM_SafeMode_safedWeapons", _safedWeapons]; + _unit setVariable [QGVAR(safedWeapons), _safedWeapons]; if (count _safedWeapons == 0) then { private "_id"; - _id = _unit getVariable ["AGM_SafeWeapon_actionID", -1]; + _id = _unit getVariable [QGVAR(actionID), -1]; - //[_unit, "DefaultAction", _id] call AGM_Core_fnc_removeActionMenuEventHandler; - [_unit, "DefaultAction", _id] call AGM_Core_fnc_removeActionEventHandler; - _unit setVariable ["AGM_SafeWeapon_actionID", -1]; + //[_unit, "DefaultAction", _id] call EFUNC(common,removeActionMenuEventHandler); + [_unit, "DefaultAction", _id] call EFUNC(common,removeActionEventHandler); + _unit setVariable [QGVAR(actionID), -1]; }; }; @@ -53,12 +51,12 @@ if (inputAction "nextWeapon" > 0) then { }; } else { // play fire mode selector sound - [_unit, _weapon, _muzzle] call AGM_SafeMode_fnc_playChangeFiremodeSound; + [_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound); }; // player hud -[true] call AGM_SafeMode_fnc_setSafeModeVisual; +[true] call FUNC(setSafeModeVisual); private "_picture"; _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture"); -[localize "STR_AGM_SafeMode_TookOffSafety", _picture] call AGM_Core_fnc_displayTextPicture; +[localize "STR_ACE_SafeMode_TookOffSafety", _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/safemode/functions/script_component.hpp b/addons/safemode/functions/script_component.hpp new file mode 100644 index 0000000000..a25fbfa4c7 --- /dev/null +++ b/addons/safemode/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\safemode\script_component.hpp" \ No newline at end of file diff --git a/addons/safemode/script_component.hpp b/addons/safemode/script_component.hpp new file mode 100644 index 0000000000..f76396afdf --- /dev/null +++ b/addons/safemode/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT safemode +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SAFEMODE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SAFEMODE + #define DEBUG_SETTINGS DEBUG_SETTINGS_SAFEMODE +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" diff --git a/TO_MERGE/agm/SafeMode/stringtable.xml b/addons/safemode/stringtable.xml similarity index 86% rename from TO_MERGE/agm/SafeMode/stringtable.xml rename to addons/safemode/stringtable.xml index ff3415831d..9684babfdf 100644 --- a/TO_MERGE/agm/SafeMode/stringtable.xml +++ b/addons/safemode/stringtable.xml @@ -1,8 +1,8 @@  - + - + Safe Mode Waffe sichern Seguro puesto @@ -11,7 +11,7 @@ Veszélytelenités Предохранитель - + Take off Safety Waffe entsichern Quitar seguro @@ -20,7 +20,7 @@ Veszélyesités Снять с предохранителя - + Put on Safety Waffe gesichert Poner seguro @@ -29,7 +29,7 @@ Veszélytelenitve Поставить на предохранитель - + Took off Safety Waffe entsichert Seguro quitado diff --git a/addons/scopes/$PBOPREFIX$ b/addons/scopes/$PBOPREFIX$ new file mode 100644 index 0000000000..48434ed1b1 --- /dev/null +++ b/addons/scopes/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\scopes \ No newline at end of file diff --git a/addons/scopes/CfgEventHandlers.hpp b/addons/scopes/CfgEventHandlers.hpp new file mode 100644 index 0000000000..204f2e267e --- /dev/null +++ b/addons/scopes/CfgEventHandlers.hpp @@ -0,0 +1,51 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; + +class Extended_Fired_EventHandlers { + class CAManBase { + class ADDON { + clientFired = QUOTE(if (_this select 0 == ACE_player) then { _this call FUNC(firedEH);};); + }; + }; +}; + +class Extended_Take_EventHandlers { + class CAManBase { + class ADDON { + clientTake = QUOTE(if (_this select 0 == ACE_player) then{ _this call FUNC(inventoryCheck);};); + }; + }; +}; + +class Extended_Put_EventHandlers { + class CAManBase { + class ADDON { + clientPut = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(inventoryCheck);};); + }; + }; +}; + +class Extended_InitPost_EventHandlers { + class CAManBase { + class ADDON { + init = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck);};); + }; + }; +}; + +class Extended_Respawn_EventHandlers { + class CAManBase { + class ADDON { + respawn = QUOTE(if (_this select 0 == call EFUNC(common,player)) then{ _this call FUNC(inventoryCheck);};); + }; + }; +}; diff --git a/addons/scopes/CfgSounds.hpp b/addons/scopes/CfgSounds.hpp new file mode 100644 index 0000000000..9063c7f730 --- /dev/null +++ b/addons/scopes/CfgSounds.hpp @@ -0,0 +1,12 @@ +class CfgSounds { + class ACE_Sound_Click; + class ACE_Scopes_Click_1: ACE_Sound_Click { + sound[] = {QUOTE(PATHTOF(sounds\ACE_scopes_click.wav)),3, 2, 200}; + }; + class ACE_Scopes_Click_2: ACE_Scopes_Click_1 { + sound[] = {QUOTE(PATHTOF(sounds\ACE_scopes_click.wav)), 3.3, 1.8, 200}; + }; + class ACE_Scopes_Click_3: ACE_Scopes_Click_1 { + sound[] = {QUOTE(PATHTOF(sounds\ACE_scopes_click.wav)), 2.8, 2.3, 200}; + }; +}; diff --git a/addons/scopes/CfgWeapons.hpp b/addons/scopes/CfgWeapons.hpp new file mode 100644 index 0000000000..67898fb449 --- /dev/null +++ b/addons/scopes/CfgWeapons.hpp @@ -0,0 +1,43 @@ +class CfgWeapons { + class ItemCore; + class InventoryOpticsItem_Base_F; + + class optic_LRPS : ItemCore { + ACE_ScopeAdjust_Horizontal[] = { -50, 50 }; + ACE_ScopeAdjust_Vertical[] = { -70, 70 }; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 1 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class optic_SOS : ItemCore { + ACE_ScopeAdjust_Horizontal[] = { -50, 50 }; + ACE_ScopeAdjust_Vertical[] = { -60, 60 }; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 1 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; + + class optic_DMS : ItemCore { + ACE_ScopeAdjust_Horizontal[] = { -40, 40 }; + ACE_ScopeAdjust_Vertical[] = { -40, 40 }; + class ItemInfo : InventoryOpticsItem_Base_F { + class OpticsModes { + class Snip { + discreteDistance[] = { 1 }; + discreteDistanceInitIndex = 0; + }; + }; + }; + }; +}; diff --git a/addons/scopes/RscTitles.hpp b/addons/scopes/RscTitles.hpp new file mode 100644 index 0000000000..daa028ab88 --- /dev/null +++ b/addons/scopes/RscTitles.hpp @@ -0,0 +1,76 @@ +class RscTitles { + class ACE_Scope_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)];); + duration = 1e+011; + fadein = 0; + fadeout = 0; + name = QGVAR(Zeroing); + class RscPicture; + class RscText; + class controls { + class ACE_Scopes_Zeroing_BG : RscPicture { + idc = 925001; + type = 0; + text = PATHTOF(UI\scopes_bg.paa); + style = 48 + 0x800; + scale = 1; + sizeEx = 1; + font = "PuristaMedium"; + colorText[] = { 1, 1, 1, 1 }; + colorBackground[] = { 1, 1, 1, 1 }; + shadow = 1; + + x = (0.5 - 0.4 / 2) * safezoneW + safezoneX; + y = 0 * safezoneH + safezoneY; + w = 0.4 * safezoneW; + h = 0.3 * safezoneH; + }; + class ACE_Scopes_Zeroing_Vertical : RscText { + idc = 925002; + type = 0; + style = 2; + sizeEx = 0.04; + lineSpacing = 1; + font = "PuristaMedium"; + text = ""; + colorText[] = { 1, 1, 1, 0.9 }; + colorBackground[] = { 1, 0, 0, 0 }; + shadow = 0; + + x = (0.5 - 0.4 / 2 + 0.45*0.4) * safezoneW + safezoneX; + y = (0 + 0.19*0.3) * safezoneH + safezoneY; + w = 0.04 * safezoneW; + h = 0.025 * safezoneH; + }; + class ACE_Scopes_Zeroing_Horizontal : RscText { + idc = 925003; + type = 0; + style = 0; + sizeEx = 0.04; + lineSpacing = 1; + font = "PuristaMedium"; + text = ""; + colorText[] = { 1, 1, 1, 0.9 }; + colorBackground[] = { 1, 0, 0, 0 }; + shadow = 0; + + x = (0.5 - 0.4 / 2 + 0.6*0.4) * safezoneW + safezoneX; + y = (0 + 0.47*0.3) * safezoneH + safezoneY; + w = 0.04 * safezoneW; + h = 0.025 * safezoneH; + }; + }; + }; +}; + +class RscInGameUI { + class RscUnitInfo; + class RscWeaponZeroing : RscUnitInfo { + onLoad = QUOTE([ARR_4('onLoad',_this,'RscUnitInfo','IGUI')] call compile preprocessfilelinenumbers 'A3\ui_f\scripts\initDisplay.sqf'; uiNamespace setVariable [ARR_2('ACE_dlgWeaponZeroing', _this select 0)]; ); + //onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgWeaponZeroing', _this select 0];"; + }; +}; diff --git a/TO_MERGE/agm/Scopes/UI/scopes_bg.paa b/addons/scopes/UI/scopes_bg.paa similarity index 100% rename from TO_MERGE/agm/Scopes/UI/scopes_bg.paa rename to addons/scopes/UI/scopes_bg.paa diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf new file mode 100644 index 0000000000..e93c7ef3dc --- /dev/null +++ b/addons/scopes/XEH_postInit.sqf @@ -0,0 +1,42 @@ +/* + * Author: KoffeinFlummi + * + * Initializes vars needed for scope adjustment and watches for scope changes. + * + * Arguments: + * None + * + * Return Value: + * None + */ + +#include "script_component.hpp" + +GVAR(fadeScript) = scriptNull; + +// show overlay after changing weapon/optic +0 spawn { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + while {True} do { + waitUntil {[ACE_player, 0,0] call FUNC(canAdjustScope)}; + _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; + sleep 3; + _layer cutFadeOut 2; + + _weapon = currentWeapon ACE_player; + _optics = [ACE_player] call FUNC(getOptics); + waitUntil {sleep 0.05; !(_optics isEqualTo ([ACE_player] call FUNC(getOptics))) or (currentWeapon ACE_player != _weapon)}; + }; +}; + +// instantly hide when scoping in +0 spawn { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + while {True} do { + waitUntil {sleep 0.05; cameraView == "GUNNER"}; + if !(isNull GVAR(fadeScript)) then { + terminate GVAR(fadeScript); + }; + _layer cutText ["", "PLAIN", 0]; + }; +}; diff --git a/addons/scopes/XEH_preInit.sqf b/addons/scopes/XEH_preInit.sqf new file mode 100644 index 0000000000..7cd5d3ca1a --- /dev/null +++ b/addons/scopes/XEH_preInit.sqf @@ -0,0 +1,8 @@ +#include "script_component.hpp" + +PREP(adjustScope); +PREP(canAdjustScope); +PREP(firedEH); +PREP(getOptics); +PREP(hideZeroing); +PREP(inventoryCheck); diff --git a/addons/scopes/config.cpp b/addons/scopes/config.cpp new file mode 100644 index 0000000000..7592ef06e9 --- /dev/null +++ b/addons/scopes/config.cpp @@ -0,0 +1,51 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { "ace_main", "ace_common" }; + author[] = {"KoffeinFlummi"}; + authorUrl = "https://github.com/KoffeinFlummi"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgSounds.hpp" +#include "CfgWeapons.hpp" + +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_adjustScope.sqf b/addons/scopes/functions/fnc_adjustScope.sqf new file mode 100644 index 0000000000..7db640590a --- /dev/null +++ b/addons/scopes/functions/fnc_adjustScope.sqf @@ -0,0 +1,69 @@ +/* + * Author: KoffeinFlummi + * + * Changes the adjustment for the current scope + * + * Arguments: + * 0: Horizontal adjustment + * 1: Vertical adjustment + * + * Return Value: + * True + */ + +#include "script_component.hpp" + +private ["_unit", "_weapons", "_zeroing", "_pitchbankyaw", "_pitch", "_bank", "_yaw", "_hint"]; + +_unit = _this select 0; + +_weapons = [ + primaryWeapon _unit, + secondaryWeapon _unit, + handgunWeapon _unit +]; + +if (isNil QGVAR(Adjustment)) then { + GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; +}; + +_zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon _unit)); +_zeroing set [0, (round (((_zeroing select 0) + (_this select 1)) * 10)) / 10]; +_zeroing set [1, (round (((_zeroing select 1) + (_this select 2)) * 10)) / 10]; + +GVAR(Adjustment) set [_weapons find (currentWeapon _unit), _zeroing]; + +playSound (["ACE_Scopes_Click_1", "ACE_Scopes_Click_2", "ACE_Scopes_Click_3"] select floor random 3); + +// slightly rotate the player if looking through optic +if (cameraView == "GUNNER") then { + _pitchbankyaw = [_unit] call EFUNC(common,getPitchBankYaw); + // these are not exact mil-to-degree conversions, but instead chosen + // to minimize the effect of rounding errors + _pitch = (_pitchbankyaw select 0) + ((_this select 2) * -0.04); + _bank = _pitchbankyaw select 1; + _yaw = (_pitchbankyaw select 2) + ((_this select 1) * -0.04); + [_unit, _pitch, _bank, _yaw] call EFUNC(common,setPitchBankYaw) +}; + +_display = uiNamespace getVariable [QGVAR(ZeroingDisplay), displayNull]; +if !(isNull _display) then { + _vertical = _display displayCtrl 925002; + _horizontal = _display displayCtrl 925003; + _vertical ctrlSetText (str (_zeroing select 1)); + _horizontal ctrlSetText (str (_zeroing select 0)); +}; + +if (!isNull (missionNamespace getVariable [QGVAR(fadeScript), scriptNull])) then { + terminate GVAR(fadeScript); +}; +if (cameraView != "GUNNER") then { + GVAR(fadeScript) = 0 spawn { + _layer = [QGVAR(Zeroing)] call BIS_fnc_rscLayer; + _layer cutRsc [QGVAR(Zeroing), "PLAIN", 0, false]; + sleep 3; + _layer cutFadeOut 2; + }; +}; + +true diff --git a/TO_MERGE/agm/Scopes/functions/fn_canAdjustScope.sqf b/addons/scopes/functions/fnc_canAdjustScope.sqf similarity index 71% rename from TO_MERGE/agm/Scopes/functions/fn_canAdjustScope.sqf rename to addons/scopes/functions/fnc_canAdjustScope.sqf index 0096bd150f..883c14bb76 100644 --- a/TO_MERGE/agm/Scopes/functions/fn_canAdjustScope.sqf +++ b/addons/scopes/functions/fnc_canAdjustScope.sqf @@ -11,33 +11,35 @@ * Can adjustment be done? (Bool) */ +#include "script_component.hpp" + private ["_unit", "_weapons", "_zeroing", "_optic", "_maxHorizontal", "_maxVertical"]; _unit = _this select 0; _weapons = [ - primaryWeapon _unit, - secondaryWeapon _unit, - handgunWeapon _unit + primaryWeapon _unit, + secondaryWeapon _unit, + handgunWeapon _unit ]; if !(currentWeapon _unit in _weapons) exitWith {false}; -if (isNil "AGM_Scopes_Adjustment") then { - AGM_Scopes_Adjustment = [[0,0], [0,0], [0,0]]; +if (isNil QGVAR(Adjustment)) then { + GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; }; if (isNil "AGM_Scopes_Optics") then { - AGM_Scopes_Optics = ["", "", ""]; + GVAR(Optics) = ["", "", ""]; }; -_zeroing = AGM_Scopes_Adjustment select (_weapons find (currentWeapon _unit)); +_zeroing = GVAR(Adjustment) select (_weapons find (currentWeapon _unit)); _zeroX = (_zeroing select 0) + (_this select 1); _zeroY = (_zeroing select 1) + (_this select 2); -_optic = AGM_Scopes_Optics select (_weapons find (currentWeapon _unit)); -_maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "AGM_ScopeAdjust_Horizontal"); -_maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "AGM_ScopeAdjust_Vertical"); +_optic = GVAR(Optics) select (_weapons find (currentWeapon _unit)); +_maxHorizontal = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Horizontal"); +_maxVertical = getArray (configFile >> "CfgWeapons" >> _optic >> "ACE_ScopeAdjust_Vertical"); if ((count _maxHorizontal < 2) or (count _maxVertical < 2)) exitWith {false}; if ((_maxHorizontal isEqualTo [0,0]) or (_maxVertical isEqualTo [0,0])) exitWith {false}; diff --git a/TO_MERGE/agm/Scopes/functions/fn_firedEH.sqf b/addons/scopes/functions/fnc_firedEH.sqf similarity index 62% rename from TO_MERGE/agm/Scopes/functions/fn_firedEH.sqf rename to addons/scopes/functions/fnc_firedEH.sqf index 925679ef98..4414f617d6 100644 --- a/TO_MERGE/agm/Scopes/functions/fn_firedEH.sqf +++ b/addons/scopes/functions/fnc_firedEH.sqf @@ -10,6 +10,8 @@ * None */ +#include "script_component.hpp" + private ["_unit", "_weaponType", "_ammoType", "_magazineType", "_round", "_weapons", "_zeroing", "_direction", "_azimuth", "_altitude", "_velocity"]; _unit = _this select 0; @@ -19,15 +21,15 @@ _round = _this select 5; _magazineType = _this select 6; _weapons = [ - primaryWeapon _unit, - secondaryWeapon _unit, - handgunWeapon _unit + primaryWeapon _unit, + secondaryWeapon _unit, + handgunWeapon _unit ]; if !(_weaponType in _weapons) exitWith {}; -_zeroing = AGM_Scopes_Adjustment select (_weapons find _weaponType); +_zeroing = GVAR(Adjustment) select (_weapons find _weaponType); // convert zeroing from mils to degrees -_zeroing = [_zeroing, {_this * 0.05625}] call AGM_Core_fnc_map; +_zeroing = [_zeroing, {_this * 0.05625}] call EFUNC(common,map); -[_round, _zeroing select 0, _zeroing select 1, 0] call AGM_Core_fnc_changeProjectileDirection; +[_round, _zeroing select 0, _zeroing select 1, 0] call EFUNC(common,changeProjectileDirection); diff --git a/TO_MERGE/agm/Scopes/functions/fn_getOptics.sqf b/addons/scopes/functions/fnc_getOptics.sqf similarity index 78% rename from TO_MERGE/agm/Scopes/functions/fn_getOptics.sqf rename to addons/scopes/functions/fnc_getOptics.sqf index 997b1dc442..7ff2c7ea1d 100644 --- a/TO_MERGE/agm/Scopes/functions/fn_getOptics.sqf +++ b/addons/scopes/functions/fnc_getOptics.sqf @@ -10,6 +10,8 @@ * [optic of primary, optic of secondary, optic of handgun] (Array) */ +#include "script_component.hpp" + private ["_unit", "_array"]; _unit = _this select 0; @@ -19,9 +21,9 @@ _array = ["", "", ""]; if !(_unit isKindOf "CAManBase") exitWith {_array}; { - if (count _x >= 2) then { - _array set [_forEachIndex, _x select 2]; - }; + if (count _x >= 2) then { + _array set [_forEachIndex, _x select 2]; + }; } forEach [primaryWeaponItems _unit, secondaryWeaponItems _unit, handgunItems _unit]; _array diff --git a/addons/scopes/functions/fnc_hideZeroing.sqf b/addons/scopes/functions/fnc_hideZeroing.sqf new file mode 100644 index 0000000000..b41fd1dab6 --- /dev/null +++ b/addons/scopes/functions/fnc_hideZeroing.sqf @@ -0,0 +1,27 @@ +// by commy2 + +#include "script_component.hpp" + +private ["_state", "_ctrl"]; + +_state = _this select 0; + +disableSerialization; +_ctrl = (uiNamespace getVariable ['ACE_dlgWeaponZeroing', displayNull]) displayCtrl 168; + +if (_state) then { + _ctrl ctrlSetPosition [0,0,0,0]; +} else { + private "_config"; + + _config = configFile >> "RscInGameUI" >> "RscWeaponZeroing" >> "CA_Zeroing"; + + _ctrl ctrlSetPosition [ + getNumber (_config >> "x"), + getNumber (_config >> "y"), + getNumber (_config >> "w"), + getNumber (_config >> "h") + ]; +}; + +_ctrl ctrlCommit 0; diff --git a/addons/scopes/functions/fnc_inventoryCheck.sqf b/addons/scopes/functions/fnc_inventoryCheck.sqf new file mode 100644 index 0000000000..23971098d6 --- /dev/null +++ b/addons/scopes/functions/fnc_inventoryCheck.sqf @@ -0,0 +1,23 @@ +// by KoffeinFlummi / commy2 + +#include "script_component.hpp" + +private "_new"; + +_new = _this call FUNC(getOptics); + +if (isNil QGVAR(Optics)) then { + GVAR(Optics) = ["", "", ""]; +}; + +if (isNil QGVAR(Adjustment)) then { + GVAR(Adjustment) = [[0,0], [0,0], [0,0]]; +}; + +{ + if (_new select _forEachIndex != _x) then { + GVAR(Adjustment) set [_forEachIndex, [0,0]]; + }; +} forEach GVAR(Optics); + +GVAR(Optics) = _new; diff --git a/addons/scopes/functions/script_component.hpp b/addons/scopes/functions/script_component.hpp new file mode 100644 index 0000000000..acca51b4b5 --- /dev/null +++ b/addons/scopes/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\scopes\script_component.hpp" diff --git a/addons/scopes/script_component.hpp b/addons/scopes/script_component.hpp new file mode 100644 index 0000000000..8c4a2cb1cd --- /dev/null +++ b/addons/scopes/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT scopes +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SCOPES + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SCOPES + #define DEBUG_SETTINGS DEBUG_SETTINGS_SCOPES +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/addons/scopes/scripts/zeroingOnLoad.sqf b/addons/scopes/scripts/zeroingOnLoad.sqf new file mode 100644 index 0000000000..c78d5785f3 --- /dev/null +++ b/addons/scopes/scripts/zeroingOnLoad.sqf @@ -0,0 +1,18 @@ +disableSerialization; + +_display = _this select 0; +uiNamespace setVariable ["ACE_Scopes_ZeroingDisplay", _display]; +_vertical = _display displayCtrl 925002; +_horizontal = _display displayCtrl 925003; + +_weapons = [ + primaryWeapon player, + secondaryWeapon player, + handgunWeapon player +]; + +if ((currentWeapon player) in _weapons) then { + _zeroing = ACE_Scopes_Adjustment select (_weapons find (currentWeapon player)); + _horizontal ctrlSetText (str (_zeroing select 0)); + _vertical ctrlSetText (str (_zeroing select 1)); +}; diff --git a/TO_MERGE/agm/Scopes/sounds/agm_scopes_click.wav b/addons/scopes/sounds/agm_scopes_click.wav similarity index 100% rename from TO_MERGE/agm/Scopes/sounds/agm_scopes_click.wav rename to addons/scopes/sounds/agm_scopes_click.wav diff --git a/TO_MERGE/agm/Scopes/stringtable.xml b/addons/scopes/stringtable.xml similarity index 90% rename from TO_MERGE/agm/Scopes/stringtable.xml rename to addons/scopes/stringtable.xml index 85d4b40994..04f777241a 100644 --- a/TO_MERGE/agm/Scopes/stringtable.xml +++ b/addons/scopes/stringtable.xml @@ -1,8 +1,8 @@  - + - + Adjust Elevation Up Magasság Állítása Felfelé Optik-Elevation erhöhen @@ -13,7 +13,7 @@ Ajustar elevación arriba Вверх по вертикали - + Adjust Elevation Down Magasság Állítása Lefelé Optik-Elevation verringern @@ -24,7 +24,7 @@ Ajustar elevación abajo Вниз по вертикали - + Adjust Windage Right Oldalirány Állítása Jobbra Optik-Azimuth erhöhen @@ -35,7 +35,7 @@ Ajustar deriva a la derecha Вправо на уровне - + Adjust Windage Left Oldalirány Állítása Balra Optik-Azimuth verringern diff --git a/addons/smallarms/$PBOPREFIX$ b/addons/smallarms/$PBOPREFIX$ new file mode 100644 index 0000000000..9d0480659e --- /dev/null +++ b/addons/smallarms/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\switchunits \ No newline at end of file diff --git a/addons/smallarms/CfgMagazines.hpp b/addons/smallarms/CfgMagazines.hpp new file mode 100644 index 0000000000..a9cc718258 --- /dev/null +++ b/addons/smallarms/CfgMagazines.hpp @@ -0,0 +1,158 @@ +class CfgMagazines { + class CA_Magazine; + + // Magazine updates: + // 1. Update all magazines with tracer mix to use 1 in 5 mix. Full tracer mags should not be changed! + // 2. Remove tracers at bottom of magazine. + // 3. Do string updates. + + // 5.56mm //////////////////////////////////// + + class 30Rnd_556x45_Stanag : CA_Magazine { + displayname = "5.56mm 30Rnd Mag"; + displaynameshort = "5.56mm"; + + tracersEvery = 0; + lastRoundsTracer = 0; + }; + + class 30Rnd_556x45_Stanag_Tracer_Red: 30Rnd_556x45_Stanag { + displayname = "5.56mm 30Rnd Tracer Mag"; + displaynameshort = "5.56mm"; + }; + + class 30Rnd_556x45_Stanag_Tracer_Green: 30Rnd_556x45_Stanag { + displayname = "5.56mm 30Rnd Tracer Mag"; + displaynameshort = "5.56mm"; + }; + + class 30Rnd_556x45_Stanag_Tracer_Yellow: 30Rnd_556x45_Stanag { + displayname = "5.56mm 30Rnd Tracer Mag"; + displaynameshort = "5.56mm"; + }; + + class 20Rnd_556x45_UW_mag: 30Rnd_556x45_Stanag { + displayname = "5.56mm 20Rnd MEA Mag"; + displaynameshort = "5.56mm MEA"; + }; + + // 6.5mm ////////////////////////////////////////// + + class 30Rnd_65x39_caseless_mag : CA_Magazine { // MX!! + displayname = "6.5mm 30Rnd Mag"; + displaynameshort = "6.5mm"; + + tracersEvery = 0; + lastRoundsTracer = 0; + }; + + class 30Rnd_65x39_caseless_mag_Tracer : 30Rnd_65x39_caseless_mag { // MX!! + displayname = "6.5mm 30Rnd Tracer Mag"; + displaynameshort = "6.5mm Tracer"; + }; + + class 30Rnd_65x39_caseless_green : 30Rnd_65x39_caseless_mag { // Katiba!! + displayname = "6.5mm 30Rnd Mag"; + displaynameshort = "6.5mm"; + + tracersEvery = 0; + lastRoundsTracer = 0; + }; + + class 30Rnd_65x39_caseless_green_Tracer : 30Rnd_65x39_caseless_green { // Katiba!! + displayname = "6.5mm 30Rnd Tracer Magazine"; + displaynameshort = "6.5mm Tracer"; + }; + + class 100Rnd_65x39_caseless_mag : CA_Magazine { + displayname = "6.5mm 100Rnd Mag"; + displaynameshort = "6.5mm"; + + tracersEvery = 5; + lastRoundsTracer = 3; + }; + + class 100Rnd_65x39_caseless_mag_Tracer : 100Rnd_65x39_caseless_mag { + displayname = "6.5mm 100Rnd Tracer Mag"; + displaynameshort = "6.5mm Tracer"; + }; + + class 200Rnd_65x39_cased_Box : 100Rnd_65x39_caseless_mag { + displayname = "6.5mm 200Rnd Box"; + displaynameshort = "6.5mm"; + + tracersEvery = 5; + lastRoundsTracer = 3; + }; + class 200Rnd_65x39_cased_Box_Tracer: 200Rnd_65x39_cased_Box { + displayname = "6.5mm 200Rnd Tracer Box"; + displaynameshort = "6.5mm Tracer"; + }; + + // 7.62mm ////////////////////////////////////////// + + class 20Rnd_762x51_Mag: CA_Magazine { + displayname = "7.62mm 20Rnd Mag"; + displaynameshort = "7.62mm"; + }; + + class 150Rnd_762x51_Box : CA_Magazine { + displayname = "7.62mm 150Rnd Box"; + + tracersEvery = 5; + lastRoundsTracer = 3; + }; + + class 150Rnd_762x51_Box_Tracer : 150Rnd_762x51_Box { + displayname = "7.62mm 150Rnd Tracer Box"; + }; + + // Anti-materiel /////////////////////////////// + + class 7Rnd_408_Mag: CA_Magazine { + displayname = ".408 7Rnd Mag"; + }; + + class 5Rnd_127x108_Mag: CA_Magazine { + displayname = "12.7mm 5Rnd Mag"; + }; + + // SMG & Pistol //////////////////////////// + + class 30Rnd_9x21_Mag : CA_Magazine { + displayname = "9mm 30Rnd Mag"; + displaynameshort = "9mm"; + + lastRoundsTracer = 0; + }; + + class 16Rnd_9x21_Mag: 30Rnd_9x21_Mag { + displayname = "9mm 17Rnd Mag"; + displaynameshort = "9mm"; + + count = 17; + }; + + class 30Rnd_45ACP_Mag_SMG_01 : 30Rnd_9x21_Mag { + displayname = ".45 25Rnd Mag"; + displaynameshort = ".45"; + + picture = "\A3\weapons_f\data\ui\M_30Rnd_9x21_CA.paa"; + + count = 25; + + tracersEvery = 0; + lastRoundsTracer = 0; + }; + + class 9Rnd_45ACP_Mag : 30Rnd_45ACP_Mag_SMG_01 { + displayname = ".45 8Rnd Mag"; + displaynameshort = ".45"; + + count = 8; + }; + + class 30Rnd_45ACP_Mag_SMG_01_Tracer_Green: 30Rnd_45ACP_Mag_SMG_01 { + displayname = ".45 25Rnd Tracer Mag"; + }; +}; \ No newline at end of file diff --git a/addons/smallarms/CfgVehicles.hpp b/addons/smallarms/CfgVehicles.hpp new file mode 100644 index 0000000000..49de74005a --- /dev/null +++ b/addons/smallarms/CfgVehicles.hpp @@ -0,0 +1,34 @@ +/*#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \ + name = #ITEM; \ + count = COUNT; \ +}; + +class CfgVehicles { + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_acc_flashlight_tls,5) + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_acc_flashlight_tls,5) + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_acc_flashlight_tls,5) + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_acc_flashlight_tls,2) + }; + }; +};*/ diff --git a/addons/smallarms/CfgWeapons.hpp b/addons/smallarms/CfgWeapons.hpp new file mode 100644 index 0000000000..8c42847bd8 --- /dev/null +++ b/addons/smallarms/CfgWeapons.hpp @@ -0,0 +1,310 @@ +class Mode_SemiAuto; +class Mode_Burst; +class Mode_FullAuto; + +// config inheritance of weapon slot info v1.32 +class SlotInfo; +class CowsSlot: SlotInfo {}; +class PointerSlot: SlotInfo { + //compatibleItems[] = {"acc_flashlight","acc_pointer_IR", "ACE_acc_flashlight_tls"}; +}; + +class CfgWeapons { + + // config inheritance of weapon slot info v1.32 for launchers + class Launcher; + class Launcher_Base_F: Launcher { + class WeaponSlotsInfo {}; + }; + + // config inheritance of weapon slot info v1.32 for assault rifles + class RifleCore; + class Rifle: RifleCore { + class WeaponSlotsInfo { + class MuzzleSlot: SlotInfo {}; + class CowsSlot: CowsSlot {}; + class PointerSlot: PointerSlot {}; + }; + }; + class Rifle_Base_F: Rifle {}; + class Rifle_Long_Base_F: Rifle_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo {}; + }; + + // config inheritance of weapon slot info v1.32 for handguns + class PistolCore; + class Pistol: PistolCore { + class WeaponSlotsInfo { + class CowsSlot: SlotInfo {}; + }; + }; + class Pistol_Base_F: Pistol { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: SlotInfo {}; + }; + }; + + /////////////////////////////////////////////////////////////////////////////// + //////////// SMALL ARMS WEAPONS /////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////// + + // Weapon updates: + // 1. Do string update. + // 2. Fix magazine compatibility as needed. + // 3. Fix firing modes as needed. + // 4. Fix accessory compatibility as needed. + + // Grenade launchers ///////////////////////////////////// + // Updated strings are in weapon configs. + class GrenadeLauncher; + class UGL_F : GrenadeLauncher {}; + + // MXs //////////////////////////////////////////////////// + + class arifle_MX_Base_F : Rifle_Base_F { + //magazines[] = {"30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer", "100Rnd_65x39_caseless_mag", "100Rnd_65x39_caseless_mag_Tracer"}; + + // http://www.bushmaster.com/acr/#/intro + // 800 rpm (whatever, fictional lol) + + //class Single : Mode_SemiAuto {}; + class Single : Mode_SemiAuto { + reloadTime = 0.075; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.075; + }; + }; + + class arifle_MX_SW_F : arifle_MX_Base_F { + modes[] = {"Single", "manual", "close", "short", "medium", "far_optic1", "far_optic2"}; + + //class Single : Single {}; + //class manual : FullAuto {}; + }; + + // Katibas //////////////////////////////////////////////////// + + class arifle_katiba_Base_F : Rifle_Base_F { + // http://world.guns.ru/assault/iran/khaybar-kh2002-e.html + // 800 rpm + + class Single : Mode_SemiAuto { + reloadTime = 0.075; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.075; + }; + }; + + // SDAR ////////////////////////////////////////////////// + + class SDAR_base_F : Rifle_Base_F { + modes[] = {"Single", "FullAuto"}; // Leave in the imaginary full-auto mode because, whatever. + }; + + // Tavor TRG //////////////////////////////////////////////// + + class Tavor_base_F : Rifle_Base_F { + // http://www.israel-weapon.com/files/brochure_2012/IWI_TAVOR_AR.pdf + // 700 ~1000 rpm (850) + class Single : Mode_SemiAuto { + reloadTime = 0.07; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.07; + }; + }; + + // Mk20 (F2000) ////////////////////////////////////////////////// + + class mk20_base_F : Rifle_Base_F { + // http://www.fnherstal.com/primary-menu/products-capabilities/rifles/technical-data/product/182/232/182/1/_/fn-f2000R-standard.html + // 850 rpm + class Single : Mode_SemiAuto { + reloadTime = 0.07; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.07; + }; + }; + + // SMG Vermin //////////////////////////////////////////////////// + + class SMG_01_Base : Rifle_Base_F { + // http://kriss-usa.com/pdf/operatormanual/ + // 1200 rpm + class Single : Mode_SemiAuto { + reloadTime = 0.05; + }; + + class Burst : Mode_Burst { + burst = 2; + reloadTime = 0.05; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.05; + }; + }; + + // SMG Scorpion //////////////////////////////////////////////////// + + class SMG_02_base_F : Rifle_Base_F { + //http://www.czub.cz/zbrojovka/cz-manual/Instruction-Manual-Scorpion-EVO-3-A1_en.pdf + // 1150 rpm + + class Single : Mode_SemiAuto { + // http://www.stengg.com/upload/915fGdhTi3ggnnGQGGL.pdf + // 900-1100 rpm (1000rpm) + reloadTime = 0.052; + }; + + class Burst : Mode_Burst { + reloadTime = 0.052; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.052; + }; + }; + + // SMG PDW2000 /////////////////////////////////////////////////// + + class pdw2000_base_F: Rifle_Base_F { + magazines[] = {"30Rnd_9x21_Mag"}; + + modes[] = {"Single", "FullAuto"}; // No burst on this thing + + class Single : Mode_SemiAuto { + // http://www.stengg.com/upload/915fGdhTi3ggnnGQGGL.pdf + // 900-1100 rpm (1000rpm) + reloadTime = 0.06; + }; + + class FullAuto: Mode_FullAuto { + reloadTime = 0.06; + }; + }; + + // Pistols ////////////////////////////////////////////// + + class hgun_P07_F : Pistol_Base_F { + magazines[] = {"16Rnd_9x21_Mag"}; + }; + + class hgun_Rook40_F : Pistol_Base_F { + magazines[] = {"16Rnd_9x21_Mag"}; + }; + + /*class hgun_ACPC2_F: Pistol_Base_F {}; + class hgun_Pistol_heavy_01_F: Pistol_Base_F {}; + class hgun_Pistol_heavy_02_F: Pistol_Base_F {};*/ + + // LMGs ////////////////////////////////////////////// + + class LMG_Mk200_F : Rifle_Long_Base_F { + modes[] = {"manual", "Single", "close", "short", "medium", "far_optic1", "far_optic2"}; + + class manual : Mode_FullAuto { + // http://www.defensereview.com/kac-stoner-lmg-belt-fed-5-56mm-nato-lightweight-light-machine-gun-squad-automatic-weapon-lmgsaw-displayed-at-sofic-2010/ + // 550 rpm + reloadTime = 0.109; + }; + + // Add semi-auto mode. + // Inherit from 'manual' for sound reasons. + class Single : manual { + reloadTime = 0.109; + dispersion = 0.00175; // radians. Equal to 6 MOA. + autofire = 0; + burst = 1; + displayname = "Semi"; + texturetype = "semi"; + showToPlayer = 1; + }; + }; + + class LMG_Zafir_F: Rifle_Long_Base_F { + modes[] = {"FullAuto", "Single", "close", "short", "medium", "far_optic1", "far_optic2"}; + + class FullAuto : Mode_FullAuto { + reloadTime = 0.070; // 850 RPM on gas position 1 + }; + }; + + // Sniper and anti-materiel rifles ///////////////////////////////// + + class EBR_base_F : Rifle_Long_Base_F { + // EMR/EBR is typically issued semi-auto AFAIK + modes[] = {"Single", "single_close_optics1", "single_medium_optics1", "single_far_optics1"}; + cursor = "arifle"; + }; + + class LRR_base_F : Rifle_Long_Base_F { + cursor = "arifle"; + }; + + class GM6_base_F : Rifle_Long_Base_F { + cursor = "arifle"; + + // Fuck your balancing, BI. + class Single : Mode_SemiAuto { + // 250 rpm is probably the limit of the finger on a heavy bullpup trigger like this thing must have. + reloadTime = 0.24; + }; + }; + + /////////////////////////////////////////////////////////////////////////////// + //////////// WEAPON ATTACHMENTS /////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////// + + /* Handgun flashlight + class ItemCore; + class InventoryItem_Base_F; + class InventoryMuzzleItem_Base_F; + class InventoryFlashLightItem_Base_F; + + class ACE_acc_flashlight_tls: ItemCore { + author = "$STR_A3_Bohemia_Interactive"; + _generalMacro = "ACE_acc_flashlight_tls"; + scope = 1; //2; + displayName = "$STR_A3_cfgWeapons_acc_flashlight0";// + descriptionUse = "$STR_A3_cfgWeapons_use_flashlight0";// + picture = "\A3\weapons_F\Data\UI\gear_accv_flashlight_tls_ca.paa"; + model = "\A3\weapons_f\acc\accv_flashlight_TLS_F"; + descriptionShort = "$STR_A3_cfgWeapons_acc_flashlight1";// + class ItemInfo: InventoryFlashLightItem_Base_F { + mass = 4; + class FlashLight { + color[] = {180,156,120}; + ambient[] = {0.9,0.78,0.6}; + intensity = 20; + size = 1; + innerAngle = 20; + outerAngle = 80; + coneFadeCoef = 5; + position = "flash dir"; + direction = "flash"; + useFlare = 1; + flareSize = 1.4; + flareMaxDistance = "100.0f"; + dayLight = 0; + class Attenuation { + start = 0.5; + constant = 0; + linear = 0; + quadratic = 1.1; + hardLimitStart = 20; + hardLimitEnd = 30; + }; + scale[] = {0}; + }; + }; + inertia = 0.1; + };*/ +}; diff --git a/addons/smallarms/config.cpp b/addons/smallarms/config.cpp new file mode 100644 index 0000000000..e5731df7b3 --- /dev/null +++ b/addons/smallarms/config.cpp @@ -0,0 +1,27 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"TaoSensai", "KoffeinFlummi"}; + authorUrl = "https://github.com/Taosenai/tmr"; + VERSION_CONFIG; + }; +}; + +// EVERYTHING BELOW BELONGS TO TAOSENSAI + +////////////////////////////////////////////////////// +// TMR strings update for weapons and magazines: +// 1. Change displayname to match TMR standards. +// 3. Add displaynameshort to TMR standards. +////////////////////////////////////////////////////// + +#include "CfgMagazines.hpp" + +#include "CfgWeapons.hpp" + +#include "CfgVehicles.hpp" diff --git a/addons/smallarms/script_component.hpp b/addons/smallarms/script_component.hpp new file mode 100644 index 0000000000..d9c70ca5e6 --- /dev/null +++ b/addons/smallarms/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT smallarms +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_SMALLARMS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_SMALLARMS + #define DEBUG_SETTINGS DEBUG_SETTINGS_SMALLARMS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" diff --git a/addons/switchunits/$PBOPREFIX$ b/addons/switchunits/$PBOPREFIX$ new file mode 100644 index 0000000000..9d0480659e --- /dev/null +++ b/addons/switchunits/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\switchunits \ No newline at end of file diff --git a/addons/switchunits/config.cpp b/addons/switchunits/config.cpp index 1f60ca83ac..b89adb3a7a 100644 --- a/addons/switchunits/config.cpp +++ b/addons/switchunits/config.cpp @@ -4,13 +4,11 @@ class CfgPatches { class ADDON { units[] = {}; weapons[] = {}; - requiredVersion = 0.60; + requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_main", "ace_common"}; - version = QUOTE(VERSION); - versionStr = QUOTE(VERSION); - versionAr[] = {VERSION_AR}; author[] = {"bux578"}; authorUrl = "https://github.com/bux578/"; + VERSION_CONFIG; }; }; diff --git a/addons/vector/CfgWeapons.hpp b/addons/vector/CfgWeapons.hpp index eea552a94b..6b8757d143 100644 --- a/addons/vector/CfgWeapons.hpp +++ b/addons/vector/CfgWeapons.hpp @@ -9,8 +9,8 @@ class CfgWeapons { modelOptics = PATHTOF(ace_vector_optics.p3d); picture = PATHTOF(UI\ace_vector_x_ca.paa); visionMode[] = {"Normal","NVG"}; - opticsZoomMax = 0.03; - opticsZoomMin = 0.03; + opticsZoomMax = 0.06621; + opticsZoomMin = 0.06621; weaponInfoType = "ACE_RscOptics_vector"; }; }; diff --git a/addons/vector/XEH_preInit.sqf b/addons/vector/XEH_preInit.sqf index 68acfa6390..ed020c4913 100644 --- a/addons/vector/XEH_preInit.sqf +++ b/addons/vector/XEH_preInit.sqf @@ -1,35 +1,29 @@ #include "script_component.hpp" -PREP(abort); -PREP(config); -PREP(convertFOS); -PREP(settings); -PREP(tabAzimuthKey); -PREP(tabDistanceKey); -///// - PREP(clearDisplay); PREP(convertToTexturesDegree); PREP(convertToTexturesDistance); +PREP(convertToTexturesFOS); PREP(showCenter); PREP(showP1); - PREP(onKeyDown); PREP(onKeyHold); PREP(onKeyUp); - PREP(getDirection); PREP(getDistance); PREP(getHeightDistance); PREP(getRelativeAzimuthDistance); PREP(getRelativeDistance); - +PREP(getRelativeHeightLength); +PREP(getFallOfShort); PREP(showAzimuth); PREP(showAzimuthInclination); PREP(showHeightDistance); PREP(showDistance); PREP(showRelativeAzimuthDistance); PREP(showRelativeDistance); +PREP(showRelativeHeightLength); +PREP(showFallOfShort); GVAR(holdKeyHandler) = -1; GVAR(isKeyDownAzimuth) = false; diff --git a/addons/vector/functions/fnc_abort.sqf b/addons/vector/functions/_abort.sqf similarity index 100% rename from addons/vector/functions/fnc_abort.sqf rename to addons/vector/functions/_abort.sqf diff --git a/addons/vector/functions/fnc_config.sqf b/addons/vector/functions/_config.sqf similarity index 100% rename from addons/vector/functions/fnc_config.sqf rename to addons/vector/functions/_config.sqf diff --git a/addons/vector/functions/fnc_convertFOS.sqf b/addons/vector/functions/_convertFOS.sqf similarity index 100% rename from addons/vector/functions/fnc_convertFOS.sqf rename to addons/vector/functions/_convertFOS.sqf diff --git a/addons/vector/functions/fnc_settings.sqf b/addons/vector/functions/_settings.sqf similarity index 100% rename from addons/vector/functions/fnc_settings.sqf rename to addons/vector/functions/_settings.sqf diff --git a/addons/vector/functions/fnc_tabAzimuthKey.sqf b/addons/vector/functions/_tabAzimuthKey.sqf similarity index 100% rename from addons/vector/functions/fnc_tabAzimuthKey.sqf rename to addons/vector/functions/_tabAzimuthKey.sqf diff --git a/addons/vector/functions/fnc_tabDistanceKey.sqf b/addons/vector/functions/_tabDistanceKey.sqf similarity index 100% rename from addons/vector/functions/fnc_tabDistanceKey.sqf rename to addons/vector/functions/_tabDistanceKey.sqf diff --git a/addons/vector/functions/fnc_clearDisplay.sqf b/addons/vector/functions/fnc_clearDisplay.sqf index 5a42461cb7..81c919a8ca 100644 --- a/addons/vector/functions/fnc_clearDisplay.sqf +++ b/addons/vector/functions/fnc_clearDisplay.sqf @@ -14,30 +14,18 @@ _dlgVector = GETUVAR(ACE_dlgVector,displayNull); switch (_this select 0) do { case ("azimuth"): { - private ["_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8"]; - - _ctrlDigit5 = _dlgVector displayCtrl 1315; - _ctrlDigit6 = _dlgVector displayCtrl 1316; - _ctrlDigit7 = _dlgVector displayCtrl 1317; - _ctrlDigit8 = _dlgVector displayCtrl 1318; - - _ctrlDigit5 ctrlSetText ""; - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText ""; - _ctrlDigit8 ctrlSetText ""; + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText ""; + (_dlgVector displayCtrl 1318) ctrlSetText ""; + (_dlgVector displayCtrl 1319) ctrlSetText ""; }; case ("distance"): { - private ["_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4"]; - - _ctrlDigit1 = _dlgVector displayCtrl 1311; - _ctrlDigit2 = _dlgVector displayCtrl 1312; - _ctrlDigit3 = _dlgVector displayCtrl 1313; - _ctrlDigit4 = _dlgVector displayCtrl 1314; - - _ctrlDigit1 ctrlSetText ""; - _ctrlDigit2 ctrlSetText ""; - _ctrlDigit3 ctrlSetText ""; - _ctrlDigit4 ctrlSetText ""; + (_dlgVector displayCtrl 1310) ctrlSetText ""; + (_dlgVector displayCtrl 1311) ctrlSetText ""; + (_dlgVector displayCtrl 1312) ctrlSetText ""; + (_dlgVector displayCtrl 1313) ctrlSetText ""; + (_dlgVector displayCtrl 1314) ctrlSetText ""; }; }; diff --git a/addons/vector/functions/fnc_convertToTexturesFOS.sqf b/addons/vector/functions/fnc_convertToTexturesFOS.sqf new file mode 100644 index 0000000000..79fe40962f --- /dev/null +++ b/addons/vector/functions/fnc_convertToTexturesFOS.sqf @@ -0,0 +1,239 @@ +/* by commy2 + +converts rangefinder distance into array of textures for the vectors scripted info control + +*/ + +#include "script_component.hpp" + +private ["_number", "_coordinate", "_isNegative"]; + +_number = _this select 0; +_coordinate = _this select 1; + +_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 +}; + +private ["_digit0", "_digit1", "_digit2", "_digit3", "_digit4"]; + +_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 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_a.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; + + case 1 : { + + if (_isNegative) then { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_l.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_l.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_l.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_r.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit3 = ""; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_r.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_r.paa)); + _digit1 = ""; + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; + + case 2 : { + + if (_isNegative) then { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_u.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_p.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_u.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_p.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_u.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_p.paa)); + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + + } else { + + if (_digit1 == 0) then { + if (_digit2 == 0) then { + if (_digit3 == 0) then { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_n.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + _digit4 = ""; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_n.paa)); + _digit2 = ""; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = QUOTE(PATHTOF(rsc\vector_d.paa)); + _digit1 = QUOTE(PATHTOF(rsc\vector_n.paa)); + _digit2 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit2]; + _digit3 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit3]; + _digit4 = format [QUOTE(PATHTOF(rsc\vector_%1.paa)), _digit4]; + }; + } else { + _digit0 = ""; + _digit1 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit2 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit3 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + _digit4 = QUOTE(PATHTOF(rsc\vector_minus.paa)); + }; + }; + + }; +}; + +[_digit0, _digit1, _digit2, _digit3, _digit4] diff --git a/addons/vector/functions/fnc_getFallOfShort.sqf b/addons/vector/functions/fnc_getFallOfShort.sqf new file mode 100644 index 0000000000..365a41518e --- /dev/null +++ b/addons/vector/functions/fnc_getFallOfShort.sqf @@ -0,0 +1,26 @@ +// by commy2 +#include "script_component.hpp" + +private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; + +_distanceP1 = GVAR(pData) select 0; +_directionP1 = GVAR(pData) select 1; +_azimuthP1 = _directionP1 select 0; +_inclinationP1 = _directionP1 select 1; + +_distanceP2 = call FUNC(getDistance); +_directionP2 = call FUNC(getDirection); +_azimuthP2 = _directionP2 select 0; +_inclinationP2 = _directionP2 select 1; + +private ["_abscissa", "_ordinate", "_applicate"]; + +_abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); +_ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); +_applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); + +if (_distanceP1 < -999 || {_distanceP2 < -999}) exitWith { + [-1000, -1000, -1000] // return +}; + +[_abscissa, _ordinate, _applicate] diff --git a/addons/vector/functions/fnc_getRelativeHeightLength.sqf b/addons/vector/functions/fnc_getRelativeHeightLength.sqf new file mode 100644 index 0000000000..319b11b6a6 --- /dev/null +++ b/addons/vector/functions/fnc_getRelativeHeightLength.sqf @@ -0,0 +1,29 @@ +// by commy2 +#include "script_component.hpp" + +private ["_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_distanceP2", "_directionP2", "_azimuthP2", "_inclinationP2"]; + +_distanceP1 = GVAR(pData) select 0; +_directionP1 = GVAR(pData) select 1; +_azimuthP1 = _directionP1 select 0; +_inclinationP1 = _directionP1 select 1; + +_distanceP2 = call FUNC(getDistance); +_directionP2 = call FUNC(getDirection); +_azimuthP2 = _directionP2 select 0; +_inclinationP2 = _directionP2 select 1; + +private ["_azimuth", "_inclination", "_height", "_length"]; + +_azimuth = abs (_azimuthP1 - _azimuthP2); +_inclination = abs (_inclinationP1 - _inclinationP2); +_height = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _inclination); +_length = sqrt (_distanceP1 ^ 2 + _distanceP2 ^ 2 - 2 * _distanceP1 * _distanceP2 * cos _azimuth); + +if (_inclination < 0) then {_height = -1 * _height}; + +if (_distanceP1 < -999 || {_distanceP2 < -999}) exitWith { + [-1000, -1000] // return +}; + +[_height, _length] diff --git a/addons/vector/functions/fnc_modeFallOfShort.sqf b/addons/vector/functions/fnc_modeFallOfShort.sqf deleted file mode 100644 index 5b37f24c85..0000000000 --- a/addons/vector/functions/fnc_modeFallOfShort.sqf +++ /dev/null @@ -1,104 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigit9", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_directionP2", "_azimuthP2", "_abscissa", "_ordinate", "_applicate", "_distanceP2", "_digits", "_inclinationP2", "_height", "_lenght", "_digits0", "_digits1", "_digits2"]; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_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; - -_ctrlVectorCenter ctrlSetText "\AGM_Vector\rsc\Vector_Center.paa"; - -_distanceP1 = call AGM_Vector_fnc_getDistance; -_directionP1 = call AGM_Vector_fnc_getDirection; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; - -_ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; -_ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; -_ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dP.paa"; - -waitUntil {!(AGM_vectorKey select 0)}; - -_distanceP2 = call AGM_Vector_fnc_getDistance; -_directionP2 = call AGM_Vector_fnc_getDirection; -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; - -_abscissa = _distanceP1 * sin (_azimuthP1 - _azimuthP2); -_ordinate = _distanceP1 * cos (_inclinationP1 - _inclinationP2) - _distanceP2 * cos (_azimuthP1 - _azimuthP2); -_applicate = (sin _inclinationP2 * _distanceP2) - (sin _inclinationP1 * _distanceP1); -if (_distanceP1 == -9999 || {_distanceP2 == -9999}) then { - _abscissa = -9999; - _ordinate = -9999; - _applicate = -9999; -}; - -_digits0 = [_ordinate, 0] call AGM_Vector_fnc_convertFOS; -_digits1 = [_abscissa, 1] call AGM_Vector_fnc_convertFOS; -_digits2 = [_applicate, 2] call AGM_Vector_fnc_convertFOS; - -_ctrlVectorCenter ctrlShow false; - -_ctrlDigitE1 ctrlShow false; -_ctrlDigitE2 ctrlShow false; -_ctrlDigitE3 ctrlShow false; - -waitUntil { - _ctrlDigit0 ctrlSetText (_digits0 select 0); - _ctrlDigit1 ctrlSetText (_digits0 select 1); - _ctrlDigit2 ctrlSetText (_digits0 select 2); - _ctrlDigit3 ctrlSetText (_digits0 select 3); - _ctrlDigit4 ctrlSetText (_digits0 select 4); - _ctrlDigit5 ctrlSetText (_digits1 select 0); - _ctrlDigit6 ctrlSetText (_digits1 select 1); - _ctrlDigit7 ctrlSetText (_digits1 select 2); - _ctrlDigit8 ctrlSetText (_digits1 select 3); - _ctrlDigit9 ctrlSetText (_digits1 select 4); - - waitUntil {!(AGM_vectorKey select 1) || {AGM_vectorKey select 0}}; - waitUntil {AGM_vectorKey select 1 || {AGM_vectorKey select 0}}; - - if !(AGM_vectorKey select 0) then { - _ctrlDigit0 ctrlSetText (_digits2 select 0); - _ctrlDigit1 ctrlSetText (_digits2 select 1); - _ctrlDigit2 ctrlSetText (_digits2 select 2); - _ctrlDigit3 ctrlSetText (_digits2 select 3); - _ctrlDigit4 ctrlSetText (_digits2 select 4); - _ctrlDigit5 ctrlSetText ""; - _ctrlDigit6 ctrlSetText ""; - _ctrlDigit7 ctrlSetText ""; - _ctrlDigit8 ctrlSetText ""; - _ctrlDigit9 ctrlSetText ""; - }; - - waitUntil {!(AGM_vectorKey select 1) || {AGM_vectorKey select 0}}; - waitUntil {AGM_vectorKey select 1 || {AGM_vectorKey select 0}}; - - AGM_vectorKey select 0 -}; -_ctrlDigit0 ctrlSetText ""; -_ctrlDigit1 ctrlSetText ""; -_ctrlDigit2 ctrlSetText ""; -_ctrlDigit3 ctrlSetText ""; -_ctrlDigit4 ctrlSetText ""; -_ctrlDigit5 ctrlSetText ""; -_ctrlDigit6 ctrlSetText ""; -_ctrlDigit7 ctrlSetText ""; -_ctrlDigit8 ctrlSetText ""; -_ctrlDigit9 ctrlSetText ""; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf b/addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf deleted file mode 100644 index 0663c31473..0000000000 --- a/addons/vector/functions/fnc_modeRelativeDistanceHeight.sqf +++ /dev/null @@ -1,68 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private["_dlgVector", "_ctrlVectorCenter", "_ctrlDigit1", "_ctrlDigit2", "_ctrlDigit3", "_ctrlDigit4", "_ctrlDigit5", "_ctrlDigit6", "_ctrlDigit7", "_ctrlDigit8", "_ctrlDigitE1", "_ctrlDigitE2", "_ctrlDigitE3", "_distanceP1", "_directionP1", "_azimuthP1", "_inclinationP1", "_directionP2", "_azimuthP2", "_distanceP2", "_inclinationP2", "_azimuth", "_inclination", "_height", "_lenght", "_relDirection", "_relDistance", "_distance", "_digits"]; - -disableSerialization; -_dlgVector = uiNamespace getVariable "AGM_dlgVector"; -_ctrlVectorCenter = _dlgVector displayCtrl 1; -_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; -_ctrlDigitE1 = _dlgVector displayCtrl 21; -_ctrlDigitE2 = _dlgVector displayCtrl 22; -_ctrlDigitE3 = _dlgVector displayCtrl 23; - -_ctrlVectorCenter ctrlSetText "\AGM_Vector\rsc\Vector_Center.paa"; - -_distanceP1 = call AGM_Vector_fnc_getDistance; -_directionP1 = call AGM_Vector_fnc_getDirection; -_azimuthP1 = _directionP1 select 0; -_inclinationP1 = _directionP1 select 1; - -_ctrlDigitE1 ctrlSetText "\AGM_Vector\rsc\d1.paa"; -_ctrlDigitE2 ctrlSetText "\AGM_Vector\rsc\d-.paa"; -_ctrlDigitE3 ctrlSetText "\AGM_Vector\rsc\dP.paa"; - -waitUntil {!(AGM_vectorKey select 1)}; - -_distanceP2 = call AGM_Vector_fnc_getDistance; -_directionP2 = call AGM_Vector_fnc_getDirection; -_azimuthP2 = _directionP2 select 0; -_inclinationP2 = _directionP2 select 1; - -_azimuth = abs (_azimuthP1 - _azimuthP2); -_inclination = abs (_inclinationP1 - _inclinationP2); -_height = sqrt (_distanceP1^2 + _distanceP2^2 - 2 * _distanceP1 * _distanceP2 * cos _inclination); -_lenght = sqrt (_distanceP1^2 + _distanceP2^2 - 2 * _distanceP1 * _distanceP2 * cos _azimuth); -if (_inclination < 0) then {_height = -1 * _height}; - -if (_distanceP1 == -9999 || {_distanceP2 == -9999}) then { - _height = -9999; - _lenght = -9999; -}; - -_digits = _height call AGM_Vector_fnc_convertDistance; -_ctrlDigit1 ctrlSetText (_digits select 0); -_ctrlDigit2 ctrlSetText (_digits select 1); -_ctrlDigit3 ctrlSetText (_digits select 2); -_ctrlDigit4 ctrlSetText (_digits select 3); - -_digits = _lenght call AGM_Vector_fnc_convertDistance; -_ctrlDigit5 ctrlSetText (_digits select 0); -_ctrlDigit6 ctrlSetText (_digits select 1); -_ctrlDigit7 ctrlSetText (_digits select 2); -_ctrlDigit8 ctrlSetText (_digits select 3); - -_ctrlVectorCenter ctrlShow false; - -_ctrlDigitE1 ctrlShow false; -_ctrlDigitE2 ctrlShow false; -_ctrlDigitE3 ctrlShow false; - -AGM_isVectorReady = true; diff --git a/addons/vector/functions/fnc_onKeyDown.sqf b/addons/vector/functions/fnc_onKeyDown.sqf index f1c1a4c77f..ec0b884ccc 100644 --- a/addons/vector/functions/fnc_onKeyDown.sqf +++ b/addons/vector/functions/fnc_onKeyDown.sqf @@ -21,7 +21,8 @@ _fnc_setPFH = { switch (_this select 0) do { case ("azimuth"): { - if (GETGVAR(isKeyDownDistance,false) && {GETGVAR(currentMode,"") in ["relative_distance"]}) exitWith {}; + // prevent additinal modifier input if advanced mode it set, spaghetti + if (GETGVAR(isKeyDownDistance,false) && {GETGVAR(currentMode,"") in ["relative_distance", "relative_height+length"]}) exitWith {}; ["azimuth"] call FUNC(clearDisplay); @@ -40,14 +41,25 @@ switch (_this select 0) do { "azimuth" call _fnc_setPFH; }; } else { - "azimuth+distance" call _fnc_setPFH; + if (GETGVAR(isKeyDownDistance,false)) then { + "azimuth+distance" call _fnc_setPFH; + } else { + ["distance"] call FUNC(clearDisplay); + "azimuth" call _fnc_setPFH; + }; }; }; case ("distance"): { - if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance"]}) exitWith {}; + // prevent additinal modifier input if advanced mode it set, spaghetti + if (GETGVAR(isKeyDownAzimuth,false) && {GETGVAR(currentMode,"") in ["relative_azimuth+distance", "fall_of_short"]}) exitWith {}; + + // toggle fos values + if (GETGVAR(currentMode,"") == "fall_of_short") exitWith { + [!(GETGVAR(FOSState,true))] call FUNC(showFallOfShort); + }; ["distance"] call FUNC(clearDisplay); @@ -63,10 +75,15 @@ switch (_this select 0) do { if (diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5) then { if !(GETGVAR(isKeyDownAzimuth,false)) then { ["azimuth"] call FUNC(clearDisplay); - "distance" call _fnc_setPFH; + "distance" call _fnc_setPFH; }; } else { - "azimuth+distance" call _fnc_setPFH; + if (GETGVAR(isKeyDownAzimuth,false)) then { + "azimuth+distance" call _fnc_setPFH; + } else { + ["azimuth"] call FUNC(clearDisplay); + "distance" call _fnc_setPFH; + }; }; }; diff --git a/addons/vector/functions/fnc_onKeyHold.sqf b/addons/vector/functions/fnc_onKeyHold.sqf index 97b1574a7f..dded828d26 100644 --- a/addons/vector/functions/fnc_onKeyHold.sqf +++ b/addons/vector/functions/fnc_onKeyHold.sqf @@ -10,9 +10,14 @@ PFH executed while holding a vector key down. switch (_this select 0) do { case ("azimuth"): { + private "_isReady"; + _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.2; + [false] call FUNC(showCenter); - call FUNC(showAzimuth); + if (_isReady) then { + call FUNC(showAzimuth); + }; if (!GVAR(isKeyDownAzimuth)) then { [_this select 1] call CBA_fnc_removePerFrameHandler; @@ -131,6 +136,29 @@ switch (_this select 0) do { }; + case ("relative_height+length"): { + + private "_isReady"; + _isReady = diag_tickTime > GVAR(keyDownTimeAzimuth) + 0.5; + + [_isReady] call FUNC(showCenter); + + if (!GVAR(isKeyDownAzimuth) && {!GVAR(isKeyDownDistance)}) then { + if (_isReady) then { + call FUNC(showRelativeHeightLength); + }; + [false] call FUNC(showCenter); + [false] call FUNC(showP1); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + + }; + case ("relative_azimuth+distance"): { private "_isReady"; @@ -154,6 +182,30 @@ switch (_this select 0) do { }; + case ("fall_of_short"): { + + private "_isReady"; + _isReady = diag_tickTime > GVAR(keyDownTimeDistance) + 0.5; + + [_isReady] call FUNC(showCenter); + + if (!GVAR(isKeyDownAzimuth) && {!GVAR(isKeyDownDistance)}) then { + if (_isReady) then { + GVAR(FOSData) = call FUNC(getFallOfShort);// + [false] call FUNC(showFallOfShort); + }; + [false] call FUNC(showCenter); + [false] call FUNC(showP1); + + [_this select 1] call CBA_fnc_removePerFrameHandler; + + if (GVAR(holdKeyHandler) > -1) then { + GVAR(holdKeyHandler) = -1; + }; + }; + + }; + }; -systemChat str (_this select 0);// +//systemChat str (_this select 0); diff --git a/addons/vector/functions/fnc_onKeyUp.sqf b/addons/vector/functions/fnc_onKeyUp.sqf index 4a86e6bc0d..5fc2d84092 100644 --- a/addons/vector/functions/fnc_onKeyUp.sqf +++ b/addons/vector/functions/fnc_onKeyUp.sqf @@ -24,12 +24,23 @@ switch (_this select 0) do { GVAR(isKeyDownAzimuth) = false; if (GVAR(isKeyDownDistance)) then { - if (GVAR(currentMode) == "distance") then { - ["azimuth"] call FUNC(clearDisplay); - [true] call FUNC(showP1); - GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; - "relative_distance" call _fnc_setPFH; + + switch (GVAR(currentMode)) do { + case ("distance"): { + ["azimuth"] call FUNC(clearDisplay); + [true] call FUNC(showP1); + GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; + "relative_distance" call _fnc_setPFH; + }; + + case ("height+distance"): { + ["azimuth"] call FUNC(clearDisplay); + [true] call FUNC(showP1); + GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; + "relative_height+length" call _fnc_setPFH; + }; }; + }; }; @@ -39,12 +50,25 @@ switch (_this select 0) do { GVAR(isKeyDownDistance) = false; if (GVAR(isKeyDownAzimuth)) then { - if (GVAR(currentMode) == "azimuth") then { - ["distance"] call FUNC(clearDisplay); - [true] call FUNC(showP1); - GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; - "relative_azimuth+distance" call _fnc_setPFH; + + switch (GVAR(currentMode)) do { + case ("azimuth"): { + ["azimuth"] call FUNC(clearDisplay); + ["distance"] call FUNC(clearDisplay); + [true] call FUNC(showP1); + GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; + "relative_azimuth+distance" call _fnc_setPFH; + }; + + case ("azimuth+inclination"): { + ["azimuth"] call FUNC(clearDisplay); + ["distance"] call FUNC(clearDisplay); + [true] call FUNC(showP1); + GVAR(pData) = [call FUNC(getDistance), call FUNC(getDirection)]; + "fall_of_short" call _fnc_setPFH; + }; }; + }; }; diff --git a/addons/vector/functions/fnc_showFallOfShort.sqf b/addons/vector/functions/fnc_showFallOfShort.sqf new file mode 100644 index 0000000000..0f2040708e --- /dev/null +++ b/addons/vector/functions/fnc_showFallOfShort.sqf @@ -0,0 +1,55 @@ +// by commy2 +#include "script_component.hpp" + +GVAR(FOSState) = _this select 0; + +private "_dlgVector"; + +disableSerialization; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); + +private "_fosData"; + +_fosData = GVAR(FOSData); + +if !(_this select 0) then { + private "_digits"; + + // of abscissa + _digits = [_fosData, 0] call FUNC(convertToTexturesFOS); + + (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); + (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); + (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 2); + (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 3); + (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 4); + + // of ordinate + _digits = [_fosData, 1] call FUNC(convertToTexturesFOS); + + (_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); + (_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); + (_dlgVector displayCtrl 1317) ctrlSetText (_digits select 2); + (_dlgVector displayCtrl 1318) ctrlSetText (_digits select 3); + (_dlgVector displayCtrl 1319) ctrlSetText (_digits select 4); + +} else { + private "_digits"; + + // applicate + _digits = [_fosData, 2] call FUNC(convertToTexturesFOS); + + (_dlgVector displayCtrl 1310) ctrlSetText (_digits select 0); + (_dlgVector displayCtrl 1311) ctrlSetText (_digits select 1); + (_dlgVector displayCtrl 1312) ctrlSetText (_digits select 2); + (_dlgVector displayCtrl 1313) ctrlSetText (_digits select 3); + (_dlgVector displayCtrl 1314) ctrlSetText (_digits select 4); + + // nothing + (_dlgVector displayCtrl 1315) ctrlSetText ""; + (_dlgVector displayCtrl 1316) ctrlSetText ""; + (_dlgVector displayCtrl 1317) ctrlSetText ""; + (_dlgVector displayCtrl 1318) ctrlSetText ""; + (_dlgVector displayCtrl 1319) ctrlSetText ""; + +}; diff --git a/addons/vector/functions/fnc_showRelativeHeightLength.sqf b/addons/vector/functions/fnc_showRelativeHeightLength.sqf new file mode 100644 index 0000000000..599195f376 --- /dev/null +++ b/addons/vector/functions/fnc_showRelativeHeightLength.sqf @@ -0,0 +1,27 @@ +// by commy2 +#include "script_component.hpp" + +private "_dlgVector"; + +disableSerialization; +_dlgVector = GETUVAR(ACE_dlgVector,displayNull); + +private ["_heightLength", "_digits"]; + +_heightLength = call FUNC(getRelativeHeightLength); + +// height +_digits = [_heightLength select 0] call FUNC(convertToTexturesDistance); + +(_dlgVector displayCtrl 1311) ctrlSetText (_digits select 0); +(_dlgVector displayCtrl 1312) ctrlSetText (_digits select 1); +(_dlgVector displayCtrl 1313) ctrlSetText (_digits select 2); +(_dlgVector displayCtrl 1314) ctrlSetText (_digits select 3); + +// length +_digits = [_heightLength select 1] call FUNC(convertToTexturesDistance); + +(_dlgVector displayCtrl 1315) ctrlSetText (_digits select 0); +(_dlgVector displayCtrl 1316) ctrlSetText (_digits select 1); +(_dlgVector displayCtrl 1317) ctrlSetText (_digits select 2); +(_dlgVector displayCtrl 1318) ctrlSetText (_digits select 3); diff --git a/addons/vector/rsc/_debug_crosshair.paa b/addons/vector/rsc/_debug_crosshair.paa deleted file mode 100644 index cce3aa8f4a..0000000000 Binary files a/addons/vector/rsc/_debug_crosshair.paa and /dev/null differ diff --git a/addons/vector/rsc/doo.paa b/addons/vector/rsc/_vector_degree.paa similarity index 100% rename from addons/vector/rsc/doo.paa rename to addons/vector/rsc/_vector_degree.paa diff --git a/addons/vector/rsc/di.paa b/addons/vector/rsc/_vector_i.paa similarity index 100% rename from addons/vector/rsc/di.paa rename to addons/vector/rsc/_vector_i.paa diff --git a/addons/vector/rsc/dq.paa b/addons/vector/rsc/_vector_q.paa similarity index 100% rename from addons/vector/rsc/dq.paa rename to addons/vector/rsc/_vector_q.paa diff --git a/addons/vector/rsc/dt.paa b/addons/vector/rsc/_vector_t.paa similarity index 100% rename from addons/vector/rsc/dt.paa rename to addons/vector/rsc/_vector_t.paa diff --git a/addons/vector/rsc/dL.paa b/addons/vector/rsc/vector_l.paa similarity index 100% rename from addons/vector/rsc/dL.paa rename to addons/vector/rsc/vector_l.paa diff --git a/addons/vector/rsc/dn.paa b/addons/vector/rsc/vector_n.paa similarity index 100% rename from addons/vector/rsc/dn.paa rename to addons/vector/rsc/vector_n.paa diff --git a/addons/vector/rsc/dr.paa b/addons/vector/rsc/vector_r.paa similarity index 100% rename from addons/vector/rsc/dr.paa rename to addons/vector/rsc/vector_r.paa diff --git a/addons/vector/rsc/dU.paa b/addons/vector/rsc/vector_u.paa similarity index 100% rename from addons/vector/rsc/dU.paa rename to addons/vector/rsc/vector_u.paa diff --git a/addons/weaponselect/$PBOPREFIX$ b/addons/weaponselect/$PBOPREFIX$ new file mode 100644 index 0000000000..dc7951fb37 --- /dev/null +++ b/addons/weaponselect/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\weaponselect \ No newline at end of file diff --git a/addons/weaponselect/CfgEventHandlers.hpp b/addons/weaponselect/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f409a36e5a --- /dev/null +++ b/addons/weaponselect/CfgEventHandlers.hpp @@ -0,0 +1,20 @@ + +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_FiredBIS_EventHandlers { + class CAManBase { + class GVAR(ThrowGrenade) { + clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(throwGrenade)};); + }; + }; +}; diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf new file mode 100644 index 0000000000..3414f64c52 --- /dev/null +++ b/addons/weaponselect/XEH_postInit.sqf @@ -0,0 +1,257 @@ +// by CAA-Picard +#include "script_component.hpp" + +if !(hasInterface) exitWith {}; + +// Add keybinds +["ACE3", + localize "STR_ACE_WeaponSelect_SelectPistol", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, handgunWeapon ACE_player] call FUNC(selectWeaponMode); + true + }, + [2, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectRifle", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMode); + true + }, + [3, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectLauncher", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, secondaryWeapon ACE_player] call FUNC(selectWeaponMode); + true + }, + [5, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, primaryWeapon ACE_player] call FUNC(selectWeaponMuzzle); + true + }, + [4, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectBinocular", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player, binocular ACE_player] call FUNC(selectWeaponMode); + true + }, + [6, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(selectGrenadeFrag); + true + }, + [7, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectGrenadeOther", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(selectGrenadeOther); + true + }, + [8, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_HolsterWeapon", + { + // Conditions: canInteract + _exceptions = [QEGVAR(interaction,isNotEscorting)]; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; + + // Statement + [ACE_player] call FUNC(putWeaponAway); + true + }, + [11, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_EngineOn", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; + + // Statement + (vehicle ACE_player) engineOn true; + true + }, + [3, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_EngineOff", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; + + // Statement + (vehicle ACE_player) engineOn false; + true + }, + [2, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectMainGun", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, 0] call FUNC(selectWeaponVehicle); + true + }, + [4, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectMachineGun", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, 1] call FUNC(selectWeaponVehicle); + true + }, + [5, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_SelectMissiles", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player) exitWith {false}; + + // Statement + [ACE_player, vehicle ACE_player, 2] call FUNC(selectWeaponVehicle); + true + }, + [6, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; + +["ACE3", + localize "STR_ACE_WeaponSelect_FireSmokeLauncher", + { + // Conditions: canInteract + _exceptions = []; + if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + // Conditions: specific + if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; + + // Statement + [vehicle ACE_player] call FUNC(fireSmokeLauncher); + true + }, + [10, [false, false, false]], + false, + "keydown" +] call cba_fnc_registerKeybind; diff --git a/addons/weaponselect/XEH_preInit.sqf b/addons/weaponselect/XEH_preInit.sqf new file mode 100644 index 0000000000..ec81c4834e --- /dev/null +++ b/addons/weaponselect/XEH_preInit.sqf @@ -0,0 +1,65 @@ +#include "script_component.hpp" + +PREP(countMagazinesForGrenadeMuzzle); +PREP(displayGrenadeTypeAndNumber); +PREP(findNextGrenadeMagazine); +PREP(findNextGrenadeMuzzle); +PREP(fireSmokeLauncher); +PREP(getSelectedGrenade); +PREP(getWeaponModes); +PREP(getWeaponMuzzles); +PREP(playChangeFiremodeSound); +PREP(putWeaponAway); +PREP(selectGrenadeAll); +PREP(selectGrenadeFrag); +PREP(selectGrenadeOther); +PREP(selectWeaponMode); +PREP(selectWeaponMuzzle); +PREP(selectWeaponVehicle); +PREP(setNextGrenadeMuzzle); +PREP(throwGrenade); + +// prepare grenades from config +GVAR(CurrentGrenadeMuzzleIsFrag) = true; +GVAR(CurrentGrenadeMuzzleFrag) = ""; +GVAR(CurrentGrenadeMuzzleOther) = ""; + +// Collect frag and other muzzles separately +with uiNamespace do { + if (isNil QGVAR(FragMuzzles)) then { + GVAR(FragMuzzles) = []; + GVAR(NonFragMuzzles) = []; + GVAR(AllMuzzles) = []; + + GVAR(FragMagazines) = []; + GVAR(NonFragMagazines) = []; + GVAR(AllMagazines) = []; + + { + _magazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines"); + _magazine = _magazines select 0; + + _ammo = getText (configfile >> "CfgMagazines" >> _magazine >> "ammo"); + _explosive = getNumber (configfile >> "CfgAmmo" >> _ammo >> "explosive"); + + if (_explosive == 0) then { + GVAR(NonFragMuzzles) pushBack _x; + GVAR(NonFragMagazines) pushBack _magazines; + } else { + GVAR(FragMuzzles) pushBack _x; + GVAR(FragMagazines) pushBack _magazines; + }; + + GVAR(AllMuzzles) pushBack _x; + GVAR(AllMagazines) pushBack _magazines; + + } forEach getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); + }; +}; + +GVAR(FragMuzzles) = uiNamespace getVariable QGVAR(FragMuzzles); +GVAR(NonFragMuzzles) = uiNamespace getVariable QGVAR(NonFragMuzzles); +GVAR(AllMuzzles) = uiNamespace getVariable QGVAR(AllMuzzles); +GVAR(FragMagazines) = uiNamespace getVariable QGVAR(FragMagazines); +GVAR(NonFragMagazines) = uiNamespace getVariable QGVAR(NonFragMagazines); +GVAR(AllMagazines) = uiNamespace getVariable QGVAR(AllMagazines); diff --git a/addons/weaponselect/config.cpp b/addons/weaponselect/config.cpp new file mode 100644 index 0000000000..adebcd322c --- /dev/null +++ b/addons/weaponselect/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"commy2","KoffeinFlummi","CAA-Picard"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf new file mode 100644 index 0000000000..4803978902 --- /dev/null +++ b/addons/weaponselect/functions/fnc_countMagazinesForGrenadeMuzzle.sqf @@ -0,0 +1,55 @@ +/* + * Author: CAA-Picard + * + * Count how many grenade magazines the unit has on the uniform and vest. + * + * Argument: + * 0: Muzzle name + * + * Return value: + * 0: Number of magazines + * 1: First magazine name + */ +#include "script_component.hpp" + +private ["_unit", "_muzzle"]; + +_unit = _this select 0; +_muzzle = _this select 1; + +private ["_uniformMags", "_vestMags", "_backPackMags"]; + +_uniformMags = getMagazineCargo uniformContainer _unit; +_vestMags = getMagazineCargo vestContainer _unit; +_backPackMags = getMagazineCargo backpackContainer _unit; + +private ["_numberOfMagazines", "_magazineClasses", "_firstMagazine"]; + +_numberOfMagazines = 0; +_magazineClasses = getArray (configFile >> "CfgWeapons" >> "Throw" >> _muzzle >> "magazines"); +_firstMagazine = _magazineClasses select 0; + +{ + private ["_indexInUniform", "_indexInVest", "_indexInBackpack"]; + + _indexInUniform = (_uniformMags select 0) find _x; + if (_indexInUniform > -1) then { + _numberOfMagazines = _numberOfMagazines + ((_uniformMags select 1) select _indexInUniform); + _firstMagazine = _x; + }; + + _indexInVest = (_vestMags select 0) find _x; + if (_indexInVest > -1) then { + _numberOfMagazines = _numberOfMagazines + ((_vestMags select 1) select _indexInVest); + _firstMagazine = _x; + }; + + _indexInBackpack = (_backpackMags select 0) find _x; + if (_indexInBackpack > -1) then { + _numberOfMagazines = _numberOfMagazines + ((_backpackMags select 1) select _indexInBackpack); + _firstMagazine = _x; + }; + +} forEach _magazineClasses; + +[_numberOfMagazines, _firstMagazine] diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_displayGrenadeTypeAndNumber.sqf b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf similarity index 61% rename from TO_MERGE/agm/WeaponSelect/functions/fn_displayGrenadeTypeAndNumber.sqf rename to addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf index abe1bf0e27..2f8a4c3f87 100644 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_displayGrenadeTypeAndNumber.sqf +++ b/addons/weaponselect/functions/fnc_displayGrenadeTypeAndNumber.sqf @@ -10,18 +10,19 @@ * Return value: * None */ +#include "script_component.hpp" + +private ["_magazine", "_numberofMagazines"]; _magazine = _this select 0; _numberofMagazines = _this select 1; -_color = []; -if (_numberOfMagazines > 0) then { - _color = [1,1,1]; -} else { - _color = [1,0,0]; -}; +private ["_color", "_name", "_text", "_picture"]; +_color = [[1,0,0], [1,1,1]] select (_numberOfMagazines > 0); _name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); + +_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call EFUNC(common,stringToColoredText); _picture = getText (configFile >> "CfgMagazines" >> _magazine >> "picture"); -_text = [format["%1 x%2", _name, _numberOfMagazines], _color] call AGM_Core_fnc_stringToColoredText; -[_text, _picture] call AGM_Core_fnc_displayTextPicture; + +[_text, _picture] call EFUNC(common,displayTextPicture); diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf new file mode 100644 index 0000000000..02a13ec932 --- /dev/null +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMagazine.sqf @@ -0,0 +1,35 @@ +// by commy2 +#include "script_component.hpp" + +private ["_type", "_allMags", "_allMuzzles", "_magazines"]; + +_type = _this select 0; //"All", "Frag" or "NonFrag" + +_allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; +_allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; + +_magazines = magazines ACE_player; + +private ["_start", "_index", "_nextMagazine"]; + +_start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); +_index = _allMuzzles find _start; + +scopeName "SearchMain"; + +_nextMagazine = ""; +for "_index" from (_index + 1) to (count _allMuzzles - 1) do { + { + if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"}; + } count _magazines; +}; + +if (_nextMagazine != "") exitWith {_nextMagazine}; + +for "_index" from 0 to _index do { + { + if (_x in (_allMags select _index)) exitWith {_nextMagazine = _x; breakTo "SearchMain"}; + } count _magazines; +}; + +_nextMagazine diff --git a/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf new file mode 100644 index 0000000000..76b4efd894 --- /dev/null +++ b/addons/weaponselect/functions/fnc_findNextGrenadeMuzzle.sqf @@ -0,0 +1,35 @@ +// by commy2 +#include "script_component.hpp" + +private ["_type", "_allMags", "_allMuzzles", "_magazines"]; + +_type = _this select 0; //"All", "Frag" or "NonFrag" + +_allMags = missionNamespace getVariable [format [QGVAR(%1Magazines), _type], []]; +_allMuzzles = missionNamespace getVariable [format [QGVAR(%1Muzzles), _type], []]; + +_magazines = magazines ACE_player; + +private ["_start", "_index", "_nextMuzzle"]; + +_start = [GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag); +_index = _allMuzzles find _start; + +scopeName "SearchMain"; + +_nextMuzzle = ""; +for "_index" from (_index + 1) to (count _allMuzzles - 1) do { + { + if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"}; + } count _magazines; +}; + +if (_nextMuzzle != "") exitWith {_nextMuzzle}; + +for "_index" from 0 to _index do { + { + if (_x in (_allMags select _index)) exitWith {_nextMuzzle = _allMuzzles select _index; breakTo "SearchMain"}; + } count _magazines; +}; + +_nextMuzzle diff --git a/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf new file mode 100644 index 0000000000..14c86f78dd --- /dev/null +++ b/addons/weaponselect/functions/fnc_fireSmokeLauncher.sqf @@ -0,0 +1,39 @@ +// by commy2 +#include "script_component.hpp" + +private ["_vehicle", "_turret", "_weapons"]; + +_vehicle = _this select 0; + +_turret = [typeOf _vehicle] call EFUNC(common,getTurretCommander); + +_weapons = _vehicle weaponsTurret _turret; + +if ( + count _weapons > 1 + || {count _weapons > 0 && {!(_weapons select 0 in ["SmokeLauncher", "BWA3_SmokeLauncher"])}} // @todo somebody might use custom smoke launcher weapons aswell, maybe ... +) then { + //This doesn't work reliably for vehilces with additional weapons for the commander. Select smoke launcher instead. + + private "_index"; + + // avoid infinite loop + if !("SmokeLauncher" in _weapons) exitWith {}; + + _index = 0; + while { + _vehicle currentWeaponTurret _turret != "SmokeLauncher" + } do { + [commander _vehicle, _vehicle, _index] call FUNC(selectWeaponVehicle); + _index = _index + 1; + }; + +} else { + // fire away! + + private "_logic"; + + _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"]; + _logic action ["useWeapon", _vehicle, commander _vehicle, 0]; + deleteVehicle _logic; +}; diff --git a/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf new file mode 100644 index 0000000000..5e8c3f920f --- /dev/null +++ b/addons/weaponselect/functions/fnc_getSelectedGrenade.sqf @@ -0,0 +1,4 @@ +// by commy2 +#include "script_component.hpp" + +[GVAR(CurrentGrenadeMuzzleOther), GVAR(CurrentGrenadeMuzzleFrag)] select GVAR(CurrentGrenadeMuzzleIsFrag) diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_getWeaponModes.sqf b/addons/weaponselect/functions/fnc_getWeaponModes.sqf similarity index 60% rename from TO_MERGE/agm/WeaponSelect/functions/fn_getWeaponModes.sqf rename to addons/weaponselect/functions/fnc_getWeaponModes.sqf index 52d4dd73ea..c5f04d1e5d 100644 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_getWeaponModes.sqf +++ b/addons/weaponselect/functions/fnc_getWeaponModes.sqf @@ -9,6 +9,7 @@ * Return value: * All firing modes (Array) */ +#include "script_component.hpp" private ["_weapon", "_modes"]; @@ -16,11 +17,14 @@ _weapon = _this select 0; _modes = []; { - if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { - _modes pushBack _x; - }; - if (_x == "this") then { - _modes pushBack _weapon; - }; + if (getNumber (configFile >> "CfgWeapons" >> _weapon >> _x >> "showToPlayer") == 1) then { + _modes pushBack _x; + }; + + if (_x == "this") then { + _modes pushBack _weapon; + }; + } forEach getArray (configfile >> "CfgWeapons" >> _weapon >> "modes"); + _modes diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_getWeaponMuzzles.sqf b/addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf similarity index 80% rename from TO_MERGE/agm/WeaponSelect/functions/fn_getWeaponMuzzles.sqf rename to addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf index 16ac740642..a3e308abfc 100644 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_getWeaponMuzzles.sqf +++ b/addons/weaponselect/functions/fnc_getWeaponMuzzles.sqf @@ -9,6 +9,7 @@ * Return value: * All weapon muzzles (Array) */ +#include "script_component.hpp" private ["_weapon", "_muzzles"]; @@ -17,6 +18,7 @@ _weapon = _this select 0; _muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles"); if ("this" in _muzzles) then { - _muzzles set [_muzzles find "this", _weapon]; + _muzzles set [_muzzles find "this", _weapon]; }; + _muzzles diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_playChangeFiremodeSound.sqf b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf similarity index 74% rename from TO_MERGE/agm/WeaponSelect/functions/fn_playChangeFiremodeSound.sqf rename to addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf index 8eb9b6178a..82901a1b52 100644 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_playChangeFiremodeSound.sqf +++ b/addons/weaponselect/functions/fnc_playChangeFiremodeSound.sqf @@ -1,4 +1,5 @@ // by commy2 +#include "script_component.hpp" private ["_unit", "_weapon", "_sound"]; @@ -11,12 +12,12 @@ if (count _sound == 0) exitWith {}; // add file extension if call { - { - if (toLower (_sound select 0) find _x == count toArray (_sound select 0) - count toArray _x - 1) exitWith {false}; - true - } forEach [".wav", ".ogg", ".wss"]; + { + if (toLower (_sound select 0) find _x == count toArray (_sound select 0) - count toArray _x - 1) exitWith {false}; + true + } forEach [".wav", ".ogg", ".wss"]; } then { - _sound set [0, (_sound select 0) + ".wss"]; + _sound set [0, (_sound select 0) + ".wss"]; }; // add default volume, pitch and distance diff --git a/TO_MERGE/agm/WeaponSelect/functions/fn_putWeaponAway.sqf b/addons/weaponselect/functions/fnc_putWeaponAway.sqf similarity index 51% rename from TO_MERGE/agm/WeaponSelect/functions/fn_putWeaponAway.sqf rename to addons/weaponselect/functions/fnc_putWeaponAway.sqf index 2be2670598..7c0bc47cd7 100644 --- a/TO_MERGE/agm/WeaponSelect/functions/fn_putWeaponAway.sqf +++ b/addons/weaponselect/functions/fnc_putWeaponAway.sqf @@ -9,11 +9,12 @@ * Return value: * None. */ +#include "script_component.hpp" -private "_player"; +private "_unit"; -_player = _this select 0; +_unit = _this select 0; -[_player] call AGM_Core_fnc_fixLoweredRifleAnimation; +[_unit] call EFUNC(common,fixLoweredRifleAnimation); -_player action ["SwitchWeapon", _player, _player, 99]; +_unit action ["SwitchWeapon", _unit, _unit, 99]; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf new file mode 100644 index 0000000000..685ef4b76e --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectGrenadeAll.sqf @@ -0,0 +1,50 @@ +/* + * Author: CAA-Picard, commy2 + * + * Cycle through all grenades. + * + * Argument: + * None + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_unit", "_nextMuzzle"]; + +_unit = _this select 0; + +_nextMuzzle = ["All"] call FUNC(findNextGrenadeMuzzle); + +if (_nextMuzzle != "") then { + + + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(AllMagazines) select (GVAR(AllMuzzles) find _nextMuzzle); + reverse _magazines; + + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + +} else { + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; GVAR(CurrentGrenadeMuzzleOther) = ""; + + _text = [localize "STR_ACE_WeaponSelect_NoGrenadesLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + +}; + +if (_nextMuzzle in GVAR(FragMuzzles)) then { + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = true; +} else { + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + GVAR(CurrentGrenadeMuzzleIsFrag) = false; +}; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf new file mode 100644 index 0000000000..4b6c4dabb2 --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectGrenadeFrag.sqf @@ -0,0 +1,44 @@ +/* + * Author: CAA-Picard, commy2 + * + * Cycle through frags. + * + * Argument: + * None + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_unit", "_nextMuzzle"]; + +_unit = _this select 0; + +_nextMuzzle = ["Frag"] call FUNC(findNextGrenadeMuzzle); + +if (_nextMuzzle != "") then { + GVAR(CurrentGrenadeMuzzleFrag) = _nextMuzzle; + + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(FragMagazines) select (GVAR(FragMuzzles) find _nextMuzzle); + reverse _magazines; + + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + +} else { + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleFrag) = ""; + + _text = [localize "STR_ACE_WeaponSelect_NoFragsLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + +}; + +GVAR(CurrentGrenadeMuzzleIsFrag) = true; diff --git a/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf new file mode 100644 index 0000000000..62b5325011 --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectGrenadeOther.sqf @@ -0,0 +1,44 @@ +/* + * Author: CAA-Picard, commy2 + * + * Cycle through non explosive grenades. + * + * Argument: + * None + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_unit", "_nextMuzzle"]; + +_unit = _this select 0; + +_nextMuzzle = ["NonFrag"] call FUNC(findNextGrenadeMuzzle); + +if (_nextMuzzle != "") then { + GVAR(CurrentGrenadeMuzzleOther) = _nextMuzzle; + + private ["_magazines", "_magazine", "_count", "_return"]; + _magazines = GVAR(NonFragMagazines) select (GVAR(NonFragMuzzles) find _nextMuzzle); + reverse _magazines; + + _magazine = ""; + _count = {_return = _x in _magazines; if (_return) then {_magazine = _x}; _return} count magazines _unit; + + // There is a muzzle with magazines --> cycle to it + [_unit, _nextMuzzle] call FUNC(setNextGrenadeMuzzle); + + [_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + +} else { + // There is a no muzzle with magazines --> select nothing + GVAR(CurrentGrenadeMuzzleOther) = ""; + + _text = [localize "STR_ACE_WeaponSelect_NoMiscGrenadeLeft", [1,0,0]] call EFUNC(common,stringToColoredText); + [composeText [lineBreak, _text]] call EFUNC(common,displayTextStructured); + +}; + +GVAR(CurrentGrenadeMuzzleIsFrag) = false; diff --git a/addons/weaponselect/functions/fnc_selectWeaponMode.sqf b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf new file mode 100644 index 0000000000..236f934257 --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectWeaponMode.sqf @@ -0,0 +1,53 @@ +/* + * Author: commy2 + * + * The player will select the specified weapon or will change to the next firing mode if the weapon was already selected. + * + * Argument: + * 0: A weapon (String) + * + * Return value: + * None. + */ +#include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +if (_weapon == "") exitWith {}; + +if (currentWeapon _unit != _weapon) exitWith { + _unit selectWeapon _weapon; +}; + +// unlock safety +if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { + [_unit, _weapon, _weapon] call EFUNC(safemode,unlockSafety); +}; + +private ["_muzzles", "_modes"]; + +_muzzles = [_weapon] call FUNC(getWeaponMuzzles); +_modes = [_weapon] call FUNC(getWeaponModes); + + +private ["_index", "_muzzle", "_mode"]; + +_index = (_modes find currentWeaponMode _unit) + 1; +if (_index > count _modes - 1) then {_index = 0}; + +_muzzle = _muzzles select 0; +_mode = _modes select _index; + +_index = 0; +while { + _index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}} +} do { + _unit action ["SwitchWeapon", _unit, _unit, _index]; + _index = _index + 1; +}; + +// play fire mode selector sound +[_unit, _weapon] call FUNC(playChangeFiremodeSound); diff --git a/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf new file mode 100644 index 0000000000..95e5a9a2aa --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectWeaponMuzzle.sqf @@ -0,0 +1,50 @@ +/* + * Author: commy2 + * + * The player will select the specified weapon and change to the first additional muzzle. E.g. the grenade launcher of a assault rifle. + * + * Argument: + * 0: A weapon (String) + * + * Return value: + * None. + */ +#include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +if (_weapon == "") exitWith {}; + +private "_muzzles"; +_muzzles = [_weapon] call FUNC(getWeaponMuzzles); + +if (currentWeapon _unit != _weapon) exitWith { + if (count _muzzles > 1) then { + + // unlock safety + /*if (_weapon in (_unit getVariable [QEGVAR(safemode,safedWeapons), []])) exitWith { + [_unit, _weapon, _muzzles select 1] call EFUNC(safemode,unlockSafety); + };*/ + + _unit selectWeapon (_muzzles select 1); + }; +}; + +private ["_index", "_muzzle"]; + +_index = (_muzzles find currentMuzzle _unit) + 1; +if (_index > count _muzzles - 1) then {_index = 1}; + +_muzzle = _muzzles select _index; + + +_index = 0; +while { + _index < 100 && {currentMuzzle _unit != _muzzle} +} do { + _unit action ["SwitchWeapon", _unit, _unit, _index]; + _index = _index + 1; +}; diff --git a/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf new file mode 100644 index 0000000000..929537b7fa --- /dev/null +++ b/addons/weaponselect/functions/fnc_selectWeaponVehicle.sqf @@ -0,0 +1,45 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_vehicle", "_index"]; + +_unit = _this select 0; +_vehicle = _this select 1; +_index = _this select 2; + +private "_turret"; +_turret = [_unit] call EFUNC(common,getTurretIndex); + +if (_turret isEqualTo [] && {_unit == driver _vehicle}) then { + private ["_weapons", "_weapon"]; + + _weapons = weapons _vehicle; + if (_index > count _weapons - 1) exitWith {}; + + _weapon = _weapons select _index; + + _index = 0; + while { + _index < 100 && {currentWeapon _vehicle != _weapon} + } do { + _unit action ["SwitchWeapon", _vehicle, _unit, _index]; + _index = _index + 1; + }; + +} else { + private ["_weapons", "_weapon"]; + + _weapons = _vehicle weaponsTurret _turret; + if (_index > count _weapons - 1) exitWith {}; + + _weapon = _weapons select _index; + + _index = 0; + while { + _index < 100 && {_vehicle currentWeaponTurret _turret != _weapon} + } do { + _unit action ["SwitchWeapon", _vehicle, _unit, _index]; + _index = _index + 1; + }; + +}; diff --git a/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf new file mode 100644 index 0000000000..67ab15e1a7 --- /dev/null +++ b/addons/weaponselect/functions/fnc_setNextGrenadeMuzzle.sqf @@ -0,0 +1,121 @@ +/* + * Author: CAA-Picard + * + * Select the next grenade muzzle to throw. + * + * Argument: + * muzzle name + * + * Return value: + * None + * + */ +#include "script_component.hpp" + +private ["_unit", "_muzzle"]; + +_unit = _this select 0; +_muzzle = _this select 1; + +private ["_uniformMags", "_vestMags", "_backPackMags"]; + +_uniformMags = getMagazineCargo uniformContainer _unit; +_vestMags = getMagazineCargo vestContainer _unit; +_backPackMags = getMagazineCargo backpackContainer _unit; + +private ["_uniformMagsToRemove", "_vestMagsToRemove", "_backPackMagsToRemove"]; + +_uniformMagsToRemove = []; +_vestMagsToRemove = []; +_backPackMagsToRemove = []; + +private ["_firstMagazine", "_throwMuzzleNames"]; + +_firstMagazine = ""; +_throwMuzzleNames = getArray (configfile >> "CfgWeapons" >> "Throw" >> "muzzles"); + +// Collect which magazines to remove +{ + private "_muzzleMagazines"; + _muzzleMagazines = getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines" ); + + if (_x != _muzzle) then { + + { + private "_index"; + _index = (_uniformMags select 0) find _x; + if (_index > -1) then { + _uniformMagsToRemove = _uniformMagsToRemove + [[_x, (_uniformMags select 1) select _index]]; + }; + + _index = (_vestMags select 0) find _x; + if (_index > -1) then { + _vestMagsToRemove = _vestMagsToRemove + [[_x, (_vestMags select 1) select _index]]; + }; + + _index = (_backpackMags select 0) find _x; + if (_index > -1) then { + _backpackMagsToRemove = _backpackMagsToRemove + [[_x, (_backpackMags select 1) select _index]]; + }; + } forEach _muzzleMagazines; + + } else { + + { + private "_index"; + _index = (_uniformMags select 0) find _x; + if (_index > -1) then { + _firstMagazine = _x; + }; + + _index = (_vestMags select 0) find _x; + if (_index > -1) then { + _firstMagazine = _x; + }; + + _index = (_backpackMags select 0) find _x; + if (_index > -1) then { + _firstMagazine = _x; + }; + } forEach _muzzleMagazines; + + }; +} forEach _throwMuzzleNames; + +// Remove all magazines except those we are switching to --> this breaks the selector +{ + for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { + _unit removeItem (_x select 0); + }; +} forEach _uniformMagsToRemove; + +{ + for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { + _unit removeItem (_x select 0); + }; +} forEach _vestMagsToRemove; + +{ + for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { + _unit removeItem (_x select 0); + }; +} forEach _backPackMagsToRemove; + +// Readd magazines +{ + for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { + _unit addItemToUniform (_x select 0); + }; +} forEach _uniformMagsToRemove; + +{ + for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { + _unit addItemToVest (_x select 0); + }; +} forEach _vestMagsToRemove; + +{ + for [{_i = 0}, {_i < (_x select 1)}, {_i = _i + 1}] do { + _unit addItemToBackpack (_x select 0); + }; +} forEach _backPackMagsToRemove; diff --git a/addons/weaponselect/functions/fnc_throwGrenade.sqf b/addons/weaponselect/functions/fnc_throwGrenade.sqf new file mode 100644 index 0000000000..e62e118e71 --- /dev/null +++ b/addons/weaponselect/functions/fnc_throwGrenade.sqf @@ -0,0 +1,19 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weapon", "_magazine"]; + +_unit = _this select 0; +_weapon = _this select 1; +_magazine = _this select 5; + +if (_weapon != "Throw") exitWith {}; + +private "_count"; +_count = {_x == _magazine} count magazines _unit; + +[_magazine, _count] call FUNC(displayGrenadeTypeAndNumber); + +if (_count == 0) then { + if (GVAR(CurrentGrenadeMuzzleIsFrag)) then {GVAR(CurrentGrenadeMuzzleFrag) = ""} else {GVAR(CurrentGrenadeMuzzleOther) = ""}; +}; diff --git a/addons/weaponselect/functions/script_component.hpp b/addons/weaponselect/functions/script_component.hpp new file mode 100644 index 0000000000..b7e33ed562 --- /dev/null +++ b/addons/weaponselect/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\weaponselect\script_component.hpp" \ No newline at end of file diff --git a/addons/weaponselect/script_component.hpp b/addons/weaponselect/script_component.hpp new file mode 100644 index 0000000000..eec47cc4b1 --- /dev/null +++ b/addons/weaponselect/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT weaponselect +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_WEAPONSELECT + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_WEAPONSELECT + #define DEBUG_SETTINGS DEBUG_ENABLED_WEAPONSELECT +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file diff --git a/TO_MERGE/agm/WeaponSelect/stringtable.xml b/addons/weaponselect/stringtable.xml similarity index 90% rename from TO_MERGE/agm/WeaponSelect/stringtable.xml rename to addons/weaponselect/stringtable.xml index 0d0c687745..a8c736b4fb 100644 --- a/TO_MERGE/agm/WeaponSelect/stringtable.xml +++ b/addons/weaponselect/stringtable.xml @@ -1,8 +1,8 @@  - + - + Select Pistol Pistole auswählen Seleccionar pistola @@ -14,7 +14,7 @@ Selecionar Pistola Seleziona la Pistola - + Select Rifle Gewehr auswählen Seleccionar fusil @@ -26,7 +26,7 @@ Selecionar Rifle Seleziona il Fucile - + Select Launcher Raketenwerfer auswählen Seleccionar lanzador @@ -38,7 +38,7 @@ Selecionar Lançador Seleziona il Lanciatore - + Select Grenade Launcher Granatwerfer auswählen Seleccionar lanzador de granadas @@ -50,7 +50,7 @@ Selecionar Lança-Granadas Seleziona il Lanciagranate - + Select Binoculars Fernglas auswählen Seleccionar prismáticos @@ -62,7 +62,7 @@ Selecionar Binóculos Seleziona il Binocolo - + Holster Weapon Waffe holstern Enfundar el arma @@ -74,7 +74,7 @@ Guardar Arma Nascondi l'arma - + Engine on Motor an Encender motor @@ -86,7 +86,7 @@ Motore acceso Включить двигатель - + Engine off Motor aus Apagar motor @@ -98,7 +98,7 @@ Motore spento Выключить двигатель - + Select Main Gun Hauptgeschütz auswählen Seleccionar arma principal @@ -110,7 +110,7 @@ Seleziona Arma Primaria Выбрать основное оружие - + Select Machine Gun Maschinengewehr auswählen Seleccionar ametralladora @@ -122,7 +122,7 @@ Seleziona Mitragliatrice Выбрать пулемёт - + Select Missiles Raketen auswählen Seleccionar misiles @@ -134,7 +134,7 @@ Seleziona Missili Выбрать ракеты - + Grenade %1 Granate %1 Granada %1 @@ -143,7 +143,7 @@ Gránát Kiválasztása Граната %1 - + Ready Grenade Granate nehmen Granada lista @@ -152,7 +152,7 @@ Kész Gránát Подготовить гранату - + Select Frag Grenade Explosive Granate auswählen Seleccionar granada de fragmenación @@ -164,7 +164,7 @@ Seleziona Granata a Frammentazione Выбрать осколочную гранату - + Select Non-Frag Grenade Nichtexplosive Granate auswählen Seleccionar granada de no fragmentación @@ -176,7 +176,7 @@ Seleziona Altre Granate Выбрать гранату - + Throw Selected Grenade Gewählte Granate werfen Arrojar granada seleccionada @@ -188,7 +188,7 @@ Lancia la Granata Selezionata Бросить выбранную гранату - + No grenades left Keine Granaten übrig No quedan granadas @@ -198,7 +198,7 @@ Nincs több gránát Гранат не осталось - + No frags left Keine explosiven Granaten übrig Sin granadas de fragmentación @@ -210,7 +210,7 @@ Nessuna granata a frammentazione rimanente Осколочныких гранат нет - + No misc. grenades left Keine nichtexplosiven Granaten übrig Sin granadas de varias @@ -222,7 +222,7 @@ Nessun'altra granata rimanente. Невзрывоопасные гранаты закончились - + No grenade selected Keine Granate ausgewählt Granada no seleccionada @@ -234,7 +234,7 @@ Nessuna granata selezionata Нет выбранной гранаты - + Fire Smoke Launcher Rauchwand abfeuern Disparar lanzador de humo diff --git a/addons/wep_dragon/config.cpp b/addons/wep_dragon/config.cpp index 235e643b18..f654e815c9 100644 --- a/addons/wep_dragon/config.cpp +++ b/addons/wep_dragon/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = { "ACE_M47StaticLauncher", "M47Launcher_EP1", "ACE_M47_Daysight" }; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_main", "ace_common" }; - version = VERSION; + VERSION_CONFIG; }; }; diff --git a/addons/wep_javelin/config.cpp b/addons/wep_javelin/config.cpp index 07a1e33d41..0c8fae6154 100644 --- a/addons/wep_javelin/config.cpp +++ b/addons/wep_javelin/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = { "ace_main", "ace_common", "ace_laser" }; - version = VERSION; + VERSION_CONFIG; }; };