[UT2k3] GUI onclick problem

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Jack oneill

New Member
Sep 4, 2001
81
0
0
42
France
atlantis.jolt.co.uk
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 :
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
}