--- a/src/order_gui.cpp Mon May 26 20:45:25 2008 +0000
+++ b/src/order_gui.cpp Tue May 27 00:50:55 2008 +0000
@@ -265,13 +265,13 @@
order.index = 0;
/* check depot first */
- if (_patches.gotodepot) {
+ if (_settings.order.gotodepot) {
switch (GetTileType(tile)) {
case MP_RAILWAY:
if (v->type == VEH_TRAIN && IsTileOwner(tile, _local_player)) {
if (IsRailDepot(tile)) {
order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS);
- if (_patches.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
+ if (_settings.gui.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
}
@@ -280,7 +280,7 @@
case MP_ROAD:
if (IsRoadDepot(tile) && v->type == VEH_ROAD && IsTileOwner(tile, _local_player)) {
order.MakeGoToDepot(GetDepotByTile(tile)->index, ODTFB_PART_OF_ORDERS);
- if (_patches.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
+ if (_settings.gui.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
break;
@@ -313,7 +313,7 @@
IsTileOwner(tile, _local_player) &&
IsRailWaypoint(tile)) {
order.MakeGoToWaypoint(GetWaypointByTile(tile)->index);
- if (_patches.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
+ if (_settings.gui.new_nonstop) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
@@ -330,7 +330,7 @@
(facil = FACIL_TRUCK_STOP, 1);
if (st->facilities & facil) {
order.MakeGoToStation(st_index);
- if (_patches.new_nonstop && (v->type == VEH_TRAIN || v->type == VEH_ROAD)) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
+ if (_settings.gui.new_nonstop && (v->type == VEH_TRAIN || v->type == VEH_ROAD)) order.SetNonStopType(ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS);
return order;
}
}
@@ -611,7 +611,7 @@
this->resize.step_height = 10;
this->selected_order = -1;
this->vehicle = v;
- if (_patches.timetabling) {
+ if (_settings.order.timetabling) {
this->widget[ORDER_WIDGET_CAPTION].right -= 61;
} else {
this->HideWidget(ORDER_WIDGET_TIMETABLE_VIEW);
@@ -926,7 +926,7 @@
ResetObjectToPlace();
}
- virtual bool OnKeyPress(uint16 key, uint16 keycode)
+ virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
static const KeyToEvent keytoevent[] = {
{'D', OrderClick_Skip},
@@ -939,15 +939,15 @@
//('?', OrderClick_Service},
};
- if (this->vehicle->owner != _local_player) return true;
+ if (this->vehicle->owner != _local_player) return ES_NOT_HANDLED;
for (uint i = 0; i < lengthof(keytoevent); i++) {
if (keycode == keytoevent[i].keycode) {
keytoevent[i].proc(this, -1);
- return false;
+ return ES_HANDLED;
}
}
- return true;
+ return ES_NOT_HANDLED;
}
virtual void OnPlaceObject(Point pt, TileIndex tile)
@@ -1063,7 +1063,6 @@
WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_orders_train_widgets,
- NULL
};
/**
@@ -1104,7 +1103,6 @@
WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_orders_widgets,
- NULL
};
/**
@@ -1145,7 +1143,6 @@
WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_other_orders_widgets,
- NULL
};
void ShowOrdersWindow(const Vehicle *v)