summaryrefslogtreecommitdiff
path: root/src/player_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-14 15:24:34 +0000
committerrubidium <rubidium@openttd.org>2007-06-14 15:24:34 +0000
commit46e531da725d7e39ff7b569b7ce2cdc68cf09e60 (patch)
tree04c4a363bfd59a1ef12e81e7c265442fbf62fbe7 /src/player_gui.cpp
parent5d55a9435b604c861b91c0bb64f4202a9006f384 (diff)
downloadopenttd-46e531da725d7e39ff7b569b7ce2cdc68cf09e60.tar.xz
(svn r10158) -Codechange: port some changes from NoAI and FS#872 to make the loan commands a little better readable.
Diffstat (limited to 'src/player_gui.cpp')
-rw-r--r--src/player_gui.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/player_gui.cpp b/src/player_gui.cpp
index 861c4182f..252b14572 100644
--- a/src/player_gui.cpp
+++ b/src/player_gui.cpp
@@ -156,15 +156,19 @@ static void PlayerFinancesWndProc(Window *w, WindowEvent *e)
PlayerID player = (PlayerID)w->window_number;
const Player *p = GetPlayer(player);
+ /* Borrow/repay buttons only exist for local player */
if (player == _local_player) {
- /* borrow/repay buttons only exist for local player */
+ /* Borrow button only shows when there is any more money to loan */
+ SetWindowWidgetDisabledState(w, 6, p->current_loan == _economy.max_loan);
+
+ /* Repay button only shows when there is any more money to repay */
SetWindowWidgetDisabledState(w, 7, p->current_loan == 0);
}
SetDParam(0, p->name_1);
SetDParam(1, p->name_2);
SetDParam(2, GetPlayerNameString(player, 3));
- SetDParam(4, 10000);
+ SetDParam(4, LOAN_INTERVAL);
DrawWindowWidgets(w);
DrawPlayerEconomyStats(p, (byte)WP(w, def_d).data_1);