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

XInterface.UT2MainMenu


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
// ====================================================================
//  Class:  XInterface.UT2MainMenu
//
// 	The Main Menu
//
//  (c) 2002, Epic Games, Inc.  All Rights Reserved
// ====================================================================

class UT2MainMenu extends UT2K3GUIPage;

#exec OBJ LOAD FILE=InterfaceContent.utx

var bool    AllowClose;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    Super.InitComponent(MyController, MyOwner);

    if (PlayerOwner().Level.IsDemoBuild())
    {
        Controls[3].SetFocus(none);
        Controls[2].MenuStateChange(MSAT_Disabled);
    }
}

function OnClose(optional Bool bCanceled)
{
}

function bool MyKeyEvent(out byte Key,out byte State,float delta)
{
    if(Key == 0x1B && State == 1)   // Escape pressed
    {
        AllowClose = true;
        return true;
    }
    else
        return false;
}

function bool CanClose(optional Bool bCanceled)
{
    if(AllowClose)
        Controller.OpenMenu("xinterface.UT2QuitPage");

    return false;
}


function bool ButtonClick(GUIComponent Sender)
{
    if ( Sender==Controls[2] )
        Controller.OpenMenu("xinterface.UT2SinglePlayerMain");
    if ( Sender==Controls[3] )
        Controller.OpenMenu("xinterface.ServerBrowser");
    if ( Sender==Controls[4] )
        Controller.OpenMenu("xinterface.UT2MultiplayerHostPage");
    if ( Sender==Controls[5] )
        Controller.OpenMenu("xinterface.UT2InstantActionPage");
    if ( Sender==Controls[6] )
        Controller.OpenMenu("xinterface.UT2SettingsPage");
    if (Sender==Controls[7] )
        Controller.OpenMenu("xinterface.UT2QuitPage");

    return true;
}

defaultproperties
{
     bDisconnectOnOpen=True
     bAllowedAsLast=True
     Background=Texture'InterfaceContent.Backgrounds.bg10'
     OnCanClose=UT2MainMenu.CanClose
     Begin Object Class=GUIImage Name=ImgUT2Logo
         Image=Texture'InterfaceContent.Logos.Logo'
         ImageStyle=ISTY_Scaled
         WinTop=-0.033854
         WinLeft=0.100000
         WinWidth=0.800000
         WinHeight=0.500000
     End Object
     Controls(0)=GUIImage'XInterface.UT2MainMenu.ImgUT2Logo'

     Begin Object Class=GUIImage Name=ImgUT2Shader
         Image=FinalBlend'InterfaceContent.Logos.fbSymbolShader'
         ImageStyle=ISTY_Scaled
         WinTop=0.223958
         WinLeft=0.399414
         WinWidth=0.198242
         WinHeight=0.132813
     End Object
     Controls(1)=GUIImage'XInterface.UT2MainMenu.ImgUT2Shader'

     Begin Object Class=GUIButton Name=SinglePlayerButton
         Caption="SINGLE PLAYER"
         StyleName="TextButton"
         Hint="Play through the Tournament"
         WinTop=0.438802
         WinLeft=0.250000
         WinWidth=0.500000
         WinHeight=0.075000
         bFocusOnWatch=True
         OnClick=UT2MainMenu.ButtonClick
         OnKeyEvent=SinglePlayerButton.InternalOnKeyEvent
     End Object
     Controls(2)=GUIButton'XInterface.UT2MainMenu.SinglePlayerButton'

     Begin Object Class=GUIButton Name=MultiplayerButton
         Caption="PLAY ON-LINE/LAN"
         StyleName="TextButton"
         Hint="Play with Human Opponents Over the Lan or the Internet"
         WinTop=0.506251
         WinLeft=0.250000
         WinWidth=0.500000
         WinHeight=0.075000
         bFocusOnWatch=True
         OnClick=UT2MainMenu.ButtonClick
         OnKeyEvent=MultiplayerButton.InternalOnKeyEvent
     End Object
     Controls(3)=GUIButton'XInterface.UT2MainMenu.MultiplayerButton'

     Begin Object Class=GUIButton Name=HostButton
         Caption="HOST MULTIPLAYER GAME"
         StyleName="TextButton"
         Hint="Start a server an invite others to join your game"
         WinTop=0.577866
         WinLeft=0.250000
         WinWidth=0.500000
         WinHeight=0.075000
         bFocusOnWatch=True
         OnClick=UT2MainMenu.ButtonClick
         OnKeyEvent=HostButton.InternalOnKeyEvent
     End Object
     Controls(4)=GUIButton'XInterface.UT2MainMenu.HostButton'

     Begin Object Class=GUIButton Name=InstantActionButton
         Caption="INSTANT ACTION"
         StyleName="TextButton"
         Hint="Play a Practice Match"
         WinTop=0.658334
         WinLeft=0.250000
         WinWidth=0.500000
         WinHeight=0.075000
         bFocusOnWatch=True
         OnClick=UT2MainMenu.ButtonClick
         OnKeyEvent=InstantActionButton.InternalOnKeyEvent
     End Object
     Controls(5)=GUIButton'XInterface.UT2MainMenu.InstantActionButton'

     Begin Object Class=GUIButton Name=SettingsButton
         Caption="SETTINGS"
         StyleName="TextButton"
         Hint="Change Your Controls and Settings"
         WinTop=0.733595
         WinLeft=0.250000
         WinWidth=0.500000
         WinHeight=0.075000
         bFocusOnWatch=True
         OnClick=UT2MainMenu.ButtonClick
         OnKeyEvent=SettingsButton.InternalOnKeyEvent
     End Object
     Controls(6)=GUIButton'XInterface.UT2MainMenu.SettingsButton'

     Begin Object Class=GUIButton Name=QuitButton
         Caption="QUIT"
         StyleName="SquareMenuButton"
         Hint="Exit Unreal Tournament 2003"
         WinTop=0.905725
         WinLeft=0.391602
         WinWidth=0.205078
         WinHeight=0.042773
         bFocusOnWatch=True
         OnClick=UT2MainMenu.ButtonClick
         OnKeyEvent=QuitButton.InternalOnKeyEvent
     End Object
     Controls(7)=GUIButton'XInterface.UT2MainMenu.QuitButton'

     WinHeight=1.000000
     OnKeyEvent=UT2MainMenu.MyKeyEvent
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:30:38.000 - Creation time: Wed 7/2/2007 19:16:58.031 - Created with UnCodeX