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 00314 00315 00316 00317 00318 00319 00320 00321 00322 00323 00324 00325 00326 00327 00328 00329 00330 00331 00332 00333 00334 00335 00336 00337 00338 00339 00340 00341 00342 00343 00344 00345 00346 00347 00348 00349 00350 |
//============================================================================== // Created on: 09/15/2003 // Configure the avatars for each team's banner // // Written by Ron Prestenback // © 2003, Epic Games, Inc. All Rights Reserved //============================================================================== class TeamSymbolConfig extends LockedFloatingWindow; var automated GUIImage i_RedPreview, i_BluePreview; var automated GUISectionBackground sb_Bk2; var automated AltSectionBackground sb_Bk3; var automated GUIVertImageListBox lb_Symbols; var automated GUIHorzScrollButton b_AddRed, b_AddBlue; var GUIVertImageList li_Sym; var Material InitialRed, InitialBlue; var localized string ResetString, RedString; function InitComponent(GUIController MyController, GUIComponent MyOwner) { local array<string> TeamSymbols; local Material m; local int i; Super.InitComponent(MyController, MyOwner); Controller.GetTeamSymbolList( TeamSymbols, false ); li_Sym = lb_Symbols.List; li_Sym.bDropSource=True; li_Sym.OnEndDrag=EndSymbolDrag; for ( i = 0; i < TeamSymbols.Length; i++ ) { m = Material(DynamicLoadObject( TeamSymbols[i], Class'Material' )); if ( m != None ) { lb_Symbols.AddImage(m); } } b_Ok.SetPosition(0.789829,0.880000,0.159649,0.050000); b_Cancel.SetPosition(0.599011,0.880000,0.159649,0.050000); sb_Main.SetPosition(0.651078,0.050317,0.264769,0.313203); sb_Main.ManageComponent(i_RedPreview); sb_Main.Caption = RedString; sb_Main.bFillClient=true; sb_Bk2.ManageComponent(i_BluePreview); sb_Bk3.ManageComponent(lb_Symbols); b_Cancel.Caption = ResetString; b_Cancel.OnClick=ResetClick; } function HandleParameters( string RedSymbol, string BlueSymbol ) { local int i; local Material M; local bool GotRed, GotBlue; if ( RedSymbol == "" ) GotRed = true; if ( BlueSymbol == "" ) GotBlue = true; while ( i < li_Sym.ItemCount && !(GotRed && GotBlue) ) { M = li_Sym.GetImageAtIndex(i); if ( !GotRed && string(M) ~= RedSymbol ) { InitialRed = M; GotRed = true; if ( SetRedImage(M) ) continue; } if ( !GotBlue && string(M) ~= BlueSymbol ) { InitialBlue = M; GotBlue = true; if ( SetBlueImage(M) ) continue; } i++; } } function bool ResetClick(GUIComponent Sender) { if ( Sender == b_Cancel ) { SetRedImage(InitialRed); SetBlueImage(InitialBlue); } return true; } function EndSymbolDrag(GUIComponent Accepting, bool bAccepted) { local int i; local array<ImageListElem> Pending; if (bAccepted && Accepting != None) { Pending = li_sym.GetPendingElements(); for (i = 0; i < Pending.Length; i++) { if ( Accepting == i_RedPreview ) SetRedImage(Pending[i].Image); else if ( Accepting == i_BluePreview ) SetBlueImage( Pending[i].Image ); } li_Sym.bRepeatClick = False; } if (Accepting == None) li_Sym.bRepeatClick = True; li_Sym.SetOutlineAlpha(255); if ( li_Sym.bNotify ) li_Sym.CheckLinkedObjects(li_Sym); } function bool DragDropped(GUIComponent Sender) { local Material Mat; Mat = li_Sym.Get(); return Mat != None && Mat != GUIImage(Sender).Image; } // Returns true if successfully removed image from main list function bool SetRedImage(Material Mat) { local int i; local bool bResult; if ( Mat == None ) { if ( i_RedPreview.Image != None ) { i = li_Sym.FindImage(i_RedPreview.Image); if ( i == -1 ) li_Sym.Add( i_RedPreview.Image ); } i_RedPreview.Image = None; return false; } // The image must exist in our list for us to add it // Otherwise, we could end up with both teams having the same image, which causes problems // when you try to change one of those images, as you then end up with two copies of the same image in the list i = li_Sym.FindImage( Mat ); if ( i != -1 ) { if ( i_RedPreview.Image != None && i_RedPreview.Image != Mat ) li_Sym.Replace( i, i_RedPreview.Image ); else { li_Sym.Remove(i); bResult = true; } i_RedPreview.Image = Mat; } return bResult; } // Returns true if successfully removed image from main list function bool SetBlueImage(Material Mat) { local int i; local bool bResult; if ( Mat == None ) { if ( i_BluePreview.Image != None ) { i = li_Sym.FindImage(i_BluePreview.Image); if ( i == -1 ) li_Sym.Add( i_BluePreview.Image ); } i_BluePreview.Image = None; return false; } // The image must exist in our list for us to add it // Otherwise, we could end up with both teams having the same image, which causes problems // when you try to change one of those images, as you then end up with two copies of the same image in the list i = li_Sym.FindImage( Mat ); if ( i != -1 ) { if ( i_BluePreview.Image != None && i_BluePreview.Image != Mat ) li_Sym.Replace( i, i_BluePreview.Image ); else { li_Sym.Remove(i); bResult = True; } i_BluePreview.Image = Mat; } return bResult; } function bool AddOnPredraw(Canvas C) { b_AddRed.WinLeft = sb_Main.WinLeft - b_AddRed.WinWidth; b_AddRed.WinLeft = sb_Bk2.WinLeft - b_AddRed.WinWidth; return false; } function bool butClick(GUIComponent Sender) { local material m; m = li_Sym.Get(); if (m!=None) { if (Sender==b_AddRed) SetRedImage(M); else if (Sender==b_AddBlue) SetBlueImage(M); } return true; } defaultproperties { Begin Object Class=GUIImage Name=RedPreview DropShadow=Texture'2K4Menus.Controls.Shadow' ImageColor=(B=0,G=0,R=245) ImageStyle=ISTY_Scaled DropShadowY=-1 WinTop=0.148005 WinLeft=0.105502 WinWidth=0.240119 WinHeight=0.407497 bBoundToParent=Wahr bScaleToParent=Wahr bAcceptsInput=Wahr bDropTarget=Wahr OnDragDrop=TeamSymbolConfig.DragDropped End Object i_RedPreview=GUIImage'GUI2K4.TeamSymbolConfig.RedPreview' Begin Object Class=GUIImage Name=BluePreview DropShadow=Texture'2K4Menus.Controls.Shadow' ImageColor=(B=245,G=0,R=0) ImageStyle=ISTY_Scaled DropShadowY=-1 WinTop=0.152873 WinLeft=0.653149 WinWidth=0.240119 WinHeight=0.400195 bBoundToParent=Wahr bScaleToParent=Wahr bAcceptsInput=Wahr bDropTarget=Wahr OnDragDrop=TeamSymbolConfig.DragDropped End Object i_BluePreview=GUIImage'GUI2K4.TeamSymbolConfig.BluePreview' Begin Object Class=GUISectionBackground Name=back2 bFillClient=Wahr Caption="Blue Team" WinTop=0.472192 WinLeft=0.651078 WinWidth=0.264769 WinHeight=0.313203 OnPreDraw=back2.InternalPreDraw End Object sb_Bk2=GUISectionBackground'GUI2K4.TeamSymbolConfig.back2' Begin Object Class=AltSectionBackground Name=back3 bFillClient=Wahr Caption="Available Team Symbols" LeftPadding=0.000000 RightPadding=0.000000 WinTop=0.050317 WinLeft=0.030960 WinWidth=0.494261 WinHeight=0.698945 OnPreDraw=back3.InternalPreDraw End Object sb_Bk3=AltSectionBackground'GUI2K4.TeamSymbolConfig.back3' Begin Object Class=GUIVertImageListBox Name=SymbList CellStyle=CELL_FixedCount NoVisibleRows=5 NoVisibleCols=5 OnCreateComponent=SymbList.InternalOnCreateComponent WinTop=0.472192 WinLeft=0.651078 WinWidth=0.264769 WinHeight=0.313203 End Object lb_Symbols=GUIVertImageListBox'GUI2K4.TeamSymbolConfig.SymbList' Begin Object Class=GUIHorzScrollButton Name=bAddRed bIncreaseButton=Wahr StyleName="AltComboButton" WinTop=0.200000 WinLeft=0.619922 WinWidth=0.033984 WinHeight=0.043750 OnPreDraw=TeamSymbolConfig.AddOnPredraw OnClick=TeamSymbolConfig.butClick OnKeyEvent=bAddRed.InternalOnKeyEvent End Object b_AddRed=GUIHorzScrollButton'GUI2K4.TeamSymbolConfig.bAddRed' Begin Object Class=GUIHorzScrollButton Name=bAddBlue bIncreaseButton=Wahr StyleName="AltComboButton" WinTop=0.634896 WinLeft=0.615039 WinWidth=0.033984 WinHeight=0.043750 OnClick=TeamSymbolConfig.butClick OnKeyEvent=bAddBlue.InternalOnKeyEvent End Object b_AddBlue=GUIHorzScrollButton'GUI2K4.TeamSymbolConfig.bAddBlue' ResetString="Reset" RedString="Red Team" WindowName="Configure Team Symbols" WinTop=0.091927 WinLeft=0.055664 WinWidth=0.885742 WinHeight=0.802344 } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |