Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbdc2f3
commit d113d03
Showing
14 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class ace_arsenal_stats { | ||
class statBase; | ||
class GVAR(frequencyRange): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,frequencyMin), QEGVAR(arsenalStats,frequencyMax)}; | ||
displayName= CSTRING(arsenalStats_frequencyRange); | ||
showText = 1; | ||
textStatement = QUOTE(call FUNC(arsenalStats_frequencyRange)); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; // Misc-Items on right tab | ||
}; | ||
class GVAR(transmitPower): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,transmitPower)}; | ||
displayName= CSTRING(arsenalStats_transmitPower); | ||
showText = 1; | ||
textStatement = QUOTE(call FUNC(arsenalStats_transmitPower)); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; | ||
}; | ||
class GVAR(effectiveRange): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,effectiveRange)}; | ||
displayName= CSTRING(arsenalStats_effectiveRange); | ||
showText = 1; | ||
textStatement = QUOTE(getText ((_this select 1) >> (_this select 0 select 0))); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; | ||
}; | ||
class GVAR(externalSpeaker): statBase { | ||
scope = 2; | ||
stats[] = {QEGVAR(arsenalStats,externalSpeaker)}; | ||
displayName= CSTRING(arsenalStats_externalSpeaker); | ||
showText = 1; | ||
textStatement = QUOTE(call FUNC(arsenalStats_externalSpeaker)); | ||
condition = QUOTE((getNumber(_this select 1 >> 'acre_isRadio')) == 1); | ||
tabs[] = {{}, {7}}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ class CfgPatches { | |
|
||
#include "CfgVehicles.hpp" | ||
#include "CfgEventHandlers.hpp" | ||
#include "ace_arsenal_stats.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Shows arsenal stats | ||
* | ||
* Arguments: | ||
* 0: Stats Array of config strings <ARRAY> | ||
* 1: Radio Cfg <CONFIG> | ||
* | ||
* Return Value: | ||
* <STRING> | ||
* | ||
* Example: | ||
* [["acre_arsenalStats_externalSpeaker"], configFile >> "CfgWeapons" >> "ACRE_PRC117F"] call acre_ace_interact_fnc_arsenalStats_externalSpeaker | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_statsArray", "_itemCfg"]; | ||
|
||
private _val = getNumber (_itemCfg >> (_statsArray select 0)); | ||
if (_val > 0) then { localize "str_lib_info_yes" } else { localize "str_lib_info_no" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Shows arsenal stats for frequency range | ||
* | ||
* Arguments: | ||
* 0: Stats Array of config strings <ARRAY> | ||
* 1: Radio Cfg <CONFIG> | ||
* | ||
* Return Value: | ||
* <STRING> | ||
* | ||
* Example: | ||
* [["..min", "...max"], configFile >> "CfgWeapons" >> "ACRE_PRC117F"] call acre_ace_interact_fnc_arsenalStats_frequencyRange | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_statsArray", "_itemCfg"]; | ||
|
||
_statsArray = _statsArray apply { | ||
private _value = getNumber (_itemCfg >> _x); | ||
switch (true) do { | ||
case (_value == 0): {"?"}; | ||
case (_value < 1e6): {format ["%1kHz", _value / 1e3]}; | ||
case (_value < 1e9): {format ["%1MHz", _value / 1e6]}; | ||
default {format ["%1GHz", _value / 1e9]}; | ||
}; | ||
}; | ||
|
||
// note: doesn't handle non-contiguous ranges, | ||
// and just because 2 radios are on same freq doesn't mean their bandwidth/modulation will be compatible.. | ||
|
||
format ["%1 - %2", _statsArray#0, _statsArray#1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "script_component.hpp" | ||
/* | ||
* Author: PabstMirror | ||
* Shows arsenal stats | ||
* | ||
* Arguments: | ||
* 0: Stats Array of config strings <ARRAY> | ||
* 1: Radio Cfg <CONFIG> | ||
* | ||
* Return Value: | ||
* <STRING> | ||
* | ||
* Example: | ||
* [["...power"], configFile >> "CfgWeapons" >> "ACRE_PRC117F"] call acre_ace_interact_fnc_arsenalStats_transmitPower | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_statsArray", "_itemCfg"]; | ||
|
||
private _power = getNumber (_itemCfg >> _statsArray select 0); //in milliwatts | ||
|
||
if (_power == 0) exitWith {"?"}; | ||
if (_power >= 1e3) then { format ["%1W", _power/1000] } else { format ["%1mW",_power] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters