Patch: Town rating indicator
Moderator: OpenTTD Developers
Patch: Town rating indicator
I have written a patch which shows changes of rating for a town. It adds an entry in the patch settings, the patch is disabled by default.
Update: Fixed the overlapping raising messages by offset the positions for each kind of rating.
Update2: Added new patch which creates a OffsetByTownRating function, this patch now use this.
Update3: Fixed a bug where town ratings of all players are shown
Update: Fixed the overlapping raising messages by offset the positions for each kind of rating.
Update2: Added new patch which creates a OffsetByTownRating function, this patch now use this.
Update3: Fixed a bug where town ratings of all players are shown
- Attachments
-
- Example how it looks
- townrating_indicator.png (137.05 KiB) Viewed 10350 times
-
- OffsetByTownRating.diff
- Patch for function OffsetByTownRating()
- (2.13 KiB) Downloaded 353 times
-
- townrating_indicator.diff
- Patch for town rating indicator (needs OffsetByTownRating patch from this post)
- (5.5 KiB) Downloaded 397 times
Last edited by Progman on 07 Sep 2007 21:26, edited 4 times in total.
Re: Patch: Town rating indicator
Make screenshots in english please so we can actually read what your rating is now!
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Re: Patch: Town rating indicator
Does it float up like the cost?
Re: Patch: Town rating indicator
yes, it starts above the town name so it doesn't get in conflict with costs for a town action like ads or bribe.
-
- Chairman
- Posts: 776
- Joined: 20 Jan 2007 12:08
- Location: Germany
Re: Patch: Town rating indicator
Nice little patch. I often have open the town window while building to watch my rating. This patch would avoid it.
Some small notes if you want to get it into trunk:
Some small notes if you want to get it into trunk:
- Use tabs for indentation not spaces. For whitespace within the line use spaces not tabs. (see the coding style for details).
- The GUI stuff should probably be in a function in town_gui.cpp and only be called from town_cmd.cpp.
"The bigger the island of our knowledge, the longer the shore of our ignorance" - John A. Wheeler, Physicist, 1911-2008
- Sir A. Boey
- Transport Coordinator
- Posts: 299
- Joined: 17 Nov 2006 17:40
- Location: Everywhere and nowhere
Re: Patch: Town rating indicator
Great Patch nice idea...
Hope to see this implemented soon...
Hope to see this implemented soon...
_____________# If you believe in it, you can achieve it" # ____________
__________________# Check out My Closed Platform #___________________
Re: Patch: Town rating indicator
awesome stuff, what does it show, when a town has no rating for you ?
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Patch: Town rating indicator
Interesting feature.
The selection of the StringID based on ratings is now done with 3 times the same code, two times in town_cmd.cpp and one time in town_gui.cpp.
It would be preferable to make it a function, probably an inline one in town.h
The selection of the StringID based on ratings is now done with 3 times the same code, two times in town_cmd.cpp and one time in town_gui.cpp.
It would be preferable to make it a function, probably an inline one in town.h
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Re: Patch: Town rating indicator
Fixed the overlapping rating messages
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: Patch: Town rating indicator
I also find it very practical. I do not need to have the town window open all the time.
Hope to see it soon into the trunk.
Hope to see it soon into the trunk.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Re: Patch: Town rating indicator
Maybe it is even more useful to have a small icon next to a town indicating what the town things of you.. like a double -- is bad, and a double ++ is perfect! In between we have -, o, and +. As I always have to open the darn window to see if I should plan a window there or not... just my 2 cents, no idea what other devs think of it
The only thing necessary for the triumph of evil is for good men to do nothing.
Re: Patch: Town rating indicator
I have added a OffsetByTownRating() function which can be used to get the correct StringID based on the given rating. This function returns an offset between 0 and 7 which must be added to the STR_3035_APPALLING value. I used the StringID return type although this function doesn't return a string from the lang-files. I'm not sure if it is the proper return type, I just try to avoid compiling errors/warnings about type casting with "StringID + int". My patches uses tabs for indents as specific in the coding style. Check the first post for the patch files.
Re: Patch: Town rating indicator
I have been thinking about exactly such a thingTrueLight wrote:Maybe it is even more useful to have a small icon next to a town indicating what the town things of you.. like a double -- is bad, and a double ++ is perfect! In between we have -, o, and +. As I always have to open the darn window to see if I should plan a window there or not... just my 2 cents, no idea what other devs think of it
being able to see the town rating directly in some way would be awesome
- belugas
- OpenTTD Developer
- Posts: 1507
- Joined: 05 Apr 2005 01:48
- Location: Deep down the deepest blue
- Contact:
Re: Patch: Town rating indicator
Good work, Progman
TrueLight, I like the idea. Seems like a good bonus
TrueLight, I like the idea. Seems like a good bonus
If you are not ready to work a bit for your ideas, it means they don't count much for you.
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
OpenTTD and Realism? Well... Here are a few thoughs on the matter.
He he he he
------------------------------------------------------------
Music from the Bloody Time Zones
Re: Patch: Town rating indicator
I just noticed a small "bug".
The rating message is shown for any player. You might add the player name in the message, or don't display the message when the current message isn't aimt for the current player
I just got spamed in several cities while an AI opponent was... Just erasing an entire city !
I thought the messages were for me, I almost got an heart attack
The rating message is shown for any player. You might add the player name in the message, or don't display the message when the current message isn't aimt for the current player
I just got spamed in several cities while an AI opponent was... Just erasing an entire city !
I thought the messages were for me, I almost got an heart attack
Re: Patch: Town rating indicator
fixed, added just a "_local_player == _current_player" checkMagicBuzz wrote:The rating message is shown for any player. You might add the player name in the message, or don't display the message when the current message isn't aimt for the current player
Re: Patch: Town rating indicator
i'd also prefer an option where your rating stays in veiw, like the town name
- Vaulter
- Traffic Manager
- Posts: 185
- Joined: 21 Dec 2004 05:35
- Skype: andrey-zaharov
- Location: St. Petersburg, Russia
- Contact:
Re: Patch: Town rating indicator
Bumped to trunk (r22604)
added Russian translate.
added Russian translate.
- Attachments
-
- townrating-indicator.r22604M.patch
- (9.46 KiB) Downloaded 291 times
- JacobD88
- Chief Executive
- Posts: 708
- Joined: 16 Aug 2008 17:51
- Location: Long Eaton, Nottinghamshire. UK
- Contact:
Re: Patch: Town rating indicator
Wow, fantastic bump Vaulter, subscribing to this thread as i wasn't aware of this patch.
Thank-you for your continued updates of so many great old patches around the forums, it's greatly appreciated
Thank-you for your continued updates of so many great old patches around the forums, it's greatly appreciated
High-Functioning Autistic & Proud... National Autistic Society * Asperger Foundation
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
My (O)TTD Work...BIGGER DEPOTS (REL.) & SERVICING-STATIONS (WIP) * Advanced DEPOT DESIGNS * SCREENSHOTS
My personal website is occasionally here - sometimes it's just the family site - it's basically a lucky dip
Re: Patch: Town rating indicator
Is it hard to bump such an old patch?Vaulter wrote:Bumped to trunk (r22604)
Who is online
Users browsing this forum: No registered users and 5 guests