News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

[r8765] themes do not use standard values if none is given

Started by Leartin, June 06, 2019, 05:31:01 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leartin

Not sure if a bug or a feature. If you set any parameter with a theme, then proceed to load a another theme that does not specifically set that parameter, the parameter from the first loaded theme is used.

This could be useful as a feature - eg. one could have a theme that only sets sizes and can be used to rescale any other theme. But it would be awkward to use.

As a bug, it means unexpected things can happen, and default values get "lost" to the user. Eg. I used my theme to set the title bar color, but since no other theme sets it, every theme now comes with the title bar color I chose, you don't get orange back (unless setting it manually - which does not work for most theme settings)

Dwachs

This only affects theme-related settings that can also be configured in simuconf.tab. Maybe it is time to read these settings only from the theme?

Here is the list of the affected settings:

font_size,
icon_width,
window_buttons_right,
left_to_right_graphs,
window_frame_active,
second_open_closes_win,
remember_window_positions,
window_snap_distance,
gui_drop_shadows,
bottom_window_darkness,
default_window_title_color,
front_window_text_color,
bottom_window_text_color,
cursor_overlay_color,
tooltip_background_color,
tooltip_text_color,
show_tooltips,
tooltip_delay,
tooltip_duration,
toolbar_max_width,
toolbar_max_height.

Some clearly belong to the theme configuration, others not.
Parsley, sage, rosemary, and maggikraut.

Leartin

Sorry, I did not realize that all those settings can be configured in the simuconf.tag. Especially cursor_overlay_color. It does make sense now why the themes don't reset them.

Not all those settings need to be read from themes I think.
left_to_right_graphs, window_buttons_right, second_open_closes_win, remember_window_positions, show_tooltips <-- all those are not quite graphical, so I don't think they need to be in a theme. Rather, those should be decisions any user can make within the game.
cursor_overlay_color <-- that's a weird one, since what mostly matters would be what the cursor looks like, which is pakset dependent. So simuconf.tab is better, and no way to set it within the game required.
font_size <-- this could make sense in a theme if the theme could also set the font, but it's more important that it stays adjustable within the game. So if it can't (or shouldn't) be both, I'd rather not have it in the theme.

prissi

You can have both.

I think those should be both (theme and simuconf.tab)
font_size,
icon_width,
toolbar_max_width,
toolbar_max_height.
window_buttons_right,
since these if I have a 2k 11" display (like my laptop), you want to apply large settings to any theme

These are rather user preferences, and thus should stay with simuconf.tab
left_to_right_graphs,
window_frame_active,
second_open_closes_win,
remember_window_positions,
window_snap_distance,
gui_drop_shadows,
cursor_overlay_color,
show_tooltips,
tooltip_delay,
tooltip_duration,
(new)
gui_theme

And the rest are indeed rather for theme use. But before moving things around, back to the original question: Should the values then always default before loading, or should the current values be retained?

Leartin

I think defaulting is better, since it makes sure each theme looks as intended.
For those size-parameters you suggest for simuconf, could we perhaps get another parameter "persistant_size_settings" which, if on, disallows those parameters to be changed by themes, but if off, themes change them (and default them)?
Normally you would expect themes to change those, and it would be strange if they don't. But on the other hand, some users (small pixels, bad eyesight) would surely be annoyed if they can't persist, which might lead them to not change themes at all.

By the way, if the parameters you listed are in the "simuconf.tab", which is also loaded from the pakset folder, does that mean with gui_theme, the pakset may finally choose the theme? If so, since that would only work if the theme is installed, could I persuade you to add a p192c-theme to the main game?

prissi

Yes, pak192 them could be part of the source. But you one could just add a folder themes to the pak and upon installation, the themes will be added to the thems folder, like pak64.german does  (That is why the zip always should start at the simutrans folder.)

I think size parameters should be in simuconf.tab and the themes. But some thing (like font size), needs to be theme independent. Or one would not to be able to read anything on smaller (11" 2k) screens ...