Kathy
Gleisarbeiter

Beiträge: 25
Registriert seit: Aug 2010
|
RE: Alle Industrien schließen
Ich habe jetzt eine Datei heruntergeladen die, im Texteditor geöffnet, so aussieht:
Zitat:diff --git a/src/date.cpp b/src/date.cpp
index 16f77be..2914e03 100644
--- a/src/date.cpp
+++ b/src/date.cpp
@@ -26,6 +26,7 @@ Year _cur_year; ///< Current year, starting at 0
Month _cur_month; ///< Current month (0..11)
Date _date; ///< Current date in days (day counter)
DateFract _date_fract;
+uint8 _date_daylength_factor; ///< Setting for DAY_LENGTH
void SetDate(Date date)
diff --git a/src/date_type.h b/src/date_type.h
index 5afc925..f77bf4f 100644
--- a/src/date_type.h
+++ b/src/date_type.h
@@ -19,11 +19,21 @@
* 1 day is thus about 2 seconds (74 * 30 = 2220) on a machine that can run OpenTTD normally
*/
enum {
- DAY_TICKS = 74, ///< ticks per day
+ ORIG_DAY_TICKS = 74, ///< unscaled ticks per day
DAYS_IN_YEAR = 365, ///< days per year
DAYS_IN_LEAP_YEAR = 366, ///< sometimes, you need one day more...
};
+/**
+ * Scale factor for DAY_TICKS
+ */
+extern uint8 _date_daylength_factor;
+
+/**
+ * Day length in ticks, calculated using a configureable scale factor.
+ */
+#define DAY_TICKS (ORIG_DAY_TICKS * _date_daylength_factor)
+
/*
* ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR and DAYS_TILL_ORIGINAL_BASE_YEAR are
* primarily used for loading newgrf and savegame data and returning some
diff --git a/src/lang/english.txt b/src/lang/english.txt
index ceb915f..fa587f7 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -1246,6 +1246,7 @@ STR_CONFIG_SETTING_TOWN_FOUNDING :{LTBLUE}Foundin
STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :forbidden
STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :allowed
STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :allowed, custom town layout
+STR_CONFIG_SETTING_DAYLENGTH_FACTOR :{LTBLUE}Day length factor: {ORANGE}{STRING}
STR_CONFIG_SETTING_TOOLBAR_POS :{LTBLUE}Position of main toolbar: {ORANGE}{STRING1}
STR_CONFIG_SETTING_TOOLBAR_POS_LEFT :Left
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index bf56143..60f36aa 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -1322,6 +1322,7 @@ static SettingEntry _settings_economy[] = {
SettingEntry(&_settings_economy_industries_page, STR_CONFIG_SETTING_ECONOMY_INDUSTRIES),
SettingEntry("economy.inflation"),
SettingEntry("economy.smooth_economy"),
+ SettingEntry("daylength_factor"),
};
/** Economy sub-page */
static SettingsPage _settings_economy_page = {_settings_economy, lengthof(_settings_economy)};
diff --git a/src/table/settings.h b/src/table/settings.h
index 7ae041c..7b7ed9b 100644
--- a/src/table/settings.h
+++ b/src/table/settings.h
@@ -368,6 +368,7 @@ const SettingDesc _settings[] = {
SDT_BOOL(GameSettings, station.never_expire_airports, 0,NN, false, STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS, NULL),
SDT_CONDVAR(GameSettings, economy.town_layout, SLE_UINT8, 59, SL_MAX_VERSION, 0,MS,TL_ORIGINAL,TL_BEGIN,NUM_TLS - 1, 1, STR_CONFIG_SETTING_TOWN_LAYOUT, TownFoundingChanged),
SDT_CONDBOOL(GameSettings, economy.allow_town_roads, 113, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_ALLOW_TOWN_ROADS, NULL),
+ SDTG_CONDVAR("daylength_factor", SLE_UINT8, 0, 0, _date_daylength_factor, 1, 1, 255, 1, STR_CONFIG_SETTING_DAYLENGTH_FACTOR, NULL, 130, SL_MAX_VERSION),
SDT_CONDVAR(GameSettings, economy.found_town, SLE_UINT8,128, SL_MAX_VERSION, 0,MS,TF_FORBIDDEN,TF_BEGIN,TF_END - 1, 1, STR_CONFIG_SETTING_TOWN_FOUNDING, TownFoundingChanged),
SDT_VAR(GameSettings, vehicle.train_acceleration_model, SLE_UINT8, 0,MS, 0, 0, 1, 1, STR_CONFIG_SETTING_TRAIN_ACCELERATION_MODEL, TrainAccelerationModelChanged),
Wo soll ein Laie jetzt erkennen, welchen Wert er ändern muss, um 4-fache Tageslänge zu erhaten? Ich verstehe nur Bahnhof. Das passt zwar zum Spiel, ist aber nicht Benutzerfreundlich.
|
|