Skip to content

Commit

Permalink
Add CSW tripods stat
Browse files Browse the repository at this point in the history
  • Loading branch information
johnb432 committed Feb 10, 2025
1 parent 4b3cd3e commit 706c5d6
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
12 changes: 12 additions & 0 deletions addons/csw/ACE_Arsenal_Stats.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class EGVAR(arsenal,stats) {
class statBase;
class GVAR(tripods): statBase {
scope = 2;
priority = -1.5;
displayName = CSTRING(statTripods);
condition = QUOTE((_this select 1) call FUNC(statTextCondition_tripods));
showText = 1;
textStatement = QUOTE((_this select 1) call FUNC(statTextStatement_tripods));
tabs[] = {{0, 2}, {}};
};
};
3 changes: 3 additions & 0 deletions addons/csw/XEH_PREP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ PREP(reload_loadMagazine);

PREP(initVehicle);
PREP(staticWeaponInit_unloadExtraMags);

PREP(statTextCondition_tripods);
PREP(statTextStatement_tripods);
1 change: 1 addition & 0 deletions addons/csw/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ class CfgPatches {
#include "CfgWeapons.hpp"
#include "CfgMagazines.hpp"
#include "CfgMagazineGroups.hpp"
#include "ACE_Arsenal_Stats.hpp"
17 changes: 17 additions & 0 deletions addons/csw/functions/fnc_statTextCondition_tripods.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "..\script_component.hpp"
/*
* Author: johnb43
* Text condition for displaying which tripods are needed for a CSW.
*
* Arguments:
* 0: Item config path <CONFIG>
*
* Return Value:
* Whether to display stat or not <BOOL>
*
* Public: No
*/

params ["_config"];

(configProperties [configFile >> "CfgWeapons" >> configName _config >> QUOTE(ADDON) >> "assembleTo", "true", true]) isNotEqualTo []
24 changes: 24 additions & 0 deletions addons/csw/functions/fnc_statTextStatement_tripods.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "..\script_component.hpp"
/*
* Author: johnb43
* Text statement for displaying which tripods are needed for a CSW.
*
* Arguments:
* 0: Item config path <CONFIG>
*
* Return Value:
* Stat Text <ARRAY of STRINGS>
*
* Public: No
*/

params ["_config"];

private _cfgWeapons = configFile >> "CfgWeapons";
private _cfgVehicles = configFile >> "CfgVehicles";

(configProperties [_cfgWeapons >> configName _config >> QUOTE(ADDON) >> "assembleTo", "true", true]) apply {
private _tripod = getText (_cfgVehicles >> configName _x >> QUOTE(ADDON) >> "disassembleTo");

getText (_cfgWeapons >> _tripod >> "displayName")
}
3 changes: 3 additions & 0 deletions addons/csw/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,9 @@
<Chinesesimp>[班组] SPG-9M 发射器包</Chinesesimp>
<Turkish>[CSW] SPG-9M Launcher Bag</Turkish>
</Key>
<Key ID="STR_ACE_CSW_statTripods">
<English>Mounts on:</English>
</Key>
<Key ID="STR_ACE_CSW_tow_tube">
<English>[CSW] BGM-71 TOW Launcher Bag</English>
<Czech>[CSW] BGM-71 TOW raketomet v pouzdře</Czech>
Expand Down

0 comments on commit 706c5d6

Please sign in to comment.