summaryrefslogtreecommitdiff
path: root/src/order_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-02-04 15:13:20 +0000
committerrubidium <rubidium@openttd.org>2011-02-04 15:13:20 +0000
commit4c5ca174861c4324761b31de5a98a5c9a7d976df (patch)
tree83c8b371d885f2ee61a178e570bcec9474f0a225 /src/order_gui.cpp
parent71f4067d19b4d861b93bd5f6fe290d9d95eec4fd (diff)
downloadopenttd-4c5ca174861c4324761b31de5a98a5c9a7d976df.tar.xz
(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
Diffstat (limited to 'src/order_gui.cpp')
-rw-r--r--src/order_gui.cpp72
1 files changed, 33 insertions, 39 deletions
diff --git a/src/order_gui.cpp b/src/order_gui.cpp
index d98140432..e5b49fadf 100644
--- a/src/order_gui.cpp
+++ b/src/order_gui.cpp
@@ -325,49 +325,47 @@ static Order GetOrderCmdFromTile(const Vehicle *v, TileIndex tile)
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 @@ public:
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;