Changeset - r9772:24a1947a2c8b
[Not reviewed]
master
0 1 0
rubidium - 16 years ago 2008-08-01 09:26:39
rubidium@openttd.org
(svn r13909) -Codechange: use the same type before CmdBuildRailStation as it used in the command itself (Alberth)
1 file changed with 8 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/rail_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file rail_gui.cpp File for dealing with rail construction user interface */
 

	
 
#include "stdafx.h"
 
#include "direction_type.h"
 
#include "openttd.h"
 
#include "tile_cmd.h"
 
#include "landscape.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
@@ -48,23 +49,24 @@ static DiagDirection _build_depot_direct
 
static byte _waypoint_count = 1;             ///< Number of waypoint types
 
static byte _cur_waypoint_type;              ///< Currently selected waypoint type
 
static bool _convert_signal_button;          ///< convert signal button in the signal GUI pressed
 
static SignalVariant _cur_signal_variant;    ///< set the signal variant (for signal GUI)
 
static SignalType _cur_signal_type;          ///< set the signal type (for signal GUI)
 

	
 
static struct {
 
	byte orientation;                 ///< Currently selected rail station orientation
 
struct RailStationGUISettings {
 
	Axis orientation;                 ///< Currently selected rail station orientation
 
	byte numtracks;                   ///< Currently selected number of tracks in station (if not \c dragdrop )
 
	byte platlength;                  ///< Currently selected platform length of station (if not \c dragdrop )
 
	bool dragdrop;                    ///< Use drag & drop to place a station
 

	
 
	bool newstations;                 ///< Are custom station definitions available?
 
	StationClassIDByte station_class; ///< Currently selected custom station class (if newstations is \c true )
 
	byte station_type;                ///< Station type within the currently selected custom station class (if newstations is \c true )
 
	byte station_count;               ///< Number of custom stations (if newstations is \c true )
 
} _railstation;
 
};
 
static RailStationGUISettings _railstation; ///< Settings of the station builder GUI
 

	
 

	
 
static void HandleStationPlacement(TileIndex start, TileIndex end);
 
static void ShowBuildTrainDepotPicker(Window *parent);
 
static void ShowBuildWaypointPicker(Window *parent);
 
static void ShowStationBuilder(Window *parent);
 
@@ -861,13 +863,13 @@ static void HandleStationPlacement(TileI
 
	uint w,h;
 

	
 
	if (sx > ex) Swap(sx, ex);
 
	if (sy > ey) Swap(sy, ey);
 
	w = ex - sx + 1;
 
	h = ey - sy + 1;
 
	if (!_railstation.orientation) Swap(w, h);
 
	if (_railstation.orientation == AXIS_X) Swap(w, h);
 

	
 
	DoCommandP(TileXY(sx, sy),
 
			_railstation.orientation | (w << 8) | (h << 16) | (_ctrl_pressed << 24),
 
			_cur_railtype | (_railstation.station_class << 8) | (_railstation.station_type << 16), CcStation,
 
			CMD_BUILD_RAILROAD_STATION | CMD_NO_WATER | CMD_MSG(STR_100F_CAN_T_BUILD_RAILROAD_STATION));
 
}
 
@@ -992,13 +994,13 @@ public:
 

	
 
		if (_railstation.dragdrop) {
 
			SetTileSelectSize(1, 1);
 
		} else {
 
			int x = _railstation.numtracks;
 
			int y = _railstation.platlength;
 
			if (_railstation.orientation == 0) Swap(x, y);
 
			if (_railstation.orientation == AXIS_X) Swap(x, y);
 
			if (!_remove_button_clicked)
 
				SetTileSelectSize(x, y);
 
		}
 

	
 
		int rad = (_settings_game.station.modified_catchment) ? CA_TRAIN : CA_UNMODIFIED;
 

	
 
@@ -1078,13 +1080,13 @@ public:
 
	virtual void OnClick(Point pt, int widget)
 
	{
 
		switch (widget) {
 
			case BRSW_PLATFORM_DIR_X:
 
			case BRSW_PLATFORM_DIR_Y:
 
				this->RaiseWidget(_railstation.orientation + BRSW_PLATFORM_DIR_X);
 
				_railstation.orientation = widget - BRSW_PLATFORM_DIR_X;
 
				_railstation.orientation = (Axis)(widget - BRSW_PLATFORM_DIR_X);
 
				this->LowerWidget(_railstation.orientation + BRSW_PLATFORM_DIR_X);
 
				SndPlayFx(SND_15_BEEP);
 
				this->SetDirty();
 
				break;
 

	
 
			case BRSW_PLATFORM_NUM_1:
0 comments (0 inline, 0 general)