Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowClientWindow | +--UBrowser.UBrowserScreenshotCW
string
MapName
Texture
Screenshot
void
Paint(Canvas C, float MouseX, float MouseY)
00001 class UBrowserScreenshotCW expands UWindowClientWindow; 00002 00003 var Texture Screenshot; 00004 var string MapName; 00005 00006 function Paint(Canvas C, float MouseX, float MouseY) 00007 { 00008 local float X, Y, W, H; 00009 local int i; 00010 local string M; 00011 local UBrowserServerList L; 00012 00013 L = UBrowserInfoClientWindow(GetParent(class'UBrowserInfoClientWindow')).Server; 00014 00015 if( L != None ) 00016 { 00017 M = L.MapName; 00018 if( M != MapName ) 00019 { 00020 MapName = M; 00021 if( MapName == "" ) 00022 ScreenShot = None; 00023 else 00024 { 00025 i = InStr(Caps(MapName), ".UNR"); 00026 if(i != -1) 00027 MapName = Left(MapName, i); 00028 00029 Screenshot = Texture(DynamicLoadObject(MapName$".Screenshot", class'Texture')); 00030 } 00031 } 00032 } 00033 else 00034 { 00035 ScreenShot = None; 00036 MapName = ""; 00037 } 00038 00039 DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'BlackTexture'); 00040 00041 if(Screenshot != None) 00042 { 00043 W = Min(WinWidth, Screenshot.USize); 00044 H = Min(WinHeight, Screenshot.VSize); 00045 00046 if(W > H) 00047 W = H; 00048 if(H > W) 00049 H = W; 00050 00051 X = (WinWidth - W) / 2; 00052 Y = (WinHeight - H) / 2; 00053 00054 DrawStretchedTexture(C, X, Y, W, H, Screenshot); 00055 } 00056 } 00057 00058 defaultproperties 00059 { 00060 }