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

GUI2K4.UT2K4Ownage


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
// ====================================================================
// (C) 2002, Epic Games
// ====================================================================

class UT2K4Ownage extends ModsAndDemosTabs;

var automated GUISectionBackground sb_1, sb_2;

var automated GUIListBox lb_MapList;
var automated GUIScrollTextBox lb_MapInfo;
var automated GUIImage i_Background;
var automated GUIImage i_FileFront;
var automated GUILabel l_FileFront;


var int                                 OwnageLevel;
var array<GUIController.eOwnageMap>     OwnageMaps;

var material FFTex;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    local int i,j;
    local array<int> RLevel;
    local array<string> MName;
    local array<string> MDesc;
    local array<string> MURL;
    Super.InitComponent(MyController, MyOwner);

    Controller.GetOwnageList(RLevel, MName, MDesc, MURL);

    for (i=0;i<RLevel.Length;i++)
    {
        j = OwnageMaps.Length;
        OwnageMaps.Length = OwnageMaps.Length+1;
        OwnageMaps[j].RLevel  = RLevel[i];
        OwnageMaps[j].MapName = MName[i];
        OwnageMaps[j].MapDesc = MDesc[i];
        OwnageMaps[j].MapURL  = MURL[i];

        if (OwnageMaps[j].RLevel > OwnageLevel)
            OwnageLevel = OwnageMaps[j].RLevel;

    }

    sb_1.ManageComponent(lb_MapList);
    sb_2.ManageComponent(lb_MapInfo);

    PrimeMapList();
    lb_MapList.List.SetIndex(0);
    ListOnChange(lb_MapList);

    MyPage.MyFooter.b_Download.OnClick=DownloadClick;

    FFTex = material(DynamicLoadObject("jwfasterfiles.FF1",class'Texture',true));
    i_FileFront.Image = FFTex;

}

function PrimeMapList()
{
    local int i;
    lb_MapList.List.Clear();
    for (i=0;i<OwnageMaps.Length;i++)
        lb_MapList.List.Add(OwnageMaps[i].MapName,,string(i));
}

function bool DownloadClick(GUIComponent Sender)
{
    local int index;
    local string url;

    Index = int(lb_MapList.List.GetExtra() );
    url = OwnageMaps[Index].MapURL;

    if (url!="")
        Controller.LaunchURL(Url);

    return true;
}

function bool GotoFF(GUIComponent Sender)
{
    Controller.LaunchURL("http://www.fasterfiles.com");
    return true;
}

Function ListOnChange(GUIComponent Sender)
{
    local int i;

    i = int(lb_MapList.List.GetExtra());
    lb_MapInfo.SetContent(OwnageMaps[i].MapDesc,"|");
}

function AddMap(int Level, string mName, string mDesc, string mURL)
{
    local int i,Index;

    Index = -1;
    for (i=0;i<OwnageMaps.Length;i++)
        if (OwnageMaps[i].RLevel == Level)
            Index = i;

    if (Index==-1)
    {
        Index = OwnageMaps.Length;
        OwnageMaps.Length = OwnageMaps.Length+1;
        OwnageMaps[Index].RLevel = Level;
    }

    if (mName!="")
        OwnageMaps[Index].MapName = mName;

    if (mDesc!="")
        OwnageMaps[Index].MapDesc = OwnageMaps[Index].MapDesc$mDesc;

    if (mURL!="")
        OwnageMaps[Index].MapURL = mUrl;

    Controller.SaveOwnageList(OwnageMaps);
    PrimeMapList();
}

defaultproperties
{
     Begin Object Class=GUISectionBackground Name=sb1
         bFillClient=Wahr
         Caption="Ownage Maps"
         BottomPadding=0.200000
         WinTop=0.012761
         WinLeft=0.012527
         WinWidth=0.408084
         WinHeight=0.831136
         RenderWeight=0.010000
         OnPreDraw=sb1.InternalPreDraw
     End Object
     sb_1=GUISectionBackground'GUI2K4.UT2K4Ownage.sb1'

     Begin Object Class=AltSectionBackground Name=sb2
         bFillClient=Wahr
         Caption="Map Details"
         WinTop=0.012761
         WinLeft=0.431054
         WinWidth=0.562541
         WinHeight=0.971442
         RenderWeight=0.010000
         OnPreDraw=sb2.InternalPreDraw
     End Object
     sb_2=AltSectionBackground'GUI2K4.UT2K4Ownage.sb2'

     Begin Object Class=GUIListBox Name=lbMapList
         bVisibleWhenEmpty=Wahr
         OnCreateComponent=lbMapList.InternalOnCreateComponent
         WinTop=0.109375
         WinLeft=0.030468
         WinWidth=0.265626
         WinHeight=0.735548
         TabOrder=0
         OnChange=UT2K4Ownage.ListOnChange
     End Object
     lb_MapList=GUIListBox'GUI2K4.UT2K4Ownage.lbMapList'

     Begin Object Class=GUIScrollTextBox Name=lbMapInfo
         bNoTeletype=Wahr
         bVisibleWhenEmpty=Wahr
         OnCreateComponent=lbMapInfo.InternalOnCreateComponent
         WinTop=0.109725
         WinLeft=0.305664
         WinWidth=0.655274
         WinHeight=0.735548
         TabOrder=1
     End Object
     lb_MapInfo=GUIScrollTextBox'GUI2K4.UT2K4Ownage.lbMapInfo'

     Begin Object Class=GUIImage Name=iFF
         ImageStyle=ISTY_Scaled
         WinTop=0.857116
         WinLeft=0.019133
         WinWidth=0.393622
         WinHeight=0.130000
         bAcceptsInput=Wahr
         OnClick=UT2K4Ownage.GotoFF
     End Object
     i_FileFront=GUIImage'GUI2K4.UT2K4Ownage.iFF'

     Tag=2
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:58.000 - Creation time: Mo 16.4.2007 11:20:56.125 - Created with UnCodeX