diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4eb190..25ee362 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,6 +83,14 @@ jobs: includes: '*.paa;*.xml' flags: '"-clear","-prefix=fr\gsri\vests"' + - name: Build GSRI Lockers + uses: team-gsri/actions-build-addon@0.1.1 + with: + source: 'addons/gsri_lockers' + target: 'addons' + prefix: 'fr\gsri\lockers' + + - name: Upload pbo files uses: actions/upload-artifact@v2 with: diff --git a/addons/gsri_lockers/config.cpp b/addons/gsri_lockers/config.cpp new file mode 100644 index 0000000..ad50526 --- /dev/null +++ b/addons/gsri_lockers/config.cpp @@ -0,0 +1,41 @@ +class CfgPatches { + class gsri_lockers { + units[]={}; + requiredVersion=0.1; + requiredAddons[]={"gsri_uniforms", "gsri_vests", "gsri_headgear", "gsri_backpacks"}; + author="www.gsri.team"; + }; +}; + +class CfgFunctions { + class GSRI { + class preslots { + file="fr\gsri\lockers\functions\preslots"; + class getRegular {}; + class getTad {}; + class getMedic {}; + class getOperator {}; + class getAbl {}; + }; + class lockers { + file="fr\gsri\lockers\functions\lockers"; + class setAsLocker {}; + class setMedicalSkills {}; + }; + }; +}; + +class CfgNotifications { + class GSRI_locker_setMedicalSkills { + title = "%1"; + iconPicture = "%2"; + description = "%3"; + duration = 5; + }; + class GSRI_locker_getPreslot { + title = "$STR_GSRI_locker_getPreslotTitle"; + iconPicture = "\A3\ui_f\data\igui\cfg\simpleTasks\types\armor_ca.paa"; + description = "%1"; + duration = 5; + }; +}; diff --git a/addons/gsri_lockers/functions/lockers/fn_setAsLocker.sqf b/addons/gsri_lockers/functions/lockers/fn_setAsLocker.sqf new file mode 100644 index 0000000..cba88b6 --- /dev/null +++ b/addons/gsri_lockers/functions/lockers/fn_setAsLocker.sqf @@ -0,0 +1,63 @@ +/* + * Author: www.gsri.team + * Set given object as a locker, including actions for : + ** Arsenal, ACE and BI + ** Medical skills, doctor and/or untrained + ** A bunch of preslots + * + * Arguments: + * _locker : object + * + * Return Value: + * None + * + * Example: + * [myCrate] call GSRI_fnc_setAsLocker + * + * Public: No + */ + +// No serverside task +if(isDedicated) exitWith {}; + +// Direct type of target object must be Object +params[["_locker", objNull, [objNull]]]; + +// If target object not defined, abort +if(isNull _locker) exitWith {}; + +private [ + "_actionArsenalMain", + "_arsenalActions", + "_actionPreslotMain", + "_preslotsActions", + "_actionMedicalMain", + "_medicalActions" +]; +_arsenalActions = []; +_preslotsActions = []; +_medicalActions = []; + +// Arsenal actions +_actionArsenalMain = ["actionArsenalMain",localize "STR_GSRI_locker_arsenalMain","\A3\ui_f\data\igui\cfg\simpleTasks\types\rifle_ca.paa",{},{true}] call ace_interact_menu_fnc_createAction; +_arsenalActions pushBack (["actionArsenalACE",localize "STR_GSRI_locker_openArsenalACE","",{params ["_target", "_player"];[_target,_player,true] call ace_arsenal_fnc_openBox},{true}] call ace_interact_menu_fnc_createAction); +_arsenalActions pushBack (["actionArsenalBI",localize "STR_GSRI_locker_openArsenalBI","",{["Open",true] spawn bis_fnc_arsenal},{true}] call ace_interact_menu_fnc_createAction); + +// Preslot actions +_actionPreslotMain = ["actionPreslotMain",localize "STR_GSRI_locker_preslotMain","\A3\ui_f\data\igui\cfg\simpleTasks\types\armor_ca.paa",{},{true}] call ace_interact_menu_fnc_createAction; +_preslotsActions pushBack (["actionOperator",localize "STR_GSRI_locker_gearAsOperator","",GSRI_fnc_getOperator,{true}] call ace_interact_menu_fnc_createAction); +_preslotsActions pushBack (["actionTad",localize "STR_GSRI_locker_gearAsTad","",GSRI_fnc_getTad,{true}] call ace_interact_menu_fnc_createAction); +_preslotsActions pushBack (["actionMedic",localize "STR_GSRI_locker_gearAsMedic","",GSRI_fnc_getMedic,{true}] call ace_interact_menu_fnc_createAction); +_preslotsActions pushBack (["actionRegular",localize "STR_GSRI_locker_gearAsRegular","",GSRI_fnc_getRegular,{true}] call ace_interact_menu_fnc_createAction); +_preslotsActions pushBack (["actionAbl",localize "STR_GSRI_locker_gearAsAbl","",GSRI_fnc_getAbl,{true}] call ace_interact_menu_fnc_createAction); + +// Medical skills actions +_actionMedicalMain = ["actionMedicalMain",localize "STR_GSRI_locker_medicalMain","\z\ace\addons\medical_gui\ui\cross.paa",{},{true}] call ace_interact_menu_fnc_createAction; +_medicalActions pushBack (["actionNoMed",localize "STR_GSRI_locker_medicalNoMed","\fr\gsri\lockers\ui\untrained_co.paa",{[0] call GSRI_fnc_setMedicalSkills},{true}] call ace_interact_menu_fnc_createAction); +_medicalActions pushBack (["actionDoctor",localize "STR_GSRI_locker_medicalDoctor","\z\ace\addons\medical_gui\ui\cross.paa",{[2] call GSRI_fnc_setMedicalSkills},{true}] call ace_interact_menu_fnc_createAction); + +// Adding tree +{ [_locker, 0, ["ACE_MainActions"], _x] call ace_interact_menu_fnc_addActionToObject } forEach [_actionArsenalMain,_actionPreslotMain,_actionMedicalMain]; +{ [_locker, 0, ["ACE_MainActions", "actionArsenalMain"], _x] call ace_interact_menu_fnc_addActionToObject } forEach _arsenalActions; +{ [_locker, 0, ["ACE_MainActions", "actionPreslotMain"], _x] call ace_interact_menu_fnc_addActionToObject } forEach _preslotsActions; +{ [_locker, 0, ["ACE_MainActions", "actionMedicalMain"], _x] call ace_interact_menu_fnc_addActionToObject } forEach _medicalActions; diff --git a/addons/gsri_lockers/functions/lockers/fn_setMedicalSkills.sqf b/addons/gsri_lockers/functions/lockers/fn_setMedicalSkills.sqf new file mode 100644 index 0000000..50b6d69 --- /dev/null +++ b/addons/gsri_lockers/functions/lockers/fn_setMedicalSkills.sqf @@ -0,0 +1,29 @@ +/* + * Author: www.gsri.team + * Set ACE medical skills. On this server, only skill 0 (untrained) and 2 (doctor) are used, skill 1 (medic) is not expected to appear here. + * + * Arguments: + * _skill : Integer, 0 or 2 + * + * Return Value: + * None + * + * Example: + * [2] call GSRI_fnc_setMedicalSkill + * + * Public: No + */ + +params[["_skill", -1, [0]]]; + +// This will filter out any number other than 0 or 2. If the argument is not an integer, the default value -1 will be used (and a script error displayed), so this line will also catch it. +if !(_skill in [0,2]) exitWith { ["Skill level %1 unknown.", _skill] call BIS_fnc_error }; + +// There is apparently no better way to change a player's medical skill, ACE itself does it this way. +player setVariable ["ace_medical_medicClass", _skill, true]; + +private _notificationData = [ + [localize "STR_GSRI_locker_nowNoMed", "\fr\gsri\lockers\ui\untrained_co.paa", localize "STR_GSRI_locker_nowNoMed_description"], + [localize "STR_GSRI_locker_nowDoctor", "\z\ace\addons\medical_gui\ui\cross.paa", localize "STR_GSRI_locker_nowDoctor_description"] +] select (_skill == 2); +["GSRI_locker_setMedicalSkills", _notificationData] call BIS_fnc_showNotification; diff --git a/addons/gsri_lockers/functions/preslots/fn_getAbl.sqf b/addons/gsri_lockers/functions/preslots/fn_getAbl.sqf new file mode 100644 index 0000000..d6fbca2 --- /dev/null +++ b/addons/gsri_lockers/functions/preslots/fn_getAbl.sqf @@ -0,0 +1,33 @@ +removeAllWeapons player; +removeAllItems player; +removeAllAssignedItems player; +removeUniform player; +removeVest player; +removeBackpack player; +removeHeadgear player; +removeGoggles player; +player addWeapon "SMA_MK18MOEOD"; +player addPrimaryWeaponItem "sma_gemtech_one_wdl"; +player addPrimaryWeaponItem "optic_MRCO"; +player addPrimaryWeaponItem "SMA_Gripod_01"; +player addWeapon "tf47_at4_heat"; +player forceAddUniform "GSRI_uniform"; +player addVest "GSRI_vest_carrier"; +player addBackpack "GSRI_Kitbag"; +for "_i" from 1 to 10 do {player addItemToUniform "ACE_quikclot";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_splint";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_tourniquet";}; +for "_i" from 1 to 2 do {player addItemToUniform "ACE_morphine";}; +player addItemToUniform "ACE_EarPlugs"; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_CableTie";}; +for "_i" from 1 to 10 do {player addItemToVest "SMA_30Rnd_556x45_Mk262";}; +for "_i" from 1 to 3 do {player addItemToVest "SmokeShell";}; +for "_i" from 1 to 3 do {player addItemToVest "ACE_M84";}; +player addItemToBackpack "A3_GPNVG18_F"; +for "_i" from 1 to 2 do {player addItemToBackpack "ACE_MRE_LambCurry";}; +for "_i" from 1 to 4 do {player addItemToBackpack "ACE_WaterBottle";}; +player addHeadgear "milgp_h_airframe_01_RGR"; +player addGoggles "G_Balaclava_blk"; +player linkItem "ItemWatch"; +player linkItem "TFAR_anprc152"; +["GSRI_locker_getPreslot", [localize "STR_GSRI_locker_gearAsAbl"]] call BIS_fnc_showNotification; diff --git a/addons/gsri_lockers/functions/preslots/fn_getMedic.sqf b/addons/gsri_lockers/functions/preslots/fn_getMedic.sqf new file mode 100644 index 0000000..ef044b6 --- /dev/null +++ b/addons/gsri_lockers/functions/preslots/fn_getMedic.sqf @@ -0,0 +1,39 @@ +removeAllWeapons player; +removeAllItems player; +removeAllAssignedItems player; +removeUniform player; +removeVest player; +removeBackpack player; +removeHeadgear player; +removeGoggles player; +player addWeapon "SMA_MK18MOEOD"; +player addPrimaryWeaponItem "sma_gemtech_one_wdl"; +player addPrimaryWeaponItem "optic_MRCO"; +player addPrimaryWeaponItem "SMA_Gripod_01"; +player forceAddUniform "GSRI_uniform"; +player addVest "GSRI_vest_ga_carrier"; +player addBackpack "GSRI_Kitbag"; +for "_i" from 1 to 10 do {player addItemToUniform "ACE_quikclot";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_splint";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_tourniquet";}; +for "_i" from 1 to 2 do {player addItemToUniform "ACE_morphine";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_CableTie";}; +player addItemToUniform "ACE_EarPlugs"; +for "_i" from 1 to 10 do {player addItemToVest "SMA_30Rnd_556x45_Mk262";}; +for "_i" from 1 to 2 do {player addItemToVest "SmokeShell";}; +for "_i" from 1 to 2 do {player addItemToVest "ACE_M84";}; +for "_i" from 1 to 2 do {player addItemToVest "HandGrenade";}; +for "_i" from 1 to 2 do {player addItemToBackpack "ACE_MRE_LambCurry";}; +for "_i" from 1 to 4 do {player addItemToBackpack "ACE_WaterBottle";}; +for "_i" from 1 to 30 do {player addItemToBackpack "ACE_packingBandage";}; +for "_i" from 1 to 15 do {player addItemToBackpack "ACE_salineIV_500";}; +for "_i" from 1 to 10 do {player addItemToBackpack "ACE_morphine";}; +for "_i" from 1 to 10 do {player addItemToBackpack "ACE_epinephrine";}; +for "_i" from 1 to 10 do {player addItemToBackpack "ACE_splint";}; +player addItemToBackpack "ACE_surgicalKit"; +player addItemToBackpack "A3_GPNVG18_F"; +player addHeadgear "GSRI_helmet_modular_advanced"; +player addGoggles "G_Balaclava_blk"; +player linkItem "ItemWatch"; +player linkItem "TFAR_anprc152"; +["GSRI_locker_getPreslot", [localize "STR_GSRI_locker_gearAsMedic"]] call BIS_fnc_showNotification; diff --git a/addons/gsri_lockers/functions/preslots/fn_getOperator.sqf b/addons/gsri_lockers/functions/preslots/fn_getOperator.sqf new file mode 100644 index 0000000..81a7d15 --- /dev/null +++ b/addons/gsri_lockers/functions/preslots/fn_getOperator.sqf @@ -0,0 +1,32 @@ +removeAllWeapons player; +removeAllItems player; +removeAllAssignedItems player; +removeUniform player; +removeVest player; +removeBackpack player; +removeHeadgear player; +removeGoggles player; +player addWeapon "SMA_MK18MOEOD"; +player addPrimaryWeaponItem "sma_gemtech_one_wdl"; +player addPrimaryWeaponItem "optic_MRCO"; +player addPrimaryWeaponItem "SMA_Gripod_01"; +player forceAddUniform "GSRI_uniform"; +player addVest "GSRI_vest_carrier"; +player addBackpack "GSRI_Kitbag"; +for "_i" from 1 to 10 do {player addItemToUniform "ACE_quikclot";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_splint";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_tourniquet";}; +for "_i" from 1 to 2 do {player addItemToUniform "ACE_morphine";}; +player addItemToUniform "ACE_EarPlugs"; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_CableTie";}; +for "_i" from 1 to 10 do {player addItemToVest "SMA_30Rnd_556x45_Mk262";}; +for "_i" from 1 to 3 do {player addItemToVest "SmokeShell";}; +for "_i" from 1 to 3 do {player addItemToVest "ACE_M84";}; +player addItemToBackpack "A3_GPNVG18_F"; +for "_i" from 1 to 2 do {player addItemToBackpack "ACE_MRE_LambCurry";}; +for "_i" from 1 to 4 do {player addItemToBackpack "ACE_WaterBottle";}; +player addHeadgear "milgp_h_airframe_01_RGR"; +player addGoggles "G_Balaclava_blk"; +player linkItem "ItemWatch"; +player linkItem "TFAR_anprc152"; +["GSRI_locker_getPreslot", [localize "STR_GSRI_locker_gearAsOperator"]] call BIS_fnc_showNotification; diff --git a/addons/gsri_lockers/functions/preslots/fn_getRegular.sqf b/addons/gsri_lockers/functions/preslots/fn_getRegular.sqf new file mode 100644 index 0000000..2a01a75 --- /dev/null +++ b/addons/gsri_lockers/functions/preslots/fn_getRegular.sqf @@ -0,0 +1,14 @@ +removeAllWeapons player; +removeAllItems player; +removeAllAssignedItems player; +removeUniform player; +removeVest player; +removeBackpack player; +removeHeadgear player; +removeGoggles player; +player forceAddUniform "GSRI_uniform"; +player addItemToUniform "ACE_Flashlight_XL50"; +player addHeadgear "GSRI_beret"; +player linkItem "ItemMap"; +player linkItem "TFAR_anprc152"; +["GSRI_locker_getPreslot", [localize "STR_GSRI_locker_gearAsRegular"]] call BIS_fnc_showNotification; diff --git a/addons/gsri_lockers/functions/preslots/fn_getTad.sqf b/addons/gsri_lockers/functions/preslots/fn_getTad.sqf new file mode 100644 index 0000000..ade2082 --- /dev/null +++ b/addons/gsri_lockers/functions/preslots/fn_getTad.sqf @@ -0,0 +1,33 @@ +removeAllWeapons player; +removeAllItems player; +removeAllAssignedItems player; +removeUniform player; +removeVest player; +removeBackpack player; +removeHeadgear player; +removeGoggles player; +player addWeapon "arifle_SPAR_01_blk_F"; +player addPrimaryWeaponItem "muzzle_snds_M"; +player addPrimaryWeaponItem "optic_MRCO"; +player addPrimaryWeaponItem "bipod_01_F_blk"; +player forceAddUniform "GSRI_uniform"; +player addVest "GSRI_vest_ga_carrier_lite"; +player addBackpack "GSRI_Kitbag"; +for "_i" from 1 to 10 do {player addItemToUniform "ACE_quikclot";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_splint";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_tourniquet";}; +for "_i" from 1 to 2 do {player addItemToUniform "ACE_morphine";}; +for "_i" from 1 to 4 do {player addItemToUniform "ACE_CableTie";}; +player addItemToUniform "ACE_EarPlugs"; +for "_i" from 1 to 5 do {player addItemToVest "150Rnd_556x45_Drum_Mag_Tracer_F";}; +for "_i" from 1 to 4 do {player addItemToVest "SmokeShell";}; +for "_i" from 1 to 2 do {player addItemToVest "ACE_M84";}; +player addItemToBackpack "A3_GPNVG18_F"; +for "_i" from 1 to 4 do {player addItemToBackpack "ACE_WaterBottle";}; +for "_i" from 1 to 2 do {player addItemToBackpack "ACE_MRE_LambCurry";}; +for "_i" from 1 to 2 do {player addItemToBackpack "150Rnd_556x45_Drum_Mag_Tracer_F";}; +player addHeadgear "GSRI_helmet_modular_advanced"; +player addGoggles "G_Balaclava_blk"; +player linkItem "ItemWatch"; +player linkItem "TFAR_anprc152_22"; +["GSRI_locker_getPreslot", [localize "STR_GSRI_locker_gearAsTad"]] call BIS_fnc_showNotification; diff --git a/addons/gsri_lockers/stringtable.xml b/addons/gsri_lockers/stringtable.xml new file mode 100644 index 0000000..b354568 --- /dev/null +++ b/addons/gsri_lockers/stringtable.xml @@ -0,0 +1,94 @@ + + + + + Preslot applied + Preslot applied + Preslot appliqué + + + Preslots + Preslots + Preslots + + + Operator outfit + Operator outfit + Tenue d'opérateur + + + Autorifleman outfit + Autorifleman outfit + Tenue de Tireur Appui Direct (TAD) + + + Medic outfit + Medic outfit + Tenue de médecin + + + Regular fatigues + Regular fatigues + Tenue régulière + + + Light anti-tank outfit + Light anti-tank outfit + Tenue d'Anti-Blindé Léger (ABL) + + + + + Arsenal + Arsenal + Arsenal + + + Full BI arsenal + Full BI arsenal + Arsenal BI complet + + + Full ACE arsenal + Full ACE arsenal + Arsenal ACE complet + + + + + Medical skills + Medical skills + Compétences médicales + + + Not trained + Not trained + Non entraîné + + + Doctor + Doctor + Médecin + + + You are now a doctor + You are now a doctor + Vous êtes à présent médecin + + + Advanced medical treatments are available. + Advanced medical treatments are available. + Les traitements médicaux avancés sont disponibles. + + + You are now untrained + You are now untrained + Vous êtes à présent non-entraîné + + + Only basic medical treatments are available. + Only basic medical treatments are available. + Seuls les traitements médicaux basiques sont disponibles. + + + diff --git a/addons/gsri_lockers/ui/untrained_co.paa b/addons/gsri_lockers/ui/untrained_co.paa new file mode 100644 index 0000000..304637e Binary files /dev/null and b/addons/gsri_lockers/ui/untrained_co.paa differ