summaryrefslogtreecommitdiff
path: root/rail_gui.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-04-02 23:05:09 +0000
committerDarkvater <Darkvater@openttd.org>2005-04-02 23:05:09 +0000
commitb05713285e4be362e138811d0752a7f5710739dd (patch)
treea3c43533eb0b67e41d490acab241a6fb4eb30cf6 /rail_gui.c
parent1ce34ea456e58b72fe9e5e6a65fa3f0a0019bccd (diff)
downloadopenttd-b05713285e4be362e138811d0752a7f5710739dd.tar.xz
(svn r2136) - Fix: [ 1174313 ] terrain hotkeys nonfunctional in scenario editor (D,Q,W,E,R,T,Y,U fltr)
- Fix: 'L' no longer opens ingame terraform bar in scenario editor bar, but the land generator one - Feature: [ 1095110 ] Create Lake and draggable Create Desert tools (initial implementation GoneWacko), also added sticky buttons to land generator and town generator - CodeChange: moved around some of the draggable tools, demystifying them - CodeChange: change CmdBuildCanal to allow for XANDY dragging not only X or Y (only scenario editor) - CodeChange: add some more enums to sprites. - TODO: merge most of the ingame and scenario editor land terraform code. This can only be done after OnClickButton function is changed so it also includes the backreference to the widget being clicked, postponed to after 0.4.0
Diffstat (limited to 'rail_gui.c')
-rw-r--r--rail_gui.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/rail_gui.c b/rail_gui.c
index f1b522958..093a2df1f 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -203,7 +203,7 @@ void PlaceProc_BuyLand(uint tile)
static void PlaceRail_ConvertRail(uint tile)
{
- VpStartPlaceSizing(tile, VPM_X_AND_Y | (1<<4));
+ VpStartPlaceSizing(tile, VPM_X_AND_Y | GUI_PlaceProc_ConvertRailArea);
}
static void PlaceRail_AutoSignals(uint tile)
@@ -436,8 +436,8 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
case WE_PLACE_MOUSEUP:
if (e->click.pt.x != -1) {
- uint start_tile = e->place.starttile;
- uint end_tile = e->place.tile;
+ TileIndex start_tile = e->place.starttile;
+ TileIndex end_tile = e->place.tile;
if (e->place.userdata == VPM_X_OR_Y) {
ResetObjectToPlace();
@@ -449,12 +449,11 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
_remove_button_clicked = old;
} else if (e->place.userdata == VPM_SIGNALDIRS) {
HandleAutoSignalPlacement();
- } else if (e->place.userdata == VPM_X_AND_Y) {
- DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA));
- } else if (e->place.userdata == (VPM_X_AND_Y | (1<<4))) {
- DoCommandP(end_tile, start_tile, _cur_railtype, CcPlaySound10, CMD_CONVERT_RAIL | CMD_MSG(STR_CANT_CONVERT_RAIL));
- } else if (e->place.userdata == (VPM_X_AND_Y | (2<<4))) {
- DoCommandP(end_tile, start_tile, _cur_railtype, CcPlaySound10, CMD_LEVEL_LAND | CMD_AUTO);
+ } else if ((e->place.userdata & 0xF) == VPM_X_AND_Y) {
+ if (GUIPlaceProcDragXY(e)) break;
+
+ if ((e->place.userdata >> 0xF) == GUI_PlaceProc_ConvertRailArea)
+ DoCommandP(end_tile, start_tile, _cur_railtype, CcPlaySound10, CMD_CONVERT_RAIL | CMD_MSG(STR_CANT_CONVERT_RAIL));
} else if (e->place.userdata == VPM_X_AND_Y_LIMITED) {
HandleStationPlacement(start_tile, end_tile);
} else