Page 1 of 1

Replace locomotive GUI

Posted: Tue Dec 30, 2014 9:13 pm
by MeinAccount
Hi,

How can I replace the locomotive GUI for a custom locomotive entity with my own one? I don't know the name for

Code: Select all

game.player.gui.top.foo.destroy()
Second question: How do I create a list with all stations in my custom GUI? Creating an element of type listbox doesn't work.

Re: Replace locomotive GUI

Posted: Tue Dec 30, 2014 10:49 pm
by Choumiko
MeinAccount wrote:Hi,

How can I replace the locomotive GUI for a custom locomotive entity with my own one?
I'm afraid that's not possible (at the moment). You'll have to create a custom gui (probably at player.gui.top or left), take a look at TheFatController, it's the same principle for what you want to do. (precisely: where/when FatController shows the AddTrain button at the top you want an OpenGUI button)
Second question: How do I create a list with all stations in my custom GUI? Creating an element of type listbox doesn't work.
Again, not possible

Re: Replace locomotive GUI

Posted: Wed Dec 31, 2014 8:37 am
by MeinAccount
Hi,

I'm wanting to create a custom GUI as a replacement for the default locomotive GUI. But as long as I can't create a list with all stations it doesn't matter that much. It seems like I'm forced to request every single feature for my mod.
Different approach: Is there any way to observe clicks on a station in the locomotive GUI. I'm talking about the bottom list of all stations.

Re: Replace locomotive GUI

Posted: Wed Dec 31, 2014 12:13 pm
by Choumiko
As far as i know all the guis that are not created by mods are a blackbox, you can't get any info from them, nor modify/destroy them. The only thing i'm aware of is: player.opened, which returns the entity of the opened gui.