Can I extend the train stop / locomotive dialog?

Place to get help with not working mods / modding interface.
Post Reply
mrvn
Smart Inserter
Smart Inserter
Posts: 3840
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Can I extend the train stop / locomotive dialog?

Post by mrvn » Wed Sep 11, 2019 7:20 pm

I want to improve trains. For that I want to add a few new configuration options to the train stop dialog and to the train schedule. The question is: Can I do that cleanly?

The train station and train schedule dialogs can be opened by clicking on the station entity. That generates an on_gui_opened event. Same if you open them by clicking on a train in the train station or a station on the trains map. So i do get an event now matter how the respective dialogs get opened.

But how do I get access to the original vanilla gui elements so I can add to them? Or do I have to re-implement the whole dialog from scratch adding my own minimap/camera views for all trains heading to a station and such?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 2994
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Can I extend the train stop / locomotive dialog?

Post by DaveMcW » Wed Sep 11, 2019 8:29 pm

mrvn wrote:
Wed Sep 11, 2019 7:20 pm
Or do I have to re-implement the whole dialog from scratch
Yes.

An alternative would be to display a button whenever the train gui is opened, and the user clicks the button to get the extended options.

Post Reply

Return to “Modding help”

Who is online

Users browsing this forum: No registered users