Page 1 of 2

[Patch]Local authority rating in town label

Posted: 28 Feb 2008 18:01
by Vikthor
This patch adds option for displaying rating local player has in town in(or rather just under) town name label. You can see direct feedback of your actions, without having to have town window opened. It's useful especially when working near more cities, where your screen could be pretty cluttered. This patch does not bump savegame version, it saves setting in cfg.

Re: [Patch]Local authority rating in town label

Posted: 28 Feb 2008 19:59
by Falco00
Works great, now i can finally see how many trees i have to build to get a good rating :D

Using a second line of text is a bit too much tho, maybe change it into a smiley or a simple collored dot behind the townname.

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 06:27
by Trond
Works like a charm as far as I can tell. However, I dont see any need for an empty line between townname and rating atleast. Besides that I like it! Also a plus that it uses strings already there, so its already in my language.

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 09:53
by Bilbo
Very nice and well commented patch. Just I thought of one improvement - if the rating is too low to build stations, perhaps print the rating in yellow to alert about the problem? Or maybe even use different colors for different ratings (some color scale like red - orange - yellow - light green - dark green - white - light blue - dark - blue or alike ... )

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 09:58
by Maedhros
What happens when you're watching a network game as a spectator?

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 10:27
by Vikthor
Falco00 wrote:Using a second line of text is a bit too much tho, maybe change it into a smiley or a simple collored dot behind the town name.
Hmm, maybe it could be patch setting, perhaps I could reuse the dot in server-list window.
On the other hand i don't want to bloat the patch too much.
Trond wrote:However, I dont see any need for an empty line between town name and rating at least.
That line is there because it has to be displayed correctly on two zoom levels, if I take it out, in normal zoom, it would overlap on the second AFAIK.
Bilbo wrote:Very nice and well commented patch.
Thanks, in fact I was not sure about the code, so I posted it here, to get some comments before I post to FS.
Bilbo wrote:if the rating is too low to build stations, perhaps print the rating in yellow to alert about the problem? Or maybe even use different colors for different ratings (some color scale like red - orange - yellow - light green - dark green - white - light blue - dark - blue or alike ... )
This would require to make a few strings of style {GREEN} {STRING}, {RED}{STRING} etc. and then choose appropriate one. Or is there something along the line {COLOUR} and pass colour as a parameter?(If not, this is idea for patch).
Maedhros wrote:What happens when you're watching a network game as a spectator?

I hope nothing, the rating is not drawn, I used this

Code: Select all

if (_patches.rating_in_label && HasBit(t->have_ratings,_local_player))
and spectator should not have rating in any city.

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 10:52
by Trond
Vikthor wrote:
Trond wrote:However, I dont see any need for an empty line between town name and rating at least.
That line is there because it has to be displayed correctly on two zoom levels, if I take it out, in normal zoom, it would overlap on the second AFAIK.
Yes, you're right, I just checked it.

I agree with bilbo's idea, a colorscheme to match the rating wuld be really nice! But not sure you can make that and still keep the same strings so my language text is already there, but I can live with that :) (but maybe it lowers chance to get it into trunk? I sure hope it will get into trunk, because this is really a great addition).

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 11:22
by richk67
Great idea. It may look better - more discrete - if the rating were displayed as a graphic. I would suggest a coloured meter bar (like a progress bar) that starts at dark red at left, and goes via red, orange, yellow, light green, green, blue, etc. for the various rating levels. This way, the rating is displayed in the same amount of space regardless of the user's language settings.

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 11:56
by PhilSophus
Just a side note: There used to be some patch where a change in rating was displayed as a rising green or red text (the same way as incomes/expenses are). I agree that being able to also see the current rating without a change is even better.

As for the colors: I would prefer using only colors between red and green (i.e. hues of red, orange, yellow, green) as these are intuitively understandable (even if that means assigning the same color to multiple rating levels). I don't think that blue or white would be that clear.

Re: [Patch]Local authority rating in town label

Posted: 29 Feb 2008 16:39
by Vikthor
richk67 wrote:It may look better - more discrete - if the rating were displayed as a graphic. I would suggest a coloured meter bar (like a progress bar) that starts at dark red at left, and goes via red, orange, yellow, light green, green, blue, etc. for the various rating levels.
I have tried this, so far not with a bar but with blop from server list. It should display green for ratings good and better, yellow for poor and better and red for the rest. The problem is, it shows nothing at all. My bet is that it gets overwritten with other sprites, I do not know if DrawSprite is right function to use. If somebody has better experience with how the sprites work in OTTD, please tell me.

Re: [Patch]Local authority rating in town label

Posted: 01 Mar 2008 03:56
by Trond
How about using the colors on the cityname itself? Green cityname for good rating and red cityname for bad, and then the yellowish inbetween?

Re: [Patch]Local authority rating in town label

Posted: 02 Mar 2008 17:51
by Vikthor
Also a possibility, for now you can't turn population off if you use this, it may change in future(I may add other strings, or maybe somebody can suggest better solution?). OK now we have 2(3 if I can get the sprites to show) options how to do it, now we have to choose the best from them, so any comments?

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 07:44
by Trond
Vikthor wrote:Also a possibility, for now you can't turn population off if you use this, it may change in future(I may add other strings, or maybe somebody can suggest better solution?). OK now we have 2(3 if I can get the sprites to show) options how to do it, now we have to choose the best from them, so any comments?
Sorry, but I'm not familiar with this kinda patch. Tortoise complains about some missing index line, and BOTTD just tells me its an unrecognized patch... So I cant see what it looks like, nor test it. If anyone feel like making a svn patch of it that would be really neat.

Also, eventough I havent seen it yet, I've was thinking this could be confusing if you play red or green CC and townnames get the same colors... This is just in my head so far, as I still havent got to test it :)

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 07:48
by Zhall
Why not have all the information? XD

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 10:14
by Vikthor
Is there some standard for .diff? If so, somebody should report it either to TortoiseSVN or Git.
Anyway, here is SVN diff.
Sapphire united wrote:Why not have all the information? XD
The problem is now it shows either all the information(town namer+rating + population) or town name + pop. or only town name, it's currently impossible to show town name + rating, but maybe it does not matter, or maybe I will change after we settle which option to show rating is best to use.

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 10:30
by Roujin
Well, maybe not a standard, but I think more people are able to apply SVN diffs than another format. Also because of the tool BuildOTTD, which understands SVN diffs only.

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 10:46
by Trond
That works out really well for me tbh, only thing I did notice is that its only the 2 innermost zooms that will color the name, not a big deal, just noticed it... Anyway, I like it :)

EDIT: Cant you just put in both/all methods and make an option so people can choose how they like it? Just use arrow to select it in patch config window. Under Cityname/Colored Cityname/Bar With Blop/Sprites/more options. That way you will still also use only one line on the patchconfig window...

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 12:22
by Ammler
Screeens available for lazy guys like me? ;-)

Re: [Patch]Local authority rating in town label

Posted: 04 Mar 2008 12:47
by Trond
Rating under cityname
Rating under cityname
Clipboard01.png (56.32 KiB) Viewed 7911 times
Rating colors cityname
Rating colors cityname
Clipboard02.png (34.73 KiB) Viewed 7907 times

Re: [Patch]Local authority rating in town label

Posted: 05 Mar 2008 16:03
by Vikthor
Trond wrote:That works out really well for me tbh, only thing I did notice is that its only the 2 innermost zooms that will color the name, not a big deal, just noticed it... Anyway, I like it :)
I know, but adding it for more zoomed out levels would require even more new strings, I don't know if it is good idea.
Trond wrote: EDIT: Cant you just put in both/all methods and make an option so people can choose how they like it? Just use arrow to select it in patch config window. Under Cityname/Colored Cityname/Bar With Blop/Sprites/more options. That way you will still also use only one line on the patchconfig window...
OpenTTD devs stated that they don't see need for everything to be set by patch settings. I think we can reach consensus on which option is best and use it. It is doable but it would complicate things for me and for anybody who would review that patch.
EDIT: I got a request for update, so here it is(only coloured townlabel) - not that there was much to update :D