UMenu
Class UMenuBotConfigBase

source: e:\games\UnrealTournament\UMenu\Classes\UMenuBotConfigBase.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UWindow.UWindowPageWindow
                  |
                  +--UMenu.UMenuPageWindow
                     |
                     +--UMenu.UMenuBotConfigBase
Direct Known Subclasses:UMenuBotConfigClientWindow, UTBotConfigClient

class UMenuBotConfigBase
extends UMenu.UMenuPageWindow


Variables
 string AtLeastOneBotText
 string AtLeastOneBotTitle
 UWindowCheckbox AutoAdjustCheck
 string AutoAdjustHelp
 string AutoAdjustText
 UWindowComboControl BaseCombo
 string BaseHelp
 string BaseText
 UMenuBotmatchClientWindow BotmatchParent
 UWindowSmallButton ConfigBots
 string ConfigBotsHelp
 string ConfigBotsText
 float ControlOffset
 bool Initialized
 UWindowEditControl NumBotsEdit
 string NumBotsHelp
 string NumBotsText
 UWindowCheckbox RandomCheck
 string RandomHelp
 string RandomText
 string SkillTaunts[8]
 string Skills[8]
 UMenuLabelControl TauntLabel


Function Summary
 void AfterCreate()
 void AutoAdjustChecked()
 void BaseChanged()
 void BeforePaint(Canvas C, float X, float Y)
 void ConfigureIndivBots()
 void Created()
 void LoadCurrentValues()
 void Notify(UWindowDialogControl C, byte E)
 void NumBotsChanged()
 void RandomChecked()
 void SetBotmatchParent()



Source Code


00001	class UMenuBotConfigBase extends UMenuPageWindow;
00002	
00003	var UMenuBotmatchClientWindow BotmatchParent;
00004	
00005	var bool Initialized;
00006	
00007	// Base Skill
00008	var UWindowComboControl BaseCombo;
00009	var localized string BaseText;
00010	var localized string BaseHelp;
00011	
00012	// Taunt Label
00013	var UMenuLabelControl TauntLabel;
00014	var localized string Skills[8];
00015	var localized string SkillTaunts[8];
00016	
00017	// # of Bots
00018	var UWindowEditControl NumBotsEdit;
00019	var localized string NumBotsText;
00020	var localized string NumBotsHelp;
00021	
00022	// Auto Adjust
00023	var UWindowCheckbox AutoAdjustCheck;
00024	var localized string AutoAdjustText;
00025	var localized string AutoAdjustHelp;
00026	
00027	// Random Order
00028	var UWindowCheckbox RandomCheck;
00029	var localized string RandomText;
00030	var localized string RandomHelp;
00031	
00032	// Configure Indiv Bots
00033	var UWindowSmallButton ConfigBots;
00034	var localized string ConfigBotsText;
00035	var localized string ConfigBotsHelp;
00036	
00037	var localized string AtLeastOneBotTitle;
00038	var localized string AtLeastOneBotText;
00039	
00040	var float ControlOffset;
00041	
00042	function Created()
00043	{
00044		local int i;
00045		local int ControlWidth, ControlLeft, ControlRight;
00046		local int CenterWidth, CenterPos, ButtonWidth, ButtonLeft;
00047	
00048		Super.Created();
00049	
00050		ControlWidth = WinWidth/2.5;
00051		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00052		ControlRight = WinWidth/2 + ControlLeft;
00053	
00054		CenterWidth = (WinWidth/4)*3;
00055		CenterPos = (WinWidth - CenterWidth)/2;
00056	
00057		ButtonWidth = WinWidth - 140;
00058		ButtonLeft = WinWidth - ButtonWidth - 40;
00059	
00060		SetBotmatchParent();
00061	
00062		// Base Skill
00063		BaseCombo = UWindowComboControl(CreateControl(class'UWindowComboControl', CenterPos, ControlOffset, CenterWidth, 1));
00064		BaseCombo.SetText(BaseText);
00065		BaseCombo.SetHelpText(BaseHelp);
00066		BaseCombo.SetFont(F_Normal);
00067		BaseCombo.SetEditable(False);
00068		for (i=0; i<8; i++)
00069		{
00070			if (Skills[i] != "")
00071				BaseCombo.AddItem(Skills[i]);
00072		}
00073		ControlOffset += 25;
00074	
00075		// Taunt Label
00076		TauntLabel = UMenuLabelControl(CreateWindow(class'UMenuLabelControl', CenterPos, ControlOffset, CenterWidth, 1));
00077		TauntLabel.Align = TA_Center;
00078		ControlOffset += 25;
00079	
00080		// # of Bots
00081		NumBotsEdit = UWindowEditControl(CreateControl(class'UWindowEditControl', ControlLeft, ControlOffset, ControlWidth, 1));
00082		NumBotsEdit.SetText(NumBotsText);
00083		NumBotsEdit.SetHelpText(NumBotsHelp);
00084		NumBotsEdit.SetFont(F_Normal);
00085		NumBotsEdit.SetNumericOnly(True);
00086		NumBotsEdit.SetMaxLength(2);
00087		NumBotsEdit.Align = TA_Right;
00088	
00089		ConfigBots = UWindowSmallButton(CreateControl(class'UWindowSmallButton', ControlRight, ControlOffset, 48, 16));
00090		ConfigBots.SetText(ConfigBotsText);
00091		ConfigBots.SetFont(F_Normal);
00092		ConfigBots.SetHelpText(ConfigBotsHelp);
00093		ControlOffset += 25;
00094	
00095		// Auto Adjust
00096		AutoAdjustCheck = UWindowCheckbox(CreateControl(class'UWindowCheckbox', ControlLeft, ControlOffset, ControlWidth, 1));
00097		AutoAdjustCheck.SetText(AutoAdjustText);
00098		AutoAdjustCheck.SetHelpText(AutoAdjustHelp);
00099		AutoAdjustCheck.SetFont(F_Normal);
00100		AutoAdjustCheck.Align = TA_Right;
00101	
00102		// Random Order
00103		RandomCheck = UWindowCheckbox(CreateControl(class'UWindowCheckbox', ControlRight, ControlOffset, ControlWidth, 1));
00104		RandomCheck.SetText(RandomText);
00105		RandomCheck.SetHelpText(RandomHelp);
00106		RandomCheck.SetFont(F_Normal);
00107		RandomCheck.Align = TA_Right;
00108		ControlOffset += 25;
00109	
00110	}
00111	
00112	function AfterCreate()
00113	{
00114		Super.AfterCreate();
00115		LoadCurrentValues();
00116		Initialized = True;
00117	
00118		DesiredWidth = 270;
00119		DesiredHeight = ControlOffset;
00120	}
00121	
00122	function LoadCurrentValues()
00123	{
00124	}
00125	
00126	function SetBotmatchParent()
00127	{
00128		if(BotmatchParent != None)
00129			return;
00130	
00131		BotmatchParent = UMenuBotmatchClientWindow(GetParent(class'UMenuBotmatchClientWindow'));
00132		if (BotmatchParent == None)
00133			Log("Error: UMenuStartMatchClientWindow without UMenuBotmatchClientWindow parent.");
00134	}
00135	
00136	function BeforePaint(Canvas C, float X, float Y)
00137	{
00138		local int ControlWidth, ControlLeft, ControlRight;
00139		local int CenterWidth, CenterPos, ButtonWidth, ButtonLeft;
00140	
00141		Super.BeforePaint(C, X, Y);
00142	
00143		ControlWidth = WinWidth/2.5;
00144		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00145		ControlRight = WinWidth/2 + ControlLeft;
00146	
00147		CenterWidth = (WinWidth/4)*3;
00148		CenterPos = (WinWidth - CenterWidth)/2;
00149	
00150		BaseCombo.SetSize(CenterWidth, 1);
00151		BaseCombo.WinLeft = CenterPos;
00152		BaseCombo.EditBoxWidth = 120;
00153	
00154		TauntLabel.SetSize(CenterWidth, 1);
00155		TauntLabel.WinLeft = CenterPos;
00156	
00157		NumBotsEdit.SetSize(ControlWidth + 10, 1);
00158		NumBotsEdit.WinLeft = ControlLeft - 5;
00159		NumBotsEdit.EditBoxWidth = 20;
00160	
00161		ConfigBots.AutoWidth(C);
00162		ConfigBots.WinLeft = ControlRight - 5;
00163	
00164		AutoAdjustCheck.SetSize(ControlWidth + 10, 1);
00165		AutoAdjustCheck.WinLeft = ControlLeft - 5;
00166	
00167		RandomCheck.SetSize(ControlWidth + 10, 1);
00168		RandomCheck.WinLeft = ControlRight - 5;
00169	}
00170	
00171	function Notify(UWindowDialogControl C, byte E)
00172	{
00173		if (!Initialized)
00174			return;
00175	
00176		Super.Notify(C, E);
00177	
00178		switch(E)
00179		{
00180		case DE_Change:
00181			switch(C)
00182			{
00183			case BaseCombo:
00184				BaseChanged();
00185				break;
00186			case NumBotsEdit:
00187				NumBotsChanged();
00188				break;
00189			case AutoAdjustCheck:
00190				AutoAdjustChecked();
00191				break;
00192			case RandomCheck:
00193				RandomChecked();
00194				break;
00195			}
00196		case DE_Click:
00197			switch(C)
00198			{
00199			case ConfigBots:
00200				ConfigureIndivBots();
00201				break;
00202			}
00203		}
00204	}
00205	
00206	function BaseChanged()
00207	{
00208	}
00209	
00210	function NumBotsChanged()
00211	{
00212	}
00213	
00214	function AutoAdjustChecked()
00215	{
00216	}
00217	
00218	function RandomChecked()
00219	{
00220	}
00221	
00222	function ConfigureIndivBots()
00223	{
00224	}
00225	
00226	defaultproperties
00227	{
00228	     BaseText="Base Skill:"
00229	     BaseHelp="This is the base skill level of the bots."
00230	     Skills(0)="Novice"
00231	     Skills(1)="Average"
00232	     Skills(2)="Skilled"
00233	     Skills(3)="Masterful"
00234	     SkillTaunts(0)="They won't hurt you...much."
00235	     SkillTaunts(1)="Don't get cocky."
00236	     SkillTaunts(2)="You think you're tough?"
00237	     SkillTaunts(3)="You're already dead."
00238	     NumBotsText="Number of Bots"
00239	     NumBotsHelp="This is the number of bots that you will play against."
00240	     AutoAdjustText="Auto Adjust Skill"
00241	     AutoAdjustHelp="If checked, bots will increase or decrease their skill to match your skill level."
00242	     RandomText="Random Order"
00243	     RandomHelp="If checked, bots will chosen at random from the list of bot configurations."
00244	     ConfigBotsText="Configure"
00245	     ConfigBotsHelp="Configure the names, appearance and other attributes of individual bots."
00246	     AtLeastOneBotTitle="Configure Bots"
00247	     AtLeastOneBotText="You must choose at least one bot in order to use the configure bots screen."
00248	     ControlOffset=20.000000
00249	}

End Source Code