Add optionals to validation tools (#8290)

This commit is contained in:
Björn Dahlgren 2021-06-29 20:21:08 +02:00 committed by GitHub
parent 59e3b07c36
commit 2513ef25de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 81 additions and 77 deletions

View File

@ -1,9 +1,9 @@
class CfgAmmo class CfgAmmo
{ {
class BulletBase; class BulletBase;
class RH_50_AE_Ball: BulletBase class RH_50_AE_Ball: BulletBase
{ {
ACE_caliber=12.7; ACE_caliber=12.7;
ACE_bulletLength=28.194; ACE_bulletLength=28.194;
ACE_bulletMass=21.06; ACE_bulletMass=21.06;
@ -14,9 +14,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={360, 398, 420}; ACE_muzzleVelocities[]={360, 398, 420};
ACE_barrelLengths[]={101.6, 152.4, 228.6}; ACE_barrelLengths[]={101.6, 152.4, 228.6};
}; };
class RH_454_Casull: BulletBase class RH_454_Casull: BulletBase
{ {
ACE_caliber=11.481; ACE_caliber=11.481;
ACE_bulletLength=22.733; ACE_bulletLength=22.733;
ACE_bulletMass=21.06; ACE_bulletMass=21.06;
@ -27,9 +27,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={450, 490, 500}; ACE_muzzleVelocities[]={450, 490, 500};
ACE_barrelLengths[]={101.6, 190.5, 228.6}; ACE_barrelLengths[]={101.6, 190.5, 228.6};
}; };
class RH_32ACP: BulletBase class RH_32ACP: BulletBase
{ {
ACE_caliber=7.938; ACE_caliber=7.938;
ACE_bulletLength=15.494; ACE_bulletLength=15.494;
ACE_bulletMass=4.212; ACE_bulletMass=4.212;
@ -40,9 +40,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={282, 300, 320}; ACE_muzzleVelocities[]={282, 300, 320};
ACE_barrelLengths[]={101.6, 127.0, 228.6}; ACE_barrelLengths[]={101.6, 127.0, 228.6};
}; };
class RH_45ACP: BulletBase class RH_45ACP: BulletBase
{ {
ACE_caliber=11.481; ACE_caliber=11.481;
ACE_bulletLength=17.272; ACE_bulletLength=17.272;
ACE_bulletMass=14.904; ACE_bulletMass=14.904;
@ -53,9 +53,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={230, 250, 285}; ACE_muzzleVelocities[]={230, 250, 285};
ACE_barrelLengths[]={101.6, 127.0, 228.6}; ACE_barrelLengths[]={101.6, 127.0, 228.6};
}; };
class RH_B_40SW: BulletBase class RH_B_40SW: BulletBase
{ {
ACE_caliber=10.16; ACE_caliber=10.16;
ACE_bulletLength=11.354; ACE_bulletLength=11.354;
ACE_bulletMass=8.748; ACE_bulletMass=8.748;
@ -66,9 +66,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={360, 380, 400}; ACE_muzzleVelocities[]={360, 380, 400};
ACE_barrelLengths[]={101.6, 152.4, 228.6}; ACE_barrelLengths[]={101.6, 152.4, 228.6};
}; };
class RH_44mag_ball: BulletBase class RH_44mag_ball: BulletBase
{ {
ACE_caliber=10.897; ACE_caliber=10.897;
ACE_bulletLength=20.422; ACE_bulletLength=20.422;
ACE_bulletMass=12.96; ACE_bulletMass=12.96;
@ -79,9 +79,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={360, 390, 420}; ACE_muzzleVelocities[]={360, 390, 420};
ACE_barrelLengths[]={101.6, 190.5, 228.6}; ACE_barrelLengths[]={101.6, 190.5, 228.6};
}; };
class RH_357mag_ball: BulletBase class RH_357mag_ball: BulletBase
{ {
ACE_caliber=9.068; ACE_caliber=9.068;
ACE_bulletLength=13.741; ACE_bulletLength=13.741;
ACE_bulletMass=8.1; ACE_bulletMass=8.1;
@ -92,9 +92,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={490, 510, 535}; ACE_muzzleVelocities[]={490, 510, 535};
ACE_barrelLengths[]={101.6, 152.4, 228.6}; ACE_barrelLengths[]={101.6, 152.4, 228.6};
}; };
class RH_762x25: BulletBase class RH_762x25: BulletBase
{ {
ACE_caliber=7.874; ACE_caliber=7.874;
ACE_bulletLength=13.856; ACE_bulletLength=13.856;
ACE_bulletMass=5.5728; ACE_bulletMass=5.5728;
@ -105,9 +105,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={360, 380, 400}; ACE_muzzleVelocities[]={360, 380, 400};
ACE_barrelLengths[]={101.6, 152.4, 228.6}; ACE_barrelLengths[]={101.6, 152.4, 228.6};
}; };
class RH_9x18_Ball: BulletBase class RH_9x18_Ball: BulletBase
{ {
ACE_caliber=9.271; ACE_caliber=9.271;
ACE_bulletLength=15.494; ACE_bulletLength=15.494;
ACE_bulletMass=6.00048; ACE_bulletMass=6.00048;
@ -118,9 +118,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={298, 330, 350}; ACE_muzzleVelocities[]={298, 330, 350};
ACE_barrelLengths[]={96.52, 127.0, 228.6}; ACE_barrelLengths[]={96.52, 127.0, 228.6};
}; };
class RH_B_9x19_Ball: BulletBase class RH_B_9x19_Ball: BulletBase
{ {
ACE_caliber=9.017; ACE_caliber=9.017;
ACE_bulletLength=15.494; ACE_bulletLength=15.494;
ACE_bulletMass=8.0352; ACE_bulletMass=8.0352;
@ -131,9 +131,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={340, 370, 400}; ACE_muzzleVelocities[]={340, 370, 400};
ACE_barrelLengths[]={101.6, 127.0, 228.6}; ACE_barrelLengths[]={101.6, 127.0, 228.6};
}; };
class RH_B_22LR_SD: BulletBase class RH_B_22LR_SD: BulletBase
{ {
ACE_caliber=5.664; ACE_caliber=5.664;
ACE_bulletLength=11.43; ACE_bulletLength=11.43;
ACE_bulletMass=2.4624; ACE_bulletMass=2.4624;
@ -144,9 +144,9 @@ class CfgAmmo
ACE_dragModel=1; ACE_dragModel=1;
ACE_muzzleVelocities[]={330, 340, 360}; ACE_muzzleVelocities[]={330, 340, 360};
ACE_barrelLengths[]={101.6, 152.4, 228.6}; ACE_barrelLengths[]={101.6, 152.4, 228.6};
}; };
class RH_57x28mm: BulletBase class RH_57x28mm: BulletBase
{ {
ACE_caliber=5.69; ACE_caliber=5.69;
ACE_bulletLength=12.573; ACE_bulletLength=12.573;
ACE_bulletMass=1.8144; ACE_bulletMass=1.8144;

View File

@ -59,8 +59,8 @@ class CfgWeapons
}; };
class RH_sbr9: Rifle_Base_F class RH_sbr9: Rifle_Base_F
{ {
ACE_barrelTwist=246.38; ACE_barrelTwist=246.38;
ACE_barrelLength=228.6; ACE_barrelLength=228.6;
}; };
class RH_M4A6: RH_M4A1_ris class RH_M4A6: RH_M4A1_ris
{ {

View File

@ -1,10 +1,10 @@
class CfgWeapons class CfgWeapons
{ {
class Rifle_Base_F; class Rifle_Base_F;
class RH_PDW: Rifle_Base_F class RH_PDW: Rifle_Base_F
{ {
ACE_barrelTwist=177.8; ACE_barrelTwist=177.8;
ACE_barrelLength=254.0; ACE_barrelLength=254.0;
}; };
}; };

View File

@ -91,7 +91,7 @@ class CfgGlasses {
ACE_Protection = 0; ACE_Protection = 0;
ACE_DustPath = QPATHTOEF(goggles,textures\fx\dust\%1.paa); ACE_DustPath = QPATHTOEF(goggles,textures\fx\dust\%1.paa);
}; };
class rhsusf_shemagh_base: G_Combat { class rhsusf_shemagh_base: G_Combat {
ACE_Overlay = ""; ACE_Overlay = "";
ACE_OverlayDirt = ""; ACE_OverlayDirt = "";
ACE_OverlayCracked = ""; ACE_OverlayCracked = "";

View File

@ -1,3 +1,4 @@
//IGNORE_STRING_WARNING(str_ace_tracers_magazine);
#define STRINGS(magazine) author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine) #define STRINGS(magazine) author = ECSTRING(common,ACETeam); displayName = CSTRING(magazine)
class CfgMagazines { class CfgMagazines {
@ -82,7 +83,7 @@ class CfgMagazines {
descriptionShort = CSTRING(100Rnd_580x42_Drum_tracer_yellow_description); descriptionShort = CSTRING(100Rnd_580x42_Drum_tracer_yellow_description);
}; };
// 6.5mm Caseless MX // 6.5mm Caseless MX
class 30Rnd_65x39_caseless_mag; class 30Rnd_65x39_caseless_mag;
class ACE_30Rnd_65x39_mx_green : 30Rnd_65x39_caseless_mag { class ACE_30Rnd_65x39_mx_green : 30Rnd_65x39_caseless_mag {
ammo = "B_65x39_Caseless_green"; ammo = "B_65x39_Caseless_green";

View File

@ -17,7 +17,7 @@ def getDefinedStrings(filepath):
return modStrings return modStrings
def getStringUsage(filepath): def getStringUsage(filepath):
selfmodule = (re.search('addons[\W]*([_a-zA-Z0-9]*)', filepath)).group(1) selfmodule = (re.search('(addons|optionals)[\W]*([_a-zA-Z0-9]*)', filepath)).group(2)
# print("Checking {0} from {1}".format(filepath,selfmodule)) # print("Checking {0} from {1}".format(filepath,selfmodule))
fileStrings = [] fileStrings = []
@ -51,23 +51,24 @@ def main(argv):
allDefinedStrings = [] allDefinedStrings = []
allUsedStrings = [] allUsedStrings = []
# Allow running from root directory as well as from inside the tools directory for folder in ['addons', 'optionals']:
rootDir = "../addons" # Allow running from root directory as well as from inside the tools directory
if (os.path.exists("addons")): rootDir = "../" + folder
rootDir = "addons" if (os.path.exists(folder)):
rootDir = folder
for root, dirnames, filenames in os.walk(rootDir): for root, dirnames, filenames in os.walk(rootDir):
for filename in fnmatch.filter(filenames, '*.sqf'): for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.cpp'): for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'): for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.h'): for filename in fnmatch.filter(filenames, '*.h'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.xml'): for filename in fnmatch.filter(filenames, '*.xml'):
xml_list.append(os.path.join(root, filename)) xml_list.append(os.path.join(root, filename))
for filename in xml_list: for filename in xml_list:
allDefinedStrings = allDefinedStrings + getDefinedStrings(filename) allDefinedStrings = allDefinedStrings + getDefinedStrings(filename)

View File

@ -131,16 +131,17 @@ def main():
parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="") parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="")
args = parser.parse_args() args = parser.parse_args()
# Allow running from root directory as well as from inside the tools directory for folder in ['addons', 'optionals']:
rootDir = "../addons" # Allow running from root directory as well as from inside the tools directory
if (os.path.exists("addons")): rootDir = "../" + folder
rootDir = "addons" if (os.path.exists(folder)):
rootDir = folder
for root, dirnames, filenames in os.walk(rootDir + '/' + args.module): for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.cpp'): for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'): for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in sqf_list: for filename in sqf_list:
bad_count = bad_count + check_config_style(filename) bad_count = bad_count + check_config_style(filename)

View File

@ -165,14 +165,15 @@ def main():
parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="") parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="")
args = parser.parse_args() args = parser.parse_args()
# Allow running from root directory as well as from inside the tools directory for folder in ['addons', 'optionals']:
rootDir = "../addons" # Allow running from root directory as well as from inside the tools directory
if (os.path.exists("addons")): rootDir = "../" + folder
rootDir = "addons" if (os.path.exists(folder)):
rootDir = folder
for root, dirnames, filenames in os.walk(rootDir + '/' + args.module): for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.sqf'): for filename in fnmatch.filter(filenames, '*.sqf'):
sqf_list.append(os.path.join(root, filename)) sqf_list.append(os.path.join(root, filename))
for filename in sqf_list: for filename in sqf_list:
bad_count = bad_count + check_sqf_syntax(filename) bad_count = bad_count + check_sqf_syntax(filename)