Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowDialogControl | +--UWindow.UWindowListControl | +--UWindow.UWindowPulldownMenu | +--UTMenu.UTGameMenu
string
BotmatchHelp
BotmatchName
UWindowMessageBox
ConfirmQuit
DemoQuitText
LoadGameHelp
LoadGameName
NewGameHelp
NewGameName
QuitHelp
QuitName
QuitText
QuitTitle
Quit,
ReturnToGame
ReturnToGameHelp
ReturnToGameName
void
Created()
ExecuteItem(UWindowPulldownMenuItem I)
MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result)
Select(UWindowPulldownMenuItem I)
ShowWindow()
00001 class UTGameMenu extends UWindowPulldownMenu; 00002 00003 var UWindowPulldownMenuItem NewGame, LoadGame, Botmatch, Quit, ReturnToGame; 00004 00005 var localized string NewGameName; 00006 var localized string NewGameHelp; 00007 var localized string LoadGameName; 00008 var localized string LoadGameHelp; 00009 var localized string BotmatchName; 00010 var localized string BotmatchHelp; 00011 var localized string ReturnToGameName; 00012 var localized string ReturnToGameHelp; 00013 var localized string QuitName; 00014 var localized string QuitHelp; 00015 var localized string QuitTitle; 00016 var localized string QuitText; 00017 var localized string DemoQuitText; 00018 00019 var UWindowMessageBox ConfirmQuit; 00020 00021 function Created() 00022 { 00023 Super.Created(); 00024 00025 // Add menu items. 00026 NewGame = AddMenuItem(NewGameName, None); 00027 Botmatch = AddMenuItem(BotmatchName, None); 00028 AddMenuItem("-", None); 00029 LoadGame = AddMenuItem(LoadGameName, None); 00030 ReturnToGame = AddMenuItem(ReturnToGameName, None); 00031 AddMenuItem("-", None); 00032 Quit = AddMenuItem(QuitName, None); 00033 } 00034 00035 function ShowWindow() 00036 { 00037 Super.ShowWindow(); 00038 ReturnToGame.bDisabled = GetLevel().Game != None && GetLevel().Game.IsA('UTIntro'); 00039 } 00040 00041 function MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result) 00042 { 00043 if(class'GameInfo'.Default.DemoBuild == 1) 00044 { 00045 if(W == ConfirmQuit) 00046 { 00047 switch(Result) 00048 { 00049 case MR_Yes: 00050 GetPlayerOwner().ConsoleCommand("start http://www.unrealtournament.com"); 00051 GetPlayerOwner().ConsoleCommand("exit"); 00052 break; 00053 case MR_No: 00054 Root.QuitGame(); 00055 break; 00056 } 00057 } 00058 } 00059 else 00060 { 00061 if(W == ConfirmQuit && Result == MR_Yes) 00062 Root.QuitGame(); 00063 } 00064 } 00065 00066 function ExecuteItem(UWindowPulldownMenuItem I) 00067 { 00068 local string StartMap; 00069 local int EmptySlot, j; 00070 00071 switch(I) 00072 { 00073 case NewGame: 00074 GetPlayerOwner().ClientTravel( "UT-Logo-Map.unr?Game=Botpack.LadderNewGame", TRAVEL_Absolute, True ); 00075 break; 00076 case LoadGame: 00077 GetPlayerOwner().ClientTravel( "UT-Logo-Map.unr?Game=Botpack.LadderLoadGame", TRAVEL_Absolute, True ); 00078 break; 00079 case Botmatch: 00080 // Create botmatch dialog. 00081 Root.CreateWindow(class'UTBotmatchWindow', 100, 100, 200, 200, Self, True); 00082 break; 00083 case Quit: 00084 if(class'GameInfo'.Default.DemoBuild == 1) 00085 ConfirmQuit = MessageBox(QuitTitle, DemoQuitText, MB_YesNoCancel, MR_Cancel, MR_No); 00086 else 00087 ConfirmQuit = MessageBox(QuitTitle, QuitText, MB_YesNo, MR_No, MR_Yes); 00088 break; 00089 case ReturnToGame: 00090 Root.Console.CloseUWindow(); 00091 break; 00092 } 00093 00094 Super.ExecuteItem(I); 00095 } 00096 00097 function Select(UWindowPulldownMenuItem I) 00098 { 00099 switch(I) 00100 { 00101 case NewGame: 00102 UMenuMenuBar(GetMenuBar()).SetHelp(NewGameHelp); 00103 return; 00104 case LoadGame: 00105 UMenuMenuBar(GetMenuBar()).SetHelp(LoadGameHelp); 00106 return; 00107 case Botmatch: 00108 UMenuMenuBar(GetMenuBar()).SetHelp(BotmatchHelp); 00109 break; 00110 case Quit: 00111 UMenuMenuBar(GetMenuBar()).SetHelp(QuitHelp); 00112 break; 00113 case ReturnToGame: 00114 UMenuMenuBar(GetMenuBar()).SetHelp(ReturnToGameHelp); 00115 break; 00116 } 00117 00118 Super.Select(I); 00119 } 00120 00121 defaultproperties 00122 { 00123 NewGameName="&Start Unreal Tournament" 00124 NewGameHelp="Select to start a new Unreal Tournament game!" 00125 LoadGameName="&Resume Saved Tournament" 00126 LoadGameHelp="Select to resume a saved Unreal Tournament game." 00127 BotmatchName="Start &Practice Session" 00128 BotmatchHelp="Select to begin a practice game against bots." 00129 ReturnToGameName="Return to &Current Game" 00130 ReturnToGameHelp="Leave the menus and return to your current game. Pressing the ESC key also returns you to the current game." 00131 QuitName="&Quit" 00132 QuitHelp="Select to save preferences and exit Unreal." 00133 QuitTitle="Confirm Quit" 00134 QuitText="Are you sure you want to Quit?" 00135 DemoQuitText="Thank you for playing the Unreal Tournament Demo. Visit our website for information on the full version of the game, which contains 7 unique game types and over 50 levels!\n\nWould you like to visit the Unreal Tournament website now?" 00136 }