UTMenu
Class UTInputOptionsCW

source: e:\games\UnrealTournament\UTMenu\Classes\UTInputOptionsCW.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UWindow.UWindowPageWindow
                  |
                  +--UMenu.UMenuPageWindow
                     |
                     +--UMenu.UMenuInputOptionsClientWindow
                        |
                        +--UTMenu.UTInputOptionsCW
Direct Known Subclasses:None

class UTInputOptionsCW
extends UMenu.UMenuInputOptionsClientWindow


Variables
 UWindowCheckbox InstantRocketCheck
 string InstantRocketHelp
 string InstantRocketText
 UWindowSmallButton SpeechBinderButton
 string SpeechBinderHelp
 string SpeechBinderText


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



Source Code


00001	class UTInputOptionsCW expands UMenuInputOptionsClientWindow;
00002	
00003	// Instant Rocket
00004	var UWindowCheckbox	InstantRocketCheck;
00005	var localized string InstantRocketText;
00006	var localized string InstantRocketHelp;
00007	
00008	// Speech Binder Button
00009	var UWindowSmallButton SpeechBinderButton;
00010	var localized string SpeechBinderText;
00011	var localized string SpeechBinderHelp;
00012	
00013	function Created()
00014	{
00015		local bool bJoystick;
00016		local int ControlWidth, ControlLeft, ControlRight;
00017		local int CenterWidth, CenterPos;
00018	
00019		Super.Created();
00020	
00021		DesiredWidth = 220;
00022		DesiredHeight = 180;
00023	
00024		ControlWidth = WinWidth/2.5;
00025		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00026		ControlRight = WinWidth/2 + ControlLeft;
00027	
00028		CenterWidth = (WinWidth/4)*3;
00029		CenterPos = (WinWidth - CenterWidth)/2;
00030	
00031		InstantRocketCheck = UWindowCheckbox(CreateControl(class'UWindowCheckbox', ControlRight, ControlOffset, ControlWidth, 1));
00032		InstantRocketCheck.bChecked = TournamentPlayer(GetPlayerOwner()).bInstantRocket;
00033		InstantRocketCheck.SetText(InstantRocketText);
00034		InstantRocketCheck.SetHelpText(InstantRocketHelp);
00035		InstantRocketCheck.SetFont(F_Normal);
00036		InstantRocketCheck.Align = TA_Right;
00037	
00038		ControlOffset += 25;
00039		SpeechBinderButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', ControlLeft, ControlOffset, 48, 16));
00040		SpeechBinderButton.SetText(SpeechBinderText);
00041		SpeechBinderButton.SetHelpText(SpeechBinderHelp);
00042	}
00043	
00044	function BeforePaint(Canvas C, float X, float Y)
00045	{
00046		local int ControlWidth, ControlLeft, ControlRight;
00047		local int CenterWidth, CenterPos;
00048	
00049		ControlWidth = WinWidth/2.5;
00050		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00051		ControlRight = WinWidth/2 + ControlLeft;
00052	
00053		CenterWidth = (WinWidth/4)*3;
00054		CenterPos = (WinWidth - CenterWidth)/2;
00055	
00056		InstantRocketCheck.SetSize(ControlWidth, 1);
00057		InstantRocketCheck.WinLeft = ControlRight;
00058	
00059		SpeechBinderButton.AutoWidth(C);
00060		SpeechBinderButton.WinLeft = (WinWidth - SpeechBinderButton.WinWidth) / 2;
00061	
00062		Super.BeforePaint(C, X, Y);
00063	}
00064	
00065	function Notify(UWindowDialogControl C, byte E)
00066	{
00067		Super.Notify(C, E);
00068		switch(E)
00069		{
00070		case DE_Change:
00071			switch(C)
00072			{
00073				case InstantRocketCheck:
00074					InstantRocketChanged();
00075					break;
00076			}
00077			break;
00078		case DE_Click:
00079			switch (C)
00080			{
00081				case SpeechBinderButton:
00082					Root.CreateWindow(class'SpeechBinderWindow', 100, 100, 100, 100);
00083					break;
00084			}
00085			break;
00086		}
00087	}
00088	
00089	function InstantRocketChanged()
00090	{
00091		TournamentPlayer(GetPlayerOwner()).SetInstantRocket(InstantRocketCheck.bChecked);
00092	}
00093	
00094	defaultproperties
00095	{
00096	     InstantRocketText="Instant Rocket Fire"
00097	     InstantRocketHelp="Make the Rocket Launcher fire rockets instantly, rather than charging up multiple rockets."
00098	     SpeechBinderText="Speech Binder"
00099	     SpeechBinderHelp="Use this special window to bind taunts and orders to keys."
00100	}

End Source Code