Close depot building tools after placement (with setting)

This commit is contained in:
Pavel Stupnikov
2019-04-01 18:09:36 +03:00
parent 0f8fd5dc2c
commit 65d5d318e7
9 changed files with 24 additions and 4 deletions

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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());

View File

@@ -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"));

View File

@@ -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

View File

@@ -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