summaryrefslogtreecommitdiff
path: root/src/settings.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-05-04 16:27:13 +0000
committerbelugas <belugas@openttd.org>2007-05-04 16:27:13 +0000
commitaff49954bf116162d440c48e29bf35fb116d1dd6 (patch)
treeaa52d3726c6fd14c5ac298000d0dbbfb570fcc93 /src/settings.cpp
parent449e76c05ad6c8502105fe80fd2390cc6944750c (diff)
downloadopenttd-aff49954bf116162d440c48e29bf35fb116d1dd6.tar.xz
(svn r9779) -Feature: Add the possiblity to choose different road patterns for towns to use.
Possible patterns are : No Road (not available in scenario editor) Original (for the nostalgics) Better Roads (same as original, but based on distance of 2 tiles instead of one) 2x2 grids 3x3 grids Patch by skiddl13
Diffstat (limited to 'src/settings.cpp')
-rw-r--r--src/settings.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index 696ac64fc..203d5e0ff 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -1174,6 +1174,24 @@ static int32 EngineRenewMoneyUpdate(int32 p1)
DoCommandP(0, 2, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
return 0;
}
+
+/**
+ * Check for right TownLayout usage in editor mode.
+ * The No Road mode is not desirable since towns have to be
+ * able to grow. If a user desires to have a town with no road,
+ * he can easily remove them himself. This would create less confusion
+ * @param p1 unused
+ * @return always 0
+ */
+static int32 CheckTownLayout(int32 p1)
+{
+ if (_patches.town_layout == TL_NO_ROADS && _game_mode == GM_EDITOR) {
+ ShowErrorMessage(INVALID_STRING_ID, STR_CONFIG_PATCHES_TOWN_LAYOUT_INVALID, 0, 0);
+ _patches.town_layout = TL_ORIGINAL;
+ }
+ return 0;
+}
+
/** Conversion callback for _gameopt_settings.landscape
* It converts (or try) between old values and the new ones,
* without loosing initial setting of the user
@@ -1334,6 +1352,7 @@ const SettingDesc _patch_settings[] = {
SDT_BOOL(Patches, always_small_airport, 0, 0, false, STR_CONFIG_PATCHES_SMALL_AIRPORTS, NULL),
SDT_VAR(Patches, drag_signals_density,SLE_UINT8,S, 0, 4, 1, 20, 0, STR_CONFIG_PATCHES_DRAG_SIGNALS_DENSITY,NULL),
SDT_VAR(Patches, semaphore_build_before,SLE_INT32, S, NC, 1975, MIN_YEAR, MAX_YEAR, 1, STR_CONFIG_PATCHES_SEMAPHORE_BUILD_BEFORE_DATE, NULL),
+ SDT_CONDVAR(Patches, town_layout, SLE_UINT8, 59, SL_MAX_VERSION, 0, MS, TL_ORIGINAL, TL_NO_ROADS, NUM_TLS - 1, 1, STR_CONFIG_PATCHES_TOWN_LAYOUT, CheckTownLayout),
/***************************************************************************/
/* Vehicle section of the GUI-configure patches window */