From ecf75849618869d9b284145afb402e556926ab65 Mon Sep 17 00:00:00 2001 From: Dcr Date: Wed, 12 Feb 2025 13:55:27 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E7=89=A9=E5=93=81=E5=AF=B9=E7=85=A7?= =?UTF-8?q?=E8=A1=A8=E7=94=9F=E6=88=90=E6=A8=A1=E7=BB=84,=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=B2=A1=E6=9C=89=E6=AD=A6=E5=99=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ItemScanToMarkDown/Scripts/PlayerBase.c | 40 ++++++++++++++----------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/ItemScanToMarkDown/Scripts/PlayerBase.c b/ItemScanToMarkDown/Scripts/PlayerBase.c index 0acf6d5..c2a81cb 100644 --- a/ItemScanToMarkDown/Scripts/PlayerBase.c +++ b/ItemScanToMarkDown/Scripts/PlayerBase.c @@ -25,26 +25,32 @@ modded class PlayerBase extends ManBase return; } - string path = "cfgVehicles"; - int childcount = GetGame().ConfigGetChildrenCount( path ); - FPrintln( file, "| ClassName | DisplayNmae |" ); FPrintln( file, "| ----------- | ----------- |" ); - for(int i = 0; i < childcount; i++) - { - string itemname; - GetGame().ConfigGetChildName( path, i, itemname ); - string chilepath = path + " " + itemname; - int scope = GetGame().ConfigGetInt( chilepath + " scope" ); - if ( scope == 0 || scope == 1 ) - continue; - - string displayname; - GetGame().ConfigGetText( chilepath + " displayname", displayname ); - if ( !displayname || displayname == "" || displayname.Contains( "$UNT$" ) ) - continue; - FPrintln( file, "| " + itemname + " | " + Widget.TranslateString( displayname ) + " |" ); + string paths = "cfgVehicles"; + ref TStringArray paths = { + "cfgVehicles", "cfgWeapons" + }; + foreach( string path : paths ) + { + int childcount = GetGame().ConfigGetChildrenCount( path ); + for(int i = 0; i < childcount; i++) + { + string itemname; + GetGame().ConfigGetChildName( path, i, itemname ); + string chilepath = path + " " + itemname; + int scope = GetGame().ConfigGetInt( chilepath + " scope" ); + if ( scope == 0 || scope == 1 ) + continue; + + string displayname; + GetGame().ConfigGetText( chilepath + " displayname", displayname ); + if ( !displayname || displayname == "" || displayname.Contains( "$UNT$" ) ) + continue; + + FPrintln( file, "| " + itemname + " | " + Widget.TranslateString( displayname ) + " |" ); + } } CloseFile( file );