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

UMenu.UMenuGameMenu


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
class UMenuGameMenu extends UWindowPulldownMenu;

var UWindowPulldownMenuItem NewGame, Load, Save, GameOptions, Botmatch, Quit;

var localized string NewGameName;
var localized string NewGameHelp;
var localized string LoadName;
var localized string LoadHelp;
var localized string SaveName;
var localized string SaveHelp;
var localized string BotmatchName;
var localized string BotmatchHelp;
var localized string QuitName;
var localized string QuitHelp;
var localized string QuitTitle;
var localized string QuitText;

var UWindowMessageBox ConfirmQuit;

function Created()
{
    Super.Created();

    // Add menu items.
    NewGame = AddMenuItem(NewGameName, None);
    Load = AddMenuItem(LoadName, None);
    Save = AddMenuItem(SaveName, None);
    AddMenuItem("-", None);
    Botmatch = AddMenuItem(BotmatchName, None);
    AddMenuItem("-", None);
    Quit = AddMenuItem(QuitName, None);
}

function MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result)
{
    if(W == ConfirmQuit && Result == MR_Yes)
        Root.QuitGame();
}

function ExecuteItem(UWindowPulldownMenuItem I) 
{
    switch(I)
    {
    case NewGame:
        // Create new game dialog.
        Root.CreateWindow(class'UMenuNewGameWindow', 100, 100, 200, 200, Self, True);
        break;
    case Load:
        // Create load game dialog.
        Root.CreateWindow(class'UMenuLoadGameWindow', 100, 100, 200, 200, Self, True);
        break;
    case Save:
        // Create save game dialog.
        Root.CreateWindow(class'UMenuSaveGameWindow', 100, 100, 200, 200, Self, True);
        break;
    case Botmatch:
        // Create botmatch dialog.
        Root.CreateWindow(class'UMenuBotmatchWindow', 100, 100, 200, 200, Self, True);
        break;
    case Quit:
        ConfirmQuit = MessageBox(QuitTitle, QuitText, MB_YesNo, MR_No, MR_Yes);
        break;
    }

    Super.ExecuteItem(I);
}

function Select(UWindowPulldownMenuItem I)
{
    switch(I)
    {
    case NewGame:
        UMenuMenuBar(GetMenuBar()).SetHelp(NewGameHelp);
        return;
    case Load:
        UMenuMenuBar(GetMenuBar()).SetHelp(LoadHelp);
        break;
    case Save:
        UMenuMenuBar(GetMenuBar()).SetHelp(SaveHelp);
        break;
    case Botmatch:
        UMenuMenuBar(GetMenuBar()).SetHelp(BotmatchHelp);
        break;
    case Quit:
        UMenuMenuBar(GetMenuBar()).SetHelp(QuitHelp);
        break;
    }

    Super.Select(I);
}

defaultproperties
{
     NewGameName="&New"
     NewGameHelp="Select to setup a new single player game of Unreal."
     LoadName="&Load"
     LoadHelp="Select to load a previously saved game."
     SaveName="&Save"
     SaveHelp="Select to save your current game."
     BotmatchName="&Botmatch"
     BotmatchHelp="Select to begin a game of Botmatch: Deathmatch with Bots!"
     QuitName="&Quit"
     QuitHelp="Select to save preferences and exit Unreal."
     QuitTitle="Confirm Quit"
     QuitText="Are you sure you want to Quit?"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Do 19.5.2005 19:42:14.000 - Creation time: Fr 7.6.2013 13:16:12.200 - Created with UnCodeX