1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

UE2 - UT2kX Subclassed GUI controller

Discussion in 'Programming' started by Randori, Jun 19, 2009.

  1. Randori

    Randori New Member

    Joined:
    May 31, 2009
    Messages:
    22
    Likes Received:
    0
    Does anyone know if it is necessary to explicitly spawn your GUIController before use? I am hacking my way through various command structures and syntax in an effort to bring up a menu on use of a UseTrigger. I have subclassed the GUIPage and GUIController but can't address the interaction directly.

    Code:
    function UsedBy( Pawn user )
    {
    	if (bMasterSwitch == True) {
    		//	Spawn interface menu
    		MyGUIController.OpenWindow(MyGUIPage);
    }
    
    I've also tried variants on the syntax, such as:

    Code:
    function UsedBy( Pawn user )
    {
            local bool RValue
    
    	if (bMasterSwitch == True) {
    		//	Spawn interface menu
    		RValue=MyGUIController.OpenWindow(MyGUIPage);
    }
    
    
     
  2. Wormbo

    Wormbo Administrator Staff Member

    Joined:
    Jun 4, 2001
    Messages:
    5,913
    Likes Received:
    36
    Of course it is. The GUIController is a special Interaction (natively) managing the rendering of any GUIPages including mouse and keyboard input.
     
  3. Randori

    Randori New Member

    Joined:
    May 31, 2009
    Messages:
    22
    Likes Received:
    0
    Thanks for the timely response, Wormbo.

    So I need to spawn the Interaction. It would be local so I'm thinking it needs to be spawned from the PlayerController, probably in the PostBeginPlay.

    MyGUI already initializes with:
    Code:
    function InitComponent(GUIController MyController, GUIComponent MyOwner)
    {
    	Super.InitComponent(MyController, MyOwner);	// Call Parent's InitComponent
     
     
    Last edited: Jun 19, 2009
  4. eblade

    eblade New Member

    Joined:
    Jan 29, 2006
    Messages:
    113
    Likes Received:
    0
    is this the only thing you are using this guicontroller for?

    Code:
    GuiController(Level.GetLocalPlayerController().player.interactionmaster.GlobalInteractions[0]).OpenMenu(Menu);
    
     
  5. Randori

    Randori New Member

    Joined:
    May 31, 2009
    Messages:
    22
    Likes Received:
    0
    Yes. This trigger -> GUIController has only one task. It opens a multiple choice menu populated from an array in the trigger.
     

Share This Page