(svn r659) Support for cutomized TTDPatch-style new stations (no selector GUI yet) (pasky)

This commit is contained in:
tron
2004-11-17 18:03:33 +00:00
parent c4e9896851
commit 3a7abc2a35
5 changed files with 169 additions and 53 deletions

View File

@@ -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));
}