Fix: 物品对照表生成模组,修复没有武器的问题

This commit is contained in:
Dcr
2025-02-12 13:55:27 +08:00
parent 6b8582da39
commit ecf7584961

View File

@@ -25,26 +25,32 @@ modded class PlayerBase extends ManBase
return; return;
} }
string path = "cfgVehicles";
int childcount = GetGame().ConfigGetChildrenCount( path );
FPrintln( file, "| ClassName | DisplayNmae |" ); FPrintln( file, "| ClassName | DisplayNmae |" );
FPrintln( file, "| ----------- | ----------- |" ); FPrintln( file, "| ----------- | ----------- |" );
for(int i = 0; i < childcount; i++)
string paths = "cfgVehicles";
ref TStringArray paths = {
"cfgVehicles", "cfgWeapons"
};
foreach( string path : paths )
{ {
string itemname; int childcount = GetGame().ConfigGetChildrenCount( path );
GetGame().ConfigGetChildName( path, i, itemname ); for(int i = 0; i < childcount; i++)
string chilepath = path + " " + itemname; {
int scope = GetGame().ConfigGetInt( chilepath + " scope" ); string itemname;
if ( scope == 0 || scope == 1 ) GetGame().ConfigGetChildName( path, i, itemname );
continue; string chilepath = path + " " + itemname;
int scope = GetGame().ConfigGetInt( chilepath + " scope" );
if ( scope == 0 || scope == 1 )
continue;
string displayname; string displayname;
GetGame().ConfigGetText( chilepath + " displayname", displayname ); GetGame().ConfigGetText( chilepath + " displayname", displayname );
if ( !displayname || displayname == "" || displayname.Contains( "$UNT$" ) ) if ( !displayname || displayname == "" || displayname.Contains( "$UNT$" ) )
continue; continue;
FPrintln( file, "| " + itemname + " | " + Widget.TranslateString( displayname ) + " |" ); FPrintln( file, "| " + itemname + " | " + Widget.TranslateString( displayname ) + " |" );
}
} }
CloseFile( file ); CloseFile( file );