Hi guys,
i really hope you could help me with that problem because i just can't get to understand what's going on... I've read everything concerning GUIs and there's no clue.
I have a made a new GUI page looking like UT2MidGameMenu where i only propose a team change. So there are only two buttons to choose your team. The code looks good and it should work but it doesn't. The menu open well and you can see it, but whenever you click on a button it doesn't do what it's supposed to do. It doesn't even log inside the InternalOnclick function.
I really don't get it cause ther's nothing fancy but only the required stuffs. Do u see anything wrong in it ?
Here's the code :
i really hope you could help me with that problem because i just can't get to understand what's going on... I've read everything concerning GUIs and there's no clue.
I have a made a new GUI page looking like UT2MidGameMenu where i only propose a team change. So there are only two buttons to choose your team. The code looks good and it should work but it doesn't. The menu open well and you can see it, but whenever you click on a button it doesn't do what it's supposed to do. It doesn't even log inside the InternalOnclick function.
I really don't get it cause ther's nothing fancy but only the required stuffs. Do u see anything wrong in it ?
Here's the code :
Code:
class At_TeamSelectionGUI extends GUIPage;
var GUIButton HumanTeam, AtlanteanTeam;
function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
Super.InitComponent(MyController, MyOwner);
HumanTeam = GUIButton(Controls[0]);
AtlanteanTeam = GUIButton(Controls[1]);
}
function bool InternalOnClick(GUIComponent Sender)
{
if ( Sender == HumanTeam ) // Switch to human team
{
log("##GUI## Human Team selected");
PlayerOwner().ChangeTeam(0);
Controller.CloseMenu();
}
else if( Sender == AtlanteanTeam ) // Switch to Atlantean team
{
log("##GUI## Atlantean Team selected");
PlayerOwner().ChangeTeam(1);
Controller.CloseMenu();
}
return true;
}
defaultproperties
{
Begin Object Class=GUIButton Name=human
Caption="Human Team"
WinWidth=0.2
WinHeight=0.04
WinLeft=0.125
WinTop=0.75
bBoundToParent=true
End Object
Controls(0)=GUIButton'human'
Begin Object Class=GUIButton Name=Atteam
Caption="Atlantean Team"
WinWidth=0.2
WinHeight=0.04
WinLeft=0.65
WinTop=0.75
bBoundToParent=true
End Object
Controls(1)=GUIButton'Atteam'
Begin Object class=GUILabel Name=Desc
Caption="Select a team !"
TextALign=TXTA_Center
TextColor=(R=220,G=180,B=0,A=255)
TextFont="UT2HeaderFont"
WinWidth=1
WinLeft=0
WinTop=0.4
WinHeight=32
End Object
Controls(2)=GUILabel'Desc'
WinLeft=0
WinTop=0.375
WinWidth=1
WinHeight=0.25
bRequire640x480=false
bAllowedAsLast=True
AllowClose=False
}