00001 class MeshBrowser expands NotifyWindow
00002 abstract;
00003
00004 // Background
00005 var texture BG1[4];
00006 var texture BG2[4];
00007 var texture BG3[4];
00008 var string BGName1[4];
00009 var string BGName2[4];
00010 var string BGName3[4];
00011
00012 var UTLadder LadderWindow;
00013
00014 var string GameType;
00015
00016 // Mesh View
00017 var UMenuPlayerMeshClient MeshWindow;
00018 var UTFadeTextArea DescArea;
00019 var localized string NameString;
00020 var localized string ClassString;
00021 var NotifyButton Descscrollup;
00022 var NotifyButton Descscrolldown;
00023 var string TeamMesh;
00024 var texture TeamTex;
00025
00026 // Title
00027 var NotifyButton Title1;
00028 var localized string BrowserName;
00029
00030 var NotifyButton BackButton;
00031 var NotifyButton NextButton;
00032
00033 // Names
00034 var LadderButton Names[8];
00035 var string EmptyText;
00036 var int Selected, NumNames;
00037
00038 var bool Initialized;
00039
00040 // Ladder
00041 var Class<Ladder> Ladder;
00042 var int Match;
00043 var class<RatedMatchInfo> MatchInfo;
00044 var RatedMatchInfo RMI;
00045 var bool bTeamGame, bEnemy;
00046
00047 function Created()
00048 {
00049 Super.Created();
00050 }
00051
00052 function SetTeamVars()
00053 {
00054 }
00055
00056 function SetInitialBot(class<Bot> InitialBot)
00057 {
00058 }
00059
00060 function SetNumNames()
00061 {
00062 }
00063
00064 function Initialize()
00065 {
00066 local class<Bot> InitialBot;
00067 local int i;
00068 local int W, H;
00069 local float XWidth, YHeight, XMod, YMod, XPos, YPos, YOffset;
00070 local color TextColor;
00071
00072 GetPlayerOwner().ViewRotation.Pitch = 0;
00073 GetPlayerOwner().ViewRotation.Roll = 0;
00074
00075 /*
00076 * Setup window parameters.
00077 */
00078
00079 bLeaveOnScreen = True;
00080 bAlwaysOnTop = True;
00081 class'UTLadderStub'.Static.GetStubClass().Static.SetupWinParams(Self, Root, W, H);
00082
00083 XMod = 4*W;
00084 YMod = 3*H;
00085
00086 /*
00087 * Load the background.
00088 */
00089
00090 BG1[0] = Texture(DynamicLoadObject(BGName1[0], Class'Texture'));
00091 BG1[1] = Texture(DynamicLoadObject(BGName1[1], Class'Texture'));
00092 BG1[2] = Texture(DynamicLoadObject(BGName1[2], Class'Texture'));
00093 BG1[3] = Texture(DynamicLoadObject(BGName1[3], Class'Texture'));
00094 BG2[0] = Texture(DynamicLoadObject(BGName2[0], Class'Texture'));
00095 BG2[1] = Texture(DynamicLoadObject(BGName2[1], Class'Texture'));
00096 BG2[2] = Texture(DynamicLoadObject(BGName2[2], Class'Texture'));
00097 BG2[3] = Texture(DynamicLoadObject(BGName2[3], Class'Texture'));
00098 BG3[0] = Texture(DynamicLoadObject(BGName3[0], Class'Texture'));
00099 BG3[1] = Texture(DynamicLoadObject(BGName3[1], Class'Texture'));
00100 BG3[2] = Texture(DynamicLoadObject(BGName3[2], Class'Texture'));
00101 BG3[3] = Texture(DynamicLoadObject(BGName3[3], Class'Texture'));
00102
00103 SetTeamVars();
00104
00105 /*
00106 * Create components.
00107 */
00108
00109 // MeshView
00110 XPos = 608.0/1024 * XMod;
00111 YPos = 88.0/768 * YMod;
00112 XWidth = 323.0/1024 * XMod;
00113 YHeight = 466.0/768 * YMod;
00114 MeshWindow = UMenuPlayerMeshClient(CreateWindow(class'UMenuPlayerMeshClient', XPos, YPos, XWidth, YHeight));
00115 MatchInfo = Ladder.Static.GetMatchConfigType(Match);
00116 RMI = GetPlayerOwner().Spawn(MatchInfo);
00117 InitialBot = class<Bot>(DynamicLoadObject(RMI.GetBotClassName(0, bTeamGame, bEnemy, GetPlayerOwner()), Class'Class'));
00118 MeshWindow.SetMeshString(InitialBot.Default.SelectionMesh);
00119 MeshWindow.ClearSkins();
00120 SetInitialBot(InitialBot);
00121
00122 if (bTeamGame)
00123 InitialBot.static.SetMultiSkin(MeshWindow.MeshActor, RMI.GetBotSkin(0, bTeamGame, True, GetPlayerOwner()), RMI.GetBotFace(0, bTeamGame, True, GetPlayerOwner()), 1);
00124 else
00125 InitialBot.static.SetMultiSkin(MeshWindow.MeshActor, RMI.GetBotSkin(0, bTeamGame, True, GetPlayerOwner()), RMI.GetBotFace(0, bTeamGame, True, GetPlayerOwner()), RMI.GetBotTeam(i, bTeamGame, True, GetPlayerOwner()));
00126
00127 // Title
00128 XPos = 74.0/1024 * XMod;
00129 YPos = 69.0/768 * YMod;
00130 XWidth = 352.0/1024 * XMod;
00131 YHeight = 41.0/768 * YMod;
00132 Title1 = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00133 if (!Ladder.Default.bTeamGame)
00134 Title1.Text = BrowserName;
00135 else
00136 Title1.Text = RMI.GetTeamName(bEnemy, GetPlayerOwner());
00137 TextColor.R = 255;
00138 TextColor.G = 255;
00139 TextColor.B = 0;
00140 Title1.SetTextColor(TextColor);
00141 Title1.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetHugeFont(Root);
00142 Title1.bStretched = True;
00143 if (!Ladder.Default.bTeamGame)
00144 Title1.bDisabled = True;
00145 else
00146 Title1.NotifyWindow = Self;
00147
00148 // Names
00149 SetNumNames();
00150 TextColor.R = 0;
00151 TextColor.G = 128;
00152 TextColor.B = 255;
00153 XPos = 168.0/1024 * XMod;
00154 YPos = 255.0/768 * YMod;
00155 XWidth = 256.0/1024 * XMod;
00156 YHeight = 64.0/768 * YMod;
00157 YOffset = 48.0/768 * YMod;
00158 for (i=0; i<NumNames; i++)
00159 {
00160 Names[i] = LadderButton(CreateWindow(class'LadderButton', XPos, YPos + i*YOffset, XWidth, YHeight));
00161 Names[i].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00162 Names[i].NotifyWindow = Self;
00163 Names[i].SetTextColor(TextColor);
00164 Names[i].Text = RMI.GetBotName(i, bTeamGame, bEnemy, GetPlayerOwner());
00165 Names[i].bStretched = True;
00166 Names[i].bDontSetLabel = True;
00167 Names[i].LabelWidth = 178/1024 * XMod;
00168 Names[i].LabelHeight = 49/768 * YMod;
00169 Names[i].OverSound = sound'LadderSounds.lcursorMove';
00170 Names[i].DownSound = sound'SpeechWindowClick';
00171 }
00172 Names[0].bBottom = True;
00173 Names[NumNames-1].bTop = True;
00174
00175 // Back Button
00176 XPos = 192.0/1024 * XMod;
00177 YPos = 701.0/768 * YMod;
00178 XWidth = 64.0/1024 * XMod;
00179 YHeight = 64.0/768 * YMod;
00180 BackButton = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00181 BackButton.DisabledTexture = Texture(DynamicLoadObject("UTMenu.LeftUp", Class'Texture'));
00182 BackButton.UpTexture = Texture(DynamicLoadObject("UTMenu.LeftUp", Class'Texture'));
00183 BackButton.DownTexture = Texture(DynamicLoadObject("UTMenu.LeftDown", Class'Texture'));
00184 BackButton.OverTexture = Texture(DynamicLoadObject("UTMenu.LeftOver", Class'Texture'));
00185 BackButton.NotifyWindow = Self;
00186 BackButton.Text = "";
00187 TextColor.R = 255;
00188 TextColor.G = 255;
00189 TextColor.B = 0;
00190 BackButton.SetTextColor(TextColor);
00191 BackButton.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00192 BackButton.bStretched = True;
00193 BackButton.OverSound = sound'LadderSounds.lcursorMove';
00194 BackButton.DownSound = sound'LadderSounds.ladvance';
00195
00196 // Next Button
00197 XPos = 256.0/1024 * XMod;
00198 YPos = 701.0/768 * YMod;
00199 XWidth = 64.0/1024 * XMod;
00200 YHeight = 64.0/768 * YMod;
00201 NextButton = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00202 NextButton.DisabledTexture = Texture(DynamicLoadObject("UTMenu.RightUp", Class'Texture'));
00203 NextButton.UpTexture = Texture(DynamicLoadObject("UTMenu.RightUp", Class'Texture'));
00204 NextButton.DownTexture = Texture(DynamicLoadObject("UTMenu.RightDown", Class'Texture'));
00205 NextButton.OverTexture = Texture(DynamicLoadObject("UTMenu.RightOver", Class'Texture'));
00206 NextButton.NotifyWindow = Self;
00207 NextButton.Text = "";
00208 TextColor.R = 255;
00209 TextColor.G = 255;
00210 TextColor.B = 0;
00211 NextButton.SetTextColor(TextColor);
00212 NextButton.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00213 NextButton.bStretched = True;
00214 NextButton.OverSound = sound'LadderSounds.lcursorMove';
00215 NextButton.DownSound = sound'LadderSounds.ladvance';
00216
00217 // Desc
00218 XPos = 609.0/1024 * XMod;
00219 YPos = 388.0/768 * YMod;
00220 XWidth = 321.0/1024 * XMod;
00221 YHeight = 113.0/768 * YMod;
00222 DescArea = UTFadeTextArea(CreateWindow(Class<UWindowWindow>(DynamicLoadObject("UTMenu.UTFadeTextArea", Class'Class')), XPos, YPos, XWidth, YHeight));
00223 DescArea.TextColor.R = 255;
00224 DescArea.TextColor.G = 255;
00225 DescArea.TextColor.B = 0;
00226 DescArea.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00227 DescArea.bAlwaysOnTop = True;
00228 DescArea.bMousePassThrough = True;
00229 DescArea.bAutoScrolling = True;
00230 if (Ladder.Default.bTeamGame)
00231 TitleClicked();
00232 else {
00233 DescArea.Clear();
00234 DescArea.AddText(NameString$" "$RMI.GetBotName(0, bTeamGame, True, GetPlayerOwner()));
00235 DescArea.AddText(ClassString$" "$RMI.GetBotClassification(0, bTeamGame, True, GetPlayerOwner()));
00236 DescArea.AddText("");
00237 DescArea.AddText(RMI.GetBotDesc(0, bTeamGame, True, GetPlayerOwner()));
00238 }
00239
00240 // DescScrollup
00241 XPos = 715.0/1024 * XMod;
00242 YPos = 538.0/768 * YMod;
00243 XWidth = 32.0/1024 * XMod;
00244 YHeight = 16.0/768 * YMod;
00245 DescScrollup = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00246 DescScrollup.NotifyWindow = Self;
00247 DescScrollup.Text = "";
00248 DescScrollup.bStretched = True;
00249 DescScrollup.UpTexture = Texture(DynamicLoadObject("UTMenu.AroUup", Class'Texture'));
00250 DescScrollup.OverTexture = Texture(DynamicLoadObject("UTMenu.AroUovr", Class'Texture'));
00251 DescScrollup.DownTexture = Texture(DynamicLoadObject("UTMenu.AroUdwn", Class'Texture'));
00252 DescScrollup.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00253 DescScrollup.bAlwaysOnTop = True;
00254
00255 // DescScrolldown
00256 XPos = 799.0/1024 * XMod;
00257 YPos = 538.0/768 * YMod;
00258 XWidth = 32.0/1024 * XMod;
00259 YHeight = 16.0/768 * YMod;
00260 DescScrolldown = NotifyButton(CreateWindow(class'NotifyButton', XPos, YPos, XWidth, YHeight));
00261 DescScrolldown.NotifyWindow = Self;
00262 DescScrolldown.Text = "";
00263 DescScrolldown.bStretched = True;
00264 DescScrolldown.UpTexture = Texture(DynamicLoadObject("UTMenu.AroDup", Class'Texture'));
00265 DescScrolldown.OverTexture = Texture(DynamicLoadObject("UTMenu.AroDovr", Class'Texture'));
00266 DescScrolldown.DownTexture = Texture(DynamicLoadObject("UTMenu.AroDdwn", Class'Texture'));
00267 DescScrolldown.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00268 DescScrolldown.bAlwaysOnTop = True;
00269
00270 Initialized = True;
00271 Root.Console.bBlackout = True;
00272
00273 if (Ladder.Default.bTeamGame)
00274 Selected = -1;
00275 }
00276
00277 function BeforePaint(Canvas C, float X, float Y)
00278 {
00279 local int i;
00280 local int W, H;
00281 local float XWidth, YHeight, XMod, YMod, XPos, YPos, YOffset;
00282
00283 Super.BeforePaint(C, X, Y);
00284
00285 class'UTLadderStub'.Static.GetStubClass().Static.SetupWinParams(Self, Root, W, H);
00286
00287 XMod = 4*W;
00288 YMod = 3*H;
00289
00290 // Title
00291 XPos = 74.0/1024 * XMod;
00292 YPos = 69.0/768 * YMod;
00293 XWidth = 352.0/1024 * XMod;
00294 YHeight = 41.0/768 * YMod;
00295 Title1.WinLeft = XPos;
00296 Title1.WinTop = YPos;
00297 Title1.SetSize(XWidth, YHeight);
00298 Title1.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetHugeFont(Root);
00299
00300 // MeshView
00301 XPos = 608.0/1024 * XMod;
00302 YPos = 88.0/768 * YMod;
00303 XWidth = 323.0/1024 * XMod;
00304 YHeight = 466.0/768 * YMod;
00305 MeshWindow.SetSize(XWidth, YHeight);
00306 MeshWindow.WinLeft = XPos;
00307 MeshWindow.WinTop = YPos;
00308
00309 // Names
00310 XPos = 168.0/1024 * XMod;
00311 YPos = 595.0/768 * YMod;
00312 XWidth = 256.0/1024 * XMod;
00313 YHeight = 64.0/768 * YMod;
00314 YOffset = 47.0/768 * YMod;
00315 // Reset the names.
00316 for (i=0; i<NumNames; i++)
00317 {
00318 Names[i].MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetBigFont(Root);
00319 Names[i].WinLeft = XPos;
00320 Names[i].WinTop = YPos - (i * YOffset);
00321 Names[i].SetSize(XWidth, YHeight);
00322 Names[i].LabelWidth = 178/1024 * XMod;
00323 Names[i].LabelHeight = 49/768 * YMod;
00324 if (i == Selected)
00325 Names[i].bSelected = True;
00326 else
00327 Names[i].bSelected = False;
00328 }
00329
00330 // Back Button
00331 XPos = 192.0/1024 * XMod;
00332 YPos = 701.0/768 * YMod;
00333 XWidth = 64.0/1024 * XMod;
00334 YHeight = 64.0/768 * YMod;
00335 BackButton.SetSize(XWidth, YHeight);
00336 BackButton.WinLeft = XPos;
00337 BackButton.WinTop = YPos;
00338
00339 // Next Button
00340 XPos = 256.0/1024 * XMod;
00341 YPos = 701.0/768 * YMod;
00342 XWidth = 64.0/1024 * XMod;
00343 YHeight = 64.0/768 * YMod;
00344 NextButton.SetSize(XWidth, YHeight);
00345 NextButton.WinLeft = XPos;
00346 NextButton.WinTop = YPos;
00347
00348 // Desc
00349 XPos = 609.0/1024 * XMod;
00350 YPos = 388.0/768 * YMod;
00351 XWidth = 321.0/1024 * XMod;
00352 YHeight = 113.0/768 * YMod;
00353 DescArea.SetSize(XWidth, YHeight);
00354 DescArea.WinLeft = XPos;
00355 DescArea.WinTop = YPos;
00356 DescArea.MyFont = class'UTLadderStub'.Static.GetStubClass().Static.GetSmallFont(Root);
00357
00358 // DescScrollup
00359 XPos = 715.0/1024 * XMod;
00360 YPos = 538.0/768 * YMod;
00361 XWidth = 32.0/1024 * XMod;
00362 YHeight = 16.0/768 * YMod;
00363 DescScrollup.WinLeft = XPos;
00364 DescScrollup.WinTop = YPos;
00365 DescScrollup.SetSize(XWidth, YHeight);
00366
00367 // DescScrolldown
00368 XPos = 799.0/1024 * XMod;
00369 YPos = 538.0/768 * YMod;
00370 XWidth = 32.0/1024 * XMod;
00371 YHeight = 16.0/768 * YMod;
00372 DescScrolldown.WinLeft = XPos;
00373 DescScrolldown.WinTop = YPos;
00374 DescScrolldown.SetSize(XWidth, YHeight);
00375 }
00376
00377 function Paint(Canvas C, float X, float Y)
00378 {
00379 local int XOffset, YOffset;
00380 local int W, H, i;
00381 local float XWidth, YHeight, XMod, YMod, XPos, YPos;
00382
00383 class'UTLadderStub'.Static.GetStubClass().Static.SetupWinParams(Self, Root, W, H);
00384
00385 XMod = 4*W;
00386 YMod = 3*H;
00387
00388 // Background
00389 DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (0 * H), W+1, H+1, BG1[0]);
00390 DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (0 * H), W+1, H+1, BG1[1]);
00391 DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (0 * H), W+1, H+1, BG1[2]);
00392 DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (0 * H), W+1, H+1, BG1[3]);
00393
00394 DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (1 * H), W+1, H+1, BG2[0]);
00395 DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (1 * H), W+1, H+1, BG2[1]);
00396 DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (1 * H), W+1, H+1, BG2[2]);
00397 DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (1 * H), W+1, H+1, BG2[3]);
00398
00399 DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (2 * H), W+1, H+1, BG3[0]);
00400 DrawStretchedTexture(C, XOffset + (1 * W), YOffset + (2 * H), W+1, H+1, BG3[1]);
00401 DrawStretchedTexture(C, XOffset + (2 * W), YOffset + (2 * H), W+1, H+1, BG3[2]);
00402 DrawStretchedTexture(C, XOffset + (3 * W), YOffset + (2 * H), W+1, H+1, BG3[3]);
00403
00404 if (Ladder.Default.bTeamGame)
00405 {
00406 DrawStretchedTexture(C, XOffset + (0 * W), YOffset + (0 * H), (W+1)/2, (H+1)/2, texture'TeamPlate');
00407 DrawStretchedTexture(C, XOffset + (0 * W) + (65.0/1024*XMod), YOffset + (0 * H) + (61.0/768*YMod), (58.0/1024*XMod), (57.0/768*YMod), RMI.GetTeamSymbol(bEnemy, GetPlayerOwner()));
00408 }
00409 }
00410
00411 function TitleClicked()
00412 {
00413 MeshWindow.SetNoAnimMesh(mesh(DynamicLoadObject(TeamMesh, Class'mesh')));
00414 MeshWindow.MeshActor.Texture = TeamTex;
00415 MeshWindow.MeshActor.bMeshEnviroMap = True;
00416 MeshWindow.MeshActor.DrawScale = 0.13 * 0.35;
00417 MeshWindow.bRotate = True;
00418 MeshWindow.bFace = False;
00419 MeshWindow.FaceButton.HideWindow();
00420 MeshWindow.ViewRotator = rot(0, 32768, 0);
00421 MeshWindow.CenterRotator = rot(0, 0, 0);
00422
00423 Selected = -1;
00424 DescArea.Clear();
00425 DescArea.AddText(RMI.GetTeamName(False, GetPlayerOwner()));
00426 DescArea.AddText("");
00427 DescArea.AddText(RMI.GetTeamBio(False, GetPlayerOwner()));
00428 }
00429
00430 function CloseUp()
00431 {
00432 RMI = None;
00433
00434 Root.Console.bLocked = False;
00435 Root.Console.bNoDrawWorld = Root.Console.ShowDesktop;
00436 UMenuRootWindow(Root).MenuBar.ShowWindow();
00437 Close();
00438 LadderWindow.Close();
00439 }
00440
00441 function BackPressed()
00442 {
00443 }
00444
00445 function EscClose()
00446 {
00447 BackPressed();
00448 }
00449
00450 function HideWindow()
00451 {
00452 Root.Console.bBlackOut = False;
00453
00454 Super.HideWindow();
00455 }
00456
00457 defaultproperties
00458 {
00459 }
|