Mercurial > hg > openttd
changeset 17218:46deeeb7a878 draft
(svn r21957) -Cleanup: gotodepot and timetabling settings are more or less useless; just don't use depot orders or timetabling if you don't want to use it
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 04 Feb 2011 15:13:20 +0000 |
parents | 2080902520d5 |
children | 27491beaffa6 |
files | src/economy.cpp src/lang/english.txt src/order_gui.cpp src/settings_gui.cpp src/settings_type.h src/table/settings.h src/timetable_cmd.cpp src/vehicle.cpp |
diffstat | 8 files changed, 38 insertions(+), 62 deletions(-) [+] |
line wrap: on
line diff
--- a/src/economy.cpp +++ b/src/economy.cpp @@ -1334,7 +1334,7 @@ /* We loaded less cargo than possible for all cargo types and it's not full * load and we're not supposed to wait any longer: stop loading. */ if (!anything_unloaded && full_load_amount == 0 && !(v->current_order.GetLoadType() & OLFB_FULL_LOAD) && - (!_settings_game.order.timetabling || v->current_order_time >= (uint)max(v->current_order.wait_time - v->lateness_counter, 0))) { + v->current_order_time >= (uint)max(v->current_order.wait_time - v->lateness_counter, 0)) { SetBit(v->vehicle_flags, VF_STOP_LOADING); } } else {
--- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1115,7 +1115,6 @@ STR_CONFIG_SETTING_INFLATION :{LTBLUE}Inflation: {ORANGE}{STRING1} STR_CONFIG_SETTING_SELECTGOODS :{LTBLUE}Deliver cargo to a station only when there is a demand: {ORANGE}{STRING1} STR_CONFIG_SETTING_LONGBRIDGES :{LTBLUE}Allow building very long bridges: {ORANGE}{STRING1} -STR_CONFIG_SETTING_GOTODEPOT :{LTBLUE}Allow goto depot orders: {ORANGE}{STRING1} STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD :{LTBLUE}Manual primary industry construction method: {ORANGE}{STRING1} STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NONE :none STR_CONFIG_SETTING_RAW_INDUSTRY_CONSTRUCTION_METHOD_NORMAL :as other industries @@ -1232,7 +1231,6 @@ STR_CONFIG_SETTING_LOADING_INDICATORS_OFF :Off STR_CONFIG_SETTING_LOADING_INDICATORS_OWN :Own company STR_CONFIG_SETTING_LOADING_INDICATORS_ALL :All companies -STR_CONFIG_SETTING_TIMETABLE_ALLOW :{LTBLUE}Enable timetabling for vehicles: {ORANGE}{STRING1} STR_CONFIG_SETTING_TIMETABLE_IN_TICKS :{LTBLUE}Show timetable in ticks rather than days: {ORANGE}{STRING1} STR_CONFIG_SETTING_TIMETABLE_SHOW_ARRIVAL_DEPARTURE :{LTBLUE}Show arrival and departure in timetables: {ORANGE}{STRING1} STR_CONFIG_SETTING_QUICKGOTO :{LTBLUE}Quick creation of vehicle orders: {ORANGE}{STRING1}
--- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -325,49 +325,47 @@ order.index = 0; /* check depot first */ - if (_settings_game.order.gotodepot) { - switch (GetTileType(tile)) { - case MP_RAILWAY: - if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) { - if (IsRailDepot(tile)) { - order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, - _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); - if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); - return order; - } - } - break; - - case MP_ROAD: - if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) { + switch (GetTileType(tile)) { + case MP_RAILWAY: + if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_company)) { + if (IsRailDepot(tile)) { order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); return order; } - break; + } + break; - case MP_STATION: - if (v->type != VEH_AIRCRAFT) break; - if (IsHangar(tile) && IsTileOwner(tile, _local_company)) { - order.MakeGoToDepot(GetStationIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE); - if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); - return order; - } - break; + case MP_ROAD: + if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_company)) { + order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, + _settings_client.gui.new_nonstop ? ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS : ONSF_STOP_EVERYWHERE); + if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); + return order; + } + break; - case MP_WATER: - if (v->type != VEH_SHIP) break; - if (IsShipDepot(tile) && IsTileOwner(tile, _local_company)) { - order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE); - if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); - return order; - } - break; + case MP_STATION: + if (v->type != VEH_AIRCRAFT) break; + if (IsHangar(tile) && IsTileOwner(tile, _local_company)) { + order.MakeGoToDepot(GetStationIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE); + if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); + return order; + } + break; - default: - break; - } + case MP_WATER: + if (v->type != VEH_SHIP) break; + if (IsShipDepot(tile) && IsTileOwner(tile, _local_company)) { + order.MakeGoToDepot(GetDepotIndex(tile), ODTFB_PART_OF_ORDERS, ONSF_STOP_EVERYWHERE); + if (_ctrl_pressed) order.SetDepotOrderType((OrderDepotTypeFlags)(order.GetDepotOrderType() ^ ODTFB_SERVICE)); + return order; + } + break; + + default: + break; } /* check waypoint */ @@ -778,10 +776,6 @@ virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) { switch (widget) { - case ORDER_WIDGET_TIMETABLE_VIEW: - if (!_settings_game.order.timetabling) size->width = 0; - break; - case ORDER_WIDGET_ORDER_LIST: resize->height = FONT_HEIGHT_NORMAL; size->height = 6 * resize->height + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM;
--- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1263,8 +1263,6 @@ static SettingEntry _settings_ui_display[] = { - SettingEntry("gui.vehicle_speed"), - SettingEntry("gui.status_long_date"), SettingEntry("gui.date_format_in_default_names"), SettingEntry("gui.population_in_label"), SettingEntry("gui.measure_tooltip"), @@ -1467,7 +1465,6 @@ SettingEntry(&_settings_vehicles_autorenew_page, STR_CONFIG_SETTING_VEHICLES_AUTORENEW), SettingEntry(&_settings_vehicles_servicing_page, STR_CONFIG_SETTING_VEHICLES_SERVICING), SettingEntry(&_settings_vehicles_trains_page, STR_CONFIG_SETTING_VEHICLES_TRAINS), - SettingEntry("order.gotodepot"), SettingEntry("gui.new_nonstop"), SettingEntry("gui.order_review_system"), SettingEntry("gui.vehicle_income_warn"), @@ -1479,7 +1476,6 @@ SettingEntry("vehicle.max_ships"), SettingEntry("vehicle.plane_speed"), SettingEntry("vehicle.plane_crashes"), - SettingEntry("order.timetabling"), SettingEntry("vehicle.dynamic_engines"), SettingEntry("vehicle.roadveh_acceleration_model"), SettingEntry("vehicle.roadveh_slope_steepness"),
--- a/src/settings_type.h +++ b/src/settings_type.h @@ -329,9 +329,7 @@ bool improved_load; ///< improved loading algorithm bool gradual_loading; ///< load vehicles gradually bool selectgoods; ///< only send the goods to station if a train has been there - bool gotodepot; ///< allow goto depot in orders bool no_servicing_if_no_breakdowns; ///< dont send vehicles to depot when breakdowns are disabled - bool timetabling; ///< whether to allow timetabling bool serviceathelipad; ///< service helicopters at helipads automatically (no need to send to depot) };
--- a/src/table/settings.h +++ b/src/table/settings.h @@ -393,7 +393,7 @@ SDT_BOOL(GameSettings, pf.forbid_90_deg, 0, 0, false, STR_CONFIG_SETTING_FORBID_90_DEG, NULL), SDT_BOOL(GameSettings, vehicle.mammoth_trains, 0,NN, true, STR_CONFIG_SETTING_MAMMOTHTRAINS, NULL), SDT_CONDVAR(GameSettings, vehicle.smoke_amount, SLE_UINT8,145, SL_MAX_VERSION, 0,MS, 1, 0, 2, 0, STR_CONFIG_SETTING_SMOKE_AMOUNT, NULL), - SDT_BOOL(GameSettings, order.gotodepot, 0, 0, true, STR_CONFIG_SETTING_GOTODEPOT, NULL), + SDT_CONDNULL( 1, 0, 158), // order.gotodepot SDT_BOOL(GameSettings, pf.roadveh_queue, 0, 0, true, STR_CONFIG_SETTING_ROAD_VEHICLE_QUEUEING, NULL), SDT_CONDBOOL(GameSettings, pf.new_pathfinding_all, 0, 86, 0, 0, false, STR_NULL, NULL), @@ -419,7 +419,7 @@ SDT_BOOL(GameSettings, vehicle.wagon_speed_limits, 0,NN, true, STR_CONFIG_SETTING_WAGONSPEEDLIMITS, UpdateConsists), SDT_CONDBOOL(GameSettings, vehicle.disable_elrails, 38, SL_MAX_VERSION, 0,NN, false, STR_CONFIG_SETTING_DISABLE_ELRAILS, SettingsDisableElrail), SDT_CONDVAR(GameSettings, vehicle.freight_trains, SLE_UINT8, 39, SL_MAX_VERSION, 0,NN, 1, 1, 255, 1, STR_CONFIG_SETTING_FREIGHT_TRAINS, NULL), - SDT_CONDBOOL(GameSettings, order.timetabling, 67, SL_MAX_VERSION, 0, 0, true, STR_CONFIG_SETTING_TIMETABLE_ALLOW, NULL), + SDT_CONDNULL( 1, 67, 158), // order.timetabling SDT_CONDVAR(GameSettings, vehicle.plane_speed, SLE_UINT8, 90, SL_MAX_VERSION, 0,NN, 4, 1, 4, 0, STR_CONFIG_SETTING_PLANE_SPEED, NULL), SDT_CONDBOOL(GameSettings, vehicle.dynamic_engines, 95, SL_MAX_VERSION, 0,NN, true, STR_CONFIG_SETTING_DYNAMIC_ENGINES, ChangeDynamicEngines), SDT_CONDVAR(GameSettings, vehicle.plane_crashes, SLE_UINT8,138, SL_MAX_VERSION, 0,MS, 2, 0, 2, 1, STR_CONFIG_SETTING_PLANE_CRASHES, NULL),
--- a/src/timetable_cmd.cpp +++ b/src/timetable_cmd.cpp @@ -60,8 +60,6 @@ */ CommandCost CmdChangeTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { - if (!_settings_game.order.timetabling) return CMD_ERROR; - VehicleID veh = GB(p1, 0, 20); Vehicle *v = Vehicle::GetIfValid(veh); @@ -119,8 +117,6 @@ */ CommandCost CmdSetVehicleOnTime(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { - if (!_settings_game.order.timetabling) return CMD_ERROR; - VehicleID veh = GB(p1, 0, 20); Vehicle *v = Vehicle::GetIfValid(veh); @@ -148,8 +144,6 @@ */ CommandCost CmdSetTimetableStart(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { - if (!_settings_game.order.timetabling) return CMD_ERROR; - Vehicle *v = Vehicle::GetIfValid(GB(p1, 0, 20)); if (v == NULL || !v->IsPrimaryVehicle()) return CMD_ERROR; @@ -189,8 +183,6 @@ */ CommandCost CmdAutofillTimetable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) { - if (!_settings_game.order.timetabling) return CMD_ERROR; - VehicleID veh = GB(p1, 0, 20); Vehicle *v = Vehicle::GetIfValid(veh); @@ -237,7 +229,6 @@ v->current_order_time = 0; - if (!_settings_game.order.timetabling) return; if (v->current_order.IsType(OT_AUTOMATIC)) return; // no timetabling of auto orders VehicleOrderID first_manual_order = 0;
--- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -168,7 +168,7 @@ */ bool Vehicle::NeedsAutomaticServicing() const { - if (_settings_game.order.gotodepot && this->HasDepotOrder()) return false; + if (this->HasDepotOrder()) return false; if (this->current_order.IsType(OT_LOADING)) return false; if (this->current_order.IsType(OT_GOTO_DEPOT) && this->current_order.GetDepotOrderType() != ODTFB_SERVICE) return false; return NeedsServicing(); @@ -1912,8 +1912,7 @@ uint wait_time = max(this->current_order.wait_time - this->lateness_counter, 0); /* Not the first call for this tick, or still loading */ - if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) || - (_settings_game.order.timetabling && this->current_order_time < wait_time)) return; + if (mode || !HasBit(this->vehicle_flags, VF_LOADING_FINISHED) || this->current_order_time < wait_time) return; this->PlayLeaveStationSound();