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

UTMenu.UTStartGameCW


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
class UTStartGameCW expands UTMenuBotmatchCW;

// Window
var UWindowSmallButton DedicatedButton;
var localized string DedicatedText;
var localized string DedicatedHelp;
var localized string ServerText;

var UWindowMessageBox ConfirmStart;
var localized string ConfirmTitle;
var localized string ConfirmText;

var UWindowPageControlPage ServerTab;

function Created()
{
    Super.Created();

    // Dedicated
    DedicatedButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', WinWidth-156, WinHeight-24, 48, 16));
    DedicatedButton.SetText(DedicatedText);
    DedicatedButton.SetHelpText(DedicatedHelp);

    ServerTab = Pages.AddPage(ServerText, class'UTServerSetupSC');
}

function Resized()
{
    Super.Resized();
    DedicatedButton.WinLeft = WinWidth-152;
    DedicatedButton.WinTop = WinHeight-20;
}

function Notify(UWindowDialogControl C, byte E)
{
    switch(E)
    {
    case DE_Click:
        switch (C)
        {
            case StartButton:
                if ((GetLevel().Game.Default.bWorldLog == True) && (GetPlayerOwner().GetNGSecret() == "") && (!GetPlayerOwner().ngSecretSet))
                {
                    ConfirmStart = MessageBox(ConfirmTitle, ConfirmText, MB_YesNo, MR_Yes, MR_No);                  
                } else
                    StartPressed();
                return;
            case DedicatedButton:
                DedicatedPressed();
                return;
            default:
                Super.Notify(C, E);
                return;
        }
    default:
        Super.Notify(C, E);
        return;
    }
}

function MessageBoxDone(UWindowMessageBox W, MessageBoxResult Result)
{
    if(W == ConfirmStart)
    {
        switch(Result)
        {
        case MR_Yes:
            Root.CreateWindow(class<UWindowWindow>(DynamicLoadObject("UTMenu.ngWorldSecretWindow", class'Class')), 100, 100, 200, 200, Root, True);
            break;
        case MR_No:
            GetPlayerOwner().ngSecretSet = True;
            GetPlayerOwner().SaveConfig();
            StartPressed();
            break;
        }               
    }
}

function DedicatedPressed()
{
    local string URL;
    local GameInfo NewGame;
    local string LanPlay;

    if(UTServerSetupPage(UTServerSetupSC(ServerTab.Page).ClientArea).bLanPlay)
        LanPlay = " -lanplay";

    URL = Map $ "?Game="$GameType$"?Mutator="$MutatorList;
    URL = URL $ "?Listen";

    ParentWindow.Close();
    Root.Console.CloseUWindow();
    GetPlayerOwner().ConsoleCommand("RELAUNCH "$URL$LanPlay$" -server log="$GameClass.Default.ServerLogName);
}

// Override botmatch's start behavior
function StartPressed()
{
    local string URL, Checksum;
    local GameInfo NewGame;

    GameClass.Static.ResetGame();

    URL = Map $ "?Game="$GameType$"?Mutator="$MutatorList;
    URL = URL $ "?Listen";
    class'StatLog'.Static.GetPlayerChecksum(GetPlayerOwner(), Checksum);
    URL = URL $ "?Checksum="$Checksum;

    ParentWindow.Close();
    Root.Console.CloseUWindow();
    GetPlayerOwner().ClientTravel(URL, TRAVEL_Absolute, false);
}

defaultproperties
{
     DedicatedText="Dedicated"
     DedicatedHelp="Press to launch a dedicated server."
     ServerText="Server"
     ConfirmTitle="Confirm Game Start"
     ConfirmText="You are about to start a listen server running ngWorldStats but you have not supplied a ngWorldStats password. If you do not specify a password, your game stats will not be accumulated. Do you want to specify a password now?"
     bNetworkGame=True
}

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