src/settings.cpp
changeset 8249 67f9410ee71e
parent 8238 29844a206bbe
child 8345 6caa3fdb972c
equal deleted inserted replaced
8248:1f991f0538f0 8249:67f9410ee71e
    39 #include "newgrf.h"
    39 #include "newgrf.h"
    40 #include "newgrf_config.h"
    40 #include "newgrf_config.h"
    41 #include "genworld.h"
    41 #include "genworld.h"
    42 #include "date.h"
    42 #include "date.h"
    43 #include "rail.h"
    43 #include "rail.h"
       
    44 #include "train.h"
    44 #include "helpers.hpp"
    45 #include "helpers.hpp"
    45 #include "news.h"
    46 #include "news.h"
    46 #ifdef WITH_FREETYPE
    47 #ifdef WITH_FREETYPE
    47 #include "gfx.h"
    48 #include "gfx.h"
    48 #include "fontcache.h"
    49 #include "fontcache.h"
  1130 }
  1131 }
  1131 
  1132 
  1132 static int32 InvalidateStationBuildWindow(int32 p1)
  1133 static int32 InvalidateStationBuildWindow(int32 p1)
  1133 {
  1134 {
  1134 	InvalidateWindow(WC_BUILD_STATION, 0);
  1135 	InvalidateWindow(WC_BUILD_STATION, 0);
       
  1136 	return 0;
       
  1137 }
       
  1138 
       
  1139 static int32 UpdateConsists(int32 p1)
       
  1140 {
       
  1141 	Vehicle *v;
       
  1142 	FOR_ALL_VEHICLES(v) {
       
  1143 		/* Update the consist of all trains so the maximum speed is set correctly. */
       
  1144 		if (v->type == VEH_TRAIN && (IsFrontEngine(v) || IsFreeWagon(v))) TrainConsistChanged(v);
       
  1145 	}
  1135 	return 0;
  1146 	return 0;
  1136 }
  1147 }
  1137 
  1148 
  1138 /* Check service intervals of vehicles, p1 is value of % or day based servicing */
  1149 /* Check service intervals of vehicles, p1 is value of % or day based servicing */
  1139 static int32 CheckInterval(int32 p1)
  1150 static int32 CheckInterval(int32 p1)
  1401 	 SDT_VAR(Patches, servint_trains,    SLE_UINT16, 0,D0,   150,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_TRAINS,       InValidateDetailsWindow),
  1412 	 SDT_VAR(Patches, servint_trains,    SLE_UINT16, 0,D0,   150,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_TRAINS,       InValidateDetailsWindow),
  1402 	 SDT_VAR(Patches, servint_roadveh,   SLE_UINT16, 0,D0,   150,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_ROADVEH,      InValidateDetailsWindow),
  1413 	 SDT_VAR(Patches, servint_roadveh,   SLE_UINT16, 0,D0,   150,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_ROADVEH,      InValidateDetailsWindow),
  1403 	 SDT_VAR(Patches, servint_ships,     SLE_UINT16, 0,D0,   360,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_SHIPS,        InValidateDetailsWindow),
  1414 	 SDT_VAR(Patches, servint_ships,     SLE_UINT16, 0,D0,   360,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_SHIPS,        InValidateDetailsWindow),
  1404 	 SDT_VAR(Patches, servint_aircraft,  SLE_UINT16, 0,D0,   100,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT,     InValidateDetailsWindow),
  1415 	 SDT_VAR(Patches, servint_aircraft,  SLE_UINT16, 0,D0,   100,     5,     800, 0, STR_CONFIG_PATCHES_SERVINT_AIRCRAFT,     InValidateDetailsWindow),
  1405 	SDT_BOOL(Patches, no_servicing_if_no_breakdowns, 0, 0, false,                    STR_CONFIG_PATCHES_NOSERVICE,            NULL),
  1416 	SDT_BOOL(Patches, no_servicing_if_no_breakdowns, 0, 0, false,                    STR_CONFIG_PATCHES_NOSERVICE,            NULL),
  1406 	SDT_BOOL(Patches, wagon_speed_limits,            0, 0,  true,                    STR_CONFIG_PATCHES_WAGONSPEEDLIMITS,     NULL),
  1417 	SDT_BOOL(Patches, wagon_speed_limits,            0, 0,  true,                    STR_CONFIG_PATCHES_WAGONSPEEDLIMITS,     UpdateConsists),
  1407 	SDT_CONDBOOL(Patches, disable_elrails, 38, SL_MAX_VERSION, 0, 0, false,          STR_CONFIG_PATCHES_DISABLE_ELRAILS,      SettingsDisableElrail),
  1418 	SDT_CONDBOOL(Patches, disable_elrails, 38, SL_MAX_VERSION, 0, 0, false,          STR_CONFIG_PATCHES_DISABLE_ELRAILS,      SettingsDisableElrail),
  1408 	SDT_CONDVAR(Patches, freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0, 0, 1, 1, 255, 1, STR_CONFIG_PATCHES_FREIGHT_TRAINS, NULL),
  1419 	SDT_CONDVAR(Patches, freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0, 0, 1, 1, 255, 1, STR_CONFIG_PATCHES_FREIGHT_TRAINS, NULL),
  1409 	SDT_CONDBOOL(Patches, timetabling,              67, SL_MAX_VERSION, 0, 0, true,  STR_CONFIG_PATCHES_TIMETABLE_ALLOW,      NULL),
  1420 	SDT_CONDBOOL(Patches, timetabling,              67, SL_MAX_VERSION, 0, 0, true,  STR_CONFIG_PATCHES_TIMETABLE_ALLOW,      NULL),
  1410 
  1421 
  1411 	/***************************************************************************/
  1422 	/***************************************************************************/