summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-01-18 13:02:47 +0000
committersmatz <smatz@openttd.org>2008-01-18 13:02:47 +0000
commit1d59439166df456e7c886b599eaf3328aef4ad33 (patch)
tree6f71f95cb20d1693e9d00ae92731d8f772f8f6ac
parent68707808c015db1cda0723882ffce99977d4593c (diff)
downloadopenttd-1d59439166df456e7c886b599eaf3328aef4ad33.tar.xz
(svn r11916) -Codechange: use enums from VehicleViewWindowWidgets instead of constants
-Fix: refit button widget was not correctly updated
-rw-r--r--src/aircraft_cmd.cpp14
-rw-r--r--src/roadveh_cmd.cpp18
-rw-r--r--src/ship_cmd.cpp16
-rw-r--r--src/train_cmd.cpp24
-rw-r--r--src/vehicle.cpp4
-rw-r--r--src/vehicle_func.h4
-rw-r--r--src/vehicle_gui.cpp20
-rw-r--r--src/vehicle_gui.h24
-rw-r--r--src/water_cmd.cpp2
9 files changed, 61 insertions, 65 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp
index 702661d65..2988791d1 100644
--- a/src/aircraft_cmd.cpp
+++ b/src/aircraft_cmd.cpp
@@ -537,7 +537,7 @@ CommandCost CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32
v->vehstatus ^= VS_STOPPED;
v->cur_speed = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClasses(WC_AIRCRAFT_LIST);
}
@@ -576,7 +576,7 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (flags & DC_EXEC) {
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -586,7 +586,7 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (v->current_order.flags & OFB_UNLOAD) v->cur_order_index++;
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
} else {
bool next_airport_has_hangar = true;
@@ -610,7 +610,7 @@ CommandCost CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uin
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
v->current_order.refit_cargo = CT_INVALID;
v->current_order.dest = next_airport_index;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
if (v->u.air.state == FLYING && !next_airport_has_hangar) {
/* The aircraft is now heading for a different hangar than the next in the orders */
AircraftNextAirportPos_and_Order(v);
@@ -715,11 +715,11 @@ static void CheckIfAircraftNeedsService(Vehicle *v)
// v->u.air.targetairport = st->index;
v->current_order.type = OT_GOTO_DEPOT;
v->current_order.flags = OFB_NON_STOP;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
} else if (v->current_order.type == OT_GOTO_DEPOT) {
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
@@ -941,7 +941,7 @@ static int UpdateAircraftSpeed(Vehicle *v, uint speed_limit = SPEED_LIMIT_NONE,
if (spd != v->cur_speed) {
v->cur_speed = spd;
if (_patches.vehicle_speed)
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
if (!(v->direction & 1)) spd = spd * 3 / 4;
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 4a5a98221..336137c96 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -314,7 +314,7 @@ CommandCost CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32
v->vehstatus ^= VS_STOPPED;
v->cur_speed = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
}
@@ -486,7 +486,7 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
if (flags & DC_EXEC) {
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -500,7 +500,7 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -518,7 +518,7 @@ CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint3
v->current_order.refit_cargo = CT_INVALID;
v->current_order.dest = dep->index;
v->dest_tile = dep->xy;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
@@ -694,7 +694,7 @@ static void RoadVehCrash(Vehicle *v)
ClearSlot(v);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
SetDParam(0, pass);
AddNewsItem(
@@ -963,7 +963,7 @@ static bool RoadVehAccelerate(Vehicle *v)
if (spd != v->cur_speed) {
v->cur_speed = spd;
if (_patches.vehicle_speed) {
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
@@ -1892,7 +1892,7 @@ again:
}
StartRoadVehSound(v);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
/* Check tile position conditions - i.e. stop position in depot,
@@ -1983,7 +1983,7 @@ static void CheckIfRoadVehNeedsService(Vehicle *v)
if (v->current_order.type == OT_GOTO_DEPOT) {
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return;
}
@@ -2001,7 +2001,7 @@ static void CheckIfRoadVehNeedsService(Vehicle *v)
v->current_order.flags = OFB_NON_STOP;
v->current_order.dest = depot->index;
v->dest_tile = depot->xy;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
void OnNewDay_RoadVeh(Vehicle *v)
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index cae413356..bddf94a94 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -158,7 +158,7 @@ static void CheckIfShipNeedsService(Vehicle *v)
if (v->current_order.type == OT_GOTO_DEPOT) {
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return;
}
@@ -167,7 +167,7 @@ static void CheckIfShipNeedsService(Vehicle *v)
v->current_order.flags = OFB_NON_STOP;
v->current_order.dest = depot->index;
v->dest_tile = depot->xy;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
void OnNewDay_Ship(Vehicle *v)
@@ -386,7 +386,7 @@ static bool ShipAccelerate(Vehicle *v)
if (spd != v->cur_speed) {
v->cur_speed = spd;
if (_patches.vehicle_speed)
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
/* Decrease somewhat when turning */
@@ -683,7 +683,7 @@ static void ShipController(Vehicle *v)
* always skip ahead. */
if (v->current_order.type == OT_LEAVESTATION) {
v->current_order.Free();
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
} else if (v->dest_tile != 0) {
/* We have a target, let's see if we reached it... */
if (v->current_order.type == OT_GOTO_STATION &&
@@ -961,7 +961,7 @@ CommandCost CmdStartStopShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
v->vehstatus ^= VS_STOPPED;
v->cur_speed = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
InvalidateWindowClasses(WC_SHIPS_LIST);
}
@@ -1007,7 +1007,7 @@ CommandCost CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
if (flags & DC_EXEC) {
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -1021,7 +1021,7 @@ CommandCost CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -1038,7 +1038,7 @@ CommandCost CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
v->current_order.refit_cargo = CT_INVALID;
v->current_order.dest = dep->index;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp
index ad6a8afe3..820b8731c 100644
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -132,7 +132,7 @@ void TrainPowerChanged(Vehicle* v)
v->u.rail.cached_power = total_power;
v->u.rail.cached_max_te = max_te;
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
@@ -1247,7 +1247,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p
InvalidateWindow(WC_VEHICLE_DETAILS, src_head->index);
/* Update the refit button and window */
InvalidateWindow(WC_VEHICLE_REFIT, src_head->index);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, src_head->index, 12);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, src_head->index, VVW_WIDGET_REFIT_VEH);
}
/* Update the depot window */
InvalidateWindow(WC_VEHICLE_DEPOT, src_head->tile);
@@ -1261,7 +1261,7 @@ CommandCost CmdMoveRailVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p
UpdateTrainAcceleration(dst_head);
InvalidateWindow(WC_VEHICLE_DETAILS, dst_head->index);
/* Update the refit button and window */
- InvalidateWindowWidget(WC_VEHICLE_VIEW, dst_head->index, 12);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, dst_head->index, VVW_WIDGET_REFIT_VEH);
InvalidateWindow(WC_VEHICLE_REFIT, dst_head->index);
}
/* Update the depot window */
@@ -1304,7 +1304,7 @@ CommandCost CmdStartStopTrain(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
}
v->vehstatus ^= VS_STOPPED;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
}
return CommandCost();
@@ -1549,7 +1549,7 @@ static void SetLastSpeed(Vehicle* v, int spd)
if (spd != old) {
v->u.rail.last_speed = spd;
if (_patches.vehicle_speed || (old == 0) != (spd == 0))
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
@@ -2062,7 +2062,7 @@ CommandCost CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32
if (flags & DC_EXEC) {
ClrBit(v->current_order.flags, OF_PART_OF_ORDERS);
ToggleBit(v->current_order.flags, OF_HALT_IN_DEPOT);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -2075,7 +2075,7 @@ CommandCost CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return CommandCost();
}
@@ -2096,7 +2096,7 @@ CommandCost CmdSendTrainToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32
if (!(p2 & DEPOT_SERVICE)) SetBit(v->current_order.flags, OF_HALT_IN_DEPOT);
v->current_order.dest = GetDepotByTile(tfdd.tile)->index;
v->current_order.refit_cargo = CT_INVALID;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
/* If there is no depot in front, reverse automatically */
if (tfdd.reverse) DoCommand(v->tile, v->index, 0, DC_EXEC, CMD_REVERSE_TRAIN_DIRECTION);
}
@@ -2844,7 +2844,7 @@ static void SetVehicleCrashed(Vehicle *v)
v->u.rail.crash_anim_pos++;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
if (v->u.rail.track == TRACK_BIT_DEPOT) {
@@ -2995,7 +2995,7 @@ static void TrainController(Vehicle *v, bool update_image)
if (v->current_order.type == OT_LEAVESTATION) {
v->current_order.Free();
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
}
} else {
@@ -3588,7 +3588,7 @@ static void CheckIfTrainNeedsService(Vehicle *v)
* schedule? */
v->current_order.type = OT_DUMMY;
v->current_order.flags = 0;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
return;
}
@@ -3605,7 +3605,7 @@ static void CheckIfTrainNeedsService(Vehicle *v)
v->current_order.flags = OFB_NON_STOP;
v->current_order.dest = depot->index;
v->dest_tile = tfdd.tile;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
void OnNewDay_Train(Vehicle *v)
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index d551bda88..0f31224c1 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -3131,7 +3131,7 @@ void Vehicle::BeginLoading()
VehiclePayment(this);
InvalidateWindow(this->GetVehicleListWindowClass(), this->owner);
- InvalidateWindowWidget(WC_VEHICLE_VIEW, this->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, this->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DETAILS, this->index);
InvalidateWindow(WC_STATION_VIEW, this->last_station_visited);
@@ -3222,7 +3222,7 @@ void StopAllVehicles()
/* Code ripped from CmdStartStopTrain. Can't call it, because of
* ownership problems, so we'll duplicate some code, for now */
v->vehstatus |= VS_STOPPED;
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
}
}
diff --git a/src/vehicle_func.h b/src/vehicle_func.h
index 476c35782..874e8910d 100644
--- a/src/vehicle_func.h
+++ b/src/vehicle_func.h
@@ -133,10 +133,6 @@ SpriteID GetEnginePalette(EngineID engine_type, PlayerID player);
*/
SpriteID GetVehiclePalette(const Vehicle *v);
-/* A lot of code calls for the invalidation of the status bar, which is widget 5.
- * Best is to have a virtual value for it when it needs to change again */
-#define STATUS_BAR 5
-
extern const uint32 _veh_build_proc_table[];
extern const uint32 _veh_sell_proc_table[];
extern const uint32 _veh_refit_proc_table[];
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index bba67dd13..eff8bfa34 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1645,26 +1645,6 @@ static void ShowVehicleDetailsWindow(const Vehicle *v)
/* Unified vehicle GUI - Vehicle View Window */
-/** Constants of vehicle view widget indices */
-enum VehicleViewWindowWidgets {
- VVW_WIDGET_CLOSEBOX = 0,
- VVW_WIDGET_CAPTION,
- VVW_WIDGET_STICKY,
- VVW_WIDGET_PANEL,
- VVW_WIDGET_VIEWPORT,
- VVW_WIDGET_START_STOP_VEH,
- VVW_WIDGET_CENTER_MAIN_VIEH,
- VVW_WIDGET_GOTO_DEPOT,
- VVW_WIDGET_REFIT_VEH,
- VVW_WIDGET_SHOW_ORDERS,
- VVW_WIDGET_SHOW_DETAILS,
- VVW_WIDGET_CLONE_VEH,
- VVW_WIDGET_EMPTY_BOTTOM_RIGHT,
- VVW_WIDGET_RESIZE,
- VVW_WIDGET_TURN_AROUND,
- VVW_WIDGET_FORCE_PROCEED,
-};
-
/** Vehicle view widgets. */
static const Widget _vehicle_view_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW }, // VVW_WIDGET_CLOSEBOX
diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h
index 64d2fe5d5..7c79aff58 100644
--- a/src/vehicle_gui.h
+++ b/src/vehicle_gui.h
@@ -22,7 +22,27 @@ void BuildVehicleList(vehiclelist_d *vl, PlayerID owner, uint16 index, uint16 wi
extern const StringID _vehicle_sort_listing[];
-/* Start of functions regarding vehicle list windows */
+/** Constants of vehicle view widget indices */
+enum VehicleViewWindowWidgets {
+ VVW_WIDGET_CLOSEBOX = 0,
+ VVW_WIDGET_CAPTION,
+ VVW_WIDGET_STICKY,
+ VVW_WIDGET_PANEL,
+ VVW_WIDGET_VIEWPORT,
+ VVW_WIDGET_START_STOP_VEH,
+ VVW_WIDGET_CENTER_MAIN_VIEH,
+ VVW_WIDGET_GOTO_DEPOT,
+ VVW_WIDGET_REFIT_VEH,
+ VVW_WIDGET_SHOW_ORDERS,
+ VVW_WIDGET_SHOW_DETAILS,
+ VVW_WIDGET_CLONE_VEH,
+ VVW_WIDGET_EMPTY_BOTTOM_RIGHT,
+ VVW_WIDGET_RESIZE,
+ VVW_WIDGET_TURN_AROUND,
+ VVW_WIDGET_FORCE_PROCEED,
+};
+
+/** Start of functions regarding vehicle list windows */
enum {
PLY_WND_PRC__OFFSET_TOP_WIDGET = 26,
PLY_WND_PRC__SIZE_OF_ROW_TINY = 13,
@@ -31,7 +51,7 @@ enum {
PLY_WND_PRC__SIZE_OF_ROW_BIG2 = 39,
};
-/* Vehicle List Window type flags */
+/** Vehicle List Window type flags */
enum {
VLW_STANDARD = 0 << 8,
VLW_SHARED_ORDERS = 1 << 8,
diff --git a/src/water_cmd.cpp b/src/water_cmd.cpp
index 319362bea..30784aad5 100644
--- a/src/water_cmd.cpp
+++ b/src/water_cmd.cpp
@@ -770,7 +770,7 @@ static void FloodVehicle(Vehicle *v)
return;
}
- InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, STATUS_BAR);
+ InvalidateWindowWidget(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
InvalidateWindow(WC_VEHICLE_DEPOT, v->tile);
SetDParam(0, pass);