News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

New themed colour parameters

Started by An_dz, May 04, 2014, 10:08:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

An_dz

As we were discussing here, the colour parameters of the theme file were broken, there was no consensus of what every entry should do and it had multiple names for the same thing.

This patch deletes all of them and create new ones easier to understand and that should theme everything possible. It doesn't colours everything right now as we need to fix the dialogs to use these colours, but will introduce the values to be used.

The new parameters are:

gui_color_text => Color to draw standard text
gui_color_text_highlight => Color to draw highlighted text (tabs, finance window headlines, ware list bonus text, fps info in video options, it and em tags)
gui_color_text_title => Color to draw title text (banner, h1 and a tags)
gui_color_text_shadow => Color to draw text shadow
gui_color_text_strong => Color to draw strong text (strong tags)

gui_color_edit_text => Color to draw text in edit areas
gui_color_edit_text_selected => Color to draw selected text in edit areas
gui_color_edit_text_disabled => Color to draw disabled text in edit areas
gui_color_edit_background_selected => Color to draw background of selected text in edit areas
gui_color_edit_beam => Color to draw the cursor beam

gui_color_chart_background => Color to draw background of charts
gui_color_chart_lines_zero => Color to draw in-chart horizontal zero line
gui_color_chart_lines_odd => Color to draw in-chart vertical odd lines and text
gui_color_chart_lines_even => Color to draw in-chart vertical even lines and text

gui_color_list_text_selected_focus => Colour to draw the selected element text in list when window has focus
gui_color_list_text_selected_nofocus => Colour to draw the selected element text in list when window is not in focus
gui_color_list_background_selected_f => Colour to draw the selected element background in list when window has focus
gui_color_list_background_selected_nf => Colour to draw the selected element background in list when window is not in focus

gui_color_button_text => Color to draw text in normal buttons
gui_color_button_text_disabled => Color to draw text in disabled buttons
gui_color_button_text_selected => Color to draw text in pressed normal buttons

gui_color_colored_button_text => Color to draw text in colored buttons
gui_color_colored_button_text_selected => Color to draw text in pressed colored buttons

gui_color_checkbox_text => Color to draw text in checkboxes
gui_color_checkbox_text_disabled => Color to draw text in disabled checkboxes

gui_color_ticker_background => Color to draw ticker background
gui_color_ticker_divider => Color to draw ticker divider

gui_color_statusbar_text => Color to draw text in statusbar
gui_color_statusbar_background => Color to draw statusbar background
gui_color_statusbar_divider => Color to draw statusbar divider

gui_highlight_color => Color to draw highlight dividers (tabs)
gui_shadow_color => Color to draw shadowed dividers (tabs)


Some things that this patch does as well that you might want to know why:

In banner.cc I changed the wiki site to http://wiki.simutrans.com/ because http://wiki.simutrans-germany.com/ may mislead the reader to think the wiki is in German.

In gui_convoiinfo.cc the gui_frame.h was included because MONEY_PLUS now uses the same colour from SYSCOL_TEXT, one reason why it was moved to bottom of simcolor.h

In money_frame.cc (finance window), the build headquarter button is changed to roundbox, as it was useless have it as box. The only use was to theme the colour of the button which is useless, this way I could remove SYSCOL_FACE which only changed this.

In component/gui_button.cc the default background_color was removed, because we always define the colour, the only button that did not I changed to roundbox.

In component/gui_scrollbar.cc I made the placeholder use the background image.

In component/gui_textinput.cc the password input was fixed by making the background use the themed image and centralising the cursor beam.

If you think that chart colours for odd/even are flipped, change to month view (it doesn't check the year number).

What needs to be fixed:
Need to dirty the state of statusbar and ticker when changing theme.

An_dz

So, any thoughts on this? So far the only error was removing the default colour of the button, because I got a compiler warning saying it must not be uninitialised. I've changed it to COL_WHITE.

prissi

I got a new computer and I am almost back to compile Simutrans again. I will look at it in the weekend.

But I think on everything (maybe with the exception of the colored boxes) there was consent.

An_dz

The colored boxes keep their original colours, only the text colour can be changed.

I'm attaching modified versions of 96comic & 192comic themes using this values, to help you to test.

prissi

Didn't you want to use the rgb routines, i.e. want to use rgb colors now? It may be a good moment to change the default type of the colors to PIXVAL and use _rgb routines. You probably have hit already all relevant places.

But I can submit the patch like it is now. Please advise.

An_dz

Yes, I wanted, but I was a little confused on RGB555 and RGB565. I've seen on simsys* some references for both, but now I understood how it works and I'm already using it.

I think the code may be merged as-is because at least new parameters will be already available. Converting the colours to PIXVAL doesn't look so straight forward, some calculations like color+1 doesn't make sense with PIXVAL. It may take a while to work them all.

Michael 'Cruzer'

Any progress on this patch? Sounds interesting with much potential. I hope you don't throw off this project.
Founder and Ex-Maintainer of pak192.comic. Provider of Simutrans Hosting rental service.

An_dz

I have paused it for a while but I keep updating my working copy so the code doesn't get incompatible.

prissi

So what is the stand: Wait for the full RGB conversion?

An_dz

That's what I guessed.

But the patch here can be committed as it doesn't change with the RGB conversion patch, and the dialogues can start using them. I can commit it if you and/or the other devs think it's ok.

I'm restarting to work on this patch, so I need to read my notes and what I have done so far to get back on track. Over 100 files changed for this. Most is working, most visible exception is the tooltips.

prissi

Yes, commit it. I was trying to keep the pending patches up, since before Christmas a new release (now with a half-height pak128 too) should be done.

An_dz

Done, in r7331.

I'm not defined in the authors file, the post-commit hook failed.