-
Notifications
You must be signed in to change notification settings - Fork 739
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 ACE Arsenal stats #6110
Add ACE Arsenal stats #6110
Changes from 72 commits
b7dab73
d92532e
77f7b33
1041ffc
327ec0e
1ccad3f
78ac754
16d878e
28cbcd7
9a2ec02
75e6ccd
d95fbee
6be8222
65fa210
cf8d94b
6aaab2f
6a868ca
699d963
daccf1a
e8de8ba
2eb1302
de1d167
26d7452
944c1e2
6c6c5e9
6e25dd6
c3a9ede
eba0a25
7faa636
ec9604c
6202e53
07eb34b
9c350a4
89e29bd
052f191
8edce71
feef0be
d637a50
0c07ace
71284a9
25079d9
36d14d4
2faeaad
da0fde7
76eb938
0344052
f24731b
734fe0b
2b68a43
d7900b2
4cc256c
f22e8b8
360b4f6
a878cc9
08ff9e0
407ef92
973baa3
ba5bea3
230e743
7e43eb3
cc4910c
75ea0ba
690bcae
da86449
20b9a12
3c0a052
f302726
283ac4c
c986270
ec329f8
d757885
fca65b2
afaf372
9a228c9
dc9facd
a3ddc77
2f67688
0889493
d4b06f4
7840557
dbd8f26
88e271e
eb64f5d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
class CfgACEArsenalStats { | ||
class statBase { | ||
scope = 1; | ||
priority = 0; | ||
stats[]= {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spaces around There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't matter There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it does. |
||
displayName= ""; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Spacing around |
||
showBar= 0; | ||
showText= 0; | ||
barStatement = ""; | ||
textStatement = ""; | ||
condition = "true"; | ||
tabs[]= {{}, {}}; | ||
}; | ||
class bananaPotassium: statBase { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should prefix those too, this config will be public API. I think it's best to prefix all, but some base ones that have nothing to do with ACE features could be left unprefixed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what kind of prefix tho. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
scope = 2; | ||
displayName= CSTRING(statPotassium); | ||
showBar= 1; | ||
barStatement = "1"; | ||
condition = QUOTE((configName (_this select 1)) == 'ACE_Banana'); | ||
tabs[]= {{}, {7}}; | ||
}; | ||
class mass: statBase { | ||
scope = 2; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_weight"; | ||
showText= 1; | ||
textStatement = QUOTE([ARR_2(_this select 0, _this select 1)] call FUNC(statTextStatement_mass)); | ||
tabs[]= {{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}, {0,1,2,3,4,5,6,7}}; | ||
}; | ||
class rateOfFire: statBase { | ||
scope = 2; | ||
priority = 5; | ||
stats[]= {"reloadTime"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_rof"; | ||
showBar= 1; | ||
showText= 1; | ||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(-1.4, 0.31)], [ARR_2(1, 0.01)], true)])] call FUNC(statBarStatement_default)); | ||
textStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-1.4, 0.31)], false)])] call FUNC(statTextStatement_rateOfFire)); | ||
tabs[]= {{0,1}, {}}; | ||
}; | ||
class accuracy: statBase { | ||
scope = 2; | ||
priority = 4; | ||
stats[]= {"dispersion"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_dispersion"; | ||
showBar= 1; | ||
showText= 1; | ||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(-4, -1.7)], [ARR_2(1, 0.01)], true)])] call FUNC(statBarStatement_default)); | ||
textStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_2([ARR_2(-4, -1.7)], false)])] call FUNC(statTextStatement_accuracy)); | ||
tabs[]= {{0,1}, {}}; | ||
}; | ||
class maxZeroing: statBase { | ||
scope = 2; | ||
priority = 3; | ||
stats[]= {"maxZeroing"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_range"; | ||
showBar= 1; | ||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 2500)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default)); | ||
tabs[]= {{0,1,2}, {}}; | ||
}; | ||
class impact: statBase { | ||
scope = 2; | ||
priority = 2; | ||
stats[]= {"hit", "initSpeed"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_impact"; | ||
showBar= 1; | ||
barStatement = QUOTE([ARR_3(_this select 0, _this select 1, [ARR_3([ARR_2(0, 3.2)], [ARR_2(-1, 1100)], 2006)])] call FUNC(statBarStatement_impact)); | ||
tabs[]= {{0,1,2}, {}}; | ||
}; | ||
class ballisticProtection: statBase { | ||
scope = 2; | ||
priority = 5; | ||
stats[]= {"passthrough"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_passthrough"; | ||
showBar= 1; | ||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 0.63)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default)); | ||
tabs[]= {{3,4,6}, {}}; | ||
}; | ||
class explosiveResistance: statBase { | ||
scope = 2; | ||
priority = 4; | ||
stats[]= {"armor"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_armor"; | ||
showBar= 1; | ||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 0.80)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default)); | ||
tabs[]= {{3,4,6}, {}}; | ||
}; | ||
class load: statBase { | ||
scope = 2; | ||
priority = 3; | ||
stats[]= {"maximumLoad"}; | ||
displayName= "$STR_a3_rscdisplayarsenal_stat_load"; | ||
showBar= 1; | ||
barStatement = QUOTE([ARR_3((_this select 0) select 0, _this select 1, [ARR_3([ARR_2(0, 500)], [ARR_2(0.01, 1)], false)])] call FUNC(statBarStatement_default)); | ||
tabs[]= {{3,4,5}, {}}; | ||
}; | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
#include "XEH_PREP.hpp" | ||
|
||
call FUNC(scanConfig); | ||
call FUNC(compileStats); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* Author: Alganthe | ||
* Add a stat to ACE Arsenal. | ||
* | ||
* Arguments: | ||
* 0: Tabs to add the stat to (ARRAY of ARRAYS) | ||
* 0.1: Left tab indexes (ARRAY of NUMBERS) | ||
* 0.2 Right tab indexes (ARRAY of NUMBERS) | ||
* 1: Stat class (STRING) (A unique string for each stat) | ||
* 2: Config entries to pass (ARRAY of STRINGS) | ||
* 3: Title (STRING) | ||
* 4: Show bar / show text bools (ARRAY of BOOLS) | ||
* 4.1 Show bar (BOOL) | ||
* 4.2 Show text (BOOL) | ||
* 5: Array of statements (ARRAY of ARRAYS) | ||
* 5.1: Bar code (CODE) | ||
* 5.2 Text code (CODE) | ||
* 5.3 Condition code (CODE) | ||
* 6: Priority (NUMBER) (Optional) | ||
* | ||
* Return Value: | ||
* 0: Array of IDs (ARRAY of STRINGS) | ||
* | ||
* Example: | ||
* [[[0,1,2], [7]], "scopeStat", ["scope"], "Scope", [false, true], [{}, { | ||
params ["_statsArray", "_itemCfg"]; | ||
getNumber (_itemCfg >> _statsArray select 0) | ||
}, {true}]] call ACE_arsenal_fnc_addStat | ||
* | ||
* Public: Yes | ||
*/ | ||
#include "script_component.hpp" | ||
params [ | ||
["_tabs", [[], []], [[]], 2], | ||
["_class", "", [""]], | ||
["_stats", [], [[]]], | ||
["_title", "", [""]], | ||
["_bools", [false, false], [[]], 2], | ||
["_statements", [{}, {}, {true}], [[]], 3], | ||
["_priority", 0, [0]] | ||
]; | ||
|
||
_tabs params [ | ||
["_leftTabs", [], [[]]], | ||
["_rightTabs", [], [[]]] | ||
]; | ||
|
||
_bools params [["_showBar", false, [false]], ["_showText", false, [false]]]; | ||
|
||
_statements params [ | ||
["_barStatement", {}, [{}]], | ||
["_textStatement", {}, [{}]], | ||
["_condition", {true}, [{}]] | ||
]; | ||
|
||
private _statsListLeftPanel = uiNamespace getVariable QGVAR(statsListLeftPanel); | ||
private _statsListRightPanel = uiNamespace getVariable QGVAR(statsListRightPanel); | ||
private _returnArray = []; | ||
|
||
private _fnc_addToTabs = { | ||
params ["_tabsList", "_tabsToAddTo", "_sideString", "_returnIndex"]; | ||
{ | ||
private _currentTab = _tabsList select _x; | ||
|
||
private _finalID = [_class, _sideString, [str _x, format ["0%1", _x]] select (_x < 10)] joinString ""; | ||
|
||
if ({{_x select 0 == _finalID} count _x > 0} count _currentTab > 0) then { | ||
TRACE_1("A stat with this ID already exists", _finalID); | ||
} else { | ||
|
||
private _arrayToSave = +_finalArray; | ||
_arrayToSave set [0, _finalID]; | ||
_returnArray pushBack _finalID; | ||
|
||
// Add to existing page if there's enough space, otherwise create a new page | ||
if ({count _x < 5} count _currentTab > 0) then { | ||
{ | ||
if (count _x < 5) exitWith { | ||
(_currentTab select _forEachIndex) append [_arrayToSave]; | ||
}; | ||
} foreach _currentTab; | ||
} else { | ||
_currentTab pushBack [_arrayToSave]; | ||
}; | ||
}; | ||
} foreach _tabsToAddTo; | ||
}; | ||
|
||
private _finalArray = ["", _stats, _title, [_showBar, _showText], [_barStatement, _textStatement, _condition], _priority]; | ||
|
||
if (count _leftTabs > 0) then { | ||
[_statsListLeftPanel, _leftTabs, "L", 0] call _fnc_addToTabs; | ||
}; | ||
|
||
if (count _rightTabs > 0) then { | ||
[_statsListRightPanel, _rightTabs, "R", 1] call _fnc_addToTabs; | ||
}; | ||
|
||
_returnArray |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Author: Alganthe | ||
* Toggle the stats control group | ||
* | ||
* Arguments: | ||
* 0: Arsenal display <DISPLAY> | ||
* 1: Button control <CONTROL> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
#include "script_component.hpp" | ||
#include "..\defines.hpp" | ||
|
||
params ["_display"]; | ||
|
||
(_display displayCtrl IDC_statsButton) ctrlShow GVAR(showStats); | ||
GVAR(showStats) = !GVAR(showStats); | ||
|
||
{ | ||
(_display displayCtrl _x) ctrlShow GVAR(showStats); | ||
} foreach [ | ||
IDC_statsBox, | ||
IDC_statsPreviousPage, | ||
IDC_statsNextPage, | ||
IDC_statsCurrentPage, | ||
IDC_statsButtonClose | ||
]; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be renamed to
class ACE_Arsenal_Stats
(GVAR(Stats)
) to fit other configs we have (ACE_detector
,ACE_UI
,ACE_Settings
,ACE_Extensions
, etc.).