diff --git a/cm_changelog.txt b/cm_changelog.txt index 0996e6efa2..30a06bffd7 100644 --- a/cm_changelog.txt +++ b/cm_changelog.txt @@ -76,10 +76,11 @@ This is usable for any OpenTTD servers *** 1.9.0 (1 Apr 2019) *** - OpenTTD update. -- Improved cargo legend looks in charts. -- Improved performance of up authority and advertisement zoning. -- Removed vehicle measurements from framerate counter (massive performance improvement). - Added treedozer tool (Ctrl+D) that destroys trees in an area - by Corns McGowan. +- Depot building tools now close after placement (hold Ctrl to keep them). Enable "" to revert to original behaviour. +- Removed vehicle measurements from framerate counter (massive performance improvement in some cases compared to vanilla). +- Improved performance of up authority and advertisement zoning. +- Improved cargo legend looks in charts. *** 1.8.0 (17 Apr 2018) - OpenTTD update. diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index e2224dfa28..d7417765c1 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -190,6 +190,8 @@ struct BuildDocksToolbarWindow : Window { case WID_DT_DEPOT: // Build depot button DoCommandP(tile, _ship_depot_direction, 0, CMD_BUILD_SHIP_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_SHIP_DEPOT), CcBuildDocks); + if (_ctrl_pressed == _settings_client.gui.persistent_depottools) + ResetObjectToPlace(); break; case WID_DT_STATION: { // Build station button diff --git a/src/lang/english.txt b/src/lang/english.txt index 503bad98d8..e3252e631d 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1440,6 +1440,8 @@ STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION :Show path reser STR_CONFIG_SETTING_SHOW_TRACK_RESERVATION_HELPTEXT :Give reserved tracks a different colour to assist in problems with trains refusing to enter path-based blocks STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS :Keep building tools active after usage: {STRING2} STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Keep the building tools for bridges, tunnels, etc. open after use +STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS :Keep depot building tools active after usage: {STRING2} +STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS_HELPTEXT :Keep the building tools for road, train and ship depots (reversible by placing with Ctrl). STR_CONFIG_SETTING_EXPENSES_LAYOUT :Group expenses in company finance window: {STRING2} STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Define the layout for the company expenses window diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 35380fdb19..9a98ce90d1 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -837,6 +837,8 @@ struct BuildRailToolbarWindow : Window { DoCommandP(tile, _cur_railtype, ddir, CMD_BUILD_TRAIN_DEPOT | CMD_MSG(STR_ERROR_CAN_T_BUILD_TRAIN_DEPOT), CcRailDepot); + if (_ctrl_pressed == _settings_client.gui.persistent_depottools) + ResetObjectToPlace(); break; case WID_RAT_BUILD_WAYPOINT: diff --git a/src/road_gui.cpp b/src/road_gui.cpp index 0923afb261..d9a13a22c4 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -673,6 +673,8 @@ struct BuildRoadToolbarWindow : Window { } DoCommandP(tile, _cur_roadtype << 2 | ddir, 0, CMD_BUILD_ROAD_DEPOT | CMD_MSG(_road_type_infos[_cur_roadtype].err_depot), CcRoadDepot); + if (_ctrl_pressed == _settings_client.gui.persistent_depottools) + ResetObjectToPlace(); break; case WID_ROT_BUS_STATION: diff --git a/src/saveload/storage_sl.cpp b/src/saveload/storage_sl.cpp index d146f0cd41..6df5f5c6e3 100644 --- a/src/saveload/storage_sl.cpp +++ b/src/saveload/storage_sl.cpp @@ -10,6 +10,7 @@ /** @file storage_sl.cpp Code handling saving and loading of persistent storages. */ #include "../stdafx.h" +#include "../debug.h" #include "../newgrf_storage.h" #include "citymania_sl.h" #include "saveload.h" @@ -49,7 +50,7 @@ static void Load_PSAC() PersistentStorage *ps = NULL; u8vector cmdata; uint chunk_size = IsSavegameVersionBefore(SLV_EXTEND_PERSISTENT_STORAGE) ? 64 : 1024; - fprintf(stderr, "CHUNK SIZE %u\n", chunk_size); + DEBUG(sl, 2, "CityMania savegame data chunk size: %u", chunk_size); while ((index = SlIterateArray()) != -1) { if (ps == NULL) { assert(PersistentStorage::CanAllocateItem()); diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 6540af4819..390ef01b2a 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1589,6 +1589,7 @@ static SettingsContainer &GetSettingsTree() construction->Add(new SettingEntry("gui.link_terraform_toolbar")); construction->Add(new SettingEntry("gui.enable_signal_gui")); construction->Add(new SettingEntry("gui.persistent_buildingtools")); + construction->Add(new SettingEntry("gui.persistent_depottools")); construction->Add(new SettingEntry("gui.quick_goto")); construction->Add(new SettingEntry("gui.default_rail_type")); construction->Add(new SettingEntry("gui.disable_unsuitable_building")); diff --git a/src/settings_type.h b/src/settings_type.h index c07036e4f8..9e26b1b3c5 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -150,6 +150,7 @@ struct GUISettings { bool station_dragdrop; ///< whether drag and drop is enabled for stations bool station_show_coverage; ///< whether to highlight coverage area bool persistent_buildingtools; ///< keep the building tools active after usage + bool persistent_depottools; ///< keep the depot building tools active after usage bool expenses_layout; ///< layout of expenses window uint32 last_newgrf_count; ///< the numbers of NewGRFs we found during the last scan byte missing_strings_threshold; ///< the number of missing strings before showing the warning diff --git a/src/table/settings.ini b/src/table/settings.ini index 01fe9d5ae6..c89f17841e 100644 --- a/src/table/settings.ini +++ b/src/table/settings.ini @@ -3102,6 +3102,14 @@ str = STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS strhelp = STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT cat = SC_BASIC +[SDTC_BOOL] +var = gui.persistent_depottools +flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC +def = false +str = STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS +strhelp = STR_CONFIG_SETTING_PERSISTENT_DEPOTTOOLS_HELPTEXT +cat = SC_BASIC + [SDTC_BOOL] var = gui.expenses_layout flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC