[Patch]Local authority rating in town label
Moderator: OpenTTD Developers
[Patch]Local authority rating in town label
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.
- Attachments
-
- rating_r12304_svn.diff
- (7.68 KiB) Downloaded 314 times
Re: [Patch]Local authority rating in town label
Works great, now i can finally see how many trees i have to build to get a good rating
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.

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
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.
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: [Patch]Local authority rating in town label
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 ... )
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: [Patch]Local authority rating in town label
What happens when you're watching a network game as a spectator?
No-one's more important than the earthworm.
Re: [Patch]Local authority rating in town label
Hmm, maybe it could be patch setting, perhaps I could reuse the dot in server-list window.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.
On the other hand i don't want to bloat the patch too much.
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.Trond wrote:However, I dont see any need for an empty line between town name and rating at least.
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:Very nice and well commented patch.
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).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 ... )
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))
Re: [Patch]Local authority rating in town label
Yes, you're right, I just checked it.Vikthor wrote: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.Trond wrote:However, I dont see any need for an empty line between town name and rating at least.
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

..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: [Patch]Local authority rating in town label
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.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: [Patch]Local authority rating in town label
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.
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.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
Re: [Patch]Local authority rating in town label
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.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.
- Attachments
-
- lameter_r12320.diff
- output of git diff, apply with -p1 or edit out "a/" and "b/" prefixes from path
- (4.35 KiB) Downloaded 235 times
Re: [Patch]Local authority rating in town label
How about using the colors on the cityname itself? Green cityname for good rating and red cityname for bad, and then the yellowish inbetween?
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: [Patch]Local authority rating in town label
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?
- Attachments
-
- towncolourlabel_r12324.diff
- output of git diff, apply with -p1 or edit out "a/" and "b/" prefixes from path
- (5.5 KiB) Downloaded 235 times
Re: [Patch]Local authority rating in town label
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.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?
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

Last edited by Trond on 04 Mar 2008 08:22, edited 1 time in total.
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
- Zhall
- Tycoon
- Posts: 1237
- Joined: 17 Jul 2007 01:36
- Skype: moonray_zdo
- Location: Teh matrix, duh.
- Contact:
Re: [Patch]Local authority rating in town label
Why not have all the information? XD
Formerly known as Sapphire United.
Learn Openttd
Learn Planetary Annihilation
Learn Orbit
Whose poo?
Learn Openttd
Learn Planetary Annihilation
Learn Orbit
Whose poo?
Re: [Patch]Local authority rating in town label
Is there some standard for .diff? If so, somebody should report it either to TortoiseSVN or Git.
Anyway, here is SVN diff.
Anyway, here is SVN diff.
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.Sapphire united wrote:Why not have all the information? XD
- Attachments
-
- towncolourlabel_r12324_SVN.diff
- (5.3 KiB) Downloaded 221 times
Re: [Patch]Local authority rating in town label
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
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...

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...
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: [Patch]Local authority rating in town label
Screeens available for lazy guys like me? 

Town Names:


Still work in progress: OpenGFX or/and OpenSFX - Please help!
Re: [Patch]Local authority rating in town label
..: Trond :.. because you deserve it! 
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
The whole problem with the world is that fools and fanatics are always so certain of themselves,
and wiser people so full of doubts.
Bertrand Russell
MyGRFs: Norwegian Funny Town Names 4 | LOTR & WoW Town Names 2 | Islandic Town Names 1 | Random Norwegian Town Names
Favorites: GRFCrawler | ISR | WIKI | Now Playing: OpenTTD 1.3.2 w/YAPP 3.0-RC3.9ish
Re: [Patch]Local authority rating in town label
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: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
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.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...
EDIT: I got a request for update, so here it is(only coloured townlabel) - not that there was much to update

- Attachments
-
- lacolourlabe_r12346_SVN.diff
- (5.3 KiB) Downloaded 249 times
Who is online
Users browsing this forum: No registered users and 12 guests