Page 1 of 2

Patch: Town rating indicator

Posted: 31 Aug 2007 12:42
by Progman
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

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 13:01
by XeryusTC
Make screenshots in english please so we can actually read what your rating is now!

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 13:12
by Zephyris
Does it float up like the cost?

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 13:14
by Progman
yes, it starts above the town name so it doesn't get in conflict with costs for a town action like ads or bribe.

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 13:28
by PhilSophus
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:
  • 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.

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 16:39
by Sir A. Boey
Great Patch nice idea... :shock:

Hope to see this implemented soon... :wink:

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 17:06
by Tom0004
awesome stuff, what does it show, when a town has no rating for you ?

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 17:12
by belugas
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

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 22:37
by Progman
Fixed the overlapping rating messages

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 23:50
by athanasios
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. :D

Re: Patch: Town rating indicator

Posted: 31 Aug 2007 23:54
by TrueBrain
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 ;)

Re: Patch: Town rating indicator

Posted: 01 Sep 2007 10:47
by Progman
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

Posted: 01 Sep 2007 13:51
by Psistorm
TrueLight 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 ;)
I have been thinking about exactly such a thing :D
being able to see the town rating directly in some way would be awesome

Re: Patch: Town rating indicator

Posted: 02 Sep 2007 01:05
by belugas
Good work, Progman

TrueLight, I like the idea. Seems like a good bonus :)

Re: Patch: Town rating indicator

Posted: 07 Sep 2007 19:12
by MagicBuzz
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 ;)

Re: Patch: Town rating indicator

Posted: 07 Sep 2007 21:26
by Progman
MagicBuzz 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 :)
fixed, added just a "_local_player == _current_player" check

Re: Patch: Town rating indicator

Posted: 07 Sep 2007 21:29
by Tom0004
i'd also prefer an option where your rating stays in veiw, like the town name

Re: Patch: Town rating indicator

Posted: 09 Jul 2011 22:23
by Vaulter
Bumped to trunk (r22604)
added Russian translate.

Re: Patch: Town rating indicator

Posted: 12 Jul 2011 21:01
by JacobD88
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 :bow:

Re: Patch: Town rating indicator

Posted: 14 Jul 2011 14:31
by Timmaexx
Vaulter wrote:Bumped to trunk (r22604)
Is it hard to bump such an old patch?