From 8e66be21f98a0827980e5fb53183aa38debc844f Mon Sep 17 00:00:00 2001 From: Filip Maciejewski Date: Wed, 1 Jul 2020 18:46:37 +0200 Subject: [PATCH] Add medical items category button to ACE Arsenal (#14) * Add medical items category button to ACE Arsenal * Move category adding to preInit Fixes missing category in eden --- addons/main/stringtable.xml | 3 +++ addons/medical_arsenal/$PBOPREFIX$ | 1 + addons/medical_arsenal/CfgEventHandlers.hpp | 10 +++++++++ addons/medical_arsenal/README.md | 7 ++++++ addons/medical_arsenal/XEH_postInit.sqf | 1 + addons/medical_arsenal/XEH_preInit.sqf | 14 ++++++++++++ addons/medical_arsenal/config.cpp | 18 +++++++++++++++ addons/medical_arsenal/initSettings.sqf | 10 +++++++++ addons/medical_arsenal/script_component.hpp | 25 +++++++++++++++++++++ addons/medical_arsenal/stringtable.xml | 17 ++++++++++++++ 10 files changed, 106 insertions(+) create mode 100644 addons/medical_arsenal/$PBOPREFIX$ create mode 100644 addons/medical_arsenal/CfgEventHandlers.hpp create mode 100644 addons/medical_arsenal/README.md create mode 100644 addons/medical_arsenal/XEH_postInit.sqf create mode 100644 addons/medical_arsenal/XEH_preInit.sqf create mode 100644 addons/medical_arsenal/config.cpp create mode 100644 addons/medical_arsenal/initSettings.sqf create mode 100644 addons/medical_arsenal/script_component.hpp create mode 100644 addons/medical_arsenal/stringtable.xml diff --git a/addons/main/stringtable.xml b/addons/main/stringtable.xml index a96ca54..a873887 100644 --- a/addons/main/stringtable.xml +++ b/addons/main/stringtable.xml @@ -11,5 +11,8 @@ Medical + + ArmaForces - Medical + diff --git a/addons/medical_arsenal/$PBOPREFIX$ b/addons/medical_arsenal/$PBOPREFIX$ new file mode 100644 index 0000000..2a3a2e4 --- /dev/null +++ b/addons/medical_arsenal/$PBOPREFIX$ @@ -0,0 +1 @@ +z\afmed\addons\medical_arsenal \ No newline at end of file diff --git a/addons/medical_arsenal/CfgEventHandlers.hpp b/addons/medical_arsenal/CfgEventHandlers.hpp new file mode 100644 index 0000000..917a0ac --- /dev/null +++ b/addons/medical_arsenal/CfgEventHandlers.hpp @@ -0,0 +1,10 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; diff --git a/addons/medical_arsenal/README.md b/addons/medical_arsenal/README.md new file mode 100644 index 0000000..c2717a5 --- /dev/null +++ b/addons/medical_arsenal/README.md @@ -0,0 +1,7 @@ +## Medical Arsenal + +ACE Arsenal integration for ArmaForces Medical. + +### Authors + +- [veteran29](http://github.com/veteran29) diff --git a/addons/medical_arsenal/XEH_postInit.sqf b/addons/medical_arsenal/XEH_postInit.sqf new file mode 100644 index 0000000..421c54b --- /dev/null +++ b/addons/medical_arsenal/XEH_postInit.sqf @@ -0,0 +1 @@ +#include "script_component.hpp" diff --git a/addons/medical_arsenal/XEH_preInit.sqf b/addons/medical_arsenal/XEH_preInit.sqf new file mode 100644 index 0000000..16f9edc --- /dev/null +++ b/addons/medical_arsenal/XEH_preInit.sqf @@ -0,0 +1,14 @@ +#include "script_component.hpp" +ADDON = false; + +#include "initSettings.sqf" + +if (GVAR(addCategory)) then { + GVAR(medicalArsenalButton) = [ + ALL_MEDICAL_ITEMS, + LLSTRING(Medications), + "\z\ace\addons\medical_gui\data\categories\medication.paa" + ] call ace_arsenal_fnc_addRightPanelButton; +}; + +ADDON = true; diff --git a/addons/medical_arsenal/config.cpp b/addons/medical_arsenal/config.cpp new file mode 100644 index 0000000..5a023b8 --- /dev/null +++ b/addons/medical_arsenal/config.cpp @@ -0,0 +1,18 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + name = COMPONENT_NAME; + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = { + "afmed_main", + "ace_arsenal" + }; + author = "ArmaForces"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/medical_arsenal/initSettings.sqf b/addons/medical_arsenal/initSettings.sqf new file mode 100644 index 0000000..469bbc3 --- /dev/null +++ b/addons/medical_arsenal/initSettings.sqf @@ -0,0 +1,10 @@ +[ + QGVAR(addCategory), + "CHECKBOX", + LLSTRING(AddCategory), + [LELSTRING(Main,SettingsCategory), LLSTRING(SettingsSubcategory)], + true, + false, + {}, + true +] call CBA_fnc_addSetting; diff --git a/addons/medical_arsenal/script_component.hpp b/addons/medical_arsenal/script_component.hpp new file mode 100644 index 0000000..1958d79 --- /dev/null +++ b/addons/medical_arsenal/script_component.hpp @@ -0,0 +1,25 @@ +#define COMPONENT medical_arsenal +#include "\z\afmed\addons\main\script_mod.hpp" + +// #define DEBUG_MODE_FULL +// #define DISABLE_COMPILE_CACHE + +#ifdef DEBUG_ENABLED_MEDICAL_ARSENAL + #define DEBUG_MODE_FULL +#endif + #ifdef DEBUG_SETTINGS_MEDICAL_ARSENAL + #define DEBUG_SETTINGS DEBUG_SETTINGS_MEDICAL_ARSENAL +#endif + +#include "\z\afmed\addons\main\script_macros.hpp" + +#define ALL_MEDICAL_ITEMS [\ + "ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_quikclot",\ + "ACE_tourniquet", "ACE_splint",\ + "ACE_morphine", "ACE_adenosine", "ACE_atropine", "ACE_epinephrine",\ + "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250",\ + "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250",\ + "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250",\ + "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag",\ + "AFMED_apap"\ +] diff --git a/addons/medical_arsenal/stringtable.xml b/addons/medical_arsenal/stringtable.xml new file mode 100644 index 0000000..8daa907 --- /dev/null +++ b/addons/medical_arsenal/stringtable.xml @@ -0,0 +1,17 @@ + + + + + Medications + Medykamenty + + + Add arsenal category + Dodaj kategorię do arsenału + + + Arsenal + Arsenał + + +