From 82450356fd143ca97952ee84484ba6275d03ffc3 Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 8 Jul 2010 19:44:00 +0000 Subject: [PATCH] (svn r20092) [1.0] -Backport from trunk: - Fix: Do not close the sort dropdown in the (original) vehicle list when there are no vehicles. That code is meant for the "actions" dropdown [FS#3881] (r20014) - Fix: When joining a company with a password you could only enter 20 characters of the password (r20012) - Fix: Sign sorting was unstable [FS#3893] (r20009) - Fix: Trains should also have running cost while slowing down for stop (r20006) - Fix: [NewGRF] Stringcodes 82, 83 and 84 were not properly converted to openttd codes so they did not work (r20004) --- src/company_gui.cpp | 2 +- src/network/network_gui.cpp | 2 +- src/newgrf_text.cpp | 2 +- src/signs_gui.cpp | 4 +++- src/train_cmd.cpp | 2 +- src/vehicle_gui.cpp | 4 +++- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/company_gui.cpp b/src/company_gui.cpp index ce9242c2b3..d97ed0612e 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -1984,7 +1984,7 @@ struct CompanyWindow : Window MarkWholeScreenDirty(); } else if (NetworkCompanyIsPassworded(company)) { /* ask for the password */ - ShowQueryString(STR_EMPTY, STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION, 20, 180, this, CS_ALPHANUMERAL, QSF_NONE); + ShowQueryString(STR_EMPTY, STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION, NETWORK_PASSWORD_LENGTH, 180, this, CS_ALPHANUMERAL, QSF_NONE); } else { /* just send the join command */ NetworkClientRequestMove(company); diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 04df337713..0f066d0758 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -2259,7 +2259,7 @@ void ShowNetworkNeedPassword(NetworkPasswordType npt) case NETWORK_GAME_PASSWORD: caption = STR_NETWORK_NEED_GAME_PASSWORD_CAPTION; break; case NETWORK_COMPANY_PASSWORD: caption = STR_NETWORK_NEED_COMPANY_PASSWORD_CAPTION; break; } - ShowQueryString(STR_EMPTY, caption, 20, 180, w, CS_ALPHANUMERAL, QSF_NONE); + ShowQueryString(STR_EMPTY, caption, NETWORK_PASSWORD_LENGTH, 180, w, CS_ALPHANUMERAL, QSF_NONE); } diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp index b9f7d473ca..37ea824dd2 100644 --- a/src/newgrf_text.cpp +++ b/src/newgrf_text.cpp @@ -245,7 +245,7 @@ char *TranslateTTDPatchCodes(uint32 grfid, const char *str) } case 0x82: case 0x83: - case 0x84: d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_SPEED + c - 0x82); break; + case 0x84: d += Utf8Encode(d, SCC_NEWGRF_PRINT_DATE + c - 0x82); break; case 0x85: d += Utf8Encode(d, SCC_NEWGRF_DISCARD_WORD); break; case 0x86: d += Utf8Encode(d, SCC_NEWGRF_ROTATE_TOP_4_WORDS); break; case 0x87: d += Utf8Encode(d, SCC_NEWGRF_PRINT_WORD_LITRES); break; diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 5597a12021..237af085ed 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -65,7 +65,9 @@ struct SignList { GetString(buf_cache, STR_SIGN_NAME, lastof(buf_cache)); } - return strcasecmp(buf, buf_cache); + int r = strcasecmp(buf, buf_cache); + + return r != 0 ? r : ((*a)->index - (*b)->index); } void SortSignsList() diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 0301a5c62d..da04fbad16 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -4080,7 +4080,7 @@ bool Train::Tick() this->tick_counter++; if (this->IsFrontEngine()) { - if (!(this->vehstatus & VS_STOPPED)) this->running_ticks++; + if (!(this->vehstatus & VS_STOPPED) || this->cur_speed > 0) this->running_ticks++; this->current_order_time++; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 6d871f0b17..61e8d4af67 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1087,7 +1087,9 @@ public: this->BuildVehicleList(this->owner, GB(this->window_number, 16, 16), window_type); this->SortVehicleList(); - if (this->vehicles.Length() == 0) HideDropDownMenu(this); + if (this->vehicles.Length() == 0 && this->IsWidgetLowered(VLW_WIDGET_MANAGE_VEHICLES_DROPDOWN)) { + HideDropDownMenu(this); + } /* Hide the widgets that we will not use in this window * Some windows contains actions only fit for the owner */