summaryrefslogtreecommitdiff
path: root/src/player_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-15 17:49:50 +0000
committerrubidium <rubidium@openttd.org>2007-11-15 17:49:50 +0000
commita731bc5812140f26c053ddddfd27f47836537e12 (patch)
treede8d36b01fc8b5be7e10ebd039d4b99e97decb64 /src/player_gui.cpp
parent18dacd34e5e2f2f6d3584834e06c1362c0d22866 (diff)
downloadopenttd-a731bc5812140f26c053ddddfd27f47836537e12.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.cpp15
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);