UMenu
Class UMenuRootWindow

source: e:\games\UnrealTournament\UMenu\Classes\UMenuRootWindow.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowRootWindow
            |
            +--UMenu.UMenuRootWindow
Direct Known Subclasses:None

class UMenuRootWindow
extends UWindow.UWindowRootWindow

//============================================================================= // UMenuRootWindow - root window subclass for Unreal Menu System //=============================================================================
Variables
 Font BetaFont


Function Summary
 void Created()
 void DoQuitGame()
 void Paint(Canvas C, float MouseX, float MouseY)
 void Resized()



Source Code


00001	//=============================================================================
00002	// UMenuRootWindow - root window subclass for Unreal Menu System
00003	//=============================================================================
00004	class UMenuRootWindow extends UWindowRootWindow;
00005	
00006	#exec TEXTURE IMPORT NAME=Bg11 FILE=Textures\Goty11.pcx GROUP="Icons" MIPS=OFF
00007	#exec TEXTURE IMPORT NAME=Bg21 FILE=Textures\Goty21.pcx GROUP="Icons" MIPS=OFF
00008	#exec TEXTURE IMPORT NAME=Bg31 FILE=Textures\Goty31.pcx GROUP="Icons" MIPS=OFF
00009	#exec TEXTURE IMPORT NAME=Bg41 FILE=Textures\Goty41.pcx GROUP="Icons" MIPS=OFF
00010	#exec TEXTURE IMPORT NAME=Bg12 FILE=Textures\Goty12.pcx GROUP="Icons" MIPS=OFF
00011	#exec TEXTURE IMPORT NAME=Bg22 FILE=Textures\Goty22.pcx GROUP="Icons" MIPS=OFF
00012	#exec TEXTURE IMPORT NAME=Bg32 FILE=Textures\Goty32.pcx GROUP="Icons" MIPS=OFF
00013	#exec TEXTURE IMPORT NAME=Bg42 FILE=Textures\Goty42.pcx GROUP="Icons" MIPS=OFF
00014	#exec TEXTURE IMPORT NAME=Bg13 FILE=Textures\Goty13.pcx GROUP="Icons" MIPS=OFF
00015	#exec TEXTURE IMPORT NAME=Bg23 FILE=Textures\Goty23.pcx GROUP="Icons" MIPS=OFF
00016	#exec TEXTURE IMPORT NAME=Bg33 FILE=Textures\Goty33.pcx GROUP="Icons" MIPS=OFF
00017	#exec TEXTURE IMPORT NAME=Bg43 FILE=Textures\Goty43.pcx GROUP="Icons" MIPS=OFF
00018	#exec TEXTURE IMPORT NAME=MenuBlack FILE=Textures\MenuBlack.bmp GROUP="Icons" MIPS=OFF
00019	
00020	var	UMenuMenuBar MenuBar;
00021	var	UMenuStatusBar StatusBar;
00022	var Font BetaFont;
00023	
00024	function Created() 
00025	{
00026		Super.Created();
00027	
00028		StatusBar = UMenuStatusBar(CreateWindow(class'UMenuStatusBar', 0, 0, 50, 16));
00029		StatusBar.HideWindow();
00030	
00031		MenuBar = UMenuMenuBar(CreateWindow(class'UMenuMenuBar', 50, 0, 500, 16));
00032	
00033		BetaFont = Font(DynamicLoadObject("UWindowFonts.UTFont40", class'Font'));
00034		Resized();
00035	}
00036	
00037	function Paint(Canvas C, float MouseX, float MouseY)
00038	{
00039		local int XOffset, YOffset;
00040		local float W, H;
00041	
00042		if(Console.bNoDrawWorld)
00043		{
00044			DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'MenuBlack');
00045	
00046			if (Console.bBlackOut)
00047				return;
00048	
00049			W = WinWidth / 4;
00050			H = W;
00051	
00052			if(H > WinHeight / 3)
00053			{
00054				H = WinHeight / 3;
00055				W = H;
00056			}
00057	
00058			XOffset = (WinWidth - (4 * (W-1))) / 2;
00059			YOffset = (WinHeight - (3 * (H-1))) / 2;
00060	
00061			C.bNoSmooth = False;
00062	
00063			DrawStretchedTexture(C, XOffset + (3 * (W-1)), YOffset + (2 * (H-1)), W, H, Texture'Bg43');
00064			DrawStretchedTexture(C, XOffset + (2 * (W-1)), YOffset + (2 * (H-1)), W, H, Texture'Bg33');
00065			DrawStretchedTexture(C, XOffset + (1 * (W-1)), YOffset + (2 * (H-1)), W, H, Texture'Bg23');
00066			DrawStretchedTexture(C, XOffset + (0 * (W-1)), YOffset + (2 * (H-1)), W, H, Texture'Bg13');
00067	
00068			DrawStretchedTexture(C, XOffset + (3 * (W-1)), YOffset + (1 * (H-1)), W, H, Texture'Bg42');
00069			DrawStretchedTexture(C, XOffset + (2 * (W-1)), YOffset + (1 * (H-1)), W, H, Texture'Bg32');
00070			DrawStretchedTexture(C, XOffset + (1 * (W-1)), YOffset + (1 * (H-1)), W, H, Texture'Bg22');
00071			DrawStretchedTexture(C, XOffset + (0 * (W-1)), YOffset + (1 * (H-1)), W, H, Texture'Bg12');
00072	
00073			DrawStretchedTexture(C, XOffset + (3 * (W-1)), YOffset + (0 * (H-1)), W, H, Texture'Bg41');
00074			DrawStretchedTexture(C, XOffset + (2 * (W-1)), YOffset + (0 * (H-1)), W, H, Texture'Bg31');
00075			DrawStretchedTexture(C, XOffset + (1 * (W-1)), YOffset + (0 * (H-1)), W, H, Texture'Bg21');
00076			DrawStretchedTexture(C, XOffset + (0 * (W-1)), YOffset + (0 * (H-1)), W, H, Texture'Bg11');
00077	
00078			C.bNoSmooth = True;
00079		}
00080	}
00081	
00082	function Resized()
00083	{
00084		Super.Resized();
00085		
00086		MenuBar.WinLeft = 0;;
00087		MenuBar.WinTop = 0;
00088		MenuBar.WinWidth = WinWidth;;
00089		MenuBar.WinHeight = 16;
00090	
00091		StatusBar.WinLeft = 0;
00092		StatusBar.WinTop = WinHeight - StatusBar.WinHeight;
00093		StatusBar.WinWidth = WinWidth;
00094	}
00095	
00096	function DoQuitGame()
00097	{
00098		MenuBar.SaveConfig();
00099		if ( GetLevel().Game != None )
00100		{
00101			GetLevel().Game.SaveConfig();
00102			GetLevel().Game.GameReplicationInfo.SaveConfig();
00103		}
00104		Super.DoQuitGame();
00105	}
00106	
00107	defaultproperties
00108	{
00109	     LookAndFeelClass="UMenu.UMenuBlueLookAndFeel"
00110	}

End Source Code