1
0
Fork 0

(svn r25496) [1.3] -Backport from trunk:

- Fix: When town creation failed, removing remnants of the construction failed on protected houses [FS#5603] (r25429)
- Fix: There were two hotkeys to toggle between 'unload' and 'unload if possible' (r25406)
- Fix: The size of station construction windows could oscillate when resizing the window moved the mouse into the window [FS#5596] (r25395)
- Fix: Restrict renaming engines to the server, just like renaming towns (r25394)
release/1.3
rubidium 2013-06-28 19:09:47 +00:00
parent 906a848cdb
commit fab048a116
8 changed files with 23 additions and 12 deletions

View File

@ -391,8 +391,10 @@ public:
top = DrawStationCoverageAreaText(panel_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
}
/* Resize background if the text is not equally long as the window. */
if (top > bottom || (top < bottom && panel_nwi->current_y > panel_nwi->smallest_y)) {
/* Resize background if the window is too small.
* Never make the window smaller to avoid oscillating if the size change affects the acceptance.
* (This is the case, if making the window bigger moves the mouse into the window.) */
if (top > bottom) {
ResizeWindow(this, 0, top - bottom);
}
}

View File

@ -13,6 +13,7 @@
#include "engine_base.h"
#include "engine_func.h"
#include "station_base.h"
#include "network/network.h"
#include "articulated_vehicles.h"
#include "textbuf_gui.h"
#include "command_func.h"
@ -970,6 +971,9 @@ struct BuildVehicleWindow : Window {
* So we just hide it, and enlarge the Rename button by the now vacant place. */
if (this->listview_mode) this->GetWidget<NWidgetStacked>(WID_BV_BUILD_SEL)->SetDisplayedPlane(SZSP_NONE);
/* disable renaming engines in network games if you are not the server */
this->SetWidgetDisabledState(WID_BV_RENAME, _networking && !_network_server);
NWidgetCore *widget = this->GetWidget<NWidgetCore>(WID_BV_LIST);
widget->tool_tip = STR_BUY_VEHICLE_TRAIN_LIST_TOOLTIP + type;

View File

@ -252,7 +252,7 @@ static const Command _command_proc_table[] = {
DEF_CMD(CmdWantEnginePreview, 0, CMDT_VEHICLE_MANAGEMENT ), // CMD_WANT_ENGINE_PREVIEW
DEF_CMD(CmdRenameVehicle, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_VEHICLE
DEF_CMD(CmdRenameEngine, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_ENGINE
DEF_CMD(CmdRenameEngine, CMD_STR_CTRL | CMD_SERVER, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_ENGINE
DEF_CMD(CmdRenameCompany, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_COMPANY
DEF_CMD(CmdRenamePresident, CMD_STR_CTRL, CMDT_OTHER_MANAGEMENT ), // CMD_RENAME_PRESIDENT

View File

@ -422,8 +422,10 @@ public:
int bottom = back_nwi->pos_y + back_nwi->current_y;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
/* Resize background if the text is not equally long as the window. */
if (top > bottom || (top < bottom && back_nwi->current_y > back_nwi->smallest_y)) {
/* Resize background if the window is too small.
* Never make the window smaller to avoid oscillating if the size change affects the acceptance.
* (This is the case, if making the window bigger moves the mouse into the window.) */
if (top > bottom) {
ResizeWindow(this, 0, top - bottom);
}
}

View File

@ -535,9 +535,9 @@ bool CanDeleteHouse(TileIndex tile)
{
const HouseSpec *hs = HouseSpec::Get(GetHouseType(tile));
/* Humans are always allowed to remove buildings, as is water and
/* Humans are always allowed to remove buildings, as is water and disasters and
* anyone using the scenario editor. */
if (Company::IsValidHumanID(_current_company) || _current_company == OWNER_WATER || _current_company == OWNER_NONE) {
if (Company::IsValidHumanID(_current_company) || _current_company == OWNER_WATER || _current_company == OWNER_NONE || _game_mode == GM_EDITOR || _generating_world) {
return true;
}

View File

@ -1516,7 +1516,6 @@ Hotkey<OrdersWindow> OrdersWindow::order_hotkeys[] = {
Hotkey<OrdersWindow>('K', "unload", 0, &OrdersWindow::OrderClick_Unload),
Hotkey<OrdersWindow>((uint16)0, "nearest_depot", 0, &OrdersWindow::OrderClick_NearestDepot),
Hotkey<OrdersWindow>((uint16)0, "always_service", 0, &OrdersWindow::OrderClick_Service),
Hotkey<OrdersWindow>((uint16)0, "force_unload", 0, &OrdersWindow::OrderClick_Unload),
Hotkey<OrdersWindow>((uint16)0, "transfer", 0, &OrdersWindow::OrderHotkey_Transfer),
Hotkey<OrdersWindow>((uint16)0, "no_unload", 0, &OrdersWindow::OrderHotkey_NoUnload),
Hotkey<OrdersWindow>((uint16)0, "no_load", 0, &OrdersWindow::OrderHotkey_NoLoad),

View File

@ -1012,8 +1012,10 @@ public:
int bottom = cov->pos_y + cov->current_y;
top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, false) + WD_PAR_VSEP_NORMAL;
top = DrawStationCoverageAreaText(left, right, top, SCT_ALL, rad, true) + WD_PAR_VSEP_NORMAL;
/* Resize the coverage text space if the text is not equally long as the window. */
if (top != bottom) {
/* Resize background if the window is too small.
* Never make the window smaller to avoid oscillating if the size change affects the acceptance.
* (This is the case, if making the window bigger moves the mouse into the window.) */
if (top > bottom) {
this->coverage_height += top - bottom;
this->ReInit();
}

View File

@ -972,8 +972,10 @@ struct BuildRoadStationWindow : public PickerWindowBase {
int bottom = back_nwi->pos_y + back_nwi->current_y;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, false) + WD_PAR_VSEP_NORMAL;
top = DrawStationCoverageAreaText(back_nwi->pos_x + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, top, sct, rad, true) + WD_PAR_VSEP_NORMAL;
/* Resize background if the text is not equally long as the window. */
if (top > bottom || (top < bottom && back_nwi->current_y > back_nwi->smallest_y)) {
/* Resize background if the window is too small.
* Never make the window smaller to avoid oscillating if the size change affects the acceptance.
* (This is the case, if making the window bigger moves the mouse into the window.) */
if (top > bottom) {
ResizeWindow(this, 0, top - bottom);
}
}