Skip to content

Commit

Permalink
Add medical items category button to ACE Arsenal (#14)
Browse files Browse the repository at this point in the history
* Add medical items category button to ACE Arsenal

* Move category adding to preInit

Fixes missing category in eden
  • Loading branch information
veteran29 authored Jul 1, 2020
1 parent 8da4ecb commit 8e66be2
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/main/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
<Key ID="STR_AFMED_Main_Toolbar">
<English>Medical</English>
</Key>
<Key ID="STR_AFMED_Main_SettingsCategory">
<English>ArmaForces - Medical</English>
</Key>
</Package>
</Project>
1 change: 1 addition & 0 deletions addons/medical_arsenal/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
z\afmed\addons\medical_arsenal
10 changes: 10 additions & 0 deletions addons/medical_arsenal/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -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));
};
};
7 changes: 7 additions & 0 deletions addons/medical_arsenal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Medical Arsenal

ACE Arsenal integration for ArmaForces Medical.

### Authors

- [veteran29](http://github.com/veteran29)
1 change: 1 addition & 0 deletions addons/medical_arsenal/XEH_postInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "script_component.hpp"
14 changes: 14 additions & 0 deletions addons/medical_arsenal/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -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;
18 changes: 18 additions & 0 deletions addons/medical_arsenal/config.cpp
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 10 additions & 0 deletions addons/medical_arsenal/initSettings.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
QGVAR(addCategory),
"CHECKBOX",
LLSTRING(AddCategory),
[LELSTRING(Main,SettingsCategory), LLSTRING(SettingsSubcategory)],
true,
false,
{},
true
] call CBA_fnc_addSetting;
25 changes: 25 additions & 0 deletions addons/medical_arsenal/script_component.hpp
Original file line number Diff line number Diff line change
@@ -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"\
]
17 changes: 17 additions & 0 deletions addons/medical_arsenal/stringtable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="AFMED">
<Package name="Medical_Arsenal">
<Key ID="STR_AFMED_Medical_Arsenal_Medications">
<English>Medications</English>
<Polish>Medykamenty</Polish>
</Key>
<Key ID="STR_AFMED_Medical_Arsenal_AddCategory">
<English>Add arsenal category</English>
<Polish>Dodaj kategorię do arsenału</Polish>
</Key>
<Key ID="STR_AFMED_Medical_Arsenal_SettingsSubcategory">
<English>Arsenal</English>
<Polish>Arsenał</Polish>
</Key>
</Package>
</Project>

0 comments on commit 8e66be2

Please sign in to comment.