UTMenu
Class UTStartGameCW

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

class UTStartGameCW
extends UTMenu.UTMenuBotmatchCW


Variables
 UWindowMessageBox ConfirmStart
 string ConfirmText
 string ConfirmTitle
 UWindowSmallButton DedicatedButton
 string DedicatedHelp
 string DedicatedText
 UWindowPageControlPage ServerTab
 string ServerText


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



Source Code


00001	class UTStartGameCW expands UTMenuBotmatchCW;
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 UWindowMessageBox ConfirmStart;
00010	var localized string ConfirmTitle;
00011	var localized string ConfirmText;
00012	
00013	var UWindowPageControlPage ServerTab;
00014	
00015	function Created()
00016	{
00017		Super.Created();
00018	
00019		// Dedicated
00020		DedicatedButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', WinWidth-156, WinHeight-24, 48, 16));
00021		DedicatedButton.SetText(DedicatedText);
00022		DedicatedButton.SetHelpText(DedicatedHelp);
00023	
00024		ServerTab = Pages.AddPage(ServerText, class'UTServerSetupSC');
00025	}
00026	
00027	function Resized()
00028	{
00029		Super.Resized();
00030		DedicatedButton.WinLeft = WinWidth-152;
00031		DedicatedButton.WinTop = WinHeight-20;
00032	}
00033	
00034	function Notify(UWindowDialogControl C, byte E)
00035	{
00036		switch(E)
00037		{
00038		case DE_Click:
00039			switch (C)
00040			{
00041				case StartButton:
00042					if ((GetLevel().Game.Default.bWorldLog == True) && (GetPlayerOwner().GetNGSecret() == "") && (!GetPlayerOwner().ngSecretSet))
00043					{
00044						ConfirmStart = MessageBox(ConfirmTitle, ConfirmText, MB_YesNo, MR_Yes, MR_No);					
00045					} else
00046						StartPressed();
00047					return;
00048				case DedicatedButton:
00049					DedicatedPressed();
00050					return;
00051				default:
00052					Super.Notify(C, E);
00053					return;
00054			}
00055		default:
00056			Super.Notify(C, E);
00057			return;
00058		}
00059	}
00060	
00061	function MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result)
00062	{
00063		if(W == ConfirmStart)
00064		{
00065			switch(Result)
00066			{
00067			case MR_Yes:
00068				Root.CreateWindow(class<UWindowWindow>(DynamicLoadObject("UTMenu.ngWorldSecretWindow", class'Class')), 100, 100, 200, 200, Root, True);
00069				break;
00070			case MR_No:
00071				GetPlayerOwner().ngSecretSet = True;
00072				GetPlayerOwner().SaveConfig();
00073				StartPressed();
00074				break;
00075			}				
00076		}
00077	}
00078	
00079	function DedicatedPressed()
00080	{
00081		local string URL;
00082		local GameInfo NewGame;
00083		local string LanPlay;
00084	
00085		if(UTServerSetupPage(UTServerSetupSC(ServerTab.Page).ClientArea).bLanPlay)
00086			LanPlay = " -lanplay";
00087	
00088		URL = Map $ "?Game="$GameType$"?Mutator="$MutatorList;
00089		URL = URL $ "?Listen";
00090	
00091		ParentWindow.Close();
00092		Root.Console.CloseUWindow();
00093		GetPlayerOwner().ConsoleCommand("RELAUNCH "$URL$LanPlay$" -server log="$GameClass.Default.ServerLogName);
00094	}
00095	
00096	// Override botmatch's start behavior
00097	function StartPressed()
00098	{
00099		local string URL, Checksum;
00100		local GameInfo NewGame;
00101	
00102		GameClass.Static.ResetGame();
00103	
00104		URL = Map $ "?Game="$GameType$"?Mutator="$MutatorList;
00105		URL = URL $ "?Listen";
00106		class'StatLog'.Static.GetPlayerChecksum(GetPlayerOwner(), Checksum);
00107		URL = URL $ "?Checksum="$Checksum;
00108	
00109		ParentWindow.Close();
00110		Root.Console.CloseUWindow();
00111		GetPlayerOwner().ClientTravel(URL, TRAVEL_Absolute, false);
00112	}
00113	
00114	defaultproperties
00115	{
00116	     DedicatedText="Dedicated"
00117	     DedicatedHelp="Press to launch a dedicated server."
00118	     ServerText="Server"
00119	     ConfirmTitle="Confirm Game Start"
00120	     ConfirmText="You are about to start a listen server running ngWorldStats but you have not supplied a ngWorldStats password. If you do not specify a password, your game stats will not be accumulated. Do you want to specify a password now?"
00121	     Map="DOM-Condemned.unr"
00122	     GameType="BotPack.Domination"
00123	     bNetworkGame=True
00124	}

End Source Code