Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Supplies Component #451

Merged
merged 11 commits into from
Sep 7, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions addons/armory/CfgVehicles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ class CfgVehicles {
scope = 2;
scopeCurator = 2;
author = ECSTRING(main,Author);
editorCategory = "tac_Mission_Items";
editorSubCategory = "tac_Mission_Items_Supplies";
editorPreview = QPATHTOF(ui\tac_locker_ca.jpg);
hiddenSelections[] = {"Camo"};
hiddenSelectionsTextures[] = {
QPATHTOF(data\tac_locker_co.paa)
Expand Down
Binary file added addons/armory/UI/tac_locker_ca.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions addons/main/CfgEditorCategories.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class CfgEditorCategories {
class tac_Mission_Items {
displayName = CSTRING(Mission_Items_Name);
};
};

class CfgEditorSubcategories {
class tac_Mission_Items_Supplies {
displayName = CSTRING(Mission_Items_Supplies_Name);
};
class tac_Mission_Items_Contraband {
displayName = CSTRING(Mission_Items_Contraband_Name);
};
class tac_Mission_Items_Electronics {
displayName = CSTRING(Mission_Items_Electronics_Name);
};
};
1 change: 1 addition & 0 deletions addons/main/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class CfgMods {
};

#include "CfgEden.hpp"
#include "CfgEditorCategories.hpp"
#include "CfgModuleCategories.hpp"
#include "CfgSettings.hpp"
#include "CfgVehicleClasses.hpp"
Expand Down
12 changes: 12 additions & 0 deletions addons/main/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,17 @@
<German>TAC Attribute</German>
<French>Attributs TAC</French>
</Key>
<Key ID="STR_TAC_Main_Mission_Items_Name">
<English>TAC - Mission Items</English>
</Key>
<Key ID="STR_TAC_Main_Mission_Items_Supplies_Name">
<English>Supplies</English>
</Key>
<Key ID="STR_TAC_Main_Mission_Items_Contraband_Name">
<English>Contraband</English>
</Key>
<Key ID="STR_TAC_Main_Mission_Items_Electronics_Name">
<English>Electronics</English>
</Key>
</Package>
</Project>
1 change: 1 addition & 0 deletions addons/supplies/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x\tac\addons\supplies
5 changes: 5 additions & 0 deletions addons/supplies/CfgEventHandlers.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
87 changes: 87 additions & 0 deletions addons/supplies/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
class CfgVehicles {
class Box_NATO_WpsLaunch_F;
class Box_AAF_Uniforms_F;

class tac_Supply_Launchers: Box_NATO_WpsLaunch_F {
author = "Tyrone";
displayName = CSTRING(Supply_Launchers_Name);
EDITOR_CATEGORY
scope = 2;
scopeCurator = 2;
maximumLoad = 3000;
transportMaxWeapons = 15;
editorPreview = QPATHTOF(ui\supply_launchers_ca.jpg);
hiddenSelections[] = {
"Camo_Signs",
"Camo"
};
hiddenSelectionsTextures[] = {
QPATHTOF(data\launchers_sign_co.paa),
QPATHTOF(data\launchers_texture_co.paa)
};

class TransportMagazines {
MACRO_ADDMAGAZINE(RPG7_F,6);
MACRO_ADDMAGAZINE(MRAWS_HEAT_F,6);
MACRO_ADDMAGAZINE(RPG32_HE_F,6);

};

class TransportWeapons {
MACRO_ADDWEAPON(launch_RPG7_F,3);
MACRO_ADDWEAPON(launch_RPG32_green_F,3);
MACRO_ADDWEAPON(CUP_launch_M136,3);
MACRO_ADDWEAPON(launch_MRAWS_green_rail_F,3);
MACRO_ADDWEAPON(launch_NLAW_F,3);
};
class TransportBackpacks {};
};

class tac_Supply_Engineer: Box_AAF_Uniforms_F {
author = "Tyrone";
displayName = CSTRING(Supply_Engineer_Name);
EDITOR_CATEGORY
scope = 2;
scopeCurator = 2;
maximumLoad = 3000;
// editorPreview = QPATHTOF(ui\supply_engineer_ca.jpg); Waiting for texture
hiddenSelections[] = {
"camo",
"camo_signs"
};
hiddenSelectionsTextures[] = { // Placeholder for Textures
"\A3\Supplies_F_Exp\Ammoboxes\Data\uniforms_box_indep_co.paa",
"\A3\Supplies_F_Exp\Ammoboxes\Data\equipment_box_indep_ca.paa"
};

class TransportMagazines {
MACRO_ADDMAGAZINE(SatchelCharge_Remote_Mag,6);
MACRO_ADDMAGAZINE(DemoCharge_Remote_Mag,6);
MACRO_ADDMAGAZINE(AMP_Breaching_Charge_Mag,12);
};
class TransportItems {
MACRO_ADDITEM(B_UavTerminal,1);
};
class TransportBackpacks {
MACRO_ADDBACKPACK(B_UGV_02_Demining_backpack_F,1); // Placeholder until new one is created.
};
};

class tac_Supply_Medic: tac_Supply_Engineer {
displayName = CSTRING(Supply_Medic_Name);
EDITOR_CATEGORY
// editorPreview = QPATHTOF(ui\supply_medic_ca.jpg); Waiting for texture
hiddenSelections[] = {
"camo",
"camo_signs"
};
hiddenSelectionsTextures[] = { // Placeholder for Textures
"\A3\Supplies_F_Exp\Ammoboxes\Data\uniforms_box_indep_co.paa",
"\A3\Supplies_F_Exp\Ammoboxes\Data\equipment_box_indep_ca.paa"
};
class TransportBackpacks {};
class TransportItems {};
class TransportMagazines {};
class TransportWeapons {};
};
};
1 change: 1 addition & 0 deletions addons/supplies/XEH_PREP.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PREP(medicalArsenal);
9 changes: 9 additions & 0 deletions addons/supplies/XEH_preInit.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "script_component.hpp"

ADDON = false;

#include "XEH_PREP.hpp"

["tac_Supply_Medic", "init", {(_this select 0) call FUNC(medicalArsenal)}, false, [], true] call CBA_fnc_addClassEventHandler;

ADDON = true;
3 changes: 3 additions & 0 deletions addons/supplies/XEH_preStart.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "script_component.hpp"

#include "XEH_PREP.hpp"
22 changes: 22 additions & 0 deletions addons/supplies/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {
"tac_supply_Launchers",
"tac_Supply_Engineer",
"tac_Supply_Medic"
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"tac_main", "cba_main", "ace_medical_treatment", "AMP_Breaching_Charge"};
author = ECSTRING(main,Author);
authors[] = {"TyroneMF", "GilleeDoo"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
Binary file added addons/supplies/data/launchers_sign_co.paa
Binary file not shown.
Binary file added addons/supplies/data/launchers_texture_co.paa
Binary file not shown.
58 changes: 58 additions & 0 deletions addons/supplies/functions/fnc_medicalArsenal.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "script_component.hpp"
/*
* Author: JoramD
* Add medical arsenal to object.
*
* Arguments:
* 0: Object <OBJECT>
*
* Return Value:
* None
*
* Example:
* [object] call tac_supplies_fnc_medicalArsenal
*
* Public: No
*/

params ["_object"];

private _medicalItems = [
"ACE_packingBandage",
"ACE_elasticBandage",
"ACE_fieldDressing",
"ACE_bloodIV",
"ACE_bloodIV_250",
"ACE_bloodIV_500",
"ACE_bodyBag",
"ACE_epinephrine",
"ACE_morphine",
"tac_medical_painkillers",
"ACE_plasmaIV",
"ACE_plasmaIV_250",
"ACE_plasmaIV_500",
"ACE_salineIV",
"ACE_salineIV_250",
"ACE_salineIV_500",
"ACE_splint",
"ACE_surgicalKit",
"ACE_tourniquet",
"ACE_adenosine",
"ACE_quikclot"
];

[_object, _medicalItems, true] call ACEFUNC(arsenal,addVirtualItems);

private _action = [
QGVAR(medicalArsenal),
"Medical Arsenal",
"",
{
[_target, _player, false] call ACEFUNC(arsenal,openBox);
},
{
ace_player getUnitTrait "Medic"
}
] call ACEFUNC(interact_menu,createAction);

[_object, 0, ["ACE_MainActions"], _action] call ACEFUNC(interact_menu,addActionToObject);
1 change: 1 addition & 0 deletions addons/supplies/functions/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "\x\tac\addons\supplies\script_component.hpp"
21 changes: 21 additions & 0 deletions addons/supplies/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#define COMPONENT supplies
#define COMPONENT_BEAUTIFIED Supplies
#include "\x\tac\addons\main\script_mod.hpp"

// #define DEBUG_MODE_FULL
// #define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS

#ifdef DEBUG_ENABLED_SUPPLIES
#define DEBUG_MODE_FULL
#endif

#ifdef DEBUG_SETTINGS_SUPPLIES
#define DEBUG_SETTINGS DEBUG_SETTINGS_SUPPLIES
#endif

#include "\x\tac\addons\main\script_macros.hpp"

#define EDITOR_CATEGORY \
editorCategory = "tac_Mission_Items"; \
editorSubCategory = "tac_Mission_Items_Supplies";
14 changes: 14 additions & 0 deletions addons/supplies/stringtable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="TAC">
<Package name="Supplies">
<Key ID="STR_TAC_Crates_Supply_Launchers_Name">
<English>[TAC] Launcher Supplies</English>
</Key>
<Key ID="STR_TAC_Crates_Supply_Engineer_Name">
<English>[TAC] Engineer Supplies</English>
</Key>
<Key ID="STR_TAC_Crates_Supply_Medic_Name">
<English>[TAC] Medic Supplies</English>
</Key>
</Package>
</Project>
Binary file added addons/supplies/ui/supply_launchers_ca.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.