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 7 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));
};
};
113 changes: 113 additions & 0 deletions addons/supplies/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
class CfgVehicles {
class Box_NATO_WpsLaunch_F;
class Box_AAF_Uniforms_F;

class GVAR(Launchers): Box_NATO_WpsLaunch_F {
author = "Tyrone";
displayName = CSTRING(Supply_Launchers_Name);
EDITOR_CATEGORY
scope = 2;
scopeCurator = 2;
maximumLoad = 3000;
transportMaxWeapons = 15;
ace_dragging_canDrag = 0;
ace_dragging_canCarry = 0;
editorPreview = QPATHTOF(ui\supplies_launchers.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 GVAR(Engineer): Box_AAF_Uniforms_F {
author = "Tyrone";
displayName = CSTRING(Supply_Engineer_Name);
EDITOR_CATEGORY
scope = 2;
scopeCurator = 2;
maximumLoad = 3000;
ace_dragging_canDrag = 0;
ace_dragging_canCarry = 0;
editorPreview = QPATHTOF(ui\supplies_engineer.jpg);
hiddenSelections[] = {
"camo",
"camo_signs"
};
hiddenSelectionsTextures[] = {
QPATHTOF(data\supply_base_texture_co.paa),
QPATHTOF(data\supply_engineer_ca.paa)
};

class TransportMagazines {
MACRO_ADDMAGAZINE(SatchelCharge_Remote_Mag,6);
MACRO_ADDMAGAZINE(DemoCharge_Remote_Mag,6);
};
class TransportItems {
MACRO_ADDITEM(B_UavTerminal,1);
MACRO_ADDITEM(ACE_UAVBattery,3);
};
class TransportBackpacks {
MACRO_ADDBACKPACK(B_UGV_02_Demining_backpack_F,1);
};
};

class GVAR(Medic): GVAR(Engineer) {
displayName = CSTRING(Supply_Medic_Name);
EDITOR_CATEGORY
editorPreview = QPATHTOF(ui\supplies_medic.jpg);
hiddenSelections[] = {
"camo",
"camo_signs"
};
hiddenSelectionsTextures[] = {
QPATHTOF(data\supply_base_texture_co.paa),
QPATHTOF(data\supply_medical_ca.paa)
};

class TransportBackpacks {};
class TransportItems {
MACRO_ADDITEM(ACE_salineIV_500,20);
MACRO_ADDITEM(ACE_salineIV_250,20);
};
class TransportMagazines {};
class TransportWeapons {};
};

class GVAR(Recruit): GVAR(Engineer) {
displayName = CSTRING(Supply_Recruit_Name);
EDITOR_CATEGORY
editorPreview = QPATHTOF(ui\supplies_Recruit.jpg);
hiddenSelections[] = {
"camo",
"camo_signs"
};
hiddenSelectionsTextures[] = {
QPATHTOF(data\supply_base_texture_co.paa),
QPATHTOF(data\supply_recruit_ca.paa)
};

class TransportMagazines {};
class TransportItems {
MACRO_ADDITEM(muzzle_snds_m,5);
};
class TransportBackpacks {};
};
};
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"

[QGVAR(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"
23 changes: 23 additions & 0 deletions addons/supplies/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {
QGVAR(Launchers),
QGVAR(Engineer),
QGVAR(Medic),
QGVAR(Recruit)
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"tac_main", "cba_main", "ace_medical_treatment"};
author = ECSTRING(main,Author);
authors[] = {"GilleeDoo", "JoramD", "TyroneMF"};
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.
Binary file added addons/supplies/data/supply_base_texture_co.paa
Binary file not shown.
Binary file added addons/supplies/data/supply_engineer_ca.paa
Binary file not shown.
Binary file added addons/supplies/data/supply_medical_ca.paa
Binary file not shown.
Binary file added addons/supplies/data/supply_recruit_ca.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";
17 changes: 17 additions & 0 deletions addons/supplies/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="TAC">
<Package name="Supplies">
<Key ID="STR_TAC_Supplies_Supply_Launchers_Name">
<English>[TAC] Launcher Supplies</English>
</Key>
<Key ID="STR_TAC_Supplies_Supply_Engineer_Name">
<English>[TAC] Engineer Supplies</English>
</Key>
<Key ID="STR_TAC_Supplies_Supply_Medic_Name">
<English>[TAC] Medic Supplies</English>
</Key>
<Key ID="STR_TAC_Supplies_Supply_Recruit_Name">
<English>[TAC] Recruit Supplies</English>
</Key>
</Package>
</Project>
Binary file added addons/supplies/ui/supplies_Engineer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/supplies/ui/supplies_Launchers.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/supplies/ui/supplies_Medic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/supplies/ui/supplies_Recruit.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions optionals/compat_amp/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x\tac\addons\compat_amp
9 changes: 9 additions & 0 deletions optionals/compat_amp/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class CfgVehicles {
class Box_AAF_Uniforms_F;

class EGVAR(supplies,Engineer): Box_AAF_Uniforms_F {
class TransportMagazines {
MACRO_ADDMAGAZINE(AMP_Breaching_Charge_Mag,12);
};
};
};
19 changes: 19 additions & 0 deletions optionals/compat_amp/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {
QEGVAR(supplies,Engineer)
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"tac_main", "cba_main", "tac_supplies", "AMP_Breaching_Charge"};
author = ECSTRING(main,Author);
authors[] = {"TyroneMF"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgVehicles.hpp"
17 changes: 17 additions & 0 deletions optionals/compat_amp/script_component.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#define COMPONENT compat_amp
#define COMPONENT_BEAUTIFIED AMP Compatibility
#include "\x\tac\addons\main\script_mod.hpp"

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

#ifdef DEBUG_ENABLED_COMPAT_AMP
#define DEBUG_MODE_FULL
#endif

#ifdef DEBUG_SETTINGS_SUPPLIES
#define DEBUG_SETTINGS DEBUG_SETTINGS_COMPAT_AMP
#endif

#include "\x\tac\addons\main\script_macros.hpp"
1 change: 1 addition & 0 deletions optionals/compat_cup_recruit/$PBOPREFIX$
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
x\tac\addons\compat_cup_recruit
10 changes: 10 additions & 0 deletions optionals/compat_cup_recruit/CfgVehicles.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CfgVehicles {
class EGVAR(supplies,Engineer);

class EGVAR(supplies,Recruit): EGVAR(supplies,Engineer) {
class TransportItems {
MACRO_ADDITEM(cup_muzzle_pbs4,5);
MACRO_ADDITEM(CUP_NVG_PVS14,5);
};
};
};
19 changes: 19 additions & 0 deletions optionals/compat_cup_recruit/config.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "script_component.hpp"

class CfgPatches {
class ADDON {
name = COMPONENT_NAME;
units[] = {
QEGVAR(supplies,Recruit)
};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"tac_main", "cba_main", "tac_supplies", "CUP_Weapons_NVG", "CUP_Weapons_East_Attachments"};
author = ECSTRING(main,Author);
authors[] = {"TyroneMF"};
url = ECSTRING(main,URL);
VERSION_CONFIG;
};
};

#include "CfgVehicles.hpp"
Loading