Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 00305 00306 00307 00308 00309 00310 00311 00312 00313 |
// ==================================================================== // (C) 2002, Epic Games // ==================================================================== class UT2K4Demos extends ModsAndDemosTabs; var automated GUIListBox lb_DemoList,lb_DemoInfo; var automated GUIScrollTextBox lb_ReqPacks; var automated GUILabel lbl_Game, l_NoPreview; var automated GUIImage i_MapShot; var automated GUISectionBackground sb_1, sb_2, sb_3, sb_4; var localized string ltScoreLimit, ltTimeLimit, UnknownText, CorruptDemText,ltSelectMsg; var localized string ltClientSide, ltServerSide, ltRecordedBy,ltGoodMsg, ltBadMsg; var array<CacheManager.MapRecord> Maps; var array<CacheManager.GameRecord> Games; function InitComponent(GUIController MyController, GUIComponent MyOwner) { local array<string> Demos; local int i; Super.InitComponent(MyController,MyOwner); class'CacheManager'.static.GetMapList(Maps); class'CacheManager'.static.GetGameTypeList(Games); MyController.GetDEMList(Demos); for (i=0;i<Demos.Length;i++) lb_DemoList.List.Add(TrimName(Demos[i])); bInit = False; if (lb_DemoList.ItemCount()>0) DemoListClick(none); MyPage.MyFooter.b_Watch.OnClick=WatchClick; MyPage.MyFooter.b_Dump.OnClick=DumpClick; sb_1.ManageComponent(lb_DemoList); sb_2.Managecomponent(i_MapShot); sb_3.ManageComponent(lb_ReqPacks); } function string TrimName(string s) { local int p; p = InStr(Caps(s),".DEMO4"); if (p>=0) return Left(s,p); return s; } function bool DumpClick(GUIComponent Sender) { Controller.OpenMenu("GUI2K4.UT2K4Demo2AVI",lb_DemoList.List.Get()); return true; } function bool WatchClick(GUIComponent Sender) { Console(Controller.Master.Console).DelayedConsoleCommand("demoplay"@lb_DemoList.List.Get()); return true; } function DemoListClick(GUIComponent Sender) { local string MapName, GameType, RecordedBy, TimeStamp,ReqPackages; local int i, ScoreLimit, TimeLimit, ClientSide; local Material Screenie; if ( bInit ) return; lb_DemoInfo.List.Clear(); if ( LB_DemoList.List.ItemCount<=0 ) { lbl_Game.Caption = ""; sb_2.Caption = ""; lb_ReqPacks.SetContent(""); i_MapShot.SetVisibility( false); l_NoPreview.SetVisibility( true ); return; } if ( Controller.GetDEMHeader(lb_DemoList.List.Get( True )$".DEMO4",MapName,GameType,ScoreLimit,TimeLimit,ClientSide,RecordedBy,TimeStamp,ReqPackages) ) { lbl_Game.Caption=Caps(MapName); i = GetGameIndex(GameType); if ( i != -1 ) sb_2.Caption = Games[i].GameName; else sb_2.Caption = UnknownText; lb_DemoInfo.List.Add(ltScoreLimit@ScoreLimit@" "@ltTimeLimit@TimeLimit); if (ClientSide!=0) lb_DemoInfo.List.Add(ltClientSide); else lb_DemoInfo.List.Add(ltServerSide); lb_DemoInfo.List.Add(ltRecordedBy@RecordedBy); if (ReqPackages!="") lb_ReqPacks.SetContent(ltBadMsg$"||"$ReqPackages); else lb_ReqPacks.SetContent(ltGoodMsg); i = GetMapIndex(MapName); if ( i != -1 ) Screenie = Material(DynamicLoadObject(Maps[i].ScreenshotRef, class'Material')); } else { sb_2.Caption=""; lbl_Game.Caption=UnknownText; lb_DemoInfo.List.Clear(); lb_ReqPacks.SetContent(CorruptDemText); } i_MapShot.Image = Screenie; i_MapShot.SetVisibility( Screenie != None ); l_NoPreview.SetVisibility( Screenie == None ); lb_ReqPacks.Restart(); lb_ReqPacks.Stop(); return; } function SetVisibility( bool bIsVisible ) { Super.SetVisibility(bIsVisible); i_MapShot.SetVisibility( i_MapShot.Image != none ); l_NoPreview.SetVisibility( i_MapShot.Image == None ); } function int GetMapIndex( string MapName ) { local int i; for ( i = 0; i < Maps.Length; i++ ) if ( Maps[i].MapName ~= MapName ) return i; return -1; } function int GetGameIndex( string GameClass ) { local int i; for ( i = 0; i < Games.Length; i++ ) if ( Games[i].ClassName ~= GameClass || GameClass ~= ("class " $ Games[i].ClassName ) ) return i; return -1; } function InfoClick(GUIComponent Sender) { lb_DemoInfo.List.Index=0; } defaultproperties { Begin Object class=GUIImage Name=iMapShot WinWidth=0.326562 WinHeight=0.288124 WinLeft=0.619686 WinTop=0.199687 ImageColor=(R=255,G=255,B=255,A=255) ImageStyle=ISTY_Scaled ImageRenderStyle=MSTY_Normal RenderWeight=1 DropShadowX=8 DropShadowY=8 End Object i_MapShot=iMapShot Begin Object Class=GUILabel Name=NoPreview WinWidth=0.318399 WinHeight=0.226862 WinLeft=0.517749 WinTop=0.286842 TextFont="UT2HeaderFont" TextAlign=TXTA_Center VertAlign=TXTA_Center bMultiline=True bTransparent=False TextColor=(R=247,G=255,B=0,A=255) Caption="No Preview Available" RenderWeight=1 End Object l_NoPreview=NoPreview Begin Object class=AltSectionBackground name=iInfoBk WinWidth=0.637278 WinHeight=0.629445 WinLeft=0.354323 WinTop=0.011296 HeaderBase=material'2K4Menus.NewControls.Display2' Caption="... Information ..." RenderWeight=0.2 End Object sb_4=iInfoBk // char stats Begin Object class=GUIListBox Name=lbDemoList WinWidth=0.265626 WinHeight=0.735548 WinLeft=0.030468 WinTop=0.109375 OnChange=DemoListClick; OutlineStyleName="NoBackground" SectionStyleName="NoBackground" SelectedStyleName="NoBackground" TabOrder=0 bVisibleWhenEmpty=true End Object lb_DemoList=lbDemoList Begin Object class=GUIListBox Name=lbDemoInfo WinWidth=0.276054 WinHeight=0.078998 WinLeft=0.529180 WinTop=0.155622 bAcceptsInput=false bVisibleWhenEmpty=true OnChange=InfoClick End Object lb_DemoInfo=lbDemoInfo Begin Object class=GUIScrollTextBox Name=lbReqPacks WinWidth=0.650391 WinHeight=0.193555 WinLeft=0.310547 WinTop=0.650090 TabOrder=2 bVisibleWhenEmpty=true bNoTeletype=true End Object lb_ReqPacks=lbReqPacks Begin Object class=GUILabel Name=lblGame Caption="" TextColor=(R=230,G=200,B=0,A=255) TextALign=TXTA_Center TextFont="UT2LargeFont" WinWidth=0.634467 WinHeight=0.061558 WinLeft=0.355370 WinTop=0.103929 RenderWeight=0.6 End Object lbl_Game=lblGame Begin Object class=GUISectionBackground Name=sb1 WinWidth=0.328364 WinHeight=0.962274 WinLeft=0.012527 WinTop=0.012761 Caption="Demos" BottomPadding=0.2 RenderWeight=0.5 bFillClient=true End Object sb_1=sb1 Begin Object class=AltSectionBackground Name=sb2 WinWidth=0.368224 WinHeight=0.346441 WinLeft=0.492837 WinTop=0.228215 Caption="" RenderWeight=0.5 bFillClient=true End Object sb_2=sb2 Begin Object class=GUISectionBackground Name=sb3 WinWidth=0.637278 WinHeight=0.318539 WinLeft=0.354323 WinTop=0.656193 Caption="Required Packages" RenderWeight=0.5 BottomPadding=0.2 bFillClient=true End Object sb_3=sb3 CorruptDemText="Corrupted or missing .DEMO4 file !" UnknownText="Unknown" ltScoreLimit="Score Limit:" ltTimeLimit="Time Limit:" ltClientSide="Client Side Demo" ltServerSide="Server Side/Single Player Demo" ltGoodMsg="All of the packages required for this demo are installed" ltBadMsg="In order to be played, this demo requires the packages listed below. If you are connected to the Internet, they will be autodownloaded when the demo is played||::Required Packages::" ltRecordedBy="Recorded By:" ltSelectMsg="Please select a demo from the list to the left." Tag=3 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |