The International Simutrans Forum

 

Author Topic: waiting bars & colorbox theme-dependent  (Read 1020 times)

0 Members and 1 Guest are viewing this topic.

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1578
  • PAK-DEV P192C
  • Languages: DE, EN
waiting bars & colorbox theme-dependent
« on: February 15, 2020, 12:30:18 PM »
I wrote a patch :o

This patch makes this possible:

Code: [Select]
gui_indicator_height = 15
gui_indicator_width = 25
gui_waitingbar_width = 10

while also remaining to look like this with old themes:


Besides what you see in the screen, the travel-bar of convois is also affected. Don't know if anything else.

What I did:
- colorbox and minimap_frame referenced D_INDICATOR_HEIGHT already, but appearently it could not be loaded from the theme correctly. I copied how it works for other values.
- the goods list had 1px frames around the colorboxes, those were missing in the minimap. (I feel like the minimap should call colorbox, but not sure how that works)
- introduced D_WAITINGBAR_WIDTH for the waiting bars, default value of 4 is equal to how it currently looks.
- used D_LABEL_HEIGHT to make sure that the waiting bars stay above the name tag, no matter how large the name tag and the station indicator are.

- unrelated, but I kind of forgot that was the first thing I did and don't know if I can just manually delete it from the diff: Changed the overcrowd code for goods so a station without capacity counts as overcrowded. Obviously that should not be part of this.

I hope this works as intended, let me know it I made grave mistakes.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1624
    • Simutrans-BLOG
  • Languages: ES
Re: waiting bars & colorbox theme-dependent
« Reply #1 on: February 15, 2020, 03:56:59 PM »
Wow, this looks great, I'm going to try as soon as I have some time. :D

I would like to suggest something, the "load" bar that boring blue bar that we see when something is loaded, it would be good to be able to change the color, size or even its shape .... I have seen that the text does not make good contrast in some themes for example in the "blue white".

Offline Andarix

  • *
  • Posts: 277
  • Languages: de
Re: waiting bars & colorbox theme-dependent
« Reply #2 on: February 15, 2020, 04:15:35 PM »
The size of the indicators in the lists already exists since 120.0.1.

Code: [Select]
gui_indicator_size = 18,8

https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_ThemeDef&no_bl=y

Offline Leartin

  • Oh no, not him again!
  • Devotee
  • *
  • Posts: 1578
  • PAK-DEV P192C
  • Languages: DE, EN
Re: waiting bars & colorbox theme-dependent
« Reply #3 on: February 15, 2020, 05:01:31 PM »
The size of the indicators in the lists already exists since 120.0.1.

It's funny: You link to the wiki in an attempt to show that the info would be there, but don't stop to check that it actually says "gui_indicator_size - Useless right now".
Meanwhile, I literally wrote that it already existed, but did not work for me. Maybe I wrongfully trusted the wiki. Maybe it was just a typo. I'm so sorry for trying to fix something, rather than complaining about it.


I would like to suggest something, the "load" bar that boring blue bar that we see when something is loaded, it would be good to be able to change the color, size or even its shape .... I have seen that the text does not make good contrast in some themes for example in the "blue white".
I'm pretty much a monkey with a typewriter, I type random symbols, compile the game, and see if it did what I wanted. Please don't think for a second that I know what I'm doing, I would possibly have to spend hours just to figure out where the loading bar is in the code xD

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1624
    • Simutrans-BLOG
  • Languages: ES
Re: waiting bars & colorbox theme-dependent
« Reply #4 on: February 15, 2020, 05:39:05 PM »
@Leartin

Hahaha is the same thing that I do when I try to change something in the code, without knowing much what I do, it is good to know that I am not the only one. :P
 

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4878
  • Languages: EN, DE, AT
Re: waiting bars & colorbox theme-dependent
« Reply #5 on: February 15, 2020, 09:35:58 PM »
gui_indicator_size is working. Maybe it was not in older versions, but in the current version (and last release) this should work.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10675
  • Languages: De,EN,JP
Re: waiting bars & colorbox theme-dependent
« Reply #6 on: February 16, 2020, 01:15:11 AM »
I really appreciate a patch instead a request. So thank you for the efforts with the bar widths, this is incorporated in r8923

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1624
    • Simutrans-BLOG
  • Languages: ES
Re: waiting bars & colorbox theme-dependent
« Reply #7 on: March 08, 2020, 11:50:33 PM »

I'm pretty much a monkey with a typewriter, I type random symbols, compile the game, and see if it did what I wanted. Please don't think for a second that I know what I'm doing, I would possibly have to spend hours just to figure out where the loading bar is in the code xD
I searched a bit and found how to change the color of the bara load.  :P

I guess it shouldn't be very difficult to add a parameter for the color.

I have modified it to show a nice black bar.  8)
simloadingscreen.cc
Code: [Select]
        // progress
        display_fillbox_wh_rgb( quarter_width, bar_y + 4, bar_len,  bar_height - 8, color_idx_to_rgb(COL_BLACK), true );