home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Game Level Design
/
GLDesign.bin
/
Software
/
UnrealEngine2Runtime
/
UE2Runtime-22262001_Demo.exe
/
GUI
/
Classes
/
MyMainMenu.uc
< prev
next >
Wrap
Text File
|
2003-06-30
|
2KB
|
113 lines
// ====================================================================
// (c) 2003, Epic Games, Inc. All Rights Reserved
// ====================================================================
class MyMainMenu extends GUIPage;
#exec OBJ LOAD FILE=GUIContent.utx
var automated GUIButton TestButton1;
var automated GUIButton TestButton2;
var automated GUIButton QuitButton;
var bool AllowClose;
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 bCancelled)
{
if(AllowClose)
Controller.OpenMenu("GUI.MyQuitPage");
return false;
}
function bool ButtonClick(GUIComponent Sender)
{
local GUIButton Selected;
if (GUIButton(Sender) != None)
Selected = GUIButton(Sender);
if (Selected == None) return false;
switch (Selected)
{
case TestButton1:
return Controller.OpenMenu("GUI.MyTest2Page"); break;
case TestButton2:
return Controller.OpenMenu("GUI.MyTestPage"); break;
case QuitButton:
return Controller.OpenMenu("GUI.MyQuitPage"); break;
}
return false;
}
defaultproperties
{
OnCanClose=CanClose
OnKeyEvent=MyKeyEvent
Begin Object Class=GUIButton Name=cTestButton1
StyleName="TextButton"
Caption="Test 1"
Hint="The First Test"
OnClick=ButtonClick
WinWidth=0.500000
WinHeight=0.075000
WinLeft=0.250000
WinTop=0.334635
TabOrder=0
bFocusOnWatch=true
End Object
Begin Object Class=GUIButton Name=cTestButton2
StyleName="TextButton"
Caption="Test 2"
Hint="More Tests"
OnClick=ButtonClick
WinWidth=0.500000
WinHeight=0.075000
WinLeft=0.250000
WinTop=0.506251
bFocusOnWatch=true
TabOrder=1
End Object
Begin Object Class=GUIButton Name=cQuitButton
Caption="QUIT"
Hint="Exit"
OnClick=ButtonClick
StyleName="TextButton"
WinWidth=0.205078
WinHeight=0.042773
WinLeft=0.391602
WinTop=0.905725
bFocusOnWatch=true
TabOrder=5
End Object
TestButton1=cTestButton1
TestButton2=cTestButton2
QuitButton=cQuitButton
Background=Material'GUIContent.EpicLogo'
WinWidth=1.0
WinHeight=1.0
WinTop=0.0
WinLeft=0.0
AllowClose=False
bAllowedAsLast=true
bDisconnectOnOpen=true
}