diff options
author | rubidium <rubidium@openttd.org> | 2007-11-15 17:49:50 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-11-15 17:49:50 +0000 |
commit | 56b1317e7050a4d1dc399b1fe00fb0608eca309f (patch) | |
tree | de8d36b01fc8b5be7e10ebd039d4b99e97decb64 /src/player_gui.cpp | |
parent | 72542b1bce374b555294fcb8f1ce641c429c212e (diff) | |
download | openttd-56b1317e7050a4d1dc399b1fe00fb0608eca309f.tar.xz |
(svn r11435) -Codechange: show all players who have shares, not just the first two. Patch by SmatZ.
Diffstat (limited to 'src/player_gui.cpp')
-rw-r--r-- | src/player_gui.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/player_gui.cpp b/src/player_gui.cpp index 8180b7b1b..e71d25b0b 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -1038,21 +1038,18 @@ int GetAmountOwnedBy(const Player *p, PlayerID owner) static void DrawCompanyOwnerText(const Player *p) { const Player *p2; - int num = -1; + uint num = 0; + const byte height = GetCharacterHeight(FS_NORMAL); FOR_ALL_PLAYERS(p2) { uint amt = GetAmountOwnedBy(p, p2->index); if (amt != 0) { - num++; + SetDParam(0, amt * 25); + SetDParam(1, p2->index); - SetDParam(num * 2 + 0, amt * 25); - SetDParam(num * 2 + 1, p2->index); - - if (num != 0) break; + DrawString(120, (num++) * height + 116, STR_707D_OWNED_BY, TC_FROMSTRING); } } - - if (num >= 0) DrawString(120, 124, STR_707D_OWNED_BY + num, TC_FROMSTRING); } /** @@ -1119,7 +1116,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e) DrawStringMultiCenter(48, 141, STR_7037_PRESIDENT, 94); SetDParam(0, CalculateCompanyValue(p)); - DrawString(110, 114, STR_7076_COMPANY_VALUE, TC_FROMSTRING); + DrawString(110, 106, STR_7076_COMPANY_VALUE, TC_FROMSTRING); DrawCompanyOwnerText(p); |