UMenu
Class UMenuGameMenu

source: e:\games\UnrealTournament\UMenu\Classes\UMenuGameMenu.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowDialogControl
            |
            +--UWindow.UWindowListControl
               |
               +--UWindow.UWindowPulldownMenu
                  |
                  +--UMenu.UMenuGameMenu
Direct Known Subclasses:None

class UMenuGameMenu
extends UWindow.UWindowPulldownMenu


Variables
 string BotmatchHelp
 string BotmatchName
 UWindowMessageBox ConfirmQuit
 string LoadHelp
 string LoadName
 string NewGameHelp
 string NewGameName
 Botmatch, Quit
 string QuitHelp
 string QuitName
 string QuitText
 string QuitTitle
 string SaveHelp
 string SaveName


Function Summary
 void Created()
 void ExecuteItem(UWindowPulldownMenuItem I)
 void MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result)
 void Select(UWindowPulldownMenuItem I)



Source Code


00001	class UMenuGameMenu extends UWindowPulldownMenu;
00002	
00003	var UWindowPulldownMenuItem NewGame, Load, Save, GameOptions, Botmatch, Quit;
00004	
00005	var localized string NewGameName;
00006	var localized string NewGameHelp;
00007	var localized string LoadName;
00008	var localized string LoadHelp;
00009	var localized string SaveName;
00010	var localized string SaveHelp;
00011	var localized string BotmatchName;
00012	var localized string BotmatchHelp;
00013	var localized string QuitName;
00014	var localized string QuitHelp;
00015	var localized string QuitTitle;
00016	var localized string QuitText;
00017	
00018	var UWindowMessageBox ConfirmQuit;
00019	
00020	function Created()
00021	{
00022		Super.Created();
00023	
00024		// Add menu items.
00025		NewGame = AddMenuItem(NewGameName, None);
00026		Load = AddMenuItem(LoadName, None);
00027		Save = AddMenuItem(SaveName, None);
00028		AddMenuItem("-", None);
00029		Botmatch = AddMenuItem(BotmatchName, None);
00030		AddMenuItem("-", None);
00031		Quit = AddMenuItem(QuitName, None);
00032	}
00033	
00034	function MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result)
00035	{
00036		if(W == ConfirmQuit && Result == MR_Yes)
00037			Root.QuitGame();
00038	}
00039	
00040	function ExecuteItem(UWindowPulldownMenuItem I) 
00041	{
00042		switch(I)
00043		{
00044		case NewGame:
00045			// Create new game dialog.
00046			Root.CreateWindow(class'UMenuNewGameWindow', 100, 100, 200, 200, Self, True);
00047			break;
00048		case Load:
00049			// Create load game dialog.
00050			Root.CreateWindow(class'UMenuLoadGameWindow', 100, 100, 200, 200, Self, True);
00051			break;
00052		case Save:
00053			// Create save game dialog.
00054			Root.CreateWindow(class'UMenuSaveGameWindow', 100, 100, 200, 200, Self, True);
00055			break;
00056		case Botmatch:
00057			// Create botmatch dialog.
00058			Root.CreateWindow(class'UMenuBotmatchWindow', 100, 100, 200, 200, Self, True);
00059			break;
00060		case Quit:
00061			ConfirmQuit = MessageBox(QuitTitle, QuitText, MB_YesNo, MR_No, MR_Yes);
00062			break;
00063		}
00064	
00065		Super.ExecuteItem(I);
00066	}
00067	
00068	function Select(UWindowPulldownMenuItem I)
00069	{
00070		switch(I)
00071		{
00072		case NewGame:
00073			UMenuMenuBar(GetMenuBar()).SetHelp(NewGameHelp);
00074			return;
00075		case Load:
00076			UMenuMenuBar(GetMenuBar()).SetHelp(LoadHelp);
00077			break;
00078		case Save:
00079			UMenuMenuBar(GetMenuBar()).SetHelp(SaveHelp);
00080			break;
00081		case Botmatch:
00082			UMenuMenuBar(GetMenuBar()).SetHelp(BotmatchHelp);
00083			break;
00084		case Quit:
00085			UMenuMenuBar(GetMenuBar()).SetHelp(QuitHelp);
00086			break;
00087		}
00088	
00089		Super.Select(I);
00090	}
00091	
00092	defaultproperties
00093	{
00094	     NewGameName="&New"
00095	     NewGameHelp="Select to setup a new single player game of Unreal."
00096	     LoadName="&Load"
00097	     LoadHelp="Select to load a previously saved game."
00098	     SaveName="&Save"
00099	     SaveHelp="Select to save your current game."
00100	     BotmatchName="&Botmatch"
00101	     BotmatchHelp="Select to begin a game of Botmatch: Deathmatch with Bots!"
00102	     QuitName="&Quit"
00103	     QuitHelp="Select to save preferences and exit Unreal."
00104	     QuitTitle="Confirm Quit"
00105	     QuitText="Are you sure you want to Quit?"
00106	}

End Source Code