Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

UBrowser.UBrowserMainClientWindow


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
//=============================================================================
// UBrowserMainClientWindow - The main client area
//=============================================================================
class UBrowserMainClientWindow extends UWindowClientWindow;

var globalconfig string     LANTabName;

var UWindowPageControl      PageControl;
var UWindowPageControlPage  LANPage;
var UWindowTabControlItem   PageBeforeLAN;
var UBrowserOpenBar         OpenBar;

var UWindowPageControlPage  Favorites;
var UWindowPageControlPage  IRC;
var localized string        FavoritesName;
var localized string        IRCName;

var() globalconfig string ServerListTitles[20];
var() globalconfig name ServerListNames[20];

var UBrowserServerListWindow FactoryWindows[20];

const OpenBarHeight=30;

function Created() 
{
    local int i, f;
    local UWindowPageControlPage P;
    local UBrowserServerListWindow W;

    PageControl = UWindowPageControl(CreateWindow(class'UWindowPageControl', 0, OpenBarHeight, WinWidth, WinHeight-OpenBarHeight));
    
    // Add favorites
    Favorites = PageControl.AddPage(FavoritesName, class'UBrowserFavoriteServers');

    for(i=0; i<20; i++)
    {
        if(ServerListNames[i] == '')
            break;

        P = PageControl.AddPage(ServerListTitles[i], class'UBrowserServerListWindow', ServerListNames[i]);
        W = UBrowserServerListWindow(P.Page);

        if(string(ServerListNames[i]) ~= LANTabName)
            LANPage = P;

        FactoryWindows[i] = W;
    }

    for(i=0; i<20; i++)
        if(FactoryWindows[i] != None)
            FactoryWindows[i].Refresh(False, True);

    //IRC = PageControl.AddPage(IRCName, class'UBrowserIRCWindow');

    OpenBar = UBrowserOpenBar(CreateWindow(class'UBrowserOpenBar', 0, 0, WinWidth, OpenBarHeight));

    Super.Created();
    SaveConfig();
}

function SelectLAN()
{
    if(LANPage != None)
    {
        PageBeforeLAN = PageControl.SelectedTab;
        PageControl.GotoTab(LANPage, True);
    }
}

function SelectInternet()
{
    if(PageBeforeLAN != None && PageControl.SelectedTab == LANPage)
        PageControl.GotoTab(PageBeforeLAN, True);
    PageBeforeLAN = None;
}

function Resized()
{
    local float Y;

    Y = 0;
    
    if(OpenBar.bWindowVisible)
    {
        OpenBar.SetSize(WinWidth, OpenBarHeight); 
        Y += OpenBarHeight;
    }

    PageControl.WinTop = Y;
    PageControl.SetSize(WinWidth, WinHeight-Y);
}

function Paint(Canvas C, float X, float Y)
{
    DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'BlackTexture');
}

function SaveConfigs()
{
    SaveConfig();
}

defaultproperties
{
     LANTabName="UBrowserLAN"
     FavoritesName="Favorites"
     IRCName="Chat"
     ServerListTitles(0)="All Servers"
     ServerListTitles(1)="LAN Servers"
     ServerListTitles(2)="Populated Servers"
     ServerListTitles(3)="Deathmatch"
     ServerListTitles(4)="Team Games"
     ServerListTitles(5)="DarkMatch"
     ServerListTitles(6)="Coop Games"
     ServerListTitles(7)="All Servers"
     ServerListNames(0)=UBrowser225
     ServerListNames(1)=UBrowserLAN
     ServerListNames(2)=UBrowserPopulated
     ServerListNames(3)=UBrowserDeathmatch
     ServerListNames(4)=UBrowserTeamGames
     ServerListNames(5)=UBrowserDarkMatch
     ServerListNames(6)=UBrowserCoop
     ServerListNames(7)=UBrowserAll
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: za 22-4-2006 13:27:48.000 - Creation time: za 22-4-2006 13:29:31.687 - Created with UnCodeX