The International Simutrans Forum

 

Author Topic: New themed colour parameters  (Read 3597 times)

0 Members and 1 Guest are viewing this topic.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
New themed colour parameters
« on: May 04, 2014, 10:08:47 PM »
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:
Code: [Select]
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.
« Last Edit: May 05, 2014, 02:00:56 AM by An_dz »

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New themed colour parameters
« Reply #1 on: May 16, 2014, 07:16:04 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: New themed colour parameters
« Reply #2 on: May 16, 2014, 09:29:51 PM »
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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New themed colour parameters
« Reply #3 on: May 17, 2014, 09:29:32 PM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: New themed colour parameters
« Reply #4 on: May 21, 2014, 10:07:37 PM »
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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New themed colour parameters
« Reply #5 on: May 23, 2014, 12:05:52 AM »
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.

Offline Michael 'Cruzer'

  • Devotee
  • *
  • Posts: 206
  • Founder of pak192.comic
    • Marktplatz für Parkplätze
  • Languages: DE, EN
Re: New themed colour parameters
« Reply #6 on: August 03, 2014, 02:25:13 PM »
Any progress on this patch? Sounds interesting with much potential. I hope you don't throw off this project.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New themed colour parameters
« Reply #7 on: August 04, 2014, 01:46:48 AM »
I have paused it for a while but I keep updating my working copy so the code doesn't get incompatible.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: New themed colour parameters
« Reply #8 on: September 16, 2014, 09:38:47 PM »
So what is the stand: Wait for the full RGB conversion?

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New themed colour parameters
« Reply #9 on: September 21, 2014, 03:25:37 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: New themed colour parameters
« Reply #10 on: September 21, 2014, 08:41:12 PM »
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.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: New themed colour parameters
« Reply #11 on: September 21, 2014, 11:32:59 PM »
Done, in r7331.

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