GUI Trouble!

  • 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.

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
right I know how to popup a menu etc, now, I need a dropdown box, and when you selected something from it, a scroller (label?) should display other information based on the drowdown value,

Should be easy .. IF you know exactly how the GUI works =/

thx GUI ppl :)
 

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
Right, I tried, but my combobox wont show up :/
Here's the whole code :

Code:
// ====================================================================
// (C) 2002, Epic Games
// ====================================================================

class BZGUI_Tab_Info extends GUITabPanel;

var GUIScrollTextBox MyScrollText;
var localized string BZTEXT;
var GUIComboBox Weapon;

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
 	Super.InitComponent(MyController, MyOwner);

    MyScrollText = GUIScrollTextBox(Controls[0]);

    MyScrollText.SetContent("Hello "$PlayerOwner().GetUrlOption("Name")@BZTEXT);

    Weapon =GUIComboBox(Controls[3]);
    Weapon.AddItem("uh?");

    WinWidth = Controller.ActivePage.WinWidth;
    WinHeight = Controller.ActivePage.WinHeight *0.7;
    WinLeft = Controller.ActivePage.WinLeft;



}

function bool ButtonClicked(GUIComponent Sender)
{
	Controller.CloseMenu(true);
    return true;
}

defaultproperties
{

	Begin Object Class=GUIScrollTextBox Name=MOTDText
		WinWidth=1.000000
		WinHeight=0.640625
		WinLeft=0.009
		WinTop=0.1
		CharDelay=0.0025
		EOLDelay=0
		StyleName="NoBackground"
        bNoTeletype=true
        bNeverFocus=true
        bBoundToParent=true
        bScaleToParent=true
	End Object
	Controls(0)=GUIScrollTextBox'MOTDText'

	Begin Object Class=GUIButton Name=ServerBackButton
		Caption="Cancel"
		StyleName="SquareMenuButton"
		Hint="Back to the Game"
		WinWidth=0.220000
		WinHeight=0.075000
		WinLeft=0.768750
		WinTop=0.934167
        bBoundToParent=true
        bScaleToParent=true
		OnClick=ButtonClicked
	End Object
	Controls(1)=GUIButton'ServerBackButton'
	
	Begin Object class=GUIImage Name=ServerBK1
		WinWidth=1.0//0.293437
		WinHeight=0.016522
		WinLeft=0.0
		WinTop=0.01
		Image=Material'InterfaceContent.Menu.BorderBoxD'
		ImageColor=(R=255,G=255,B=255,A=255);
		ImageRenderStyle=MSTY_Alpha
		ImageStyle=ISTY_Stretched
        bBoundToParent=true
        bScaleToParent=true
	End Object
	Controls(2)=GUIImage'ServerBK1'

        Begin Object class=GUIComboBox Name=WapenMenu
		WinWidth=0.500000
		WinHeight=0.060000
		WinLeft=0.25
		WinTop=0.047917
		Hint="Select the type of game you wish to play."
	        bVisible=false
	End Object
	Controls(3)=GUIComboBox'WapenMenu'

    WinWidth=1
    WinHeight=0.7
    BZTEXT[0]=", in this Gametype, the two teams have to eliminate every member of the other team, in order to win a round."

}

Well it gives no error, but looks like this :

gui.gif


So, there's no combobox :|
I just copied the box of another UT2k3 menu (not ingame though) .. :/
 
Last edited:

elmuerte

Master of Science
Jan 25, 2000
1,936
0
36
42
the Netherlands
elmuerte.com
First a very important thing, remove the "(c) 2002, Epic Games" from your file.
It's your work, Epic doesn't own it.

Second:
Code:
        Begin Object class=GUIComboBox Name=WapenMenu
		WinWidth=0.500000
		WinHeight=0.060000
		WinLeft=0.25
		WinTop=0.047917
		Hint="Select the type of game you wish to play."
	        [color=red][b]bVisible=false[/b][/color]
	End Object
	Controls(3)=GUIComboBox'WapenMenu'
 

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
Well, I did what I wanted :

gui.jpg


When you select something else from the dropdown menu, the description beneath it changes :)

It isnt hard at all Solid :p
Unless i have a variable bInvisible set to true
rolleyes.gif
 

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
Uh .. Next problem ..

XInterface.GUIButton: Delegate assignment failed: OnClick=KoopWapens

Can't I assign my own functions to a button?

Code:
Begin Object Class=GUIButton Name=BuyButton
		Caption="Buy"
		StyleName="SquareMenuButton"
		Hint="Back to the Game"
		WinWidth=0.220000
		WinHeight=0.075000
		WinLeft=0.368750
		WinTop=0.934167
        bBoundToParent=true
        bScaleToParent=true
		OnClick=KoopWapens
	End Object
	Controls(5)=GUIButton'BuyButton'

and the KoopWapens function, simple, just to test :
Code:
function KoopWapens(GUIComponent Sender)
{
    Controller.CloseMenu(true);
}

omg? :(
 

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
thx again muerte :)
It seems that I have another problem though .. :(

The function KoopWapens is for buying the weapons (had je al door :p)
but I dont know how to give the player a weapon .. I tried P.GiveWeapon :
Code:
function bool KoopWapens(GUIComponent Sender)
{
        local string wapen;
        local Pawn P;

        wapen = GUIComboBox(Controls[3]).GetText();
	log("Chosen weapon : "@wapen);
        P.GiveWeapon("XWeapons.AssaultRifle");

        Controller.CloseMenu(true);
    return true;
}

Well, it gives me an accessed none in the log, probably cause the Pawn is nothing actually .. How can I set the pawn like that, so that I can give him the weapon with this?
Or maybe another solution?

thx :)
 

RegularX

Master of Dagoth Lies
Feb 2, 2000
1,215
0
0
Chicago, IL
If you handling an XI that is trying to do inventory control on a pawn, when the pawn isn't there (because it's before RestartPlayer() usually), you'll have some complications.

Things to remember: Pawns are destroyed when the player dies, and so is their inventory, and then the Pawn starts from scratch.

So to do dynamic, or persistent, or both, your best bet is to first interact with either the PlayerController or the PRI, something which is static, and then modify either RestartPlayer() or AddDefaultInventory() to do what you want.

Hard to be specific without know your exact framework.
 

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
Well, I have my own PRI and PlayerController Classes, so thats no problem i guess ..
 

SuperDre

New Member
May 6, 2002
254
0
0
Helmond.nl
www.superteam.tk
And maybe, just maybe, change the routines from dutch to english.. So if ever needed anyone else could work on the code who doesn't speak/read dutch..

Maarja je moet het natuurlijk zelf weten.... :D
 

EggXzaB

BinaryZero Error maker .. o_O
Jul 15, 2003
69
0
0
I know :D
but thats just the function names :p

Still didn't figure out my last prob btw, hope anyone can help me a bit with the PRI functions to get my weapons .. :(