function OnLoad()
{
local int i;
local int nMultiSample;
local bool bEnableEngSelection;
local ELanguageType Language;
local string strResolution;
dScript = DialogBox(GetScript("DialogBox"));
bPartyMember = false;
bPartyMaster = false;
// bPartyRoomMaster = false;
// Lootingtype = 0;
if(CREATE_ON_DEMAND==0)
OnRegisterEvent();
if(CREATE_ON_DEMAND==0)
InitHandle();
else
InitHandleCOD();
m_bAirState = false;
// 2006/03/26 - added register state by NeverDie. multi-registering states can only be placed in uc...
RegisterState( "OptionWnd", "GamingState" );
RegisterState( "OptionWnd", "LoginState" );
// Shader version
GetShaderVersion( nPixelShaderVersion, nVertexShaderVersion );
GetResolutionList( ResolutionList );
SetOptionBool( "Game", "HideDropItem", false );
for( i = 0; i < ResolutionList.Length; ++i )
{
strResolution = "" $ ResolutionList[ i ].nWidth $ "*" $ ResolutionList[ i ].nHeight $ " " $ ResolutionList[ i ].nColorBit $ "bit";
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.ResBox", strResolution );
}
ResetRefreshRate();
GetRefreshRateList( RefreshRateList );
class'UIAPI_COMBOBOX'.static.Clear( "OptionWnd.RefreshRateBox" );
for( i = 0; i < RefreshRateList.Length; ++i )
{
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.RefreshRateBox", RefreshRateList[ i ] $ "Hz" );
}
nMultiSample = GetMultiSample();
if( 0 == nMultiSample )
{
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.AABox", 869 );
class'UIAPI_WINDOW'.static.DisableWindow( "OptionWnd.AABox" );
}
else if( 1 == nMultiSample )
{
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.AABox", 869 );
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.AABox", 870 );
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.AABox" );
}
else if( 2 == nMultiSample )
{
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.AABox", 869 );
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.AABox", 870 );
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.AABox", 871 );
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.AABox" );
}
bEnableEngSelection = IsEnableEngSelection();
Language = GetLanguage();
switch( Language )
{
case LANG_None:
break;
case LANG_Korean:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Korean" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
break;
case LANG_English:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Russia" );
if( bEnableEngSelection )
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.LanguageBox" );
else
class'UIAPI_WINDOW'.static.DisableWindow( "OptionWnd.LanguageBox" );
break;
case LANG_Japanese:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Japanese" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
if( bEnableEngSelection )
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.LanguageBox" );
else
class'UIAPI_WINDOW'.static.DisableWindow( "OptionWnd.LanguageBox" );
break;
case LANG_Taiwan:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Chinese(Taiwan)" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
if( bEnableEngSelection )
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.LanguageBox" );
else
class'UIAPI_WINDOW'.static.DisableWindow( "OptionWnd.LanguageBox" );
break;
case LANG_Chinese:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "China" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
if( bEnableEngSelection )
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.LanguageBox" );
else
class'UIAPI_WINDOW'.static.DisableWindow( "OptionWnd.LanguageBox" );
break;
case LANG_Thai:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Thai" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
if( bEnableEngSelection )
class'UIAPI_WINDOW'.static.EnableWindow( "OptionWnd.LanguageBox" );
else
class'UIAPI_WINDOW'.static.DisableWindow( "OptionWnd.LanguageBox" );
break;
case LANG_Philippine:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
break;
case LANG_Russia:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Russia" );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
break;
default:
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "Russia " );
class'UIAPI_COMBOBOX'.static.AddString( "OptionWnd.LanguageBox", "English" );
break;
}
if( CanUseHDR() )
{
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.HDRBox", 1230 );
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.HDRBox", 1231 );
class'UIAPI_COMBOBOX'.static.SYS_AddString( "OptionWnd.HDRBox", 1232 );
}
// 2007/11/16 Now new functions(LoadVideoOption,LoadAudioOption,LoadGameOption) load the ini configuration. - NeverDie
//InitVideoOption();
//InitAudioOption();
//InitGameOption();
LoadVideoOption();
LoadAudioOption();
LoadGameOption();
bShow = false;
}