UnrealShare
Class UnrealGameMenu

source: e:\games\UnrealTournament\UnrealShare\Classes\UnrealGameMenu.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Menu
         |
         +--UnrealShare.UnrealMenu
            |
            +--UnrealShare.UnrealLongMenu
               |
               +--UnrealShare.UnrealGameMenu
Direct Known Subclasses:UnrealNewGameMenu

class UnrealGameMenu
extends UnrealShare.UnrealLongMenu

//============================================================================= // UnrealGameMenu //=============================================================================

Function Summary
 void DrawMenu(Canvas Canvas)
 bool ProcessSelection()
 void SaveConfigs()



Source Code


00001	//=============================================================================
00002	// UnrealGameMenu
00003	//=============================================================================
00004	class UnrealGameMenu extends UnrealLongMenu;
00005	
00006	function bool ProcessSelection()
00007	{
00008		local Menu ChildMenu;
00009	
00010		if ( (Selection == 1) && (Level.NetMode == NM_Standalone)
00011					&& !Level.Game.IsA('DeathMatchGame') )
00012			ChildMenu = spawn(class'UnrealSaveMenu', owner);
00013		else if ( Selection == 2 ) 
00014			ChildMenu = spawn(class'UnrealLoadMenu', owner);
00015		else if ( Selection == 3 )
00016			ChildMenu = spawn(class'UnrealChooseGameMenu', owner);
00017		else if ( Selection == 4 )
00018		{
00019			if ( (Level.Game != None) && (Level.Game.GameMenuType != None) )
00020				ChildMenu = spawn(Level.Game.GameMenuType, owner);
00021		}
00022		else if ( Selection == 5 )
00023		{
00024			ChildMenu = spawn(class'UnrealServerMenu', owner);
00025			UnrealServerMenu(ChildMenu).bStandAlone = true;
00026		}
00027		else 
00028			return false;
00029	
00030		if ( ChildMenu != None )
00031		{
00032			HUD(Owner).MainMenu = ChildMenu;
00033			ChildMenu.ParentMenu = self;
00034			ChildMenu.PlayerOwner = PlayerOwner;
00035		}
00036		return true;
00037	}
00038	
00039	function SaveConfigs()
00040	{
00041		Level.Game.SaveConfig();
00042		Level.Game.GameReplicationInfo.SaveConfig();
00043	}
00044	
00045	function DrawMenu(canvas Canvas)
00046	{
00047		local int StartX, StartY, Spacing;
00048		local string SkillName;
00049	
00050		DrawBackGround(Canvas, false);
00051	
00052		Spacing = Clamp(0.1 * Canvas.ClipY, 16, 48);
00053		StartX = Max(40, 0.5 * Canvas.ClipX - 96);
00054		StartY = Max(4, 0.5 * (Canvas.ClipY - 5 * Spacing - 128));
00055	
00056		// draw text
00057		DrawList(Canvas, true, Spacing, StartX, StartY);  
00058	
00059		// Draw help panel
00060		DrawHelpPanel(Canvas, StartY + MenuLength * Spacing + 4, 228);
00061	}
00062	
00063	defaultproperties
00064	{
00065	     MenuLength=5
00066	     HelpMessage(1)="Hit enter to save the current game."
00067	     HelpMessage(2)="Hit enter to load a saved game."
00068	     HelpMessage(3)="Select a difficulty level, and start a new game."
00069	     HelpMessage(4)="Hit enter to modify game options.  Note that you cannot do this if you are playing in a multiplayer game."
00070	     HelpMessage(5)="DeathMatch against Bots."
00071	     MenuList(1)="SAVE GAME"
00072	     MenuList(2)="LOAD GAME"
00073	     MenuList(3)="NEW GAME"
00074	     MenuList(4)="GAME OPTIONS"
00075	     MenuList(5)="BOTMATCH"
00076	}

End Source Code