UMenu
Class UMenuStartGameClientWindow

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

class UMenuStartGameClientWindow
extends UMenu.UMenuBotmatchClientWindow


Variables
 UWindowSmallButton DedicatedButton
 string DedicatedHelp
 string DedicatedText
 UWindowPageControlPage ServerTab
 string ServerText


Function Summary
 void Created()
 void DedicatedPressed()
 void Notify(UWindowDialogControl C, byte E)
 void Resized()
 void StartPressed()
     
// Override botmatch's start behavior



Source Code


00001	class UMenuStartGameClientWindow extends UMenuBotmatchClientWindow;
00002	
00003	// Window
00004	var UWindowSmallButton DedicatedButton;
00005	var localized string DedicatedText;
00006	var localized string DedicatedHelp;
00007	var localized string ServerText;
00008	
00009	var UWindowPageControlPage ServerTab;
00010	
00011	function Created()
00012	{
00013		Super.Created();
00014	
00015		// Dedicated
00016		DedicatedButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', WinWidth-156, WinHeight-24, 48, 16));
00017		DedicatedButton.SetText(DedicatedText);
00018		DedicatedButton.SetHelpText(DedicatedHelp);
00019	
00020		ServerTab = Pages.AddPage(ServerText, class'UMenuServerSetupSC');
00021	}
00022	
00023	function Resized()
00024	{
00025		Super.Resized();
00026		DedicatedButton.WinLeft = WinWidth-152;
00027		DedicatedButton.WinTop = WinHeight-20;
00028	}
00029	
00030	function Notify(UWindowDialogControl C, byte E)
00031	{
00032		switch(E)
00033		{
00034		case DE_Click:
00035			switch (C)
00036			{
00037				case DedicatedButton:
00038					DedicatedPressed();
00039					return;
00040				default:
00041					Super.Notify(C, E);
00042					return;
00043			}
00044		default:
00045			Super.Notify(C, E);
00046			return;
00047		}
00048	}
00049	
00050	function DedicatedPressed()
00051	{
00052		local string URL;
00053		local GameInfo NewGame;
00054		local string LanPlay;
00055	
00056		if(UMenuServerSetupPage(UMenuServerSetupSC(ServerTab.Page).ClientArea).bLanPlay)
00057			LanPlay = " -lanplay";
00058	
00059		URL = Map $ "?Game="$GameType$"?Mutator="$MutatorList;
00060		URL = URL $ "?Listen";
00061	
00062		ParentWindow.Close();
00063		Root.Console.CloseUWindow();
00064		GetPlayerOwner().ConsoleCommand("RELAUNCH "$URL$LanPlay$" -server log="$GameClass.Default.ServerLogName);
00065	}
00066	
00067	// Override botmatch's start behavior
00068	function StartPressed()
00069	{
00070		local string URL, Checksum;
00071		local GameInfo NewGame;
00072	
00073		// Reset the game class.
00074		GameClass.Static.ResetGame();
00075	
00076		URL = Map $ "?Game="$GameType$"?Mutator="$MutatorList;
00077		URL = URL $ "?Listen";
00078		class'StatLog'.Static.GetPlayerChecksum(GetPlayerOwner(), Checksum);
00079		if (Checksum == "")
00080			URL = URL $ "?Checksum=NoChecksum";
00081		else
00082			URL = URL $ "?Checksum="$Checksum;
00083	
00084		ParentWindow.Close();
00085		Root.Console.CloseUWindow();
00086		GetPlayerOwner().ClientTravel(URL, TRAVEL_Absolute, false);
00087	}
00088	
00089	defaultproperties
00090	{
00091	     DedicatedText="Dedicated"
00092	     DedicatedHelp="Press to launch a dedicated server."
00093	     ServerText="Server"
00094	     bNetworkGame=True
00095	}

End Source Code