diff options
author | tron <tron@openttd.org> | 2004-11-17 18:03:33 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-11-17 18:03:33 +0000 |
commit | 3a7abc2a35fba00e1e59d8ea7fbfb1442e9c20c9 (patch) | |
tree | 948381017e4e170aac46612f80b7a790ea6b75b7 /rail_gui.c | |
parent | c4e989685179fbe463d138834f71375e94e0fbad (diff) | |
download | openttd-3a7abc2a35fba00e1e59d8ea7fbfb1442e9c20c9.tar.xz |
(svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)
Diffstat (limited to 'rail_gui.c')
-rw-r--r-- | rail_gui.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/rail_gui.c b/rail_gui.c index b50b56c59..dc0721d73 100644 --- a/rail_gui.c +++ b/rail_gui.c @@ -140,7 +140,9 @@ static void PlaceRail_Station(uint tile) VpStartPlaceSizing(tile, VPM_X_AND_Y_LIMITED); VpSetPlaceSizingLimit(_patches.station_spread); } else { - DoCommandP(tile, _railstation.orientation | (_railstation.numtracks<<8) | (_railstation.platlength<<16),_cur_railtype, CcStation, + // TODO: Custom station selector GUI. Now we just try using first custom station + // (and fall back to normal stations if it isn't available). + DoCommandP(tile, _railstation.orientation | (_railstation.numtracks<<8) | (_railstation.platlength<<16),_cur_railtype|1<<4, CcStation, CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); } } @@ -822,6 +824,9 @@ void ShowBuildRailToolbar(int index, int button) if (w != NULL && button >= 0) _build_railroad_button_proc[button](w); } +/* TODO: For custom stations, respect their allowed platforms/lengths bitmasks! + * --pasky */ + static void HandleStationPlacement(uint start, uint end) { uint sx = GET_TILE_X(start); @@ -836,7 +841,9 @@ static void HandleStationPlacement(uint start, uint end) h = ey - sy + 1; if (!_railstation.orientation) intswap(w,h); - DoCommandP(TILE_XY(sx,sy), _railstation.orientation | (w<<8) | (h<<16),_cur_railtype, CcStation, + // TODO: Custom station selector GUI. Now we just try using first custom station + // (and fall back to normal stations if it isn't available). + DoCommandP(TILE_XY(sx,sy), _railstation.orientation | (w<<8) | (h<<16),_cur_railtype|1<<4, CcStation, CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_AUTO | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION)); } |