Game Development Community

Disappearing buttons

by Stephen · in Torque 3D Professional · 07/03/2014 (1:18 am) · 6 replies

I'm currently working on changing my menus to work with a controller. The default menus in T3D doesn't support controllers. I have been using code from the T3D folder in TGEA 1.8.2 since it's the only example that had controller support. Anyway, I have got my menu working but I noticed a issue with some of the buttons disappearing.

I'm using the GuiGameListMenu and GuiGameListOptions. I noticed the issue happens with the GuiGameListMenu and not with GuiGameListOptions. With each menu I add the "GamepadButtonsGui" in the onWake function.
%this.add(GamepadButtonsGui);
When I use GuiGameListOptions for the menu then buttons don't disappear but if I use GuiGameListMenu once I go to a different menu then the buttons disappear.

Here's a video showing the issue.

#1
07/03/2014 (6:55 am)
Found the old unified shell GUI and script files in T3D MIT v2.0 tagged repository at github.com/GarageGames/Torque3D/tree/v2.0/Templates/Full/game/core/unifiedShell Which is what you probably want to look at for example usage of those controls in T3D and might get away with using those script files there with just a few modifications for your game.

Unfortunately the example scripts were removed for odd reasons in later releases since pull request #260.
#2
07/03/2014 (10:28 am)
I haven't compared them 1 on 1 with my files just yet but it looks just like mine fines. I'm wondering if it's a bug in the script or code.
#3
07/03/2014 (5:25 pm)
Look through GuiGameListMenu and see if there is any place where the buttons are being "removed" - I think ::clear() actually destroys the objects as they are removed from a control. Also, see if they're being moved to another parent control - GuiControl inherits SimGroup and an object can only belong to one SimGroup at a time....
#4
07/04/2014 (4:32 am)
I haven't found any clear() function in my gui files. I did a search and found nothing. I wonder if I change the menus from pop up windows to full GUIs if that would stop the buttons from disappearing.
#5
07/04/2014 (10:23 am)
I should go get a USB controller - hard to troubleshoot this stuff without one. I had forgotten about the GuiGameListMenuCtrl - hadn't even looked at it since the TGEA-based T3D demo....

Having said that, I honestly would have just added scripting to the default main menu to allow keyboard binds to cycle through the buttons and "press" the selected one. You could use those as doubles for controller input bindings, too.
#6
07/05/2014 (4:47 am)
I have the keyboard working where you can navigate through the menus. I'm also using this resource from Kevin.