UMenu
Class UMenuTeamGameRulesCWindow

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

class UMenuTeamGameRulesCWindow
extends UMenu.UMenuGameRulesCWindow


Variables
 string FFHelp
 UWindowHSliderControl FFSlider
 string FFText


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



Source Code


00001	class UMenuTeamGameRulesCWindow extends UMenuGameRulesCWindow;
00002	
00003	// Friendly Fire Scale
00004	var UWindowHSliderControl FFSlider;
00005	var localized string FFText;
00006	var localized string FFHelp;
00007	
00008	function Created()
00009	{
00010		local int FFS;
00011		local int ControlWidth, ControlLeft, ControlRight;
00012		local int CenterWidth, CenterPos, ButtonWidth, ButtonLeft;
00013	
00014		Super.Created();
00015	
00016		ControlWidth = WinWidth/2.5;
00017		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00018		ControlRight = WinWidth/2 + ControlLeft;
00019	
00020		CenterWidth = (WinWidth/4)*3;
00021		CenterPos = (WinWidth - CenterWidth)/2;
00022	
00023		DesiredWidth = 220;
00024		DesiredHeight = 245;
00025	
00026		// Friendly Fire Scale
00027		FFSlider = UWindowHSliderControl(CreateControl(class'UWindowHSliderControl', CenterPos, ControlOffset, CenterWidth, 1));
00028		FFSlider.SetRange(0, 10, 1);
00029		FFS = Class<TeamGame>(BotmatchParent.GameClass).Default.FriendlyFireScale * 10;
00030		FFSlider.SetValue(FFS);
00031		FFSlider.SetText(FFText$" ["$FFS*10$"%]:");
00032		FFSlider.SetHelpText(FFHelp);
00033		FFSlider.SetFont(F_Normal);
00034	}
00035	
00036	function BeforePaint(Canvas C, float X, float Y)
00037	{
00038		local int ControlWidth, ControlLeft, ControlRight;
00039		local int CenterWidth, CenterPos, ButtonWidth, ButtonLeft;
00040	
00041		Super.BeforePaint(C, X, Y);
00042	
00043		ControlWidth = WinWidth/2.5;
00044		ControlLeft = (WinWidth/2 - ControlWidth)/2;
00045		ControlRight = WinWidth/2 + ControlLeft;
00046	
00047		CenterWidth = (WinWidth/4)*3;
00048		CenterPos = (WinWidth - CenterWidth)/2;
00049	
00050		FFSlider.SetSize(CenterWidth, 1);
00051		FFSlider.SliderWidth = 90;
00052		FFSlider.WinLeft = CenterPos;
00053	}
00054	
00055	function Notify(UWindowDialogControl C, byte E)
00056	{
00057		if (!Initialized)
00058			return;
00059	
00060		Super.Notify(C, E);
00061	
00062		switch(E)
00063		{
00064		case DE_Change:
00065			switch(C)
00066			{
00067				case FFSlider:
00068					FFChanged();
00069					break;
00070			}
00071		}
00072	}
00073	
00074	function FFChanged()
00075	{
00076		//TeamGame(Game).FriendlyFireScale = FFSlider.GetValue() / 10;
00077		//FFSlider.SetText(FFText$" ["$int(FFSlider.GetValue()*10)$"%]:");
00078	}
00079	
00080	defaultproperties
00081	{
00082	     FFText="Friendly Fire:"
00083	     FFHelp="Slide to adjust the amount of damage friendly fire imparts to other teammates."
00084	}

End Source Code