69 lines
2.2 KiB
C
69 lines
2.2 KiB
C
modded class PlayerBase extends ManBase
|
|
{
|
|
override void OnJumpStart()
|
|
{
|
|
super.OnJumpStart();
|
|
|
|
if ( GetGame().IsServer() )
|
|
return;
|
|
|
|
if ( GetCurrentUILanguage() != "zh_CN" )
|
|
{
|
|
MessageAction( "Please set the UI language to Chinese" );
|
|
return;
|
|
}
|
|
|
|
string FilePathStr = "$profile:ItemCodeComparisonTable.md";
|
|
|
|
if ( FileExist( FilePathStr ) )
|
|
DeleteFile( FilePathStr );
|
|
|
|
FileHandle file = OpenFile( FilePathStr, FileMode.APPEND );
|
|
if ( file == 0 )
|
|
{
|
|
MessageImportant( "存储文件创建失败. 请重试!" );
|
|
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 ) + " |" );
|
|
}
|
|
|
|
CloseFile( file );
|
|
}
|
|
|
|
string GetCurrentUILanguage()
|
|
{
|
|
ListOptionsAccess language_option;
|
|
GameOptions gameOptions = new GameOptions;
|
|
language_option = ListOptionsAccess.Cast( gameOptions.GetOptionByType( OptionAccessType.AT_OPTIONS_LANGUAGE ) );
|
|
int idx = -1;
|
|
if ( language_option )
|
|
idx = language_option.GetIndex();
|
|
|
|
string languageName;
|
|
language_option.GetItemText( idx, languageName );
|
|
if ( languageName == "#options_language_CHS" )
|
|
return "zh_CN";
|
|
|
|
return "en_US";
|
|
}
|
|
} |