Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

XInterface.Tab_NetworkSettings


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
// ====================================================================
//  Class:  XInterface.Tab_OnlineSettings
//  Parent: XInterface.GUITabPanel
//
//  <Enter a description here>
// ====================================================================

class Tab_NetworkSettings extends UT2K3TabPanel;


var localized string	NetSpeedText[4];

var localized string	StatsURL;
var localized string    EpicIDMsg;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{

	local int i;
	Super.Initcomponent(MyController, MyOwner);

	for (i=0;i<Controls.Length;i++)
		Controls[i].OnChange=InternalOnChange;

	for(i = 0;i < ArrayCount(NetSpeedText);i++)
		moComboBox(Controls[1]).AddItem(NetSpeedText[i]);

	moEditBox(Controls[2]).MyEditBox.bConvertSpaces = true;
	moEditBox(Controls[2]).MyEditBox.MaxWidth=14;

	moEditBox(Controls[3]).MyEditBox.MaxWidth=14;

	moEditBox(Controls[3]).MaskText(true);
	moEditBox(Controls[2]).MenuStateChange(MSAT_Disabled);
	moEditBox(Controls[3]).MenuStateChange(MSAT_Disabled);

	GUILabel(Controls[8]).Caption = EpicIDMsg@FormatID(PlayerOwner().GetPlayerIDHash());

    moCheckBox(Controls[9]).Checked(PlayerOwner().bDynamicNetSpeed);

}

function string FormatID(string id)
{
    id=Caps(id);
	return mid(id,0,8)$"-"$mid(id,8,8)$"-"$mid(id,16,8)$"-"$mid(id,24,8);
}

function InternalOnLoadINI(GUIComponent Sender, string s)
{
	local int i;

	if (Sender==Controls[1])
	{
		i = class'Player'.default.ConfiguredInternetSpeed;
		if (i<=2600)
			moComboBox(Sender).SetText(NetSpeedText[0]);
		else if (i<=5000)
			moComboBox(Sender).SetText(NetSpeedText[1]);
		else if (i<=10000)
			moComboBox(Sender).SetText(NetSpeedText[2]);
		else
			moComboBox(Sender).SetText(NetSpeedText[3]);
	}
	else if (Sender==Controls[2])
	{
		if(PlayerOwner().StatsUserName!="" && PlayerOwner().StatsPassword!="")
		{
			moEditBox(Sender).SetText(PlayerOwner().StatsUserName);
			moEditBox(Sender).MenuStateChange(MSAT_Blurry);
		}
		else
		{
			moEditBox(Sender).SetText("");
			moEditBox(Sender).MenuStateChange(MSAT_Disabled);
		}
	}
	else if (Sender==Controls[3])
	{
		if(PlayerOwner().StatsUserName!="" && PlayerOwner().StatsPassword!="")
		{
			moEditBox(Sender).SetText(PlayerOwner().StatsPassword);
			moEditBox(Sender).MenuStateChange(MSAT_Blurry);
		}
		else
		{
			moEditBox(Sender).SetText("");
			moEditBox(Sender).MenuStateChange(MSAT_Disabled);
		}
	}
	else if (Sender==Controls[5])
	{
		GUICheckBoxButton(GUIMenuOption(Sender).MyComponent).SetChecked( PlayerOwner().StatsUserName!="" && PlayerOwner().StatsPassword!="" );
	}

	Controls[7].bVisible = !ValidStatConfig();
}

function bool ValidStatConfig()
{
	if(moCheckBox(Controls[5]).IsChecked())
	{
		if(Len(moEditBox(Controls[2]).GetText()) < 4)
			return false;

		if(Len(moEditBox(Controls[3]).GetText()) < 6)
			return false;
	}

	return true;
}

function ApplyStatConfig()
{
	if(moCheckBox(Controls[5]).IsChecked())
	{
		PlayerOwner().StatsUserName = moEditBox(Controls[2]).GetText();
		PlayerOwner().StatsPassword = moEditBox(Controls[3]).GetText();
	}
	else
	{
		PlayerOwner().StatsUserName = moEditBox(Controls[2]).GetText();
		PlayerOwner().StatsPassword = moEditBox(Controls[3]).GetText();
	}
	PlayerOwner().SaveConfig();
}

function InternalOnChange(GUIComponent Sender)
{
	local GUIMenuOption O;

	if (!Controller.bCurMenuInitialized)
		return;

	if (Sender==Controls[1])
	{
		if (moComboBox(Sender).GetText()==NetSpeedText[0])
			PlayerOwner().ConsoleCommand("netspeed 2600");
		else if (moComboBox(Sender).GetText()==NetSpeedText[1])
			PlayerOwner().ConsoleCommand("netspeed 5000");
		else if (moComboBox(Sender).GetText()==NetSpeedText[2])
			PlayerOwner().ConsoleCommand("netspeed 10000");
		else if (moComboBox(Sender).GetText()==NetSpeedText[3])
			PlayerOwner().ConsoleCommand("netspeed 20000");
	}
	else
	if (Sender==Controls[5])
	{
		O = GUIMenuOption(Sender);
		if ( !GUICheckBoxButton(O.MyComponent).bChecked )
		{
			moEditBox(Controls[2]).SetText("");
			moEditBox(Controls[3]).SetText("");
			moEditBox(Controls[2]).MenuStateChange(MSAT_Disabled);
			moEditBox(Controls[3]).MenuStateChange(MSAT_Disabled);
		}
		else
		{
			moEditBox(Controls[2]).MenuStateChange(MSAT_Blurry);
			moEditBox(Controls[3]).MenuStateChange(MSAT_Blurry);
		}
	}

    else if (Sender==Controls[9])
    {
    	PlayerOwner().bDynamicNetSpeed = moCheckBox(Controls[9]).IsChecked();
        PlayerOwner().Saveconfig();
    }

	Controls[7].bVisible = !ValidStatConfig();
}

function bool OnViewStats(GUIComponent Sender)
{
	PlayerOwner().ConsoleCommand("start"@StatsURL);
	return true;
}

defaultproperties
{
	Begin Object class=GUIImage Name=OnlineBK1
		WinWidth=0.576640
		WinHeight=0.489999
		WinLeft=0.216797
		WinTop=0.355208
		Image=Material'InterfaceContent.Menu.BorderBoxD'
		ImageColor=(R=255,G=255,B=255,A=160);
		ImageRenderStyle=MSTY_Alpha
		ImageStyle=ISTY_Stretched
	End Object
	Controls(0)=GUIImage'OnlineBK1'

	Begin Object class=moComboBox Name=OnlineNetSpeed
		WinWidth=0.500000
		WinHeight=0.060000
		WinLeft=0.250000
		WinTop=0.085678
		Caption="Connection"
		INIOption="@Internal"
		INIDefault="Cable Modem/DSL"
		OnLoadINI=InternalOnLoadINI
		Hint="How fast is your connection?"
		CaptionWidth=0.4
		ComponentJustification=TXTA_Left
		bReadOnly=true
	End Object
	Controls(1)=GUIMenuOption'OnlineNetSpeed'


	Begin Object class=moEditBox Name=OnlineStatsName
		WinWidth=0.500000
		WinHeight=0.060000
		WinLeft=0.250000
		WinTop=0.494271
		INIOption="@Internal"
		OnLoadINI=InternalOnLoadINI
		Caption="Stats UserName"
		Hint="Please select a name to use for UT Stats!"
		CaptionWidth=0.4
	End Object
	Controls(2)=moEditBox'OnlineStatsName'

	Begin Object class=moEditBox Name=OnlineStatsPW
		WinWidth=0.500000
		WinHeight=0.060000
		WinLeft=0.250000
		WinTop=0.583594
		Caption="Stats Password"
		INIOption="@Internal"
		OnLoadINI=InternalOnLoadINI
		Hint="Please select a password that will secure your UT Stats!"
		CaptionWidth=0.4
	End Object
	Controls(3)=moEditBox'OnlineStatsPW'

	Begin Object class=GUILabel Name=OnlineStatDesc
		Caption="UT2003 Global Stats"
		TextALign=TXTA_Center
		TextFont="UT2HeaderFont"
		TextColor=(R=230,G=200,B=0,A=255)
		WinWidth=0.500000
		WinHeight=32.000000
		WinLeft=0.250000
		WinTop=0.391145
	End Object
	Controls(4)=GUILabel'OnlineStatDesc'

	Begin Object class=moCheckBox Name=OnlineTrackStats
		WinWidth=0.210000
		WinHeight=0.040000
		WinLeft=0.251565
		WinTop=0.742708
		Caption="Track Stats"
		INIOption="@Internal"
		INIDefault="True"
		OnLoadINI=InternalOnLoadINI
		Hint="Enable this option to join the online ranking system."
		CaptionWidth=0.9
		bSquare=true
		ComponentJustification=TXTA_Left
	End Object
	Controls(5)=moCheckBox'OnlineTrackStats'

	Begin Object class=GUIButton Name=ViewOnlineStats
		WinWidth=0.210000
		WinHeight=0.040000
		WinLeft=0.536721
		WinTop=0.742708
		Caption="View Stats"
		Hint="Click to launch the UT stats website."
		OnClick=OnViewStats
	End Object
	Controls(6)=GUIButton'ViewOnlineStats'

	Begin Object class=GUILabel Name=InvalidWarning
		WinWidth=0.576561
		WinHeight=0.125001
		WinLeft=0.215625
		WinTop=0.870832
		Caption="Your stats username or password is invalid.  Your username must be at least 4 characters long, and your password must be at least 6 characters long."
		TextAlign=TXTA_Center
		bMultiLine=True
		TextColor=(R=255,G=0,B=0,A=255)
		TextFont="UT2MenuFont"
	End Object
	Controls(7)=GUILabel'InvalidWarning'

	Begin Object class=GUILabel Name=EpicID
		WinWidth=1
		WinHeight=0.066407
		WinLeft=0
		WinTop=0.313279
		Caption="Your Unique id is:"
		TextAlign=TXTA_Center
		bMultiLine=True
		TextColor=(R=255,G=255,B=0,A=255)
		TextFont="UT2SmallFont"
	End Object
	Controls(8)=GUILabel'EpicID'

	Begin Object class=moCheckBox Name=NetworkDynamicNetspeed
		WinWidth=0.500000
		WinHeight=0.040000
		WinLeft=0.250000
		WinTop=0.179011
		Caption="Dynamic Netspeed"
		Hint="Dynamic adjust your netspeed on slower connections."
		CaptionWidth=0.9
		bSquare=true
		ComponentJustification=TXTA_Left
	End Object
	Controls(9)=moCheckBox'NetworkDynamicNetspeed'

	WinTop=0.15
	WinLeft=0
	WinWidth=1
	WinHeight=0.74
	bAcceptsInput=false

	NetSpeedText(0)="Modem"
	NetSpeedText(1)="ISDN"
	NetSpeedText(2)="Cable/ADSL"
	NetSpeedText(3)="LAN/T1"

	StatsURL="http://ut2003stats.epicgames.com/"
    EpicIDMsg="Your Unique id is:"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:36:28.000 - Creation time: Do 14.8.2014 09:58:51.602 - Created with UnCodeX