UTMenu
Class UTLadder

source: e:\games\UnrealTournament\UTMenu\Classes\UTLadder.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UTMenu.NotifyWindow
            |
            +--UTMenu.UTLadderStub
               |
               +--UTMenu.UTLadder
Direct Known Subclasses:UTLadderAS, UTLadderChal, UTLadderCTF, UTLadderDM, UTLadderDOM

class UTLadder
extends UTMenu.UTLadderStub


Variables
 float ArrowPos
 Texture ArrowTex
 string AuthorText
 Texture BG1[4]
 Texture BG2[4]
 Texture BG3[4]
 string BGName1[4]
 string BGName2[4]
 string BGName3[4]
 NotifyButton BackButton
 Class DemoLadder
 string FragText
 Class GOTYLadder
 string GameType
 NotifyButton InfoScrolldown
 NotifyButton InfoScrollup
 Class Ladder
 string LadderName
 LadderInventory LadderObj
 int LadderPos
 int LadderRank
 Texture LadderTrophy
 UTFadeTextArea MapInfoArea
 Texture MapShot
 StaticArea MapStatic
 string MapText
 MatchButton Matches[32]
 BaseMatch, MaxBaseMatch
 NotifyButton NextButton
 string NotAvailableString
 int PendingPos
 int RequiredRungs
 NotifyButton Scrolldown
 NotifyButton Scrollup
 int SelectedMatch
 float StaticScale
 Texture StaticTex
 string TeamScoreText
 NotifyButton Title1
 string TrophyMap
 bool bGOTY
 bool bInitialized
 bool bMapStatic
 bool bTrophyTravelPending


Function Summary
 void BackPressed()
 void BeforePaint(Canvas C, float X, float Y)
 void CheckOpenCondition()
 void Close(optional bool)
 void CloseUp()
 void Created()
 void EscClose()
 void EvaluateMatch(optional bool)
     
// Called after individual ladders evaluate.
 void FillInfoArea(int i)
 void HideWindow()
 void NextPressed()
 void Notify(UWindowWindow B, byte E)
 void Paint(Canvas C, float X, float Y)
 void SetMapShot(int i)
 void SetupLadder(int Pos, int Rank)
 void ShowWindow()
 void StartMap(string StartMap, int Rung, string GameType)
 void Tick(float Delta)



Source Code


00001	class UTLadder extends UTLadderStub
00002		abstract;
00003	
00004	// Ladder
00005	#exec TEXTURE IMPORT NAME=Ladr11 FILE=TEXTURES\Ladr\Ladr11.PCX GROUP=Skins MIPS=OFF
00006	#exec TEXTURE IMPORT NAME=Ladr12 FILE=TEXTURES\Ladr\Ladr12.PCX GROUP=Skins MIPS=OFF
00007	#exec TEXTURE IMPORT NAME=Ladr13 FILE=TEXTURES\Ladr\Ladr13.PCX GROUP=Skins MIPS=OFF
00008	#exec TEXTURE IMPORT NAME=Ladr14 FILE=TEXTURES\Ladr\Ladr14.PCX GROUP=Skins MIPS=OFF
00009	#exec TEXTURE IMPORT NAME=Ladr21 FILE=TEXTURES\Ladr\Ladr21.PCX GROUP=Skins MIPS=OFF
00010	#exec TEXTURE IMPORT NAME=Ladr22 FILE=TEXTURES\Ladr\Ladr22.PCX GROUP=Skins MIPS=OFF
00011	#exec TEXTURE IMPORT NAME=Ladr23 FILE=TEXTURES\Ladr\Ladr23.PCX GROUP=Skins MIPS=OFF
00012	#exec TEXTURE IMPORT NAME=Ladr24 FILE=TEXTURES\Ladr\Ladr24.PCX GROUP=Skins MIPS=OFF
00013	#exec TEXTURE IMPORT NAME=Ladr31 FILE=TEXTURES\Ladr\Ladr31.PCX GROUP=Skins MIPS=OFF
00014	#exec TEXTURE IMPORT NAME=Ladr32 FILE=TEXTURES\Ladr\Ladr32.PCX GROUP=Skins MIPS=OFF
00015	#exec TEXTURE IMPORT NAME=Ladr33 FILE=TEXTURES\Ladr\Ladr33.PCX GROUP=Skins MIPS=OFF
00016	#exec TEXTURE IMPORT NAME=Ladr34 FILE=TEXTURES\Ladr\Ladr34.PCX GROUP=Skins MIPS=OFF
00017	
00018	// Arrows
00019	#exec TEXTURE IMPORT NAME=AroDdwn FILE=TEXTURES\Ladr\AroDdwn.PCX GROUP=Skins FLAGS=2  MIPS=OFF
00020	#exec TEXTURE IMPORT NAME=AroDovr FILE=TEXTURES\Ladr\AroDovr.PCX GROUP=Skins FLAGS=2 MIPS=OFF
00021	#exec TEXTURE IMPORT NAME=AroDup FILE=TEXTURES\Ladr\AroDup.PCX GROUP=Skins FLAGS=2 MIPS=OFF
00022	#exec TEXTURE IMPORT NAME=AroUdwn FILE=TEXTURES\Ladr\AroUdwn.PCX GROUP=Skins FLAGS=2 MIPS=OFF
00023	#exec TEXTURE IMPORT NAME=AroUovr FILE=TEXTURES\Ladr\AroUovr.PCX GROUP=Skins FLAGS=2 MIPS=OFF
00024	#exec TEXTURE IMPORT NAME=AroUup FILE=TEXTURES\Ladr\AroUup.PCX GROUP=Skins FLAGS=2 MIPS=OFF
00025	#exec OBJ LOAD FILE=..\Textures\LadrArrow.utx PACKAGE=LadrArrow
00026	
00027	// Sounds
00028	#exec OBJ LOAD FILE=..\Sounds\LadderSounds.uax PACKAGE=LadderSounds
00029	
00030	// Trophy Icons
00031	#exec TEXTURE IMPORT NAME=TrophyAS FILE=TEXTURES\Trophy\IconAssault.PCX GROUP=Skins MIPS=OFF
00032	#exec TEXTURE IMPORT NAME=TrophyChal FILE=TEXTURES\Trophy\IconChallenge.PCX GROUP=Skins MIPS=OFF
00033	#exec TEXTURE IMPORT NAME=TrophyCTF FILE=TEXTURES\Trophy\IconCTF.PCX GROUP=Skins MIPS=OFF
00034	#exec TEXTURE IMPORT NAME=TrophyDM FILE=TEXTURES\Trophy\IconDeathMatch.PCX GROUP=Skins MIPS=OFF
00035	#exec TEXTURE IMPORT NAME=TrophyDOM FILE=TEXTURES\Trophy\IconDomination.PCX GROUP=Skins MIPS=OFF
00036	
00037	// Background
00038	var texture BG1[4];
00039	var texture BG2[4];
00040	var texture BG3[4];
00041	var string BGName1[4];
00042	var string BGName2[4];
00043	var string BGName3[4];
00044	
00045	var texture ArrowTex;
00046	var int PendingPos;
00047	var float ArrowPos;
00048	
00049	var texture StaticTex;
00050	
00051	var string GameType;
00052	
00053	var localized string MapText;
00054	var localized string AuthorText;
00055	var localized string FragText;
00056	var localized string TeamScoreText;
00057	var localized string TrophyMap;
00058	
00059	// Player
00060	var LadderInventory LadderObj;
00061	
00062	// Title
00063	var NotifyButton Title1;
00064	var localized string LadderName;
00065	
00066	// Navigation
00067	var NotifyButton BackButton;
00068	var NotifyButton NextButton;
00069	
00070	// Matches
00071	var MatchButton Matches[32];
00072	var int BaseMatch, MaxBaseMatch;
00073	var NotifyButton Scrollup;
00074	var NotifyButton Scrolldown;
00075	var int SelectedMatch;
00076	
00077	// Map Screen Shot
00078	var float StaticScale;
00079	var texture MapShot;
00080	var StaticArea MapStatic;
00081	var bool bMapStatic;
00082	
00083	// Map Info
00084	var UTFadeTextArea MapInfoArea;
00085	var NotifyButton InfoScrollup;
00086	var NotifyButton InfoScrolldown;
00087	
00088	// Ladder
00089	var Class<Ladder> Ladder;
00090	var Class<Ladder> DemoLadder;
00091	var Class<Ladder> GOTYLadder;
00092	
00093	var string NotAvailableString;
00094	
00095	var bool bTrophyTravelPending;
00096	var texture LadderTrophy;
00097	var int LadderRank;
00098	var int LadderPos;
00099	var int RequiredRungs;
00100	
00101	var bool bInitialized;
00102	var config bool bGOTY;
00103	
00104	function Created()
00105	{
00106		local int i, C;
00107		local int W, H;
00108		local float XWidth, YHeight, XMod, YMod, XPos, YPos, YOffset;
00109		local color TextColor;
00110	
00111		Super.Created();
00112	
00113		/*
00114		 * Setup window parameters.
00115		 */
00116	
00117		bLeaveOnScreen = True;
00118		bAlwaysOnTop = True;
00119		class'UTLadderStub'.Static.GetStubClass().Static.SetupWinParams(Self, Root, W, H);
00120	
00121		XMod = 4*W;
00122		YMod = 3*H;
00123	
00124		/*
00125		 * Load the background.
00126		 */
00127	
00128		BG1[0] = Texture(DynamicLoadObject(BGName1[0], Class'Texture'));
00129		BG1[1] = Texture(DynamicLoadObject(BGName1[1], Class'Texture'));
00130		BG1[2] = Texture(DynamicLoadObject(BGName1[2], Class'Texture'));
00131		BG1[3] = Texture(DynamicLoadObject(BGName1[3], Class'Texture'));
00132		BG2[0] = Texture(DynamicLoadObject(BGName2[0], Class'Texture'));
00133		BG2[1] = Texture(DynamicLoadObject(BGName2[1], Class'Texture'));
00134		BG2[2] = Texture(DynamicLoadObject(BGName2[2], Class'Texture'));
00135		BG2[3] = Texture(DynamicLoadObject(BGName2[3], Class'Texture'));
00136		BG3[0] = Texture(DynamicLoadObject(BGName3[0], Class'Texture'));
00137		BG3[1] = Texture(DynamicLoadObject(BGName3[1], Class'Texture'));
00138		BG3[2] = Texture(DynamicLoadObject(BGName3[2], Class'Texture'));
00139		BG3[3] = Texture(DynamicLoadObject(BGName3[3], Class'Texture'));
00140	
00141		/*
00142		 * Create components.
00143		 */
00144	
00145		// Check ladder object.
00146		LadderObj = LadderInventory(GetPlayerOwner().FindInventoryType(class'LadderInventory'));
00147		if (LadderObj == None)
00148		{
00149			Log("UTLadder: Player has no LadderInventory!!");
00150		}
00151		if ( bGOTY && (GOTYLadder != None) )
00152			LadderObj.CurrentLadder = GOTYLadder;
00153		else if (class'UTLadder'.Static.IsDemo())
00154			LadderObj.CurrentLadder = DemoLadder;
00155		else
00156			LadderObj.CurrentLadder = Ladder;
00157		log("Current Ladder is "$LadderObj.CurrentLadder);
00158	
00159		// Title
00160		XPos = 74.0/1024 * XMod;
00161		YPos = 69.0/768 * YMod;
00162		XWidth = 352.0/1024 * XMod;
00163		YHeight = 41.0/768 * YMod;	
00164		Title1 = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00165		Title1.Text = LadderName;
00166		Title1.NotifyWindow = Self;
00167		TextColor.R = 255;
00168		TextColor.G = 255;
00169		TextColor.B = 0;
00170		Title1.SetTextColor(TextColor);
00171		Title1.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetHugeFont(Root);
00172		Title1.bStretched = True;
00173	
00174		// Matches
00175		TextColor.R = 0;
00176		TextColor.G = 128;
00177		TextColor.B = 255;
00178		XPos = 168.0/1024 * XMod;
00179		YPos = 599.0/768 * YMod;
00180		XWidth = 256.0/1024 * XMod;
00181		YHeight = 64.0/768 * YMod;
00182		YOffset = 48.0/768 * YMod;
00183		C = LadderObj.CurrentLadder.Default.Matches;
00184		MaxBaseMatch = C - 8;
00185		Matches[C-1] = MatchButton(CreateWindow(class'MatchButton', XPos, YPos - i*YOffset, XWidth, YHeight));
00186		Matches[C-1].SetLadder(LadderObj.CurrentLadder);
00187		Matches[C-1].SetMatchIndex(C-1);
00188		Matches[C-1].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00189		Matches[C-1].SetTextColor(TextColor);
00190		Matches[C-1].LadderWindow = Self;
00191		Matches[C-1].DisabledTexture = Texture(DynamicLoadObject("UTMenu.Plate3Cap", Class'Texture'));
00192		Matches[C-1].UpTexture = Texture(DynamicLoadObject("UTMenu.Plate3Cap", Class'Texture'));
00193		Matches[C-1].OverTexture = Texture(DynamicLoadObject("UTMenu.PlateCap", Class'Texture'));
00194		Matches[C-1].DownTexture = Texture(DynamicLoadObject("UTMenu.PlateCap", Class'Texture'));
00195		Matches[C-1].OtherTexture = Texture(DynamicLoadObject("UTMenu.PlateYellowCap", Class'Texture'));
00196		Matches[C-1].OldOverTexture = Matches[C-1].OverTexture;
00197		Matches[C-1].bStretched = True;
00198		Matches[C-1].LabelWidth = 178/1024 * XMod;
00199		Matches[C-1].LabelHeight = 49/768 * YMod;
00200		Matches[C-1].DownSound = sound'LadderSounds.lsChange1';
00201		Matches[C-1].OverSound = sound'LadderSounds.lcursorMove';
00202		for (i=C-2; i>0; i--)
00203		{
00204			Matches[i] = MatchButton(CreateWindow(class'MatchButton', XPos, YPos - i*YOffset, XWidth, YHeight));
00205			Matches[i].SetLadder(LadderObj.CurrentLadder);
00206			Matches[i].SetMatchIndex(i);
00207			Matches[i].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00208			Matches[i].SetTextColor(TextColor);
00209			Matches[i].LadderWindow = Self;
00210			Matches[i].DisabledTexture = Texture(DynamicLoadObject("UTMenu.Plate3", Class'Texture'));
00211			Matches[i].UpTexture = Texture(DynamicLoadObject("UTMenu.Plate3", Class'Texture'));
00212			Matches[i].OverTexture = Texture(DynamicLoadObject("UTMenu.Plate", Class'Texture'));
00213			Matches[i].DownTexture = Texture(DynamicLoadObject("UTMenu.Plate", Class'Texture'));
00214			Matches[i].OtherTexture = Texture(DynamicLoadObject("UTMenu.PlateYellow", Class'Texture'));
00215			Matches[i].OldOverTexture = Matches[i].OverTexture;
00216			Matches[i].bStretched = True;
00217			Matches[i].LabelWidth = 178/1024 * XMod;
00218			Matches[i].LabelHeight = 49/768 * YMod;
00219			Matches[i].DownSound = sound'LadderSounds.lsChange1';
00220			Matches[i].OverSound = sound'LadderSounds.lcursorMove';
00221			Matches[i].bDisabled = True;
00222		}
00223		Matches[0] = MatchButton(CreateWindow(class'MatchButton', XPos, YPos - i*YOffset, XWidth, YHeight));
00224		Matches[0].SetLadder(LadderObj.CurrentLadder);
00225		Matches[0].SetMatchIndex(0);
00226		Matches[0].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00227		Matches[0].SetTextColor(TextColor);
00228		Matches[0].LadderWindow = Self;
00229		Matches[0].DisabledTexture = Texture(DynamicLoadObject("UTMenu.Plate3LowCap", Class'Texture'));
00230		Matches[0].UpTexture = Texture(DynamicLoadObject("UTMenu.Plate3LowCap", Class'Texture'));
00231		Matches[0].OverTexture = Texture(DynamicLoadObject("UTMenu.PlateLowCap", Class'Texture'));
00232		Matches[0].DownTexture = Texture(DynamicLoadObject("UTMenu.PlateLowCap", Class'Texture'));
00233		Matches[0].OtherTexture = Texture(DynamicLoadObject("UTMenu.PlateYellowLowCap", Class'Texture'));
00234		Matches[0].OldOverTexture = Matches[0].OverTexture;
00235		Matches[0].bStretched = True;
00236		Matches[0].LabelWidth = 178/1024 * XMod;
00237		Matches[0].LabelHeight = 49/768 * YMod;
00238		Matches[0].DownSound = sound'LadderSounds.lsChange1';
00239		Matches[0].OverSound = sound'LadderSounds.lcursorMove';
00240	
00241		// Scrollup
00242		XPos = 357.0/1024 * XMod;
00243		YPos = 259.0/768 * YMod;
00244		XWidth = 32.0/1024 * XMod;
00245		YHeight = 16.0/768 * YMod;
00246		Scrollup = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00247		Scrollup.NotifyWindow = Self;
00248		Scrollup.Text = "";
00249		Scrollup.bStretched = True;
00250		Scrollup.UpTexture = Texture(DynamicLoadObject("UTMenu.AroUup", Class'Texture'));
00251		Scrollup.OverTexture = Texture(DynamicLoadObject("UTMenu.AroUovr", Class'Texture'));
00252		Scrollup.DownTexture = Texture(DynamicLoadObject("UTMenu.AroUdwn", Class'Texture'));
00253		Scrollup.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00254		Scrollup.bAlwaysOnTop = True;
00255		Scrollup.bIgnoreLDoubleClick = True;
00256	
00257		// Scrolldown
00258		XPos = 357.0/1024 * XMod;
00259		YPos = 630.0/768 * YMod;
00260		XWidth = 32.0/1024 * XMod;
00261		YHeight = 16.0/768 * YMod;
00262		Scrolldown = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00263		Scrolldown.NotifyWindow = Self;
00264		Scrolldown.Text = "";
00265		Scrolldown.bStretched = True;
00266		Scrolldown.UpTexture = Texture(DynamicLoadObject("UTMenu.AroDup", Class'Texture'));
00267		Scrolldown.OverTexture = Texture(DynamicLoadObject("UTMenu.AroDovr", Class'Texture'));
00268		Scrolldown.DownTexture = Texture(DynamicLoadObject("UTMenu.AroDdwn", Class'Texture'));
00269		Scrolldown.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00270		Scrolldown.bAlwaysOnTop = True;
00271		Scrolldown.bIgnoreLDoubleClick = True;
00272	
00273		// Map Info
00274		XPos = 529.0/1024 * XMod;
00275		YPos = 586.0/768 * YMod;
00276		XWidth = 385.0/1024 * XMod;
00277		YHeight = 113.0/768 * YMod;
00278		MapInfoArea = UTFadeTextArea(CreateWindow(Class<UWindowWindow>(DynamicLoadObject("UTMenu.UTFadeTextArea", Class'Class')), XPos, YPos, XWidth, YHeight));
00279		MapInfoArea.TextColor.R = 255;
00280		MapInfoArea.TextColor.G = 255;
00281		MapInfoArea.TextColor.B = 0;
00282		MapInfoArea.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallestFont(Root);
00283		MapInfoArea.bAutoScrolling = True;
00284	
00285		// InfoScrollup
00286		XPos = 923.0/1024 * XMod;
00287		YPos = 590.0/768 * YMod;
00288		XWidth = 32.0/1024 * XMod;
00289		YHeight = 16.0/768 * YMod;
00290		InfoScrollup = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00291		InfoScrollup.NotifyWindow = Self;
00292		InfoScrollup.Text = "";
00293		InfoScrollup.bStretched = True;
00294		InfoScrollup.UpTexture = Texture(DynamicLoadObject("UTMenu.AroUup", Class'Texture'));
00295		InfoScrollup.OverTexture = Texture(DynamicLoadObject("UTMenu.AroUovr", Class'Texture'));
00296		InfoScrollup.DownTexture = Texture(DynamicLoadObject("UTMenu.AroUdwn", Class'Texture'));
00297		InfoScrollup.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00298		InfoScrollup.bAlwaysOnTop = True;
00299		InfoScrollUp.bIgnoreLDoubleClick = True;
00300	
00301		// InfoScrolldown
00302		XPos = 923.0/1024 * XMod;
00303		YPos = 683.0/768 * YMod;
00304		XWidth = 32.0/1024 * XMod;
00305		YHeight = 16.0/768 * YMod;
00306		InfoScrolldown = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00307		InfoScrolldown.NotifyWindow = Self;
00308		InfoScrolldown.Text = "";
00309		InfoScrolldown.bStretched = True;
00310		InfoScrolldown.UpTexture = Texture(DynamicLoadObject("UTMenu.AroDup", Class'Texture'));
00311		InfoScrolldown.OverTexture = Texture(DynamicLoadObject("UTMenu.AroDovr", Class'Texture'));
00312		InfoScrolldown.DownTexture = Texture(DynamicLoadObject("UTMenu.AroDdwn", Class'Texture'));
00313		InfoScrolldown.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00314		InfoScrolldown.bAlwaysOnTop = True;
00315		InfoScrolldown.bIgnoreLDoubleClick = True;
00316	
00317		// Back Button
00318		XPos = 192.0/1024 * XMod;
00319		YPos = 701.0/768 * YMod;
00320		XWidth = 64.0/1024 * XMod;
00321		YHeight = 64.0/768 * YMod;
00322		BackButton = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00323		BackButton.DisabledTexture = Texture(DynamicLoadObject("UTMenu.LeftUp", Class'Texture'));
00324		BackButton.UpTexture = Texture(DynamicLoadObject("UTMenu.LeftUp", Class'Texture'));
00325		BackButton.DownTexture = Texture(DynamicLoadObject("UTMenu.LeftDown", Class'Texture'));
00326		BackButton.OverTexture = Texture(DynamicLoadObject("UTMenu.LeftOver", Class'Texture'));
00327		BackButton.NotifyWindow = Self;
00328		BackButton.Text = "";
00329		TextColor.R = 255;
00330		TextColor.G = 255;
00331		TextColor.B = 0;
00332		BackButton.SetTextColor(TextColor);
00333		BackButton.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00334		BackButton.bStretched = True;
00335		BackButton.OverSound = sound'LadderSounds.lcursorMove';
00336		BackButton.DownSound = sound'LadderSounds.ladvance';
00337	
00338		// Next Button
00339		XPos = 256.0/1024 * XMod;
00340		YPos = 701.0/768 * YMod;
00341		XWidth = 64.0/1024 * XMod;
00342		YHeight = 64.0/768 * YMod;
00343		NextButton = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00344		NextButton.DisabledTexture = Texture(DynamicLoadObject("UTMenu.RightUp", Class'Texture'));
00345		NextButton.UpTexture = Texture(DynamicLoadObject("UTMenu.RightUp", Class'Texture'));
00346		NextButton.DownTexture = Texture(DynamicLoadObject("UTMenu.RightDown", Class'Texture'));
00347		NextButton.OverTexture = Texture(DynamicLoadObject("UTMenu.RightOver", Class'Texture'));
00348		NextButton.NotifyWindow = Self;
00349		NextButton.Text = "";
00350		TextColor.R = 255;
00351		TextColor.G = 255;
00352		TextColor.B = 0;
00353		NextButton.SetTextColor(TextColor);
00354		NextButton.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00355		NextButton.bStretched = True;
00356		NextButton.OverSound = sound'LadderSounds.lcursorMove';
00357		NextButton.DownSound = sound'LadderSounds.ladvance';
00358	
00359		// StaticArea
00360		XPos = 608.0/1024 * XMod;
00361		YPos = 90.0/768 * YMod;
00362		XWidth = 320.0/1024 * XMod;
00363		YHeight = 319.0/768 * YMod;
00364		MapStatic = StaticArea(CreateWindow(class'StaticArea', XPos, YPos, XWidth, YHeight));
00365		MapStatic.VStaticScale = 300.0;
00366	
00367		PendingPos = -1;
00368	
00369		Root.Console.bBlackout = True;
00370	
00371		StaticScale = 1.0;
00372	
00373		bInitialized = True;
00374	}
00375	
00376	function BeforePaint(Canvas C, float X, float Y)
00377	{
00378		local int i;
00379		local int W, H;
00380		local float XWidth, YHeight, XMod, YMod, XPos, YPos, YOffset;
00381	
00382		Super.BeforePaint(C, X, Y);
00383	
00384		class'UTLadderStub'.Static.GetStubClass().Static.SetupWinParams(Self, Root, W, H);
00385	
00386		XMod = 4*W;
00387		YMod = 3*H;
00388	
00389		// Title
00390		XPos = 74.0/1024 * XMod;
00391		YPos = 69.0/768 * YMod;
00392		XWidth = 352.0/1024 * XMod;
00393		YHeight = 41.0/768 * YMod;	
00394		Title1.WinLeft = XPos;
00395		Title1.WinTop = YPos;
00396		Title1.SetSize(XWidth, YHeight);
00397		Title1.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetHugeFont(Root);
00398	
00399		// Matches
00400		XPos = 168.0/1024 * XMod;
00401		YPos = 599.0/768 * YMod;
00402		XWidth = 256.0/1024 * XMod;
00403		YHeight = 64.0/768 * YMod;
00404		YOffset = 48.0/768 * YMod;
00405		if (BaseMatch > 0)
00406		{
00407			for (i=0; i<BaseMatch; i++)
00408				Matches[i].WinLeft = -2 * XMod;
00409		}
00410		for (i=BaseMatch+7; i<LadderObj.CurrentLadder.Default.Matches; i++)
00411			if (Matches[i] != None)
00412				Matches[i].WinLeft = -2 * XMod;	
00413	
00414		for (i=BaseMatch+7; i>BaseMatch-1; i--)
00415		{
00416			if ( (i >= 0) && (Matches[i] != None) )
00417			{
00418				Matches[i].WinLeft = XPos;
00419				Matches[i].WinTop = YPos - ((i-BaseMatch) * YOffset);
00420				Matches[i].SetSize(XWidth, YHeight);
00421			}
00422		}
00423	
00424		// Scrollup
00425		XPos = 354.0/1024 * XMod;
00426		YPos = 258.0/768 * YMod;
00427		XWidth = 32.0/1024 * XMod;
00428		YHeight = 16.0/768 * YMod;
00429		Scrollup.WinLeft = XPos;
00430		Scrollup.WinTop = YPos;
00431		Scrollup.SetSize(XWidth, YHeight);
00432	
00433		// Scrolldown
00434		XPos = 354.0/1024 * XMod;
00435		YPos = 632.0/768 * YMod;
00436		XWidth = 32.0/1024 * XMod;
00437		YHeight = 16.0/768 * YMod;
00438		Scrolldown.WinLeft = XPos;
00439		Scrolldown.WinTop = YPos;
00440		Scrolldown.SetSize(XWidth, YHeight);
00441	
00442		// Map Info
00443		XPos = 529.0/1024 * XMod;
00444		YPos = 590.0/768 * YMod;
00445		XWidth = 385.0/1024 * XMod;
00446		YHeight = 105.0/768 * YMod;
00447		MapInfoArea.WinLeft = XPos;
00448		MapInfoArea.WinTop = YPos;
00449		MapInfoArea.SetSize(XWidth, YHeight);
00450		MapInfoArea.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallestFont(Root);
00451	
00452		// InfoScrollup
00453		XPos = 923.0/1024 * XMod;
00454		YPos = 590.0/768 * YMod;
00455		XWidth = 32.0/1024 * XMod;
00456		YHeight = 16.0/768 * YMod;
00457		InfoScrollup.WinLeft = XPos;
00458		InfoScrollup.WinTop = YPos;
00459		InfoScrollup.SetSize(XWidth, YHeight);
00460	
00461		// InfoScrolldown
00462		XPos = 923.0/1024 * XMod;
00463		YPos = 683.0/768 * YMod;
00464		XWidth = 32.0/1024 * XMod;
00465		YHeight = 16.0/768 * YMod;
00466		InfoScrolldown.WinLeft = XPos;
00467		InfoScrolldown.WinTop = YPos;
00468		InfoScrolldown.SetSize(XWidth, YHeight);
00469	
00470		// Back Button
00471		XPos = 192.0/1024 * XMod;
00472		YPos = 701.0/768 * YMod;
00473		XWidth = 64.0/1024 * XMod;
00474		YHeight = 64.0/768 * YMod;
00475		BackButton.WinLeft = XPos;
00476		BackButton.WinTop = YPos;
00477		BackButton.SetSize(XWidth, YHeight);
00478	
00479		// Next Button
00480		XPos = 256.0/1024 * XMod;
00481		YPos = 701.0/768 * YMod;
00482		XWidth = 64.0/1024 * XMod;
00483		YHeight = 64.0/768 * YMod;
00484		NextButton.WinLeft = XPos;
00485		NextButton.WinTop = YPos;
00486		NextButton.SetSize(XWidth, YHeight);
00487	
00488		// StaticArea
00489		XPos = 608.0/1024 * XMod;
00490		YPos = 90.0/768 * YMod;
00491		XWidth = 320.0/1024 * XMod;
00492		YHeight = 319.0/768 * YMod;
00493		MapStatic.WinLeft = XPos;
00494		MapStatic.WinTop = YPos;
00495		MapStatic.SetSize(XWidth, YHeight);
00496	
00497		if (LadderObj != None)
00498		{
00499			for (i=0; i<LadderPos+1; i++)
00500			{
00501				Matches[i].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00502				Matches[i].LabelWidth = 178/1024 * XMod;
00503				Matches[i].LabelHeight = 49/768 * YMod;
00504				Matches[i].SetMatchIndex(i);
00505				Matches[i].bDisabled = False;
00506				Matches[i].bUnknown = False;
00507				if (SelectedMatch == i)
00508				{
00509					Matches[i].UpTexture = Matches[i].OtherTexture;
00510					Matches[i].OverTexture = Matches[i].OtherTexture;
00511				} else {
00512					Matches[i].UpTexture = Matches[i].DisabledTexture;
00513					Matches[i].OverTexture = Matches[i].OldOverTexture;
00514				}
00515			}
00516			for (i=LadderPos+1; i<LadderObj.CurrentLadder.Default.Matches; i++)
00517			{
00518				if (LadderObj.CurrentLadder.Default.DemoDisplay[LadderPos] != 1)
00519				{
00520					Matches[i].LabelWidth = 178/1024 * XMod;
00521					Matches[i].LabelHeight = 49/768 * YMod;
00522					Matches[i].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00523					Matches[i].bDisabled = True;
00524					Matches[i].bUnknown = True;
00525					Matches[i].UpTexture = Matches[i].DisabledTexture;
00526				} else if (LadderObj.CurrentLadder.Default.DemoDisplay[i] == 0) {
00527					Matches[i].LabelWidth = 178/1024 * XMod;
00528					Matches[i].LabelHeight = 49/768 * YMod;
00529					Matches[i].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00530					Matches[i].bDisabled = True;
00531					Matches[i].bUnknown = True;
00532					Matches[i].UpTexture = Matches[i].DisabledTexture;
00533				}
00534			}
00535		}
00536	}
00537	
00538	function Paint(Canvas C, float X, float Y)
00539	{
00540		local int XOffset, YOffset;
00541		local int W, H;
00542		local float XWidth, YHeight, XMod, YMod, XPos, YPos, DrawPos;
00543		local bool bOldSmooth;
00544	
00545		class'UTLadderStub'.Static.GetStubClass().Static.SetupWinParams(Self, Root, W, H);
00546	
00547		XMod = 4*W;
00548		YMod = 3*H;
00549	
00550		// Background
00551		DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (0 * H), W+1, H+1, BG1[0]);
00552		DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (0 * H), W+1, H+1, BG1[1]);
00553		DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (0 * H), W+1, H+1, BG1[2]);
00554		DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (0 * H), W+1, H+1, BG1[3]);
00555	
00556		DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (1 * H), W+1, H+1, BG2[0]);
00557		DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (1 * H), W+1, H+1, BG2[1]);
00558		DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (1 * H), W+1, H+1, BG2[2]);
00559		DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (1 * H), W+1, H+1, BG2[3]);
00560			
00561		DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (2 * H), W+1, H+1, BG3[0]);
00562		DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (2 * H), W+1, H+1, BG3[1]);
00563		DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (2 * H), W+1, H+1, BG3[2]);
00564		DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (2 * H), W+1, H+1, BG3[3]);
00565	
00566		// MapShot
00567		bOldSmooth = C.bNoSmooth;
00568		C.bNoSmooth = False;
00569		XPos = 608.0/1024 * XMod;
00570		YPos = 90.0/768 * YMod;
00571		XWidth = 320.0/1024 * XMod;
00572		YHeight = 319.0/768 * YMod;
00573		if(MapShot != None)
00574	 		DrawStretchedTexture(C, XPos, YPos, XWidth, YHeight, MapShot);
00575		C.bNoSmooth = bOldSmooth;
00576	
00577		// Static
00578		XPos = 608.0/1024 * XMod;
00579		YPos = 90.0/768 * YMod;
00580		XWidth = 320.0/1024 * XMod;
00581		YHeight = 319.0/768 * YMod;
00582		C.DrawColor.R = 255 * StaticScale;
00583		C.DrawColor.G = 255 * StaticScale;
00584		C.DrawColor.B = 255 * StaticScale;
00585		C.Style = GetPlayerOwner().ERenderStyle.STY_Translucent;
00586	 	DrawStretchedTexture(C, XPos, YPos, XWidth, YHeight, StaticTex);
00587		C.Style = GetPlayerOwner().ERenderStyle.STY_Normal;
00588		C.DrawColor.R = 255;
00589		C.DrawColor.G = 255;
00590		C.DrawColor.B = 255;
00591	
00592		// Status Arrow
00593		DrawPos = ArrowPos - BaseMatch;
00594		XPos = 126.0/1024 * XMod;
00595		YPos = (607.0 - DrawPos*49)/768 * YMod;
00596		XWidth = 32.0/1024 * XMod;
00597		YHeight = 32.0/768 * YMod;
00598		if ((DrawPos > -1) && (DrawPos < 8))
00599	 		DrawStretchedTexture(C, XPos, YPos, XWidth, YHeight, ArrowTex);
00600	
00601		// Trophy Icon
00602		if (LadderRank == 6)
00603		{
00604			DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (0 * H), (W+1)/2, (H+1)/2, texture'TeamPlate');
00605			DrawStretchedTexture(C, XOffset + (0 * W) + (65.0/1024*XMod), YOffset + (0 * H) + (61.0/768*YMod), (58.0/1024*XMod), (57.0/768*YMod), LadderTrophy);
00606		}
00607	
00608		Super.Paint(C, X, Y);
00609	}
00610	
00611	function SetupLadder(int Pos, int Rank)
00612	{
00613		LadderPos = Pos;
00614		LadderRank = Rank;
00615	
00616		ArrowPos = LadderPos;
00617		if (SelectedMatch > 7)
00618			BaseMatch = SelectedMatch - 7;
00619		FillInfoArea(SelectedMatch);
00620		SetMapShot(SelectedMatch);
00621	}
00622	
00623	function FillInfoArea(int i)
00624	{
00625	}
00626	
00627	function Notify(UWindowWindow B, byte E)
00628	{
00629		local int i;
00630	
00631		if (!bInitialized)
00632			return;
00633	
00634		switch (E)
00635		{
00636			case DE_DoubleClick:
00637				for (i=0; i<LadderObj.CurrentLadder.Default.Matches; i++)
00638				{
00639					if (B == Matches[i])
00640						NextPressed();
00641				}
00642				break;
00643			case DE_Click:
00644				switch (B)
00645				{
00646					case Scrollup:
00647						if (LadderObj.CurrentLadder.Default.Matches > 8)
00648						{
00649							BaseMatch++;
00650							if (BaseMatch > MaxBaseMatch)
00651								BaseMatch = MaxBaseMatch;
00652						}
00653						break;
00654					case Scrolldown:
00655						BaseMatch--;
00656						if (BaseMatch < 0)
00657							BaseMatch = 0;
00658						break;
00659					case InfoScrollup:
00660						MapInfoArea.ScrollingOffset--;
00661						if (MapInfoArea.ScrollingOffset < 0)
00662							MapInfoArea.ScrollingOffset = 0;
00663						break;
00664					case InfoScrolldown:
00665						MapInfoArea.ScrollingOffset++;
00666						if (MapInfoArea.ScrollingOffset > 10)
00667							MapInfoArea.ScrollingOffset = 10;
00668						break;
00669					case BackButton:
00670						BackPressed();
00671						break;
00672				}
00673				for (i=0; i<LadderObj.CurrentLadder.Default.Matches; i++)
00674				{
00675					if (B == Matches[i])
00676					{
00677						SelectedMatch = i;
00678						FillInfoArea(i);
00679						SetMapShot(i);
00680					}
00681				}
00682				if (B == NextButton)
00683					NextPressed();
00684				break;
00685		}
00686	}
00687	
00688	function Close(optional bool bByParent)
00689	{
00690		LadderObj = None;
00691	
00692		Super.Close(bByParent);
00693	}
00694	
00695	function EscClose()
00696	{
00697		BackPressed();
00698	}
00699	
00700	function BackPressed()
00701	{
00702		Root.CreateWindow(class'ManagerWindow', 100, 100, 200, 200, Root, True);
00703		Close();
00704	}
00705	
00706	// Called after individual ladders evaluate.
00707	function EvaluateMatch(optional bool bTrophyVictory)
00708	{
00709		local string SaveString;
00710		local int Team, i;
00711	
00712		// Save the game.
00713		if (LadderObj != None)
00714		{
00715			SaveString = string(LadderObj.TournamentDifficulty);
00716			if (!class'UTLadderStub'.Static.GetStubClass().Static.IsDemo())
00717			{
00718				for (i=0; i<class'Ladder'.Default.NumTeams; i++)
00719				{
00720					if (class'Ladder'.Default.LadderTeams[i] == LadderObj.Team)
00721						Team = i;
00722				}
00723			} else {
00724				if (class'Ladder'.Default.LadderTeams[class'Ladder'.Default.NumTeams] == LadderObj.Team)
00725					Team = class'Ladder'.Default.NumTeams;
00726				else
00727					Team = class'Ladder'.Default.NumTeams+1;
00728			}
00729			SaveString = SaveString$"\\"$Team;
00730			SaveString = SaveString$"\\"$LadderObj.DMRank;
00731			SaveString = SaveString$"\\"$LadderObj.DMPosition;
00732			SaveString = SaveString$"\\"$LadderObj.DOMRank;
00733			SaveString = SaveString$"\\"$LadderObj.DOMPosition;
00734			SaveString = SaveString$"\\"$LadderObj.CTFRank;
00735			SaveString = SaveString$"\\"$LadderObj.CTFPosition;
00736			SaveString = SaveString$"\\"$LadderObj.ASRank;
00737			SaveString = SaveString$"\\"$LadderObj.ASPosition;
00738			SaveString = SaveString$"\\"$LadderObj.ChalRank;
00739			SaveString = SaveString$"\\"$LadderObj.ChalPosition;
00740			SaveString = SaveString$"\\"$LadderObj.Sex;
00741			SaveString = SaveString$"\\"$LadderObj.Face;
00742			SaveString = SaveString$"\\"$GetPlayerOwner().PlayerReplicationInfo.PlayerName;
00743			class'SlotWindow'.Default.Saves[LadderObj.Slot] = SaveString;
00744			class'SlotWindow'.Static.StaticSaveConfig();
00745	
00746			if (LadderObj.PendingPosition > 7)
00747			{
00748				SelectedMatch = LadderObj.PendingPosition;
00749				BaseMatch = LadderObj.PendingPosition - 7;
00750				ArrowPos = LadderObj.PendingPosition - 1;
00751				PendingPos = LadderObj.PendingPosition;
00752			}
00753			LadderObj.PendingPosition = 0;
00754			if (bTrophyVictory)
00755				bTrophyTravelPending = True;
00756	
00757			SelectedMatch = LadderPos;
00758			SetMapShot(LadderPos);
00759			FillInfoArea(LadderPos);
00760		}
00761	}
00762	
00763	function StartMap(string StartMap, int Rung, string GameType)
00764	{
00765		local Class<GameInfo> GameClass;
00766	
00767		GameClass = Class<GameInfo>(DynamicLoadObject(GameType, Class'Class'));
00768		GameClass.Static.ResetGame();
00769	
00770		StartMap = StartMap
00771					$"?Game="$GameType
00772					$"?Mutator="
00773					$"?Tournament="$Rung
00774					$"?Name="$GetPlayerOwner().PlayerReplicationInfo.PlayerName
00775					$"?Team=0";
00776	
00777		Root.SetMousePos((Root.WinWidth*Root.GUIScale)/2, (Root.WinHeight*Root.GUIScale)/2);
00778		Root.Console.CloseUWindow();
00779		GetPlayerOwner().ClientTravel(StartMap, TRAVEL_Absolute, True);
00780	}
00781	
00782	function CloseUp()
00783	{
00784		Root.Console.bLocked = False;
00785		Root.Console.bNoDrawWorld = Root.Console.ShowDesktop;
00786		UMenuRootWindow(Root).MenuBar.ShowWindow();
00787		Close();
00788	}
00789	
00790	function ShowWindow()
00791	{
00792		if ( bGOTY && (GOTYLadder != None) )
00793			LadderObj.CurrentLadder = GOTYLadder;
00794		else if (class'UTLadder'.Static.IsDemo())
00795			LadderObj.CurrentLadder = DemoLadder;
00796		else
00797			LadderObj.CurrentLadder = Ladder;
00798		Super.ShowWindow();
00799	}
00800	
00801	function HideWindow()
00802	{
00803		Root.Console.bBlackOut = False;
00804	
00805		Super.HideWindow();
00806	}
00807	
00808	function CheckOpenCondition()
00809	{
00810		if ((PendingPos == RequiredRungs) && (LadderObj.PendingChange < 4))
00811		{
00812			PendingPos = -1;
00813			BackPressed();
00814		}
00815	}
00816	
00817	function Tick(float Delta)
00818	{
00819		if (PendingPos > ArrowPos)
00820			ArrowPos += Delta/3;
00821		if ((PendingPos > 0) && (ArrowPos >= PendingPos))
00822		{
00823			ArrowPos = PendingPos;
00824	
00825			// After the arrow has moved, check for special event.
00826			CheckOpenCondition();
00827			PendingPos = -1;
00828		}
00829	
00830		if (StaticScale > 0)
00831			StaticScale -= Delta;
00832		if (StaticScale < 0)
00833		{
00834			if (bMapStatic)
00835			{
00836				MapStatic.bVPanStatic = True;
00837				bMapStatic = False;
00838			}
00839			StaticScale = 0.0;
00840		}
00841	
00842		if (bTrophyTravelPending)
00843		{
00844			bTrophyTravelPending = False;
00845			CloseUp();
00846			StartMap(TrophyMap, -1, "Botpack.TrophyGame");
00847		}
00848	}
00849	
00850	function SetMapShot(int i)
00851	{
00852		local int Pos;
00853		local string MapName;
00854	
00855		Pos = InStr(LadderObj.CurrentLadder.Static.GetMap(i), ".");
00856		MapName = Left(LadderObj.CurrentLadder.Static.GetMap(i), Pos);
00857		MapName = LadderObj.CurrentLadder.Default.MapPrefix$MapName;
00858		MapShot = texture(DynamicLoadObject(MapName$"."$"Screenshot", class'Texture'));
00859	
00860		StaticScale = 1.0;
00861		bMapStatic = True;
00862	}
00863	
00864	function NextPressed()
00865	{
00866	}
00867	
00868	defaultproperties
00869	{
00870	     BGName1(0)="UTMenu.Ladr11"
00871	     BGName1(1)="UTMenu.Ladr12"
00872	     BGName1(2)="UTMenu.Ladr13"
00873	     BGName1(3)="UTMenu.Ladr14"
00874	     BGName2(0)="UTMenu.Ladr21"
00875	     BGName2(1)="UTMenu.Ladr22"
00876	     BGName2(2)="UTMenu.Ladr23"
00877	     BGName2(3)="UTMenu.Ladr24"
00878	     BGName3(0)="UTMenu.Ladr31"
00879	     BGName3(1)="UTMenu.Ladr32"
00880	     BGName3(2)="UTMenu.Ladr33"
00881	     BGName3(3)="UTMenu.Ladr34"
00882	     ArrowTex=Texture'LadrArrow.LadrArrow.arrow_a00'
00883	     StaticTex=Texture'Botpack.LadrStatic.Static.Static_A00'
00884	     MapText="Map:"
00885	     AuthorText="Author:"
00886	     FragText="Frag Limit:"
00887	     TeamScoreText="Team Score Limit:"
00888	     NotAvailableString="Not Available In Demo"
00889	     RequiredRungs=4
00890	     bGOTY=True
00891	}

End Source Code