Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Window titles

Started by hreintke, April 12, 2017, 04:21:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I have a number of local additions in my environment and like to make some updates to the window titles of factories and halts.
(in this case adding "area" information to factories & halts)

F.e the texts in the attached pictures :

Papierfabriek Mechelen (48,272) -> Papierfabriek Mechelen (48,272), Area 0
Mechelen buiten halte (58,300) -> Mechelen buiten halte (58,300), Area 4

But I cannot find the location in the code where these texts are generated.
Anyone can point me to the location ?


It's being set in the info windows contructor to the name of the halt. (and doesn't appear to be updated when the halt is renamed...)
   ./gui/ -> gui_frame_t( halt->get_name(), ...

For an example of updating the Window title upon renaming see:
   ./gui/ -> fabrik_info_t::update_info()

Similar would work for what you want, but:
   Papierfabriek Mechelen, Area 0   (48,272)    should be relatively trivial (depending on where the area info comes from...)
   Papierfabriek Mechelen (48,272), Area 0      would require much more significant changes.



Didn't see it before because I was looking for a concatenation of name and position.

Now checking the options I see now
- Adding it to the gui_frame_t name -> need to do for each window type
- Updating the koord::get_fullstr() -> will get into the (xxx,yyy) part -> generic solution, but need to check whether this has side effects
- Updating it to the location where the (xxx,yyy) is added to the title -> do you know where that is done.

On updating on changing name :
Sometimes it is updated directly when editing, sometimes only after finished updating.
Can't figure out (yet) what causes the yes/no updating