Scope stats and ballistic stats improvement (#6164)

* Hide some of the ballistic stats if config value not defined

ACE_magMuzzleVelocity
ACE_bulletMass
ACE_ballisticCoef

* Add vertical and horizontal scope limits stats
This commit is contained in:
Josuan Albin 2018-02-24 06:29:41 +01:00 committed by PabstMirror
parent 1835ccebb8
commit 123c19c1c0
4 changed files with 30 additions and 0 deletions

View File

@ -34,6 +34,7 @@ class EGVAR(arsenal,stats) {
displayName= CSTRING(statBallisticCoef);
showText= 1;
textStatement = QUOTE(params[ARR_2('_stat', '_config')]; private _ammoCfg = (configFile >> 'CfgAmmo' >> (getText (_config >> 'ammo'))); private _ballisticCoef = getArray (_ammoCfg >> _stat select 1); _ballisticCoef sort false; format [ARR_4('%1 G%2 (%3)', _ballisticCoef select 0 ,getNumber (_ammoCfg >> _stat select 0), getText (_ammoCfg >> _stat select 2))]);
condition = QUOTE(params[ARR_2('_stat', '_config')]; private _ammoCfg = (configFile >> 'CfgAmmo' >> (getText (_config >> 'ammo'))); !(getArray (_ammoCfg >> _stat select 1) isEqualTo []));
tabs[] ={{}, {4}};
};
class ACE_bulletMass: statBase {
@ -43,6 +44,7 @@ class EGVAR(arsenal,stats) {
displayName = CSTRING(statBulletMass);
showText = 1;
textStatement = QUOTE(params[ARR_2('_stat', '_config')]; private _ammoWeight = getNumber (configFile >> 'CfgAmmo' >> (getText (_config >> 'ammo')) >> _stat select 0); format [ARR_3('%1g (%2gr)', _ammoWeight toFixed 1, (_ammoWeight * 15.43) toFixed 1)]);
condition = QUOTE(params[ARR_2('_stat', '_config')]; getNumber (configFile >> 'CfgAmmo' >> (getText (_config >> 'ammo')) >> _stat select 0) > 0);
tabs[] = {{}, {4}};
};
class ACE_magMuzzleVelocity: statBase {
@ -52,6 +54,7 @@ class EGVAR(arsenal,stats) {
displayName= CSTRING(statMuzzleVelocity);
showText= 1;
textStatement = QUOTE(params[ARR_2('_stat', '_config')]; private _initSpeed = getNumber (_config >> _stat select 0); format [ARR_3('%1 m/s (%2 ft/s)', _initSpeed, (_initSpeed * 3.28084) toFixed 0)]);
condition = QUOTE(getNumber (_this select 1 >> (_this select 0) select 0) > 0);
tabs[] = {{}, {4}};
};
class ACE_weaponMuzzleVelocity: statBase {

View File

@ -0,0 +1,18 @@
class EGVAR(arsenal,stats) {
class statBase;
class ACE_scopeHorizontalLimits: statBase {
scope = 2;
priority = 3;
stats[] = {"ACE_ScopeAdjust_Horizontal", "ACE_ScopeAdjust_HorizontalIncrement"};
displayName = CSTRING(statHorizontalLimits);
showText = 1;
textStatement = QUOTE(params[ARR_2('_stat','_config')]; private _limits = getArray (_config >> _stat select 0); format [ARR_4('%1 / %2 MIL ( %3 MIL)', _limits select 0, _limits select 1, getNumber (_config >> _stat select 1))]);
condition = QUOTE(params[ARR_2('_stat', '_config')]; !((getArray (_config >> _stat select 0)) isEqualTo []));
tabs[] = {{}, {0}};
};
class ACE_scopeVerticalLimits: ACE_scopeHorizontalLimits {
stats[] = {"ACE_ScopeAdjust_Vertical", "ACE_ScopeAdjust_VerticalIncrement"};
priority = 2;
displayName = CSTRING(statVerticalLimits);
};
};

View File

@ -20,3 +20,4 @@ class CfgPatches {
#include "CfgWeapons.hpp"
#include "RscTitles.hpp"
#include "ACE_Settings.hpp"
#include "ACE_Arsenal_Stats.hpp"

View File

@ -440,5 +440,13 @@
<Japanese>%1R</Japanese>
<Korean>%1R</Korean>
</Key>
<Key ID="STR_ACE_Scopes_statHorizontalLimits">
<English>Horizontal limits</English>
<Chinese>Limites horizontales</Chinese>
</Key>
<Key ID="STR_ACE_Scopes_statVerticalLimits">
<English>Vertical limits</English>
<Chinese>Limites verticales</Chinese>
</Key>
</Package>
</Project>