The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended bug reports => Topic started by: Ranran(retired) on December 29, 2019, 05:09:46 AM

Title: Livery scheme selector has no meaning in timeline disabled game
Post by: Ranran(retired) on December 29, 2019, 05:09:46 AM
This is a separate issue from the bug posted here (https://forum.simutrans.com/index.php/topic,19311.new.html), so I post this in a new thread.

Quote
Quote from: Spenk009 on December 19, 2019, 07:24:30 PMMay I suggest that while this receives attention, that use_timeline also acts on the selection disables the timeline of liveries and enables all? It would make pakset work easier and improve control for players wishing to build outside of timelines.
Does this mean that if you turn off the timeline, all options will be displayed, but even if you select a livery scheme, the livery will not be applied until the year of its actual appearance?
certainly, this looks like a bug, but the problem is that the livery scheme doesn't know which to choose from multiple liveries.

For example, if it has 1850's and 1870's liveries, which livery should be applied if the timeline setting is disabled?
The same goes for Vladki's proposal.
It is probably easier to choose the old one if the applicable one has not yet appeared, but it should be noted that you cannot choose any one. It is different from Vladki's desired feature, but choosing individual livery is another feature.
Since the current livery scheme system is designed with the goal of changing the livery over time (it means, you can not select obsolete liveries), adding such features may require a lot of work.

EDIT:
I may now understand Spenk009's opinion. Apparently, if the timeline setting is disabled, the choice of the livery scheme doesn't seem to work at all. It means, if the timeline is disabled, displaying the list does not make sense. I will try to fix this.
Title: Re: Livery scheme selector has no meaning in timeline disabled game
Post by: Ranran(retired) on December 29, 2019, 10:45:23 AM
I think I made it possible to select the livery scheme even when the timeline is off.
Try testing this (https://github.com/Ranran-the-JuicyPork/simutrans-extended/tree/enable-livery-scheme-in-disabled-timeline-game)  ;)
If the timeline is off, the first registered livery in the livery scheme will be applied preferentially.
Title: Re: Livery scheme selector has no meaning in timeline disabled game
Post by: jamespetts on December 30, 2019, 11:24:03 AM
Thank you for this work. I am afraid that I am having some trouble compiling this on Linux, however: I get the following error when compiling the latest code from the enable-livery-scheme-in-disabled-timeline-game branch:



gui/components/gui_convoy_assembler.cc: In member function 'void gui_convoy_assembler_t::build_vehicle_lists()':
gui/components/gui_convoy_assembler.cc:1078:62: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
      (info->is_retired(month_now) && ((show_retired_vehicles && info->is_obsolete(month_now, welt) ||
                                        ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gui/components/gui_convoy_assembler.cc:1182:19: error: 'class livery_scheme_t' has no member named 'is_contained'
       if (scheme->is_contained(info)) {
                   ^~~~~~~~~~~~
gui/components/gui_convoy_assembler.cc: In member function 'void gui_convoy_assembler_t::add_to_vehicle_list(const vehicle_desc_t*)':
gui/components/gui_convoy_assembler.cc:1317:33: warning: comparison is always true due to limited range of data type [-Wtype-limits]
     && (info->get_engine_type() != vehicle_desc_t::unknown && info->get_engine_type() != 255))
         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
gui/components/gui_convoy_assembler.cc: In member function 'void gui_convoy_assembler_t::update_data()':
gui/components/gui_convoy_assembler.cc:1679:132: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
Title: Re: Livery scheme selector has no meaning in timeline disabled game
Post by: Ranran(retired) on December 30, 2019, 12:30:49 PM
I'm sorry about it. I uploaded the missing push and confirmed that I could compile it myself.  :-[
I hope you check it again.
Title: Re: Livery scheme selector has no meaning in timeline disabled game
Post by: jamespetts on December 30, 2019, 01:16:37 PM
Excellent, thank you: this now works and I have incorporated it.