Replace locomotive GUI

Place to get help with not working mods / modding interface.
Post Reply
MeinAccount
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Apr 30, 2014 7:49 pm
Contact:

Replace locomotive GUI

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

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Replace locomotive GUI

Post 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

MeinAccount
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed Apr 30, 2014 7:49 pm
Contact:

Re: Replace locomotive GUI

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

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Replace locomotive GUI

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

Post Reply

Return to “Modding help”