mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-19 13:41:11 +00:00
(svn r3) -[1005611] Player Window patch: When looking in dropdownlist for player stuff, it will say
for all human players (Player #), not only for the first 2
This commit is contained in:
parent
804f038594
commit
e4940ebc79
@ -83,7 +83,7 @@ void SubtractMoneyFromPlayer(int32 cost);
|
||||
void SubtractMoneyFromPlayerFract(byte player, int32 cost);
|
||||
bool CheckOwnership(byte owner);
|
||||
bool CheckTileOwnership(uint tile);
|
||||
StringID GetPlayerNameString(byte player);
|
||||
StringID GetPlayerNameString(byte player, byte index);
|
||||
|
||||
/* standard */
|
||||
void ShowInfo(const char *str);
|
||||
|
@ -212,7 +212,7 @@ static void GraphLegendWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
SET_DPARAM16(0, p->name_1);
|
||||
SET_DPARAM32(1, p->name_2);
|
||||
SET_DPARAM16(2, GetPlayerNameString(p->index));
|
||||
SET_DPARAM16(2, GetPlayerNameString(p->index, 3));
|
||||
DrawString(21,17+p->index*12,STR_7021,HASBIT(_legend_showbits, p->index) ? 0x10 : 0xC);
|
||||
}
|
||||
break;
|
||||
@ -823,8 +823,8 @@ static void CompanyLeagueWndProc(Window *w, WindowEvent *e)
|
||||
SET_DPARAM16(1, p->name_1);
|
||||
SET_DPARAM32(2, p->name_2);
|
||||
|
||||
SET_DPARAM16(3, GetPlayerNameString(p->index));
|
||||
SET_DPARAM16(4, GetPerformanceTitleFromValue(p->old_economy[1].performance_history));
|
||||
SET_DPARAM16(3, GetPlayerNameString(p->index, 4));
|
||||
SET_DPARAM16(5, GetPerformanceTitleFromValue(p->old_economy[1].performance_history));
|
||||
|
||||
DrawString(2, 15 + i * 10, i == 0 ? STR_7054 : STR_7055, 0);
|
||||
DrawPlayerIcon(p->index, 27, 16 + i * 10);
|
||||
|
@ -1724,8 +1724,7 @@ STR_683B_HOSTILE :Hostile
|
||||
##id 0x7000
|
||||
STR_7000 :
|
||||
STR_7001 :{WHITE}{STRING}{BLACK}{STRING}
|
||||
STR_7002_PLAYER_1 : (Player 1)
|
||||
STR_7003_PLAYER_2 : (Player 2)
|
||||
STR_7002_PLAYER : (Player {COMMA16})
|
||||
STR_7004_NEW_FACE :{BLACK}New Face
|
||||
STR_7005_COLOR_SCHEME :{BLACK}Color Scheme
|
||||
STR_7006_COLOR_SCHEME :{GOLD}Color Scheme:
|
||||
|
@ -504,7 +504,7 @@ static void PlayerMenuWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
SET_DPARAM16(0, p->name_1);
|
||||
SET_DPARAM32(1, p->name_2);
|
||||
SET_DPARAM16(2, GetPlayerNameString(p->index));
|
||||
SET_DPARAM16(2, GetPlayerNameString(p->index, 3));
|
||||
|
||||
color = (byte)((p->index==sel) ? 0xC : 0x10);
|
||||
if (chk&1) color = 14;
|
||||
|
@ -134,8 +134,8 @@ static void PlayerFinancesWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
SET_DPARAM16(0, p->name_1);
|
||||
SET_DPARAM32(1, p->name_2);
|
||||
SET_DPARAM16(2, GetPlayerNameString((byte)w->window_number));
|
||||
SET_DPARAM32(3, 10000);
|
||||
SET_DPARAM16(2, GetPlayerNameString((byte)w->window_number, 3));
|
||||
SET_DPARAM32(4, 10000);
|
||||
DrawWindowWidgets(w);
|
||||
|
||||
DrawPlayerEconomyStats(p, (byte)WP(w,def_d).data_1);
|
||||
@ -480,7 +480,7 @@ static void PlayerCompanyWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
SET_DPARAM16(0, p->name_1);
|
||||
SET_DPARAM32(1, p->name_2);
|
||||
SET_DPARAM16(2, GetPlayerNameString((byte)w->window_number));
|
||||
SET_DPARAM16(2, GetPlayerNameString((byte)w->window_number, 3));
|
||||
|
||||
dis = 0;
|
||||
if (GetAmountOwnedBy(p, 0xFF) == 0) dis |= 1 << 8;
|
||||
|
@ -559,10 +559,13 @@ void RunOtherPlayersLoop()
|
||||
_current_player = 0;
|
||||
}
|
||||
|
||||
StringID GetPlayerNameString(byte player)
|
||||
// index is the next parameter in _decode_parameters to set up
|
||||
StringID GetPlayerNameString(byte player, byte index)
|
||||
{
|
||||
if (IS_HUMAN_PLAYER(player) && player < 2) // temporarily fixes the names in the list.
|
||||
return STR_7002_PLAYER_1+player;
|
||||
if (IS_HUMAN_PLAYER(player) && player < MAX_PLAYERS) {
|
||||
SET_DPARAM16(index, player+1);
|
||||
return STR_7002_PLAYER;
|
||||
}
|
||||
return STR_EMPTY;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e)
|
||||
|
||||
SET_DPARAM16(0, p->name_1);
|
||||
SET_DPARAM32(1, p->name_2);
|
||||
SET_DPARAM16(2, GetPlayerNameString(p->index));
|
||||
SET_DPARAM16(2, GetPlayerNameString(p->index, 3));
|
||||
|
||||
r = t->ratings[p->index];
|
||||
(str = STR_3035_APPALLING, r <= -400) || // Apalling
|
||||
@ -126,7 +126,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e)
|
||||
(str++, r <= 800) || // Excellent
|
||||
(str++, true); // Outstanding
|
||||
|
||||
SET_DPARAM16(3, str);
|
||||
SET_DPARAM16(4, str);
|
||||
DrawString(19, y, STR_2024, 0);
|
||||
y+=10;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user