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

TribesGUI.TribesDifficultyMenu


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
// ====================================================================
//  Class:  TribesGui.TribesMainMenu
//
//  Menu to load map from entry screen.
// ====================================================================

class TribesDifficultyMenu extends TribesGUIPage
     ;

var(TribesGui) private EditInline Config GUIButton		    EasyButton "A component of this page which has its behavior defined in the code for this page's class.";
var(TribesGui) private EditInline Config GUIButton		    NormalButton "A component of this page which has its behavior defined in the code for this page's class.";
var(TribesGui) private EditInline Config GUIButton		    HardButton "A component of this page which has its behavior defined in the code for this page's class.";
var(TribesGui) private EditInline Config GUIButton		    CancelButton "A component of this page which has its behavior defined in the code for this page's class.";

function InitComponent(GUIComponent MyOwner)
{
	Super.InitComponent(MyOwner);

    EasyButton.OnClick=InternalOnClick;
    NormalButton.OnClick=InternalOnClick;
    HardButton.OnClick=InternalOnClick;
	CancelButton.OnClick=InternalOnClick;

	bEscapeable = true;
	PageOpenedAfterEscape = class'GameEngine'.default.MainMenuClass;
}

function InternalOnClick(GUIComponent Sender)
{
	local int difficulty;

	switch (Sender)
	{
		case EasyButton:
			difficulty = 0;
			break;
		case NormalButton:
			difficulty = 1;
			break;
		case HardButton:
			difficulty = 2;
			break;
		case CancelButton:
			Controller.CloseMenu();
			Controller.OpenMenu(class'GameEngine'.default.MainMenuClass);
			return;
	}

	if (!TribesGUIController(Controller).StartNewCampaign(difficulty))
	{
		Log("Campaign error:  no campaign has been defined");
	}
}

defaultproperties
{
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: st 16.4.2014 10:20:44.000 - Creation time: st 23.5.2018 00:10:48.157 - Created with UnCodeX