News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Text colors still missing by parameters

Started by Yona-TYT, May 12, 2020, 11:46:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT


I would like to work on a patch to manage the color of the text in places such as the server list, vehicle list or the construction list.


I am going to quote a bit of a previous discussion in order to continue discussing here:
Quote from: Leartin on March 13, 2020, 09:02:01 AM
IIRC, the issue was that those colors are referenced in the help file. Therefore, if those colors could be picked by the theme, the help file would be wrong.

There are solutions to this.
1) One could write the label of the checkmarks - "City attraction", "Land Attraction" and "Monument" - in the same color as they appear in the list. This would even increase readability to the point where the help file does not need to explain anymore which is which (or can just state "same color"), and no matter which color is chosen in the theme, it would always hold true.
2) The game could give a selection of colors referenced by name. Since they are named, the name can be translated, and no matter which colors the theme picks, the help file might provide the correct name for it.
3) Rather than referencing the color by name, the help file could show the color. eg. "blue text signifies a residential building" would be replaced by "residential building"

- I'm not sure though if help texts could cope with option 2 or 3 as they are, and if they can't, it's probably not worth implementing. But option one should be relatively easy, I think I could do that. However, since it does mean a change for everybody (even with default theme, those checkboxes would have colored text) and help texts would still require adjustment (even if it's just deletion of the clarification), I'd like to hear opinions first.
(And if I do it, should it only be 3 colors to be used by all dialogs, or should each dialog have their own?)

Quote from: Yona-TYT on March 15, 2020, 02:10:33 PM
I was thinking of creating new warning color parameters.
gui_color_text_alert_verygood = green color: They would be used in those green texts, but I think there must be other places like the finance window maybe.

gui_color_text_alert_good = blue color: They would be used in the list of buildings, but also in names of obsolete vehicles and the list of online servers.
gui_color_text_alert_normal = yellow color: They would be used for the names of vehicle lines, although I don't know where else this can be used.

gui_color_text_alert_bad = orange color: saturation alerts for example, I don't know where else it can be useful.

gui_color_text_alert_verybad = red color: They can be used in vehicles that cannot find the route, unassigned line names, servers that do not respond.

Another idea would be to call the parameters like this:
gui_color_text_style1 = Green
gui_color_text_style2 = Blue
gui_color_text_style3 = Yellow
gui_color_text_style4 = Red


I think orange has no use.  :P

Leartin

I think at the moment, the colors are hardcoded seperately. The build-industry-dialog uses textcolor, while build-curiosity uses black. However, using the same three colors in all lists where there is no special meaning, just seperation, would be fine.

As for meaningful color parameters:

Line management:
Everything in order
No vehicles
No vehicle moved yet
Loses money
Vehicle out of date

vehicle list
Everything in order
In depot
Not moved since start of year
Loses money
no route/stuck

stop list
Everything in order
no goods nor vehicles (not in use)
completely overcrowded
sometimes overcrowded

factory list
Everything in order/Optimal production
not connected
something is wrong
works, but not perfectly
no productivity

curiosity list
connected for pax
connected for mail
connected for pax and mail
all stations overcrowded
at least one station overcrowded
not connected

online playing
Same PaksetWrong Pakset
offline

So generally speaking:
Everything okay = green, black. It's black in text and green in boxes. I think that makes sense, since "normal" shouldn't change text color, but a black box would be weird. So only set a color for boxes and let black text be in normal text color (NOT black)
Nothing happened yet = yellow
Nothing can happen = white
worst case, pay attention = red
you might want to do something, pay attention = orange

I feel like there is an issue with the vehicle list. Money loss is certainly bad, but a stuck vehicle is worse. However, money loss is always red, eg. in the finance window, so that's a given. So should "no route" have the same color as "sometimes overcrowded" Should it be seperate?

This leaves "vehicle out of date", which has no color restrictions,
and three "Connected to" since Connected to pax should not be the same color definition as "okay" - even if someone chooses for it to be the same green, it needs to be it's own setting.

Therefore, you need (using "list_color_" as a prefix, could be anything:
list_color_good = green
list_color_verybad = red
list_color_bad = orange
list_color_ignore = white
list_color_uncertain = yellow

list_color_stuck = orange
list_color_ood = blue (out of date) makes kind of sense for servers as well

list_color_pax = green
list_color_mail = blue
list_color_paxmail = teal

as well as the three colors for curiosity builder etc. - technically, it could just be regular textcolor, paxcolor and mailcolor. But both mailcolor and paxcolor are restricted since they can't be the other colors used (bad, verybad, uncertain), while there is no need to restrict the other lists.

list_color_style1 = black
list_color_style2 = green
list_color_style3 = blue


Quite a bit more than the 4 you suggest.

Yona-TYT

Quote from: Leartin on May 13, 2020, 03:44:02 PMQuite a bit more than the 4 you suggest.
There are certainly many more, but I must admit that I haven't played a serious game in a long time, I think things have changed a bit since then, so I don't really have as much knowledge of the game as you do.  :P


For someone as bad in code as I am, this takes some time, I will start with the "curiosity builder etc." and the "online playing" window.
For the "builder" windows this seems good to me:
list_color_style1 = black
list_color_style2 = green
list_color_style3 = blue

For the servers window these?:list_color_good = verde
list_color_verybad = rojo
list_color_ood = azul (desactualizado) tiene sentido para los servidores también


prissi

#3
With color changes some colors are also in the help files does not match any more. Of course for trivial dialoges it does not matter.

But the dialog already uses SYSCOL_TEXT at least in the current nightly, and the text is black for me ...

Leartin

#4
Quote from: prissi on May 14, 2020, 12:00:14 PM
But the dialog already uses SYSCOL_TEXT at least in the current nightly, and the text is black for me ...
Factory and Citybuilding do, Curiosity use black (for monuments). Since the text color in the default theme is black, you wouldn't notice.
But the point was that each list has their own color definitions.

As for the help files, there are three suggestions above how to handle them:
- Showing colors in the dialogs so they don't need be explained in the help file (Eg. the checkbox label "Residential Buildings" uses the same color as the residential buildings in the list.)
- Defining a bunch of named colors that can be translated - basically like the forum text colors (HTML4/VGA)
- Allow colored text or colorboxes in help texts such that the same color is shown there.
It would be helpful to discuss which of those to use, and/or find other suggestions, since different approaches might lead different ways
(eg. if we go with named colors, it would make sense to name the player color sets and have one name reference 8 shades, but in return, the playercolors might need changes (hand-picked sets) )


Edit:
There is another text color. In messages, informations about new vehicles are currently pink (everything else is in playercolor, plus textcolor/black for neutral messages like new year). To remain backward compatible, this needs to be it's own color.

Yona-TYT

#5
I would like to use the same 3 colors "Green Blue and Black" in the server list, like this:
Without clicking on the server = Green color
After clicking on the server = Black color
Offline servers (old, obsolete) = Color Blue

What do you think ?.

It also seems to me that this "Black" color is out of place, for example in the list of constructions, etc. Can we use the color pink? the same color used when a new vehicle, I mention @leartin
QuoteIn messages, informations about new vehicles are currently pink
.

Leartin

Quote from: Yona-TYT on May 17, 2020, 02:09:21 AM
I would like to use the same 3 colors "Green Blue and Black" in the server list, like this:
Without clicking on the server = Green color
After clicking on the server = Black color
Offline servers (old, obsolete) = Color Blue

We don't need to decide on colors, and shouldn't. We should think of which elements may use the same color (defined in the theme). For backwards compatability, that also means two elements that currently don't share a color must be referenced differently.

As for the server colors, it's already a bit weird. In the other post, I claimed offline paksets to be white - which they are with my theme. They are red with standard theme. That's because they don't use a hardcoded color, they use "gui_color_text_strong" - the color used in help files for important sections, which just so happened to be red. I think it's obvious that it should not do that.

Furthermore, it seems to display in blue all servers that claim to have a different revision, but once you click on them, it actually checks and displays the server in the list with black/textcolor, but shows unmatching pak in red/strongtext in the details.

Anyway, my opinion:

Server claims to have different pakset/revision: list_color_ood = blue (same as for vehicles out of date)
Server offline: list_color_ignore = white (you should focus on the other entries, not those that are offline)

If possible:
Untested Server claims same pakset: textcolor
Tested Server, confirmed compatability: list_color_good = green
Tested Server, confirmed incompatability: list_color_bad = orange

Else:
Maybe just use textcolor and let the details do the talking (where an unmatching pakset would be the verybad-color rather than strong)

In this case, there is a bit more leeway, since the current implementation is already slightly theme dependent and needs to be "fixed" anyway. I think it's fine to reuse the same color definitions as for the other lists.

Btw. if you are gonna do this, using the offline color on the "show offline" button and the different-pakset-color on the "show incompatible" button would be a nice touch to help explaining the colors without help file.

Quote from: Yona-TYT on May 17, 2020, 02:09:21 AMIt also seems to me that this "Black" color is out of place, for example in the list of constructions, etc. Can we use the color pink? the same color used when a new vehicle, I mention @leartin

Remember: You don't choose colors. You choose color references. I think it's best to have three variables for these lists (style1, style2, style3). The default for those would be blue, green and black, but your theme might use pink instead. I don't think it makes much sense to link the "new vehicle" message color with the list colors, that's the same kind of mess as using the strong-text color for offline servers. Plus, to be backwards compatible, you need to be able to set that color to pink without changing anything else to pink.

prissi

Partially introduced in r9101. Please check it.

Yona-TYT

#8
Quote from: prissi on May 17, 2020, 03:06:52 PM
Partially introduced in r9101. Please check it.
I don't agree with using "MONEY_MINUS" in the server list, wouldn't it be better to use green color?, Something contrary to "obsolete" like "recent" or "new".
Example:
gui_color_new

I am referring to the yellow color "SYSCOL_TEXT_UNUSED", for a moment I thought I was using the color of currency (MONEY_PLUS). :p

Leartin

Quote from: Yona-TYT on May 17, 2020, 11:26:09 PMI don't agree with using "MONEY_MINUS" in the server list, wouldn't it be better to use green color?

There must be a misunderstanding, "MONEY_MINUS" is used instead of "SYSCOL_TEXT_STRONG" in places where the text was already meant to be red. Certainly you don't want an unreachable or unmatching server to be green?


I was unaware of "MONEY_PLUS" and "MONEY_MINUS" as well as "SYSCOL_TEXT_UNUSED". The later two are equivalent to what I considered verybad and uncertain, and could be used as such (if they aren't already). I wouldn't mind "MONEY_PLUS" in line management and vehicle list for "everything's fine". I dislike the names, but I'm  two years late to that party.

Yona-TYT

#10
Quote from: Leartin on May 18, 2020, 11:44:51 AMThere must be a misunderstanding, "MONEY_MINUS" is used instead of "SYSCOL_TEXT_STRONG" in places where the text was already meant to be red. Certainly you don't want an unreachable or unmatching server to be green? 
How clumsy of me, my mistake .... I am referring to the yellow color "SYSCOL_TEXT_UNUSED", for a moment I thought I was using the color of currency (MONEY_PLUS). hehehe X_X

Edit:

Quote from: Yona-TYT on May 18, 2020, 12:46:55 PMThe later two are equivalent to what I considered verybad and uncertain, and could be used as such (if they aren't already).

This is where I prefer to use a green or white color.