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

UMenu.UMenuGameSettingsBase


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
class UMenuGameSettingsBase extends UMenuPageWindow;

var UMenuBotmatchClientWindow BotmatchParent;

var bool Initialized;
var float ControlOffset;

// Game Style
var UWindowComboControl StyleCombo;
var localized string StyleText;
var localized string Styles[3];
var localized string StyleHelp;

// Game Speed
var UWindowHSliderControl SpeedSlider;
var localized string SpeedText;
var localized string SpeedHelp;

function Created()
{
    local int ControlWidth, ControlLeft, ControlRight;
    local int CenterWidth, CenterPos, ButtonWidth, ButtonLeft;

    Super.Created();

    ControlWidth = WinWidth/2.5;
    ControlLeft = (WinWidth/2 - ControlWidth)/2;
    ControlRight = WinWidth/2 + ControlLeft;

    CenterWidth = (WinWidth/4)*3;
    CenterPos = (WinWidth - CenterWidth)/2;

    ButtonWidth = WinWidth - 140;
    ButtonLeft = WinWidth - ButtonWidth - 40;

    BotmatchParent = UMenuBotmatchClientWindow(GetParent(class'UMenuBotmatchClientWindow'));
    if (BotmatchParent == None)
        Log("Error: UMenuGameSettingsCWindow without UMenuBotmatchClientWindow parent.");

    // Game Style
    StyleCombo = UWindowComboControl(CreateControl(class'UWindowComboControl', CenterPos, ControlOffset, CenterWidth, 1));
    StyleCombo.SetText(StyleText);
    StyleCombo.SetHelpText(StyleHelp);
    StyleCombo.SetFont(F_Normal);
    StyleCombo.SetEditable(False);
    StyleCombo.AddItem(Styles[0]);
    StyleCombo.AddItem(Styles[1]);
    StyleCombo.AddItem(Styles[2]);
    ControlOffset += 25;

    // Game Speed
    SpeedSlider = UWindowHSliderControl(CreateControl(class'UWindowHSliderControl', CenterPos, ControlOffset, CenterWidth, 1));
    SpeedSlider.SetRange(50, 200, 5);
    SpeedSlider.SetHelpText(SpeedHelp);
    SpeedSlider.SetFont(F_Normal);
    ControlOffset += 25;
}

function AfterCreate()
{
    Super.AfterCreate();

    DesiredWidth = 270;
    DesiredHeight = ControlOffset;

    LoadCurrentValues();
    Initialized = True;
}

function LoadCurrentValues()
{
}

function BeforePaint(Canvas C, float X, float Y)
{
    local int ControlWidth, ControlLeft, ControlRight;
    local int CenterWidth, CenterPos, ButtonWidth, ButtonLeft;

    Super.BeforePaint(C, X, Y);

    ControlWidth = WinWidth/2.5;
    ControlLeft = (WinWidth/2 - ControlWidth)/2;
    ControlRight = WinWidth/2 + ControlLeft;

    CenterWidth = (WinWidth/4)*3;
    CenterPos = (WinWidth - CenterWidth)/2;

    StyleCombo.SetSize(CenterWidth, 1);
    StyleCombo.WinLeft = CenterPos;
    StyleCombo.EditBoxWidth = 110;

    SpeedSlider.SetSize(CenterWidth, 1);
    SpeedSlider.SliderWidth = 90;
    SpeedSlider.WinLeft = CenterPos;
}

function Notify(UWindowDialogControl C, byte E)
{
    if (!Initialized)
        return;

    Super.Notify(C, E);

    switch(E)
    {
    case DE_Change:
        switch(C)
        {
            case StyleCombo:
                StyleChanged();
                break;
            case SpeedSlider:
                SpeedChanged();
                break;
        }
    }
}

function StyleChanged()
{
}

function SpeedChanged()
{
}

defaultproperties
{
     ControlOffset=20.000000
     StyleText="Game Style:"
     Styles(0)="Classic"
     Styles(1)="Hardcore"
     Styles(2)="Turbo"
     StyleHelp="Choose your game style. Hardcore is 10% faster with a 50% damage increase. Turbo also adds ultra fast player movement."
     SpeedText="Game Speed"
     SpeedHelp="Adjust the speed of the game."
}

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