caudex
05-10-2007, 10:21 PM
God this error is getting so annoying...............
Keeps saying XInterface.GUIButton: Delegate Assignment Failed.
Kinda getting on my nerves.... the Menu works 100% perfectly... i change a value of the Name of a button... then it brings up that error... ctrl+z to undo that name change... and it still gives me that error... Where does the error come from?
The error is hooking at OnClick=InternalOnClick
I never even changed the Onclick, only thing i changed was the Name of the button.
Code of one of the buttons:
Begin Object Class=GUIButton Name=ExitMenu
Caption="Exit Menu"
WinWidth=0.2
WinHeight=0.04
WinLeft=0.65
WinTop=0.75
bBoundToParent=true
OnClick=InternalOnClick
End Object
Controls(3)=GUIButton'ExitMenu'
Heres my internalonclick
function bool InternalOnClick(GUIComponent Sender)
{
P = PlayerOwner().Pawn;
if (Sender==Controls[1])
{
P.GiveWeapon("xweapons.RocketLauncher");
P.ClientMessage("You have bought Rocket Launcher");
}
if (Sender==Controls[2])
{
P.GiveWeapon("xweapons.flakcannon");
P.ClientMessage("You have bought Flak Cannon");
}
if (Sender==Controls[3])
{
P.GiveWeapon("xweapons.SniperRifle");
P.ClientMessage("You have bought Sniper Rifle");
}
else
Controller.CloseMenu(false);
return false;
}
But im pretty sure that code is correct
Keeps saying XInterface.GUIButton: Delegate Assignment Failed.
Kinda getting on my nerves.... the Menu works 100% perfectly... i change a value of the Name of a button... then it brings up that error... ctrl+z to undo that name change... and it still gives me that error... Where does the error come from?
The error is hooking at OnClick=InternalOnClick
I never even changed the Onclick, only thing i changed was the Name of the button.
Code of one of the buttons:
Begin Object Class=GUIButton Name=ExitMenu
Caption="Exit Menu"
WinWidth=0.2
WinHeight=0.04
WinLeft=0.65
WinTop=0.75
bBoundToParent=true
OnClick=InternalOnClick
End Object
Controls(3)=GUIButton'ExitMenu'
Heres my internalonclick
function bool InternalOnClick(GUIComponent Sender)
{
P = PlayerOwner().Pawn;
if (Sender==Controls[1])
{
P.GiveWeapon("xweapons.RocketLauncher");
P.ClientMessage("You have bought Rocket Launcher");
}
if (Sender==Controls[2])
{
P.GiveWeapon("xweapons.flakcannon");
P.ClientMessage("You have bought Flak Cannon");
}
if (Sender==Controls[3])
{
P.GiveWeapon("xweapons.SniperRifle");
P.ClientMessage("You have bought Sniper Rifle");
}
else
Controller.CloseMenu(false);
return false;
}
But im pretty sure that code is correct