UMenu
Class UMenuBotSetupBase

source: e:\games\UnrealTournament\UMenu\Classes\UMenuBotSetupBase.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UMenu.UMenuDialogClientWindow
                  |
                  +--UMenu.UMenuPlayerSetupClient
                     |
                     +--UMenu.UMenuBotSetupBase
Direct Known Subclasses:UMenuBotSetupClient, UTIndivBotSetupClient

class UMenuBotSetupBase
extends UMenu.UMenuPlayerSetupClient


Variables
 UWindowComboControl BotCombo
 string BotHelp
 string BotText
 string BotWord
 int ConfigureBot
 UWindowSmallButton DefaultsButton
 string DefaultsHelp
 string DefaultsText


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



Source Code


00001	class UMenuBotSetupBase extends UMenuPlayerSetupClient;
00002	
00003	var int ConfigureBot;
00004	
00005	var UWindowComboControl BotCombo;
00006	var localized string BotText;
00007	var localized string BotHelp;
00008	var localized string BotWord;
00009	
00010	var UWindowSmallButton DefaultsButton;
00011	var localized string DefaultsText;
00012	var localized string DefaultsHelp;
00013	
00014	function Created()
00015	{
00016		local int ControlWidth, ControlLeft, ControlRight;
00017		local int CenterWidth, CenterPos;
00018		local int i;
00019	
00020		ControlWidth = WinWidth/3;
00021		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00022		ControlRight = WinWidth/2 + ControlLeft;
00023	
00024		CenterWidth = (WinWidth/4)*3;
00025		CenterPos = (WinWidth - CenterWidth)/2;
00026	
00027		// Defaults Button
00028		DefaultsButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', 30, 10, 48, 16));
00029		DefaultsButton.SetText(DefaultsText);
00030		DefaultsButton.SetFont(F_Normal);
00031		DefaultsButton.SetHelpText(DefaultsHelp);
00032	
00033		BotCombo = UWindowComboControl(CreateControl(class'UWindowComboControl', CenterPos, ControlOffset, CenterWidth, 1));
00034		BotCombo.SetButtons(True);
00035		BotCombo.SetText(BotText);
00036		BotCombo.SetHelpText(BotHelp);
00037		BotCombo.SetFont(F_Normal);
00038		BotCombo.SetEditable(False);
00039		LoadBots();
00040		BotCombo.SetSelectedIndex(0);
00041		ConfigureBot = 0;
00042		ControlOffset += 25;
00043	
00044		Super.Created();
00045	}
00046	
00047	function LoadBots()
00048	{
00049	}
00050	
00051	function ResetBots()
00052	{
00053	}
00054	
00055	function BeforePaint(Canvas C, float X, float Y)
00056	{
00057		local int ControlWidth, ControlLeft, ControlRight;
00058		local int CenterWidth, CenterPos;
00059		local float W;
00060	
00061		W = Min(WinWidth, 220);
00062	
00063		ControlWidth = W/3;
00064		ControlLeft = (W/2 - ControlWidth)/2;
00065		ControlRight = W/2 + ControlLeft;
00066	
00067		CenterWidth = (W/7)*6;
00068		CenterPos = (W - CenterWidth)/2;
00069	
00070		DefaultsButton.AutoWidth(C);
00071		DefaultsButton.WinLeft = CenterPos + CenterWidth - DefaultsButton.WinWidth;
00072	
00073		Super.BeforePaint(C, X, Y);
00074		BotCombo.SetSize(CenterWidth, 1);
00075		BotCombo.WinLeft = CenterPos;
00076		BotCombo.EditBoxWidth = 105;
00077	}
00078	
00079	function Notify(UWindowDialogControl C, byte E)
00080	{
00081		Super.Notify(C, E);
00082	
00083		switch(E)
00084		{
00085		case DE_Click:
00086			switch(C)
00087			{
00088				case DefaultsButton:
00089					ResetBots();
00090					break;
00091			}
00092			break;
00093		case DE_Change:
00094			switch(C)
00095			{
00096				case BotCombo:
00097					BotChanged();
00098					break;
00099			}
00100			break;
00101		}
00102	}
00103	
00104	function BotChanged()
00105	{
00106		if (Initialized)
00107		{
00108			Initialized = False;
00109			ConfigureBot = BotCombo.GetSelectedIndex();
00110			LoadCurrent();
00111			UseSelected();
00112			Initialized = True;
00113		}
00114	}
00115	
00116	defaultproperties
00117	{
00118	     BotText="Bot:"
00119	     BotHelp="Select the bot you wish to configure."
00120	     BotWord="Bot"
00121	     DefaultsText="Reset"
00122	     DefaultsHelp="Reset all bot configurations to their default settings."
00123	     ControlOffset=35
00124	     PlayerBaseClass="Bots"
00125	     NameHelp="Set this bot's name."
00126	     TeamText="Color:"
00127	     TeamHelp="Select the team color for this bot."
00128	     ClassHelp="Select this bot's class."
00129	     SkinHelp="Choose a skin for this bot."
00130	     FaceHelp="Choose a face for this bot."
00131	}

End Source Code