UMenu
Class UMenuLoadGameClientWindow

source: e:\games\UnrealTournament\UMenu\Classes\UMenuLoadGameClientWindow.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UMenu.UMenuDialogClientWindow
                  |
                  +--UMenu.UMenuSlotClientWindow
                     |
                     +--UMenu.UMenuLoadGameClientWindow
Direct Known Subclasses:None

class UMenuLoadGameClientWindow
extends UMenu.UMenuSlotClientWindow


Variables
 UMenuRaisedButton RestartButton
 string RestartHelp
 string RestartText


Function Summary
 void BeforePaint(Canvas C, float X, float Y)
 void Created()
 void Notify(UWindowDialogControl C, byte E)



Source Code


00001	class UMenuLoadGameClientWindow extends UMenuSlotClientWindow;
00002	
00003	var UMenuRaisedButton RestartButton;
00004	var localized string RestartText;
00005	var localized string RestartHelp;
00006	
00007	function Created()
00008	{
00009		local int ButtonWidth, ButtonLeft, ButtonTop, I;
00010	
00011		Super.Created();
00012	
00013		ButtonWidth = WinWidth - 60;
00014		ButtonLeft = (WinWidth - ButtonWidth)/2;
00015	
00016		ButtonTop = 25 + 25*10;
00017		RestartButton = UMenuRaisedButton(CreateControl(class'UMenuRaisedButton', ButtonLeft, ButtonTop, ButtonWidth, 1));
00018		RestartButton.SetText(RestartText@GetLevel().Title);
00019		RestartButton.SetHelpText(RestartHelp);
00020	}
00021	
00022	function BeforePaint(Canvas C, float X, float Y)
00023	{
00024		local int ButtonWidth, ButtonLeft, I;
00025	
00026		Super.BeforePaint(C, X, Y);
00027	
00028		ButtonWidth = WinWidth - 60;
00029		ButtonLeft = (WinWidth - ButtonWidth)/2;
00030	
00031		RestartButton.SetSize(ButtonWidth, 1);
00032		RestartButton.WinLeft = ButtonLeft;
00033	}
00034	
00035	function Notify(UWindowDialogControl C, byte E)
00036	{
00037		local int I;
00038		local int Selection;
00039	
00040		Super.Notify(C, E);
00041	
00042		switch(E)
00043		{
00044		case DE_Click:
00045			if ( C == RestartButton )
00046			{
00047				Root.GetPlayerOwner().ReStartLevel();
00048				Close();
00049				return;
00050			}
00051	
00052			if ( UMenuRaisedButton(C).Text ~= "..Empty.." )
00053			{
00054				return;
00055			}
00056	
00057			for (I=0; I<9; I++)
00058			{
00059				if (C == Slots[I])
00060				{
00061					Selection = I;
00062				}
00063			}
00064	
00065			if ( Left(UMenuRaisedButton(C).Text, 4) == "Net:" )
00066				GetLevel().ServerTravel( "?load="$Selection, false);
00067			else
00068				GetPlayerOwner().ClientTravel( "?load="$Selection, TRAVEL_Absolute, false);
00069			Close();
00070			break;
00071		}
00072	}
00073	
00074	defaultproperties
00075	{
00076	     RestartText="Restart"
00077	     RestartHelp="Press to restart the current level."
00078	}

End Source Code