summaryrefslogtreecommitdiff
path: root/src/dock_gui.cpp
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-05-23 12:45:56 +0000
committermaedhros <maedhros@openttd.org>2007-05-23 12:45:56 +0000
commit1a9d43ff40f859c705ab987ef66b1576b6090425 (patch)
tree6595e32b2d16537c3647b01f1ff39b07b4d0f57a /src/dock_gui.cpp
parentc35b459d021068333c08be402e2bfbcb8842c659 (diff)
downloadopenttd-1a9d43ff40f859c705ab987ef66b1576b6090425.tar.xz
(svn r9900) -Codechange: Separate the variables for how to highlight a land area and what to do with it afterwards.
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r--src/dock_gui.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index a4a57d14b..8cd977928 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -53,12 +53,12 @@ static void PlaceDocks_Buoy(TileIndex tile)
static void PlaceDocks_DemolishArea(TileIndex tile)
{
- VpStartPlaceSizing(tile, VPM_X_AND_Y | GUI_PlaceProc_DemolishArea);
+ VpStartPlaceSizing(tile, VPM_X_AND_Y, GUI_PlaceProc_DemolishArea);
}
static void PlaceDocks_BuildCanal(TileIndex tile)
{
- VpStartPlaceSizing(tile, VPM_X_OR_Y);
+ VpStartPlaceSizing(tile, VPM_X_OR_Y, GUI_PlaceProc_None);
}
static void PlaceDocks_BuildLock(TileIndex tile)
@@ -147,16 +147,20 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
break;
case WE_PLACE_DRAG: {
- VpSelectTilesWithMethod(e->we.place.pt.x, e->we.place.pt.y, e->we.place.userdata);
+ VpSelectTilesWithMethod(e->we.place.pt.x, e->we.place.pt.y, e->we.place.select_method);
return;
}
case WE_PLACE_MOUSEUP:
if (e->we.place.pt.x != -1) {
- if ((e->we.place.userdata & 0xF) == VPM_X_AND_Y) { // dragged actions
- GUIPlaceProcDragXY(e);
- } else if (e->we.place.userdata == VPM_X_OR_Y) {
- DoCommandP(e->we.place.tile, e->we.place.starttile, 0, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS));
+ switch (e->we.place.select_method) {
+ case VPM_X_AND_Y:
+ GUIPlaceProcDragXY(e);
+ break;
+ case VPM_X_OR_Y:
+ DoCommandP(e->we.place.tile, e->we.place.starttile, 0, CcBuildCanal, CMD_BUILD_CANAL | CMD_AUTO | CMD_MSG(STR_CANT_BUILD_CANALS));
+ break;
+ default: break;
}
}
break;