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 |
// ==================================================================== // Class: XInterface.UT2SinglePlayerMain // Parent: XInterface.GUIPage // // <Enter a description here> // ==================================================================== class UT2SinglePlayerMain extends UT2K3GUIPage; #exec OBJ LOAD FILE=InterfaceContent.utx #exec OBJ LOAD FILE=GameSounds.uax var Tab_SPPanelBase TP_Profile, TP_Tutorials, TP_Qual, TP_Ladder, TP_Roster, TP_Play; var GUIButton ButtonMenu, ButtonPlay; var GUITabControl TabC; var localized string MessageLadderAvailable, MessageLadderComplete, MessageCreateProfileFirst; var localized string TabNameProfileNew, TabNameProfileLoad, TabNameQualification, TabNameLadder, TabNameRoster, TabNameTutorials; var localized string TabHintProfileNew, TabHintProfileLoad, TabHintQualification, TabHintLadder, TabHintRoster, TabHintTutorials; var bool bFinishedPanels; // to avoid creating roster at wrong time function InitComponent(GUIController MyController, GUIComponent MyOwner) { Super.Initcomponent(MyController, MyOwner); TabC = GUITabControl(Controls[0]); ButtonMenu = GUIButton(Controls[2]); ButtonPlay = GUIButton(Controls[3]); //ButtonPlay.MenuState = MSAT_Disabled; // hide the play button until a profile is loaded GUITitleBar(Controls[4]).DockedTabs = TabC; TP_Profile = Tab_SPPanelBase(TabC.AddTab(TabNameProfileLoad,"xinterface.Tab_SPProfileLoad",,"",true)); //TP_Profile.MyButton.Hint = TabHintProfileLoad; TP_Tutorials = Tab_SPPanelBase(TabC.AddTab(TabNameTutorials,"xinterface.Tab_SPTutorials",,"")); TP_Tutorials.MyButton.Hint = TabHintTutorials; TP_Qual = Tab_SPPanelBase(TabC.AddTab(TabNameQualification,"xinterface.Tab_SPLadderQualify",,"")); TP_Qual.MyButton.Hint = TabHintQualification; TP_Ladder = Tab_SPPanelBase(TabC.AddTab(TabNameLadder,"xinterface.Tab_SPLadderTeam",,"")); TP_Ladder.MyButton.Hint = TabHintLadder; bFinishedPanels=true; ProfileUpdated(); TabC.bDockPanels=true; TP_Qual.bAcceptsInput = false; TP_Ladder.bAcceptsInput = false; //TP_Roster.bAcceptsInput = false; } event HandleParameters(string Param1, string Param2) { local GameProfile GP; Super.HandleParameters(Param1, Param2); GP = PlayerOwner().Level.Game.CurrentGameProfile; if ( GP != none ) { TP_Qual.bAcceptsInput = true; // anyone can access this menu if ( GP.LadderRung[1] >= 0 ) { TP_Ladder.bAcceptsInput = true; //TP_Roster.bAcceptsInput = true; TabC.ActivateTab(TP_Ladder.MyButton, true); // return to correct ladder } else { TabC.ActivateTab(TP_Qual.MyButton, true); // return to correct ladder } if ( GP.SpecialEvent != "" ) { HandleSpecialEvent(GP.SpecialEvent); } } /* mocombobox(Controls[5]).AddItem("DRAFT"); mocombobox(Controls[5]).AddItem("TRADE Widowmaker"); mocombobox(Controls[5]).AddItem("TRADE Syzygy"); mocombobox(Controls[5]).AddItem("DM COMPLETE"); mocombobox(Controls[5]).AddItem("TDM COMPLETE"); mocombobox(Controls[5]).AddItem("CTF COMPLETE"); mocombobox(Controls[5]).AddItem("DOM COMPLETE"); mocombobox(Controls[5]).AddItem("BR COMPLETE"); mocombobox(Controls[5]).AddItem("CHAMPIONSHIP COMPLETE"); mocombobox(Controls[5]).AddItem("TDM OPENED"); mocombobox(Controls[5]).AddItem("CTF OPENED"); mocombobox(Controls[5]).AddItem("DOM OPENED"); mocombobox(Controls[5]).AddItem("BR OPENED"); mocombobox(Controls[5]).AddItem("CHAMPIONSHIP OPENED"); mocombobox(Controls[5]).AddItem("TRADE 1"); mocombobox(Controls[5]).OnChange=BoxChange; moComboBox(Controls[5]).ReadOnly(true); */ } function PopupButton(byte yButton) { PlayerOwner().Level.Game.CurrentGameProfile.SpecialEvent = ""; } function HandleSpecialEvent(string SpecialEvent) { local UT2SP_LadderEventPage LPage; local UT2SP_PlayerTradePage TPage; local string tmp; // handle special events Log("SINGLEPLAYER UT2SinglePlayerMain detected special event of "$SpecialEvent); // clear this event from the gameprofile, if there is one if ( PlayerOwner().Level.Game.CurrentGameProfile != none ) { PlayerOwner().Level.Game.CurrentGameProfile.SpecialEvent = ""; PlayerOwner().Level.Game.SavePackage(PlayerOwner().Level.Game.CurrentGameProfile.PackageName); } //Messages are of the following form: //"DRAFT" -- go to the draft menu //"XX COMPLETE" "XX OPENED" -- open or complete a ladder if ( SpecialEvent == "DRAFT" ) { //TabC.ActivateTab(TP_Roster.MyButton, true); // so it'll be waiting for them Controller.OpenMenu("XInterface.UT2SP_DraftEventPage"); LPage = UT2SP_LadderEventPage(Controller.ActivePage); LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.TeamDMShot", class'Material', true)); } else if ( InStr (SpecialEvent, "TRADE") >= 0 ) { tmp = Mid ( SpecialEvent, 6, Len(SpecialEvent) ); Controller.OpenMenu("XInterface.UT2SP_PlayerTradePage"); TPage = UT2SP_PlayerTradePage(Controller.ActivePage); TPage.Initialize(tmp); } else if ( InStr (SpecialEvent, "COMPLETE") >= 0 ) { if ( Left (SpecialEvent, 5) != "CHAMP" ) { Controller.OpenMenu("XInterface.UT2SP_LadderEventPage"); LPage = UT2SP_LadderEventPage(Controller.ActivePage); if ( Left (SpecialEvent, 3) == "TDM" ) { class'Tab_SPTutorials'.default.bTDMUnlocked = true; class'Tab_SPTutorials'.static.StaticSaveConfig(); LPage.lblCaption.Caption = class'xGame.xTeamgame'.default.GameName@MessageLadderComplete; LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.TeamDMMoneyShot", class'Material', true)); PlayerOwner().ClientPlaySound(Sound'GameSounds.OtherFanfares.LadderClosed',,,SLOT_Talk); } else if ( Left (SpecialEvent, 3) == "CTF" ) { class'Tab_SPTutorials'.default.bCTFUnlocked = true; class'Tab_SPTutorials'.static.StaticSaveConfig(); LPage.lblCaption.Caption = class'xGame.xCTFGame'.default.GameName@MessageLadderComplete; LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.CTFMoneyShot", class'Material', true)); PlayerOwner().ClientPlaySound(Sound'GameSounds.OtherFanfares.LadderClosed',,,SLOT_Talk); } else if ( Left (SpecialEvent, 3) == "DOM" ) { class'Tab_SPTutorials'.default.bDOMUnlocked = true; class'Tab_SPTutorials'.static.StaticSaveConfig(); LPage.lblCaption.Caption = class'xGame.xDoubleDom'.default.GameName@MessageLadderComplete; LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.DOMMoneyShot", class'Material', true)); PlayerOwner().ClientPlaySound(Sound'GameSounds.OtherFanfares.LadderClosed',,,SLOT_Talk); } else if ( Left (SpecialEvent, 2) == "BR" ) { class'Tab_SPTutorials'.default.bBRUnlocked = true; class'Tab_SPTutorials'.static.StaticSaveConfig(); LPage.lblCaption.Caption = class'xGame.xBombingRun'.default.GameName@MessageLadderComplete; LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.BRMoneyShot", class'Material', true)); PlayerOwner().ClientPlaySound(Sound'GameSounds.OtherFanfares.LadderClosed',,,SLOT_Talk); } } else // if ( Left (SpecialEvent, 5) == "CHAMP" ) { class'Tab_PlayerSettings'.default.bUnlocked = true; class'Tab_PlayerSettings'.static.StaticSaveConfig(); bAllowedAsLast=true; PlayerOwner().Level.Game.CurrentGameProfile.bInLadderGame=false; // don't want it to reload into SP menus PlayerOwner().ConsoleCommand ("START endgame.ut2?quickstart=true?TeamScreen=false?savegame="$PlayerOwner().Level.Game.CurrentGameProfile.PackageName); Controller.CloseAll(false); } } else if ( InStr (SpecialEvent, "OPENED") >= 0 ) { Controller.OpenMenu("XInterface.UT2SP_LadderEventPage"); LPage = UT2SP_LadderEventPage(Controller.ActivePage); PlayerOwner().ClientPlaySound(Sound'GameSounds.OtherFanfares.LadderOpened',,,SLOT_Talk); if ( Left (SpecialEvent, 3) == "TDM" ) { LPage.lblCaption.Caption = class'xGame.xTeamgame'.default.GameName@MessageLadderAvailable; LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.TeamDMShot", class'Material', true)); } else if ( Left (SpecialEvent, 3) == "CTF" ) { LPage.lblCaption.Caption = class'xGame.xCTFGame'.default.GameName@MessageLadderAvailable; LPage.SetTutorialName("TUT-CTF"); LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.CTFShot", class'Material', true)); } else if ( Left (SpecialEvent, 3) == "DOM" ) { LPage.lblCaption.Caption = class'xGame.xDoubleDom'.default.GameName@MessageLadderAvailable; LPage.SetTutorialName("TUT-DOM"); LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.DOMShot", class'Material', true)); } else if ( Left (SpecialEvent, 2) == "BR" ) { LPage.lblCaption.Caption = class'xGame.xBombingRun'.default.GameName@MessageLadderAvailable; LPage.SetTutorialName("TUT-BR"); LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.BRShot", class'Material', true)); } else if ( Left (SpecialEvent, 5) == "CHAMP" ) { LPage.lblCaption.Caption = class'xGame.BossDM'.default.GameName@MessageLadderAvailable; LPage.gImage.Image = Material(DynamicLoadObject("Laddershots.ChampionshipShot", class'Material', true)); } } } event ChangeHint(string NewHint) { GUITitleBar(Controls[1]).SetCaption(NewHint); } function bool ButtonClick(GUIComponent Sender) { local GameProfile GP; local LevelInfo myLevel; local GUIQuestionPage GPage; if ( Sender == ButtonMenu ) { Controller.CloseMenu(); } else if ( Sender == ButtonPlay ) { GP = PlayerOwner().Level.Game.CurrentGameProfile; if ( GP != none ) { PlayerOwner().Level.Game.SavePackage(GP.PackageName); // check to see if player was supposed to have drafted a team, but was // somehow interrupted if ( ( GP.CurrentLadder > 0 || (GP.CurrentLadder == 0 && GP.CurrentMenuRung == 5) ) && ( GP.PlayerTeam[0] == "" ) ) { HandleSpecialEvent("DRAFT"); return true; } myLevel = PlayerOwner().Level; TabC.ActivateTab(TP_Ladder.MyButton, true); // return to ladder Controller.CloseAll(false); GP.StartNewMatch ( GP.CurrentLadder, myLevel ); } else { if (Controller.OpenMenu("XInterface.GUIQuestionPage")) { GPage=GUIQuestionPage(Controller.TopPage()); GPage.SetupQuestion(MessageCreateProfileFirst, QBTN_Ok, QBTN_Ok); } } } return true; } function TabChange(GUIComponent Sender) { if (GUITabButton(Sender)==none) return; ResetTitleBar(GUITabButton(Sender)); } // called by Tab_SPPanelBase.ProfileUpdated() function ResetTitleBar(GUITabButton TB) { if ( PlayerOwner().Level.Game.CurrentGameProfile != none ) { GUITitleBar(Controls[4]).SetCaption(GUITitleBar(default.Controls[4]).GetCaption()@"|"@ PlayerOwner().Level.Game.CurrentGameProfile.PlayerName@"|"@TB.Caption); } else GUITitleBar(Controls[4]).SetCaption(GUITitleBar(default.Controls[4]).GetCaption()@"|"@TB.Caption); } function BoxChange(GUIComponent Sender) { HandleSpecialEvent(mocombobox(Sender).GetText()); } function PassThroughProfileUpdated() { TP_Qual.ProfileUpdated(); // this will pass the call to all children } function ProfileUpdated() { local GameProfile GP; local bool bRosterOn; if (TabC != none && TabC.ActiveTab != none) ResetTitleBar(TabC.ActiveTab); // make sure we don't accidentally create the Roster menu first and get it out of order if ( !bFinishedPanels ) { return; } GP = PlayerOwner().Level.Game.CurrentGameProfile; if ( GP == none ) { bRosterOn = false; } else { bRosterOn = ( GP.PlayerTeam[0] != "" ); } if ( bRosterOn ) { if ( TP_Roster == none ) { TP_Roster = Tab_SPPanelBase(TabC.AddTab(TabNameRoster,"xinterface.Tab_SPRoster",,"")); TP_Roster.MyButton.Hint = TabHintRoster; } } else { if ( TP_Roster != none ) { TabC.RemoveTab(TabNameRoster); TP_Roster = none; } } } defaultproperties { Begin Object Class=GUITabControl Name=SPTabs WinWidth=1.0 WinLeft=0 WinTop=0.25 WinHeight=48 TabHeight=0.04 bFillSpace=True OnChange=TabChange; bAcceptsInput=true End Object Controls(0)=GUITabControl'SPTabs' Begin Object class=GUITitleBar name=SPHints WinWidth=0.76 WinHeight=0.055 WinLeft=0.12 WinTop=0.93 bUseTextHeight=false StyleName="Footer" Justification=TXTA_Center End Object Controls(1)=GUITitleBar'SPHints' Begin Object Class=GUIButton Name=SPBack Caption="MENU" Hint="Return to main menu" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.12 WinHeight=0.055 WinLeft=0 WinTop=0.93 bFocusOnWatch=true End Object Controls(2)=GUIButton'SPBack' Begin Object Class=GUIButton Name=SPPlay Caption="PLAY" Hint="Play the selected match" OnClick=ButtonClick StyleName="SquareMenuButton" WinWidth=0.12 WinHeight=0.055 WinLeft=0.88 WinTop=0.93 bFocusOnWatch=true End Object Controls(3)=GUIButton'SPPlay' Begin Object class=GUITitleBar name=SPPageHeader Caption="Single Player" StyleName="Header" WinWidth=1 WinHeight=46.000000 WinLeft=0 WinTop=0.036406 Effect=material'CO_Final' End Object Controls(4)=GUITitleBar'SPPageHeader' Begin Object class=moComboBox Name=SPevent WinWidth=0.548128 WinHeight=0.060000 WinLeft=0.446251 WinTop=0.043745 CaptionWidth=0.375 Caption="SpecialEvent Test" End Object //Controls(5)=moComboBox'SPevent' Background=Material'InterfaceContent.Backgrounds.bg11' WinWidth=1.0 WinHeight=1.0 WinTop=0.0 WinLeft=0.0 MessageCreateProfileFirst="You must create or load a profile before playing." MessageLadderAvailable="ladder is now available." MessageLadderComplete="ladder completed." TabNameProfileNew="Create Profile" TabNameProfileLoad="Manage Profiles" TabNameQualification="Qualification" TabNameLadder="Ladder" TabNameRoster="Roster" TabNameTutorials="Tutorials" TabHintProfileNew="Create a new single player campaign" TabHintProfileLoad="Manage your existing single player campaigns" TabHintQualification="Individual competition to qualify for the Unreal Tournament" TabHintLadder="Team competition in the Unreal Tournament" TabHintRoster="Manage your lineup for the next match" TabHintTutorials="View tutorials for each game type" } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |