News:

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

waiting bars & colorbox theme-dependent

Started by Leartin, February 15, 2020, 12:30:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Leartin

I wrote a patch :o

This patch makes this possible:

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.

Yona-TYT

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".

Andarix


Leartin

Quote from: Andarix on February 15, 2020, 04:15:35 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.


Quote from: Yona-TYT on February 15, 2020, 03:56:59 PMI 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

Yona-TYT

@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
 

Dwachs

gui_indicator_size is working. Maybe it was not in older versions, but in the current version (and last release) this should work.
Parsley, sage, rosemary, and maggikraut.

prissi

I really appreciate a patch instead a request. So thank you for the efforts with the bar widths, this is incorporated in r8923

Yona-TYT

Quote from: Leartin on February 15, 2020, 05:01:31 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
        // progress
        display_fillbox_wh_rgb( quarter_width, bar_y + 4, bar_len,  bar_height - 8, color_idx_to_rgb(COL_BLACK), true );