Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 00351 00352 00353 00354 00355 00356 00357 00358 00359 00360 00361 00362 00363 00364 00365 00366 00367 00368 00369 00370 00371 00372 00373 00374 00375 00376 00377 00378 00379 00380 00381 00382 00383 00384 00385 00386 00387 00388 00389 00390 00391 00392 00393 00394 00395 00396 00397 00398 00399 00400 00401 00402 00403 00404 00405 00406 00407 00408 00409 00410 00411 00412 00413 00414 00415 00416 00417 00418 00419 00420 00421 00422 00423 00424 00425 00426 00427 00428 00429 00430 00431 00432 00433 00434 00435 00436 00437 00438 00439 00440 00441 00442 00443 00444 00445 00446 00447 00448 00449 00450 00451 00452 00453 00454 00455 00456 00457 00458 00459 00460 00461 00462 00463 00464 00465 00466 00467 00468 00469 00470 00471 00472 00473 00474 00475 00476 00477 00478 00479 00480 00481 00482 00483 00484 00485 00486 00487 00488 00489 00490 00491 00492 00493 00494 00495 00496 00497 00498 00499 00500 00501 00502 00503 00504 00505 00506 00507 00508 00509 00510 00511 00512 00513 00514 00515 00516 00517 00518 00519 00520 00521 00522 00523 00524 00525 00526 00527 00528 00529 00530 00531 00532 00533 00534 00535 00536 00537 00538 00539 00540 00541 00542 00543 00544 00545 00546 |
class Browser_Prefs extends Browser_Page; var GUITitleBar StatusBar; var localized string ViewStatsStrings[3]; var localized string MutatorModeStrings[4]; var localized string WeaponStayStrings[3]; var localized string TranslocatorStrings[3]; var bool bIsInitialised; var array<xUtil.MutatorRecord> MutatorRecords; function InitComponent(GUIController MyController, GUIComponent MyOwner) { local int i; Super.InitComponent(MyController, MyOwner); if(bIsInitialised) return; GUIButton(GUIPanel(Controls[0]).Controls[0]).OnClick=BackClick; // Set options for stats server viewing moComboBox(Controls[5]).AddItem(ViewStatsStrings[0]); moComboBox(Controls[5]).AddItem(ViewStatsStrings[1]); moComboBox(Controls[5]).AddItem(ViewStatsStrings[2]); moComboBox(Controls[5]).ReadOnly(true); // Load mutators into combobox class'xUtil'.static.GetMutatorList(MutatorRecords); moComboBox(Controls[9]).AddItem(MutatorModeStrings[0]); moComboBox(Controls[9]).AddItem(MutatorModeStrings[1]); moComboBox(Controls[9]).AddItem(MutatorModeStrings[2]); moComboBox(Controls[9]).AddItem(MutatorModeStrings[3]); moComboBox(Controls[9]).ReadOnly(true); moComboBox(Controls[13]).AddItem(MutatorModeStrings[0]); moComboBox(Controls[13]).AddItem(MutatorModeStrings[2]); moComboBox(Controls[13]).AddItem(MutatorModeStrings[3]); moComboBox(Controls[13]).ReadOnly(true); for(i=0; i<MutatorRecords.Length; i++) { moComboBox(Controls[6]).AddItem(MutatorRecords[i].FriendlyName, None, MutatorRecords[i].ClassName); moComboBox(Controls[14]).AddItem(MutatorRecords[i].FriendlyName, None, MutatorRecords[i].ClassName); } moComboBox(Controls[6]).ReadOnly(true); // Weapon stay moComboBox(Controls[11]).AddItem(WeaponStayStrings[0]); moComboBox(Controls[11]).AddItem(WeaponStayStrings[1]); moComboBox(Controls[11]).AddItem(WeaponStayStrings[2]); moComboBox(Controls[11]).ReadOnly(true); // Translocator moComboBox(Controls[12]).AddItem(TranslocatorStrings[0]); moComboBox(Controls[12]).AddItem(TranslocatorStrings[1]); moComboBox(Controls[12]).AddItem(TranslocatorStrings[2]); moComboBox(Controls[12]).ReadOnly(true); moNumericEdit(Controls[15]).MyNumericEdit.Step = 10; moNumericEdit(Controls[16]).MyNumericEdit.Step = 10; for(i=2; i<17; i++) { Controls[i].OnLoadINI=MyOnLoadINI; Controls[i].OnChange=MyOnChange; } StatusBar = GUITitleBar(GUIPanel(Controls[0]).Controls[1]); // Set on click for 'Show Icon Key' button GUIButton(GUIPanel(Controls[0]).Controls[2]).OnClick = InternalShowIconKey; bIsInitialised=true; } // delegates function bool BackClick(GUIComponent Sender) { Controller.CloseMenu(true); return true; } function UpdateMutatorVisibility() { // If first one is 'any' or 'none', don't show any mutator selector boxes if(Browser.ViewMutatorMode == VMM_AnyMutators || Browser.ViewMutatorMode == VMM_NoMutators) { Controls[6].bVisible = false; Controls[13].bVisible = false; Controls[14].bVisible = false; } else // If its not - show the first mutator selection box, and the second mode box { Controls[6].bVisible = true; Controls[13].bVisible = true; // And check the second mode drop-down, if(Browser.ViewMutator2Mode == VMM_AnyMutators) Controls[14].bVisible = false; else Controls[14].bVisible = true; } } function bool InternalShowIconKey(GUIComponent Sender) { Controller.OpenMenu("XInterface.Browser_IconKey"); return true; } ///////////////////// LOAD /////////////////////// function MyOnLoadINI(GUIComponent Sender, string s) { local int i; if(Sender == Controls[8]) moCheckBox(Controls[8]).Checked(Browser.bOnlyShowStandard); else if(Sender == Controls[2]) moCheckBox(Controls[2]).Checked(Browser.bOnlyShowNonPassword); else if(Sender == Controls[3]) moCheckBox(Controls[3]).Checked(Browser.bDontShowFull); else if(Sender == Controls[4]) moCheckBox(Controls[4]).Checked(Browser.bDontShowEmpty); else if(Sender == Controls[5]) moComboBox(Controls[5]).SetText(ViewStatsStrings[Browser.StatsServerView]); else if(Sender == Controls[6]) { // Find the Mutator with this class name, and put its friendly name in the box for(i=0; i<MutatorRecords.Length; i++) { if( Browser.DesiredMutator == MutatorRecords[i].ClassName ) { moComboBox(Controls[6]).SetText( MutatorRecords[i].FriendlyName ); return; } } } else if(Sender == Controls[7]) { moEditBox(Controls[7]).SetText(Browser.CustomQuery); } else if(Sender == Controls[9]) { moComboBox(Controls[9]).SetText( MutatorModeStrings[Browser.ViewMutatorMode] ); UpdateMutatorVisibility(); } else if(Sender == Controls[10]) moCheckBox(Controls[10]).Checked(Browser.bDontShowWithBots); else if(Sender == Controls[11]) moComboBox(Controls[11]).SetText(WeaponStayStrings[Browser.WeaponStayServerView]); else if(Sender == Controls[12]) moComboBox(Controls[12]).SetText(TranslocatorStrings[Browser.TranslocServerView]); else if(Sender == Controls[13]) { moComboBox(Controls[13]).SetText( MutatorModeStrings[Browser.ViewMutator2Mode] ); UpdateMutatorVisibility(); } else if(Sender == Controls[14]) { for(i=0; i<MutatorRecords.Length; i++) { if( Browser.DesiredMutator2 == MutatorRecords[i].ClassName ) { moComboBox(Controls[14]).SetText( MutatorRecords[i].FriendlyName ); return; } } } else if(Sender == Controls[15]) moNumericEdit(Controls[15]).SetValue(Browser.MinGamespeed); else if(Sender == Controls[16]) moNumericEdit(Controls[16]).SetValue(Browser.MaxGamespeed); } ///////////////////// SAVE /////////////////////// function MyOnChange(GUIComponent Sender) { local string t; if(Sender == Controls[8]) Browser.bOnlyShowStandard = moCheckBox(Controls[8]).IsChecked(); else if(Sender == Controls[2]) Browser.bOnlyShowNonPassword = moCheckBox(Controls[2]).IsChecked(); else if(Sender == Controls[3]) Browser.bDontShowFull = moCheckBox(Controls[3]).IsChecked(); else if(Sender == Controls[4]) Browser.bDontShowEmpty = moCheckBox(Controls[4]).IsChecked(); else if(Sender == Controls[5]) { t = moComboBox(Controls[5]).GetText(); if(t == ViewStatsStrings[0]) Browser.StatsServerView = SSV_Any; else if(t == ViewStatsStrings[1]) Browser.StatsServerView = SSV_OnlyStatsEnabled; else if(t == ViewStatsStrings[2]) Browser.StatsServerView = SSV_NoStatsEnabled; } else if(Sender == Controls[6]) { Browser.DesiredMutator = moComboBox(Controls[6]).GetExtra(); } else if(Sender == Controls[7]) { Browser.CustomQuery = moEditBox(Controls[7]).GetText(); } else if(Sender == Controls[9]) { t = moComboBox(Controls[9]).GetText(); if(t == MutatorModeStrings[0]) Browser.ViewMutatorMode = VMM_AnyMutators; else if(t == MutatorModeStrings[1]) Browser.ViewMutatorMode = VMM_NoMutators; else if(t == MutatorModeStrings[2]) Browser.ViewMutatorMode = VMM_ThisMutator; else if(t == MutatorModeStrings[3]) Browser.ViewMutatorMode = VMM_NotThisMutator; UpdateMutatorVisibility(); } else if(Sender == Controls[10]) Browser.bDontShowWithBots = moCheckBox(Controls[10]).IsChecked(); else if(Sender == Controls[11]) { t = moComboBox(Controls[11]).GetText(); if(t == WeaponStayStrings[0]) Browser.WeaponStayServerView = WSSV_Any; else if(t == WeaponStayStrings[1]) Browser.WeaponStayServerView = WSSV_OnlyWeaponStay; else if(t == WeaponStayStrings[2]) Browser.WeaponStayServerView = WSSV_NoWeaponStay; } else if(Sender == Controls[12]) { t = moComboBox(Controls[12]).GetText(); if(t == TranslocatorStrings[0]) Browser.TranslocServerView = TSV_Any; else if(t == TranslocatorStrings[1]) Browser.TranslocServerView = TSV_OnlyTransloc; else if(t == TranslocatorStrings[2]) Browser.TranslocServerView = TSV_NoTransloc; } else if(Sender == Controls[13]) { t = moComboBox(Controls[13]).GetText(); if(t == MutatorModeStrings[0]) Browser.ViewMutator2Mode = VMM_AnyMutators; else if(t == MutatorModeStrings[2]) Browser.ViewMutator2Mode = VMM_ThisMutator; else if(t == MutatorModeStrings[3]) Browser.ViewMutator2Mode = VMM_NotThisMutator; UpdateMutatorVisibility(); } else if(Sender == Controls[14]) { Browser.DesiredMutator2 = moComboBox(Controls[14]).GetExtra(); } else if(Sender == Controls[15]) { if( moNumericEdit(Controls[15]).GetValue() < 0 ) moNumericEdit(Controls[15]).SetValue( 0 ); Browser.MinGamespeed = moNumericEdit(Controls[15]).GetValue(); } else if(Sender == Controls[16]) { if( moNumericEdit(Controls[16]).GetValue() > 200 ) moNumericEdit(Controls[16]).SetValue( 200 ); Browser.MaxGamespeed = moNumericEdit(Controls[16]).GetValue(); } Browser.SaveConfig(); } defaultproperties { ViewStatsStrings(0)="Any Servers" ViewStatsStrings(1)="Only Stats Servers" ViewStatsStrings(2)="No Stats Servers" MutatorModeStrings(0)="Any Mutators" MutatorModeStrings(1)="No Mutators" MutatorModeStrings(2)="This Mutator" MutatorModeStrings(3)="Not This Mutator" WeaponStayStrings(0)="Any Servers" WeaponStayStrings(1)="Only Weapon Stay Servers" WeaponStayStrings(2)="No Weapon Stay Servers" TranslocatorStrings(0)="Any Servers" TranslocatorStrings(1)="Only Translocator Servers" TranslocatorStrings(2)="No Translocator Servers" Begin Object Class=GUIPanel Name=FooterPanel Begin Object Class=GUIButton Name=MyBackButton Caption="BACK" StyleName="SquareMenuButton" WinWidth=0.200000 WinHeight=0.500000 OnKeyEvent=MyBackButton.InternalOnKeyEvent End Object Controls(0)=GUIButton'XInterface.Browser_Prefs.MyBackButton' Begin Object Class=GUITitleBar Name=MyStatus bUseTextHeight=Falsch Justification=TXTA_Left StyleName="SquareBar" WinTop=0.500000 WinHeight=0.500000 End Object Controls(1)=GUITitleBar'XInterface.Browser_Prefs.MyStatus' Begin Object Class=GUIButton Name=MyKeyButton Caption="ICON KEY" StyleName="SquareMenuButton" WinLeft=0.200000 WinWidth=0.200000 WinHeight=0.500000 OnKeyEvent=MyKeyButton.InternalOnKeyEvent End Object Controls(2)=GUIButton'XInterface.Browser_Prefs.MyKeyButton' WinTop=0.900000 WinHeight=0.100000 End Object Controls(0)=GUIPanel'XInterface.Browser_Prefs.FooterPanel' Begin Object Class=GUILabel Name=FilterTitle Caption="Server Filtering Options:" TextColor=(B=0,G=200,R=230) TextFont="UT2HeaderFont" WinTop=0.050000 WinLeft=0.150000 WinWidth=0.720003 WinHeight=0.056250 End Object Controls(1)=GUILabel'XInterface.Browser_Prefs.FilterTitle' Begin Object Class=moCheckBox Name=NoPasswdCheckBox ComponentJustification=TXTA_Left CaptionWidth=0.900000 Caption="No Passworded Servers" OnCreateComponent=NoPasswdCheckBox.InternalOnCreateComponent IniOption="@Internal" WinTop=0.210000 WinLeft=0.050000 WinWidth=0.340000 WinHeight=0.040000 End Object Controls(2)=moCheckBox'XInterface.Browser_Prefs.NoPasswdCheckBox' Begin Object Class=moCheckBox Name=NoFullCheckBox ComponentJustification=TXTA_Left CaptionWidth=0.900000 Caption="No Full Servers" OnCreateComponent=NoFullCheckBox.InternalOnCreateComponent IniOption="@Internal" WinTop=0.270000 WinLeft=0.050000 WinWidth=0.340000 WinHeight=0.040000 End Object Controls(3)=moCheckBox'XInterface.Browser_Prefs.NoFullCheckBox' Begin Object Class=moCheckBox Name=NoEmptyCheckBox ComponentJustification=TXTA_Left CaptionWidth=0.900000 Caption="No Empty Servers" OnCreateComponent=NoEmptyCheckBox.InternalOnCreateComponent IniOption="@Internal" WinTop=0.330000 WinLeft=0.050000 WinWidth=0.340000 WinHeight=0.040000 End Object Controls(4)=moCheckBox'XInterface.Browser_Prefs.NoEmptyCheckBox' Begin Object Class=moComboBox Name=StatsViewCombo ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Stats Servers" OnCreateComponent=StatsViewCombo.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.390000 WinLeft=0.050000 WinWidth=0.760000 WinHeight=0.040000 End Object Controls(5)=moComboBox'XInterface.Browser_Prefs.StatsViewCombo' Begin Object Class=moComboBox Name=MutatorCombo ComponentJustification=TXTA_Left CaptionWidth=0.000000 OnCreateComponent=MutatorCombo.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.450000 WinLeft=0.675004 WinWidth=0.308750 WinHeight=0.060000 End Object Controls(6)=moComboBox'XInterface.Browser_Prefs.MutatorCombo' Begin Object Class=moEditBox Name=CustomQuery CaptionWidth=0.400000 Caption="Custom Query" OnCreateComponent=CustomQuery.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.750000 WinLeft=0.050000 WinWidth=0.760000 WinHeight=0.040000 End Object Controls(7)=moEditBox'XInterface.Browser_Prefs.CustomQuery' Begin Object Class=moCheckBox Name=OnlyStandardCheckBox ComponentJustification=TXTA_Left CaptionWidth=0.900000 Caption="Only Standard Servers" OnCreateComponent=OnlyStandardCheckBox.InternalOnCreateComponent IniOption="@Internal" WinTop=0.150000 WinLeft=0.050000 WinWidth=0.340000 WinHeight=0.040000 End Object Controls(8)=moCheckBox'XInterface.Browser_Prefs.OnlyStandardCheckBox' Begin Object Class=moComboBox Name=MutatorModeCombo ComponentJustification=TXTA_Left Caption="Mutators" OnCreateComponent=MutatorModeCombo.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.450000 WinLeft=0.050000 WinWidth=0.610000 WinHeight=0.040000 End Object Controls(9)=moComboBox'XInterface.Browser_Prefs.MutatorModeCombo' Begin Object Class=moCheckBox Name=NoBotServersCheckBox ComponentJustification=TXTA_Left CaptionWidth=0.900000 Caption="No Servers With Bots" OnCreateComponent=NoBotServersCheckBox.InternalOnCreateComponent IniOption="@Internal" WinTop=0.390000 WinLeft=0.050000 WinWidth=0.340000 WinHeight=0.040000 bVisible=Falsch End Object Controls(10)=moCheckBox'XInterface.Browser_Prefs.NoBotServersCheckBox' Begin Object Class=moComboBox Name=WeaponStayCombo ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="WeaponStay" OnCreateComponent=WeaponStayCombo.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.570000 WinLeft=0.050000 WinWidth=0.760000 WinHeight=0.040000 End Object Controls(11)=moComboBox'XInterface.Browser_Prefs.WeaponStayCombo' Begin Object Class=moComboBox Name=TranslocatorCombo ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Translocator" OnCreateComponent=TranslocatorCombo.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.630000 WinLeft=0.050000 WinWidth=0.760000 WinHeight=0.040000 End Object Controls(12)=moComboBox'XInterface.Browser_Prefs.TranslocatorCombo' Begin Object Class=moComboBox Name=MutatorModeCombo2 ComponentJustification=TXTA_Left OnCreateComponent=MutatorModeCombo2.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.510000 WinLeft=0.050000 WinWidth=0.610000 WinHeight=0.040000 End Object Controls(13)=moComboBox'XInterface.Browser_Prefs.MutatorModeCombo2' Begin Object Class=moComboBox Name=MutatorCombo2 ComponentJustification=TXTA_Left CaptionWidth=0.000000 OnCreateComponent=MutatorCombo2.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.510000 WinLeft=0.675004 WinWidth=0.308750 WinHeight=0.060000 End Object Controls(14)=moComboBox'XInterface.Browser_Prefs.MutatorCombo2' Begin Object Class=moNumericEdit Name=MinGamespeed MinValue=0 MaxValue=200 ComponentJustification=TXTA_Left CaptionWidth=0.700000 Caption="Game Speed Min" OnCreateComponent=MinGamespeed.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.690000 WinLeft=0.050000 WinWidth=0.433750 WinHeight=0.060000 End Object Controls(15)=moNumericEdit'XInterface.Browser_Prefs.MinGamespeed' Begin Object Class=moNumericEdit Name=MaxGamespeed MinValue=0 MaxValue=200 ComponentJustification=TXTA_Left CaptionWidth=0.400000 Caption="Max" OnCreateComponent=MaxGamespeed.InternalOnCreateComponent IniOption="@INTERNAL" WinTop=0.690000 WinLeft=0.557501 WinWidth=0.235000 WinHeight=0.060000 End Object Controls(16)=moNumericEdit'XInterface.Browser_Prefs.MaxGamespeed' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |