Changeset - r7789:42eeaa70c489
[Not reviewed]
master
0 7 0
rubidium - 17 years ago 2007-10-22 19:11:50
rubidium@openttd.org
(svn r11339) -Add: autoroad; same as autorail, but for road and trams and only on X and Y direction. Patch by Octopussy and skidd13.
7 files changed with 159 insertions and 35 deletions:
0 comments (0 inline, 0 general)
bin/data/openttd.grf
Show inline comments
 
binary diff not shown
src/gfxinit.cpp
Show inline comments
 
@@ -321,13 +321,13 @@ static const SpriteID _openttd_grf_index
 
	633, 633, ///<  × large
 
	665, 665, ///<  ÷ large
 
	SPR_SELL_TRAIN, SPR_SHARED_ORDERS_ICON,
 
	377, 377, ///<  · small
 
	153, 153, ///<  · medium
 
	601, 601, ///<  · large
 
	SPR_WARNING_SIGN, SPR_WARNING_SIGN,
 
	SPR_WARNING_SIGN, SPR_CURSOR_AUTOTRAM,
 
	END
 
};
 

	
 

	
 
static void LoadSpriteTables()
 
{
src/gui.h
Show inline comments
 
@@ -85,12 +85,13 @@ enum {
 
	DDSP_REMOVE_STATION,
 
	DDSP_CONVERT_RAIL,
 

	
 
	/* Road specific actions */
 
	DDSP_PLACE_ROAD_NE,
 
	DDSP_PLACE_ROAD_NW,
 
	DDSP_PLACE_AUTOROAD,
 
};
 

	
 
/* misc_gui.cpp */
 
void PlaceLandBlockInfo();
 
void ShowAboutWindow();
 
void ShowBuildTreesToolbar();
src/lang/english.txt
Show inline comments
 
@@ -1664,13 +1664,15 @@ STR_1808_CAN_T_BUILD_BUS_STATION        
 
STR_1809_CAN_T_BUILD_TRUCK_STATION                              :{WHITE}Can't build lorry station...
 
STR_1808_CAN_T_BUILD_PASSENGER_TRAM_STATION                     :{WHITE}Can't build passenger tram station...
 
STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION                         :{WHITE}Can't build freight tram station...
 
STR_180A_ROAD_CONSTRUCTION                                      :Road construction
 
STR_180A_TRAMWAY_CONSTRUCTION                                   :Tramway construction
 
STR_180B_BUILD_ROAD_SECTION                                     :{BLACK}Build road section
 
STR_BUILD_AUTOROAD_TIP                                          :{BLACK}Build road section using the Autoroad mode
 
STR_180B_BUILD_TRAMWAY_SECTION                                  :{BLACK}Build tramway section
 
STR_BUILD_AUTOTRAM_TIP                                          :{BLACK}Build tramway section using the Autotram mode
 
STR_180C_BUILD_ROAD_VEHICLE_DEPOT                               :{BLACK}Build road vehicle depot (for building and servicing vehicles)
 
STR_180C_BUILD_TRAM_VEHICLE_DEPOT                               :{BLACK}Build tram vehicle depot (for building and servicing vehicles)
 
STR_180D_BUILD_BUS_STATION                                      :{BLACK}Build bus station
 
STR_180E_BUILD_TRUCK_LOADING_BAY                                :{BLACK}Build lorry loading bay
 
STR_180D_BUILD_PASSENGER_TRAM_STATION                           :{BLACK}Build passenger tram station
 
STR_180E_BUILD_CARGO_TRAM_STATION                               :{BLACK}Build freight tram station
src/road_gui.cpp
Show inline comments
 
@@ -27,36 +27,85 @@
 

	
 
static void ShowRVStationPicker(RoadStop::Type rs);
 
static void ShowRoadDepotPicker();
 

	
 
static bool _remove_button_clicked;
 

	
 
static byte _place_road_flag;
 
/**
 
 * Define the values of the RoadFlags
 
 * @see CmdBuildLongRoad
 
 */
 
enum RoadFlags {
 
	RF_NONE             = 0x00,
 
	RF_START_HALFROAD_Y = 0x01,    // The start tile in Y-dir should have only a half hoad
 
	RF_END_HALFROAD_Y   = 0x02,    // The end tile in Y-dir should have only a half hoad
 
	RF_DIR_Y            = 0x04,    // The direction is Y-dir
 
	RF_DIR_X            = RF_NONE, // Dummy; Dir X is set when RF_DIR_Y is not set
 
	RF_START_HALFROAD_X = 0x08,    // The start tile in X-dir should have only a half hoad
 
	RF_END_HALFROAD_X   = 0x10,    // The end tile in X-dir should have only a half hoad
 
};
 
DECLARE_ENUM_AS_BIT_SET(RoadFlags);
 

	
 
static RoadFlags _place_road_flag;
 

	
 
static RoadType _cur_roadtype;
 

	
 
static DiagDirection _road_depot_orientation;
 
static DiagDirection _road_station_picker_orientation;
 

	
 
void CcPlaySound1D(bool success, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (success) SndPlayTileFx(SND_1F_SPLAT, tile);
 
}
 

	
 
/**
 
 * Set the initial flags for the road constuction.
 
 * The flags are:
 
 * @li The direction is the Y-dir
 
 * @li The first tile has a partitial RoadBit (true or false)
 
 *
 
 * @param tile The start tile
 
 */
 
static void PlaceRoad_NE(TileIndex tile)
 
{
 
	_place_road_flag = (_tile_fract_coords.y >= 8) + 4;
 
	_place_road_flag = RF_DIR_Y;
 
	if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y;
 
	VpStartPlaceSizing(tile, VPM_FIX_X, DDSP_PLACE_ROAD_NE);
 
}
 

	
 
/**
 
 * Set the initial flags for the road constuction.
 
 * The flags are:
 
 * @li The direction is the X-dir
 
 * @li The first tile has a partitial RoadBit (true or false)
 
 *
 
 * @param tile The start tile
 
 */
 
static void PlaceRoad_NW(TileIndex tile)
 
{
 
	_place_road_flag = (_tile_fract_coords.x >= 8) + 0;
 
	_place_road_flag = RF_DIR_X;
 
	if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X;
 
	VpStartPlaceSizing(tile, VPM_FIX_Y, DDSP_PLACE_ROAD_NW);
 
}
 

	
 
/**
 
 * Set the initial flags for the road constuction.
 
 * The flags are:
 
 * @li The direction is not set.
 
 * @li The first tile has a partitial RoadBit (true or false)
 
 *
 
 * @param tile The start tile
 
 */
 
static void PlaceRoad_AutoRoad(TileIndex tile)
 
{
 
	_place_road_flag = RF_NONE;
 
	if (_tile_fract_coords.x >= 8) _place_road_flag |= RF_START_HALFROAD_X;
 
	if (_tile_fract_coords.y >= 8) _place_road_flag |= RF_START_HALFROAD_Y;
 
	VpStartPlaceSizing(tile, VPM_X_OR_Y, DDSP_PLACE_AUTOROAD);
 
}
 

	
 
static void PlaceRoad_Bridge(TileIndex tile)
 
{
 
	VpStartPlaceSizing(tile, VPM_X_OR_Y, DDSP_BUILD_BRIDGE);
 
}
 

	
 

	
 
@@ -80,12 +129,13 @@ struct RoadTypeInfo {
 

	
 
	StringID picker_title[2];       ///< Title for the station picker for bus or truck stations
 
	StringID picker_tooltip[2];     ///< Tooltip for the station picker for bus or truck stations
 

	
 
	SpriteID cursor_nesw;           ///< Cursor for building NE and SW bits
 
	SpriteID cursor_nwse;           ///< Cursor for building NW and SE bits
 
	SpriteID cursor_autoroad;       ///< Cursor for building autoroad
 
};
 

	
 
/** What errors/cursors must be shown for several types of roads */
 
static const RoadTypeInfo _road_type_infos[] = {
 
	{
 
		STR_1804_CAN_T_BUILD_ROAD_HERE,
 
@@ -95,24 +145,26 @@ static const RoadTypeInfo _road_type_inf
 
		{ STR_CAN_T_REMOVE_BUS_STATION,            STR_CAN_T_REMOVE_TRUCK_STATION     },
 
		{ STR_3042_BUS_STATION_ORIENTATION,        STR_3043_TRUCK_STATION_ORIENT      },
 
		{ STR_3051_SELECT_BUS_STATION_ORIENTATION, STR_3052_SELECT_TRUCK_LOADING_BAY  },
 

	
 
		SPR_CURSOR_ROAD_NESW,
 
		SPR_CURSOR_ROAD_NWSE,
 
		SPR_CURSOR_AUTOROAD,
 
	},
 
	{
 
		STR_1804_CAN_T_BUILD_TRAMWAY_HERE,
 
		STR_1805_CAN_T_REMOVE_TRAMWAY_FROM,
 
		STR_1807_CAN_T_BUILD_TRAM_VEHICLE,
 
		{ STR_1808_CAN_T_BUILD_PASSENGER_TRAM_STATION,        STR_1809_CAN_T_BUILD_CARGO_TRAM_STATION        },
 
		{ STR_CAN_T_REMOVE_PASSENGER_TRAM_STATION,            STR_CAN_T_REMOVE_CARGO_TRAM_STATION            },
 
		{ STR_3042_PASSENGER_TRAM_STATION_ORIENTATION,        STR_3043_CARGO_TRAM_STATION_ORIENT             },
 
		{ STR_3051_SELECT_PASSENGER_TRAM_STATION_ORIENTATION, STR_3052_SELECT_CARGO_TRAM_STATION_ORIENTATION },
 

	
 
		SPR_CURSOR_TRAMWAY_NESW,
 
		SPR_CURSOR_TRAMWAY_NWSE,
 
		SPR_CURSOR_AUTOTRAM,
 
	},
 
};
 

	
 
static void PlaceRoad_Tunnel(TileIndex tile)
 
{
 
	DoCommandP(tile, 0x200 | RoadTypeToRoadTypes(_cur_roadtype), 0, CcBuildRoadTunnel, CMD_BUILD_TUNNEL | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE));
 
@@ -184,33 +236,56 @@ static void PlaceRoad_DemolishArea(TileI
 
enum RoadToolbarWidgets {
 
	RTW_CLOSEBOX = 0,
 
	RTW_CAPTION,
 
	RTW_STICKY,
 
	RTW_ROAD_X,
 
	RTW_ROAD_Y,
 
	RTW_AUTOROAD,
 
	RTW_DEMOLISH,
 
	RTW_DEPOT,
 
	RTW_BUS_STATION,
 
	RTW_TRUCK_STATION,
 
	RTW_BUILD_BRIDGE,
 
	RTW_BUILD_TUNNEL,
 
	RTW_REMOVE,
 
};
 

	
 
typedef void OnButtonClick(Window *w);
 

	
 
/**
 
 * Function that handles the click on the
 
 *  X road placement button.
 
 *
 
 * @param w The current window
 
 */
 
static void BuildRoadClick_NE(Window *w)
 
{
 
	HandlePlacePushButton(w, RTW_ROAD_X, _road_type_infos[_cur_roadtype].cursor_nesw, 1, PlaceRoad_NE);
 
}
 

	
 
/**
 
 * Function that handles the click on the
 
 *  Y road placement button.
 
 *
 
 * @param w The current window
 
 */
 
static void BuildRoadClick_NW(Window *w)
 
{
 
	HandlePlacePushButton(w, RTW_ROAD_Y, _road_type_infos[_cur_roadtype].cursor_nwse, 1, PlaceRoad_NW);
 
}
 

	
 
/**
 
 * Function that handles the click on the
 
 *  autoroad placement button.
 
 *
 
 * @param w The current window
 
 */
 
static void BuildRoadClick_AutoRoad(Window *w)
 
{
 
	HandlePlacePushButton(w, RTW_AUTOROAD, _road_type_infos[_cur_roadtype].cursor_autoroad, 1, PlaceRoad_AutoRoad);
 
}
 

	
 
static void BuildRoadClick_Demolish(Window *w)
 
{
 
	HandlePlacePushButton(w, RTW_DEMOLISH, ANIMCURSOR_DEMOLISH, 1, PlaceRoad_DemolishArea);
 
}
 

	
 
@@ -248,31 +323,35 @@ static void BuildRoadClick_Remove(Window
 
	SetWindowDirty(w);
 
	SndPlayFx(SND_15_BEEP);
 
	ToggleWidgetLoweredState(w, RTW_REMOVE);
 
	SetSelectionRed(IsWindowWidgetLowered(w, RTW_REMOVE));
 
}
 

	
 
/** Array with the handlers of the button-clicks for the road-toolbar */
 
static OnButtonClick* const _build_road_button_proc[] = {
 
	BuildRoadClick_NE,
 
	BuildRoadClick_NW,
 
	BuildRoadClick_AutoRoad,
 
	BuildRoadClick_Demolish,
 
	BuildRoadClick_Depot,
 
	BuildRoadClick_BusStation,
 
	BuildRoadClick_TruckStation,
 
	BuildRoadClick_Bridge,
 
	BuildRoadClick_Tunnel,
 
	BuildRoadClick_Remove
 
};
 

	
 
/** Array with the keycode of the button-clicks for the road-toolbar */
 
static const uint16 _road_keycodes[] = {
 
	'1',
 
	'2',
 
	'3',
 
	'4',
 
	'5',
 
	'6',
 
	'7',
 
	'B',
 
	'T',
 
	'R',
 
};
 

	
 
/**
 
@@ -288,12 +367,13 @@ static void UpdateRemoveWidgetStatus(Win
 
			/* If it is the removal button that has been clicked, do nothing,
 
			 * as it is up to the other buttons to drive removal status */
 
			return;
 
			break;
 
		case RTW_ROAD_X:
 
		case RTW_ROAD_Y:
 
		case RTW_AUTOROAD:
 
		case RTW_BUS_STATION:
 
		case RTW_TRUCK_STATION:
 
			/* Removal button is enabled only if the road/station
 
			 * button is still lowered.  Once raised, it has to be disabled */
 
			SetWindowWidgetDisabledState(w, RTW_REMOVE, !IsWindowWidgetLowered(w, clicked_widget));
 
			break;
 
@@ -358,19 +438,44 @@ static void BuildRoadToolbWndProc(Window
 
		if (w != NULL) WP(w, def_d).close = true;
 
		w = FindWindowById(WC_BUILD_DEPOT, 0);
 
		if (w != NULL) WP(w, def_d).close = true;
 
		break;
 

	
 
	case WE_PLACE_DRAG:
 
		/* Here we update the end tile flags
 
		 * of the road placement actions.
 
		 * At first we reset the end halfroad
 
		 * bits and if needed we set them again. */
 
		switch (e->we.place.select_proc) {
 
			case DDSP_PLACE_ROAD_NE:
 
				_place_road_flag = (_place_road_flag & ~2) | ((e->we.place.pt.y & 8) >> 2);
 
				_place_road_flag &= ~RF_END_HALFROAD_Y;
 
				if (e->we.place.pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
 
				break;
 

	
 
			case DDSP_PLACE_ROAD_NW:
 
				_place_road_flag = (_place_road_flag & ~2) | ((e->we.place.pt.x & 8) >> 2);
 
				_place_road_flag &= ~RF_END_HALFROAD_X;
 
				if (e->we.place.pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X;
 
				break;
 

	
 
			case DDSP_PLACE_AUTOROAD:
 
				_place_road_flag &= ~(RF_END_HALFROAD_Y | RF_END_HALFROAD_X);
 
				if (e->we.place.pt.y & 8) _place_road_flag |= RF_END_HALFROAD_Y;
 
				if (e->we.place.pt.x & 8) _place_road_flag |= RF_END_HALFROAD_X;
 

	
 
				/* For autoroad we need to update the
 
				 * direction of the road */
 
				if (_thd.size.x > _thd.size.y || (_thd.size.x == _thd.size.y &&
 
						(_tile_fract_coords.x < _tile_fract_coords.y && (_tile_fract_coords.x + _tile_fract_coords.y) < 16) ||
 
						(_tile_fract_coords.x > _tile_fract_coords.y && (_tile_fract_coords.x + _tile_fract_coords.y) > 16) )) {
 
					/* Set dir = X */
 
					_place_road_flag &= ~RF_DIR_Y;
 
				} else {
 
					/* Set dir = Y */
 
					_place_road_flag |= RF_DIR_Y;
 
				}
 

	
 
				break;
 
		}
 

	
 
		VpSelectTilesWithMethod(e->we.place.pt.x, e->we.place.pt.y, e->we.place.select_method);
 
		return;
 

	
 
@@ -388,12 +493,19 @@ static void BuildRoadToolbWndProc(Window
 
				case DDSP_DEMOLISH_AREA:
 
					DoCommandP(end_tile, start_tile, 0, CcPlaySound10, CMD_CLEAR_AREA | CMD_MSG(STR_00B5_CAN_T_CLEAR_THIS_AREA));
 
					break;
 

	
 
				case DDSP_PLACE_ROAD_NE:
 
				case DDSP_PLACE_ROAD_NW:
 
				case DDSP_PLACE_AUTOROAD:
 
					/* Flag description:
 
					 * Use the first three bits (0x07) if dir == Y
 
					 * else use the last 2 bits (X dir has
 
					 * not the 3rd bit set) */
 
					_place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3));
 

	
 
					DoCommandP(end_tile, start_tile, _place_road_flag | (_cur_roadtype << 3) | _ctrl_pressed << 5, CcPlaySound1D,
 
						_remove_button_clicked ?
 
						CMD_REMOVE_LONG_ROAD | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) :
 
						CMD_BUILD_LONG_ROAD | CMD_NO_WATER | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road));
 
					break;
 
			}
 
@@ -414,55 +526,59 @@ static void BuildRoadToolbWndProc(Window
 
	}
 
}
 

	
 
/** Widget definition of the build road toolbar */
 
static const Widget _build_road_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5,                   STR_018B_CLOSE_WINDOW},             // RTW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   205,     0,    13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},   // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,     7,   206,   217,     0,    13, 0x0,                        STR_STICKY_BUTTON},                 // RTW_STICKY
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   227,     0,    13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},   // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,     7,   228,   239,     0,    13, 0x0,                        STR_STICKY_BUTTON},                 // RTW_STICKY
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,     0,    21,    14,    35, SPR_IMG_ROAD_NW,            STR_180B_BUILD_ROAD_SECTION},       // RTW_ROAD_X
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    22,    43,    14,    35, SPR_IMG_ROAD_NE,            STR_180B_BUILD_ROAD_SECTION},       // RTW_ROAD_Y
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    44,    65,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},   // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    66,    87,    14,    35, SPR_IMG_ROAD_DEPOT,         STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, // RTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    88,   109,    14,    35, SPR_IMG_BUS_STATION,        STR_180D_BUILD_BUS_STATION},        // RTW_BUS_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   110,   131,    14,    35, SPR_IMG_TRUCK_BAY,          STR_180E_BUILD_TRUCK_LOADING_BAY},  // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   132,   173,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_ROAD_BRIDGE},        // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   174,   195,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_ROAD_TUNNEL},        // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   196,   217,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR},  // RTW_REMOVE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    44,    65,    14,    35, SPR_IMG_AUTOROAD,           STR_BUILD_AUTOROAD_TIP},            // RTW_AUTOROAD
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    66,    87,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},   // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    88,   109,    14,    35, SPR_IMG_ROAD_DEPOT,         STR_180C_BUILD_ROAD_VEHICLE_DEPOT}, // RTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   110,   131,    14,    35, SPR_IMG_BUS_STATION,        STR_180D_BUILD_BUS_STATION},        // RTW_BUS_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   132,   153,    14,    35, SPR_IMG_TRUCK_BAY,          STR_180E_BUILD_TRUCK_LOADING_BAY},  // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   153,   195,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_ROAD_BRIDGE},        // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   196,   217,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_ROAD_TUNNEL},        // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   218,   239,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR},  // RTW_REMOVE
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_desc = {
 
	WDP_ALIGN_TBR, 22, 218, 36, 218, 36,
 
	WDP_ALIGN_TBR, 22, 240, 36, 240, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_road_widgets,
 
	BuildRoadToolbWndProc
 
};
 

	
 
/** Widget definition of the build tram toolbar */
 
static const Widget _build_tramway_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5,                   STR_018B_CLOSE_WINDOW},                     // RTW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   205,     0,    13, STR_1802_TRAMWAY_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},        // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,     7,   206,   217,     0,    13, 0x0,                        STR_STICKY_BUTTON},                         // RTW_STICKY
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   227,     0,    13, STR_1802_TRAMWAY_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},        // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,     7,   228,   239,     0,    13, 0x0,                        STR_STICKY_BUTTON},                         // RTW_STICKY
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,     0,    21,    14,    35, SPR_IMG_TRAMWAY_NW,         STR_180B_BUILD_TRAMWAY_SECTION},            // RTW_ROAD_X
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    22,    43,    14,    35, SPR_IMG_TRAMWAY_NE,         STR_180B_BUILD_TRAMWAY_SECTION},            // RTW_ROAD_Y
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    44,    65,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},           // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    66,    87,    14,    35, SPR_IMG_ROAD_DEPOT,         STR_180C_BUILD_TRAM_VEHICLE_DEPOT},         // RTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    88,   109,    14,    35, SPR_IMG_BUS_STATION,        STR_180D_BUILD_PASSENGER_TRAM_STATION},     // RTW_BUS_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   110,   131,    14,    35, SPR_IMG_TRUCK_BAY,          STR_180E_BUILD_CARGO_TRAM_STATION},         // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   132,   173,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_TRAMWAY_BRIDGE},             // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   174,   195,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_TRAMWAY_TUNNEL},             // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   196,   217,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS}, // RTW_REMOVE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    44,    65,    14,    35, SPR_IMG_AUTOTRAM,           STR_BUILD_AUTOTRAM_TIP},                    // RTW_AUTOROAD
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    66,    87,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},           // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    88,   109,    14,    35, SPR_IMG_ROAD_DEPOT,         STR_180C_BUILD_TRAM_VEHICLE_DEPOT},         // RTW_DEPOT
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   110,   131,    14,    35, SPR_IMG_BUS_STATION,        STR_180D_BUILD_PASSENGER_TRAM_STATION},     // RTW_BUS_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   132,   153,    14,    35, SPR_IMG_TRUCK_BAY,          STR_180E_BUILD_CARGO_TRAM_STATION},         // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   153,   195,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_TRAMWAY_BRIDGE},             // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   196,   217,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_TRAMWAY_TUNNEL},             // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   218,   239,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR_TRAMWAYS}, // RTW_REMOVE
 

	
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_tramway_desc = {
 
	WDP_ALIGN_TBR, 22, 218, 36, 218, 36,
 
	WDP_ALIGN_TBR, 22, 240, 36, 240, 36,
 
	WC_BUILD_TOOLBAR, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_tramway_widgets,
 
	BuildRoadToolbWndProc
 
};
 

	
 
@@ -476,29 +592,30 @@ void ShowBuildRoadToolbar(RoadType roadt
 
	if (_patches.link_terraform_toolbar) ShowTerraformToolbar(w);
 
}
 

	
 
/** Widget definition of the build road toolbar in the scenario editor */
 
static const Widget _build_road_scen_widgets[] = {
 
{   WWT_CLOSEBOX,   RESIZE_NONE,     7,     0,    10,     0,    13, STR_00C5,                   STR_018B_CLOSE_WINDOW},            // RTW_CLOSEBOX
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   139,     0,    13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},  // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,     7,   140,   151,     0,    13, 0x0,                        STR_STICKY_BUTTON},                // RTW_STICKY
 
{    WWT_CAPTION,   RESIZE_NONE,     7,    11,   161,     0,    13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},  // RTW_CAPTION
 
{  WWT_STICKYBOX,   RESIZE_NONE,     7,   162,   173,     0,    13, 0x0,                        STR_STICKY_BUTTON},                // RTW_STICKY
 

	
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,     0,    21,    14,    35, SPR_IMG_ROAD_NW,            STR_180B_BUILD_ROAD_SECTION},      // RTW_ROAD_X
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    22,    43,    14,    35, SPR_IMG_ROAD_NE,            STR_180B_BUILD_ROAD_SECTION},      // RTW_ROAD_Y
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    44,    65,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},  // RTW_DEMOLISH
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    44,    65,    14,    35, SPR_IMG_AUTOROAD,           STR_BUILD_AUTOROAD_TIP},           // RTW_AUTOROAD
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    66,    87,    14,    35, SPR_IMG_DYNAMITE,           STR_018D_DEMOLISH_BUILDINGS_ETC},  // RTW_DEMOLISH
 
{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,                        STR_NULL},                         // RTW_DEPOT
 
{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,                        STR_NULL},                         // RTW_BUS_STATION
 
{      WWT_EMPTY,   RESIZE_NONE,     0,     0,     0,     0,     0, 0x0,                        STR_NULL},                         // RTW_TRUCK_STATION
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    66,   107,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_ROAD_BRIDGE},       // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   108,   129,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_ROAD_TUNNEL},       // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   130,   151,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR}, // RTW_REMOVE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,    88,   130,    14,    35, SPR_IMG_BRIDGE,             STR_180F_BUILD_ROAD_BRIDGE},       // RTW_BUILD_BRIDGE
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   131,   151,    14,    35, SPR_IMG_ROAD_TUNNEL,        STR_1810_BUILD_ROAD_TUNNEL},       // RTW_BUILD_TUNNEL
 
{     WWT_IMGBTN,   RESIZE_NONE,     7,   152,   173,    14,    35, SPR_IMG_REMOVE,             STR_1811_TOGGLE_BUILD_REMOVE_FOR}, // RTW_REMOVE
 
{   WIDGETS_END},
 
};
 

	
 
static const WindowDesc _build_road_scen_desc = {
 
	WDP_AUTO, WDP_AUTO, 152, 36, 152, 36,
 
	WDP_AUTO, WDP_AUTO, 174, 36, 174, 36,
 
	WC_SCEN_BUILD_ROAD, WC_NONE,
 
	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
 
	_build_road_scen_widgets,
 
	BuildRoadToolbWndProc
 
};
 

	
src/table/files.h
Show inline comments
 
@@ -56,13 +56,13 @@ static MD5File files_openttd[] = {
 
	{ "nsignalsw.grf", { 0x65, 0xb9, 0xd7, 0x30, 0x56, 0x06, 0xcc, 0x9e, 0x27, 0x57, 0xc8, 0xe4, 0x9b, 0xb3, 0x66, 0x81 } },
 
	{ "2ccmap.grf",    { 0x20, 0x03, 0x32, 0x1a, 0x43, 0x6c, 0xc1, 0x05, 0x80, 0xbd, 0x43, 0xeb, 0xe1, 0xfd, 0x0c, 0x62 } },
 
	{ "airports.grf",  { 0xfd, 0xa4, 0x38, 0xd6, 0x9c, 0x81, 0x74, 0xfe, 0xa0, 0x98, 0xa2, 0x14, 0x4b, 0x15, 0xb8, 0x4b } },
 
	{ "autorail.grf",  { 0xed, 0x44, 0x7f, 0xbb, 0x19, 0x44, 0x48, 0x4c, 0x07, 0x8a, 0xb1, 0xc1, 0x5c, 0x12, 0x3a, 0x60 } },
 
	{ "canalsw.grf",   { 0x13, 0x9c, 0x98, 0xcf, 0xb8, 0x7c, 0xd7, 0x1f, 0xca, 0x34, 0xa5, 0x6b, 0x65, 0x31, 0xec, 0x0f } },
 
	{ "elrailsw.grf",  { 0x4f, 0xf9, 0xac, 0x79, 0x50, 0x28, 0x9b, 0xe2, 0x15, 0x30, 0xa8, 0x1e, 0xd5, 0xfd, 0xe1, 0xda } },
 
	{ "openttd.grf",   { 0x20, 0x64, 0x4a, 0xf6, 0x75, 0x26, 0x5b, 0x92, 0xbb, 0x6f, 0x8d, 0x0e, 0x34, 0x7e, 0xa6, 0xe3 } },
 
	{ "openttd.grf",   { 0x95, 0xe3, 0x09, 0xe4, 0x2c, 0x2d, 0x47, 0x80, 0xd2, 0x09, 0x06, 0x64, 0xaf, 0x20, 0x32, 0x14 } },
 
	{ "trkfoundw.grf", { 0x12, 0x33, 0x3f, 0xa3, 0xd1, 0x86, 0x8b, 0x04, 0x53, 0x18, 0x9c, 0xee, 0xf9, 0x2d, 0xf5, 0x95 } },
 
	{ "roadstops.grf", { 0xa1, 0x5b, 0xb3, 0x52, 0x60, 0x12, 0x3c, 0xb7, 0x7b, 0x73, 0x09, 0xc1, 0x1a, 0xb4, 0xd0, 0xb8 } },
 
	{ "group.grf",     { 0xe8, 0x52, 0x5f, 0x1c, 0x3e, 0xf9, 0x91, 0x9d, 0x0f, 0x70, 0x8c, 0x8a, 0x21, 0xa4, 0xc7, 0x02 } },
 
	{ "tramtrkw.grf",  { 0x83, 0x0a, 0xf4, 0x9f, 0x29, 0x10, 0x48, 0xfd, 0x76, 0xe9, 0xda, 0xac, 0x5d, 0xa2, 0x30, 0x45 } },
 
	{ "oneway.grf",    { 0xbb, 0xc6, 0xa3, 0xb2, 0xb3, 0xa0, 0xc9, 0x3c, 0xc9, 0xee, 0x24, 0x7c, 0xb6, 0x51, 0x74, 0x63 } },
 
	{ "halffndw.grf",  { 0xf2, 0x10, 0xe0, 0xc1, 0xa1, 0xdc, 0xb3, 0x6e, 0x3f, 0xce, 0xb8, 0x98, 0x1a, 0x08, 0xb0, 0x67 } },
src/table/sprites.h
Show inline comments
 
@@ -44,13 +44,13 @@ enum Sprites {
 
	/* ASCII */
 
	SPR_ASCII_SPACE       = 2,
 
	SPR_ASCII_SPACE_SMALL = 226,
 
	SPR_ASCII_SPACE_BIG   = 450,
 

	
 
	/* Extra graphic spritenumbers */
 
	OPENTTD_SPRITES_COUNT = 112, // number of gfx-sprites in openttd.grf
 
	OPENTTD_SPRITES_COUNT = 116, // number of gfx-sprites in openttd.grf
 
	SPR_SIGNALS_BASE  = 4896,
 
	SPR_CANALS_BASE   = SPR_SIGNALS_BASE + 486,
 

	
 
	SPR_SLOPES_BASE                    = SPR_CANALS_BASE + 70,
 
	SPR_SLOPES_INCLINED_OFFSET         = 15,
 
	SPR_SLOPES_VIRTUAL_BASE            = SPR_SLOPES_BASE - SPR_SLOPES_INCLINED_OFFSET, // The original foundations (see SPR_FOUNDATION_BASE below) are mapped before the additional foundations.
 
@@ -1222,20 +1222,22 @@ enum Sprites {
 
	SPR_IMG_STOP_MUSIC    = 711,
 
	SPR_IMG_PLAY_MUSIC    = 712,
 

	
 
	/* road_gui.c */
 
	SPR_IMG_ROAD_NW       = 1309,
 
	SPR_IMG_ROAD_NE       = 1310,
 
	SPR_IMG_AUTOROAD      = SPR_OPENTTD_BASE + 112,
 
	SPR_IMG_ROAD_DEPOT    = 1295,
 
	SPR_IMG_BUS_STATION   = 749,
 
	SPR_IMG_TRUCK_BAY     = 750,
 
	SPR_IMG_BRIDGE        = 2594,
 
	SPR_IMG_ROAD_TUNNEL   = 2429,
 
	SPR_IMG_REMOVE        = 714,
 
	SPR_IMG_TRAMWAY_NW    = SPR_TRAMWAY_BASE + 0,
 
	SPR_IMG_TRAMWAY_NE    = SPR_TRAMWAY_BASE + 1,
 
	SPR_IMG_AUTOTRAM      = SPR_OPENTTD_BASE + 114,
 

	
 
	/* rail_gui.c */
 
	SPR_IMG_RAIL_NS    = 1251,
 
	SPR_IMG_RAIL_NE    = 1252,
 
	SPR_IMG_RAIL_EW    = 1253,
 
	SPR_IMG_RAIL_NW    = 1254,
 
@@ -1346,14 +1348,16 @@ enum CursorSprite {
 
	SPR_CURSOR_CONVERT_MONO   = SPR_OPENTTD_BASE + 25,
 
	SPR_CURSOR_CONVERT_MAGLEV = SPR_OPENTTD_BASE + 27,
 

	
 
	/* road cursors */
 
	SPR_CURSOR_ROAD_NESW      = 1311,
 
	SPR_CURSOR_ROAD_NWSE      = 1312,
 
	SPR_CURSOR_AUTOROAD       = SPR_OPENTTD_BASE + 113,
 
	SPR_CURSOR_TRAMWAY_NESW   = SPR_TRAMWAY_BASE + 2,
 
	SPR_CURSOR_TRAMWAY_NWSE   = SPR_TRAMWAY_BASE + 3,
 
	SPR_CURSOR_AUTOTRAM       = SPR_OPENTTD_BASE + 115,
 

	
 
	SPR_CURSOR_ROAD_DEPOT     = 1297,
 
	SPR_CURSOR_BUS_STATION    = 2725,
 
	SPR_CURSOR_TRUCK_STATION  = 2726,
 
	SPR_CURSOR_ROAD_TUNNEL    = 2433,
 

	
0 comments (0 inline, 0 general)