summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordominik <dominik@openttd.org>2004-12-12 17:42:04 +0000
committerdominik <dominik@openttd.org>2004-12-12 17:42:04 +0000
commit6d8a0c52f5e2de255a445f65765b87dea36d662e (patch)
tree887039908b482a414d60dabc6882058855a7407b
parent8057dd221482d22b5a5477c982cd0d7ac9be80f9 (diff)
downloadopenttd-6d8a0c52f5e2de255a445f65765b87dea36d662e.tar.xz
(svn r1030) Some toolbar icons are arranged differently:
- Landscaping buttons have to be accessed from the landscaping toolbar - Landscaping toolbar can be opened from all other toolbars - The order of buttons in the docks toolbar now matches the other toolbars - Landscaping toolbar has new keyboard shortcuts
-rw-r--r--airport_gui.c32
-rw-r--r--dock_gui.c73
-rw-r--r--lang/american.txt2
-rw-r--r--lang/english.txt3
-rw-r--r--main_gui.c2
-rw-r--r--misc_gui.c5
-rw-r--r--rail_gui.c196
-rw-r--r--road_gui.c75
-rw-r--r--table/sprites.h13
-rw-r--r--terraform_gui.c55
-rw-r--r--ttd.h4
11 files changed, 207 insertions, 253 deletions
diff --git a/airport_gui.c b/airport_gui.c
index 20e68b2ed..65c42a1e4 100644
--- a/airport_gui.c
+++ b/airport_gui.c
@@ -45,28 +45,16 @@ static void BuildAirClick_Demolish(Window *w)
HandlePlacePushButton(w, 3, ANIMCURSOR_DEMOLISH, 1, PlaceAir_DemolishArea);
}
-static void BuildAirClick_Lower(Window *w)
+static void BuildAirClick_Landscaping(Window *w)
{
- HandlePlacePushButton(w, 4, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LowerLand);
-}
-
-static void BuildAirClick_Raise(Window *w)
-{
- HandlePlacePushButton(w, 5, ANIMCURSOR_RAISELAND, 2, PlaceProc_RaiseLand);
-}
-
-static void BuildAirClick_Purchase(Window *w)
-{
- HandlePlacePushButton(w, 6, 0x12B8, 1, PlaceProc_BuyLand);
+ ShowTerraformToolbar();
}
typedef void OnButtonClick(Window *w);
static OnButtonClick * const _build_air_button_proc[] = {
BuildAirClick_Airport,
BuildAirClick_Demolish,
- BuildAirClick_Lower,
- BuildAirClick_Raise,
- BuildAirClick_Purchase,
+ BuildAirClick_Landscaping,
};
static void BuildAirToolbWndProc(Window *w, WindowEvent *e)
@@ -107,19 +95,17 @@ static void BuildAirToolbWndProc(Window *w, WindowEvent *e)
}
static const Widget _air_toolbar_widgets[] = {
-{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 129, 0, 13, STR_A000_AIRPORT_CONSTRUCT, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, 7, 0, 41, 14, 35, 0x2E8, STR_A01E_BUILD_AIRPORT},
-{ WWT_PANEL, 7, 42, 63, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 64, 85, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 86, 107, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 108, 129, 14, 35, 0x12B7, STR_0329_PURCHASE_LAND_FOR_FUTURE},
+{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
+{ WWT_CAPTION, 7, 11, 85, 0, 13, STR_A000_AIRPORTS, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_PANEL, 7, 0, 41, 14, 35, 0x2E8, STR_A01E_BUILD_AIRPORT},
+{ WWT_PANEL, 7, 42, 63, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
+{ WWT_PANEL, 7, 64, 85, 14, 35, SPR_IMG_LANDSCAPING_S, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END},
};
static const WindowDesc _air_toolbar_desc = {
- 510, 22, 130, 36,
+ 640-86, 22, 86, 36,
WC_BUILD_TOOLBAR,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_air_toolbar_widgets,
diff --git a/dock_gui.c b/dock_gui.c
index c9444c6e0..36efe83b8 100644
--- a/dock_gui.c
+++ b/dock_gui.c
@@ -59,20 +59,14 @@ static void PlaceDocks_BuildLock(uint tile)
}
-static void BuildDocksClick_Dock(Window *w)
-{
-
- if (HandlePlacePushButton(w, 2, 0xE54, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker();
-}
-
-static void BuildDocksClick_Depot(Window *w)
+static void BuildDocksClick_Canal(Window *w)
{
- if (HandlePlacePushButton(w, 3, 0x2D1, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker();
+ HandlePlacePushButton(w, 2, SPR_OPENTTD_BASE + 11, 1, PlaceDocks_BuildCanal);
}
-static void BuildDocksClick_Buoy(Window *w)
+static void BuildDocksClick_Lock(Window *w)
{
- HandlePlacePushButton(w, 4, 0x2BE, 1, PlaceDocks_Buoy);
+ HandlePlacePushButton(w, 3, SPR_OPENTTD_BASE + 64, 1, PlaceDocks_BuildLock);
}
static void BuildDocksClick_Demolish(Window *w)
@@ -80,42 +74,37 @@ static void BuildDocksClick_Demolish(Window *w)
HandlePlacePushButton(w, 5, ANIMCURSOR_DEMOLISH, 1, PlaceDocks_DemolishArea);
}
-static void BuildDocksClick_Lower(Window *w)
+static void BuildDocksClick_Depot(Window *w)
{
- HandlePlacePushButton(w, 6, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LowerLand);
+ if (HandlePlacePushButton(w, 6, 0x2D1, 1, PlaceDocks_Depot)) ShowBuildDocksDepotPicker();
}
-static void BuildDocksClick_Raise(Window *w)
+static void BuildDocksClick_Dock(Window *w)
{
- HandlePlacePushButton(w, 7, ANIMCURSOR_RAISELAND, 2, PlaceProc_RaiseLand);
-}
-static void BuildDocksClick_Purchase(Window *w)
-{
- HandlePlacePushButton(w, 8, 0x12B8, 1, PlaceProc_BuyLand);
+ if (HandlePlacePushButton(w, 7, 0xE54, 3, PlaceDocks_Dock)) ShowBuildDockStationPicker();
}
-static void BuildDocksClick_Canal(Window *w)
+static void BuildDocksClick_Buoy(Window *w)
{
- HandlePlacePushButton(w, 9, SPR_OPENTTD_BASE + 11, 1, PlaceDocks_BuildCanal);
+ HandlePlacePushButton(w, 8, 0x2BE, 1, PlaceDocks_Buoy);
}
-static void BuildDocksClick_Lock(Window *w)
+static void BuildDocksClick_Landscaping(Window *w)
{
- HandlePlacePushButton(w, 10, SPR_OPENTTD_BASE + 64, 1, PlaceDocks_BuildLock);
+ ShowTerraformToolbar();
}
typedef void OnButtonClick(Window *w);
static OnButtonClick * const _build_docks_button_proc[] = {
- BuildDocksClick_Dock,
- BuildDocksClick_Depot,
- BuildDocksClick_Buoy,
- BuildDocksClick_Demolish,
- BuildDocksClick_Lower,
- BuildDocksClick_Raise,
- BuildDocksClick_Purchase,
BuildDocksClick_Canal,
BuildDocksClick_Lock,
+ 0,
+ BuildDocksClick_Demolish,
+ BuildDocksClick_Depot,
+ BuildDocksClick_Dock,
+ BuildDocksClick_Buoy,
+ BuildDocksClick_Landscaping,
};
static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
@@ -126,7 +115,7 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
break;
case WE_CLICK: {
- if (e->click.widget - 2 >= 0) _build_docks_button_proc[e->click.widget - 2](w);
+ if (e->click.widget - 2 >= 0 && e->click.widget!=4) _build_docks_button_proc[e->click.widget - 2](w);
} break;
case WE_PLACE_OBJ:
@@ -175,21 +164,23 @@ static void BuildDocksToolbWndProc(Window *w, WindowEvent *e)
static const Widget _build_docks_toolb_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 197, 0, 13, STR_9801_DOCK_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, 7, 0, 21, 14, 35, 746, STR_981D_BUILD_SHIP_DOCK},
-{ WWT_PANEL, 7, 22, 43, 14, 35, 748, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING},
-{ WWT_PANEL, 7, 44, 65, 14, 35, 693, STR_9834_POSITION_BUOY_WHICH_CAN},
-{ WWT_PANEL, 7, 66, 87, 14, 35, 703, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 88, 109, 14, 35, 695, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 110, 131, 14, 35, 694, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 132, 153, 14, 35, 4791, STR_0329_PURCHASE_LAND_FOR_FUTURE},
-{ WWT_PANEL, 7, 154, 175, 14, 35, SPR_OPENTTD_BASE+65, STR_BUILD_CANALS_TIP},
-{ WWT_PANEL, 7, 176, 197, 14, 35, SPR_CANALS_BASE+69, STR_BUILD_LOCKS_TIP},
+{ WWT_CAPTION, 7, 11, 157, 0, 13, STR_9801_DOCK_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
+
+{ WWT_PANEL, 7, 0, 21, 14, 35, SPR_OPENTTD_BASE+65, STR_BUILD_CANALS_TIP},
+{ WWT_PANEL, 7, 22, 43, 14, 35, SPR_CANALS_BASE+69, STR_BUILD_LOCKS_TIP},
+
+{ WWT_PANEL, 7, 44, 47, 14, 35, 0x0, STR_NULL},
+
+{ WWT_PANEL, 7, 48, 69, 14, 35, 703, STR_018D_DEMOLISH_BUILDINGS_ETC},
+{ WWT_PANEL, 7, 70, 91, 14, 35, 748, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING},
+{ WWT_PANEL, 7, 92, 113, 14, 35, 746, STR_981D_BUILD_SHIP_DOCK},
+{ WWT_PANEL, 7, 114, 135, 14, 35, 693, STR_9834_POSITION_BUOY_WHICH_CAN},
+{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_IMG_LANDSCAPING_S, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END},
};
static const WindowDesc _build_docks_toolbar_desc = {
- 640-197, 22, 198, 36,
+ 640-158, 22, 158, 36,
WC_BUILD_TOOLBAR,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_docks_toolb_widgets,
diff --git a/lang/american.txt b/lang/american.txt
index 8ea6afcd8..e71e7400e 100644
--- a/lang/american.txt
+++ b/lang/american.txt
@@ -2573,7 +2573,7 @@ STR_GO_TO_SHIP_DEPOT :Go to {TOWN} Ship Depot
SERVICE_AT_SHIP_DEPOT :Service at {TOWN} Ship Depot
##id 0xA000
-STR_A000_AIRPORT_CONSTRUCT :{WHITE}Airport Construct.
+STR_A000_AIRPORTS :{WHITE}Airports
STR_A001_CAN_T_BUILD_AIRPORT_HERE :{WHITE}Can't build airport here...
STR_A002_AIRCRAFT_HANGAR :{WHITE}{STATION} Aircraft Hangar
STR_A003_NEW_AIRCRAFT :{BLACK}New Aircraft
diff --git a/lang/english.txt b/lang/english.txt
index f6ea2f1e0..badee2c4e 100644
--- a/lang/english.txt
+++ b/lang/english.txt
@@ -1114,6 +1114,7 @@ STR_MANY_RANDOM_INDUSTRIES :{BLACK}Many random industries
STR_RANDOM_INDUSTRIES_TIP :{BLACK}Cover the map with randomly placed industries
STR_CAN_T_GENERATE_INDUSTRIES :{WHITE}Can't generate industries...
+STR_LANDSCAPING_TOOLBAR_TIP :{BLACK}Open the landscaping toolbar to raise/lower land, plant trees, etc.
STR_LANDSCAPING_TOOLBAR :{WHITE}Landscaping
STR_LEVEL_LAND_TOOLTIP :{BLACK}Level land
@@ -2575,7 +2576,7 @@ STR_GO_TO_SHIP_DEPOT :Go to {TOWN} Ship Depot
SERVICE_AT_SHIP_DEPOT :Service at {TOWN} Ship Depot
##id 0xA000
-STR_A000_AIRPORT_CONSTRUCT :{WHITE}Airport Construct.
+STR_A000_AIRPORTS :{WHITE}Airports
STR_A001_CAN_T_BUILD_AIRPORT_HERE :{WHITE}Can't build airport here...
STR_A002_AIRCRAFT_HANGAR :{WHITE}{STATION} Aircraft Hangar
STR_A003_NEW_AIRCRAFT :{BLACK}New Aircraft
diff --git a/main_gui.c b/main_gui.c
index 49e311a7a..369b2aa80 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -1898,7 +1898,7 @@ static const Widget _toolb_normal_widgets[] = {
{ WWT_PANEL, 14, 479, 500, 0, 21, 0x2D8, STR_0182_BUILD_ROADS},
{ WWT_PANEL, 14, 501, 522, 0, 21, 0x2D9, STR_0183_BUILD_SHIP_DOCKS},
{ WWT_PANEL, 14, 523, 544, 0, 21, 0x2DA, STR_0184_BUILD_AIRPORTS},
-{ WWT_PANEL, 14, 545, 566, 0, 21, 0xFF3, STR_0185_PLANT_TREES_PLACE_SIGNS}, // tree icon is 0x2E6
+{ WWT_PANEL, 14, 545, 566, 0, 21, 0xFF3, STR_LANDSCAPING_TOOLBAR_TIP}, // tree icon is 0x2E6
{ WWT_PANEL, 14, 574, 595, 0, 21, 0x2C9, STR_01D4_SHOW_SOUND_MUSIC_WINDOW},
{ WWT_PANEL, 14, 596, 617, 0, 21, 0x2A8, STR_0203_SHOW_LAST_MESSAGE_NEWS},
diff --git a/misc_gui.c b/misc_gui.c
index 824c53a6f..d7aae3b20 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -326,7 +326,7 @@ static const Widget _build_trees_widgets[] = {
static const WindowDesc _build_trees_desc = {
497, 22, 143, 171,
- WC_BUILD_TOOLBAR,0,
+ WC_BUILD_TREES, WC_SCEN_LAND_GEN,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_trees_widgets,
BuildTreesWndProc
@@ -355,7 +355,7 @@ static const Widget _build_trees_scen_widgets[] = {
static const WindowDesc _build_trees_scen_desc = {
-1, -1, 143, 184,
- WC_SCEN_BUILD_TREES,0,
+ WC_BUILD_TREES,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_trees_scen_widgets,
BuildTreesWndProc
@@ -364,7 +364,6 @@ static const WindowDesc _build_trees_scen_desc = {
void ShowBuildTreesToolbar()
{
- DeleteWindowById(WC_BUILD_TOOLBAR, 0);
AllocateWindowDesc(&_build_trees_desc);
}
diff --git a/rail_gui.c b/rail_gui.c
index 28f12caac..271fedfb4 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -211,44 +211,34 @@ static void PlaceRail_AutoSignals(uint tile)
VpStartPlaceSizing(tile, VPM_SIGNALDIRS);
}
-static void BuildRailClick_AutoRail(Window *w)
-{
- HandlePlacePushButton(w, 3, _cur_railtype + SPR_OPENTTD_BASE + 4, 1, PlaceRail_AutoRail);
-}
-
static void BuildRailClick_N(Window *w)
{
- HandlePlacePushButton(w, 4, _cur_railtype*4 + 0x4EF, 1, PlaceRail_N);
+ HandlePlacePushButton(w, 3, _cur_railtype*4 + 0x4EF, 1, PlaceRail_N);
}
static void BuildRailClick_NE(Window *w)
{
- HandlePlacePushButton(w, 5, _cur_railtype*4 + 0x4F0, 1, PlaceRail_NE);
+ HandlePlacePushButton(w, 4, _cur_railtype*4 + 0x4F0, 1, PlaceRail_NE);
}
static void BuildRailClick_E(Window *w)
{
- HandlePlacePushButton(w, 6, _cur_railtype*4 + 0x4F1, 1, PlaceRail_E);
+ HandlePlacePushButton(w, 5, _cur_railtype*4 + 0x4F1, 1, PlaceRail_E);
}
static void BuildRailClick_NW(Window *w)
{
- HandlePlacePushButton(w, 7, _cur_railtype*4 + 0x4F2, 1, PlaceRail_NW);
-}
-
-static void BuildRailClick_Demolish(Window *w)
-{
- HandlePlacePushButton(w, 8, ANIMCURSOR_DEMOLISH, 1, PlaceProc_DemolishArea);
+ HandlePlacePushButton(w, 6, _cur_railtype*4 + 0x4F2, 1, PlaceRail_NW);
}
-static void BuildRailClick_Lower(Window *w)
+static void BuildRailClick_AutoRail(Window *w)
{
- HandlePlacePushButton(w, 9, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LowerLand);
+ HandlePlacePushButton(w, 7, _cur_railtype + SPR_OPENTTD_BASE + 4, 1, PlaceRail_AutoRail);
}
-static void BuildRailClick_Raise(Window *w)
+static void BuildRailClick_Demolish(Window *w)
{
- HandlePlacePushButton(w, 10, ANIMCURSOR_RAISELAND, 2, PlaceProc_RaiseLand);
+ HandlePlacePushButton(w, 8, ANIMCURSOR_DEMOLISH, 1, PlaceProc_DemolishArea);
}
static const SpriteID _depot_cursors[] = {
@@ -259,42 +249,50 @@ static const SpriteID _depot_cursors[] = {
static void BuildRailClick_Depot(Window *w)
{
- if (HandlePlacePushButton(w, 11, _depot_cursors[_cur_railtype], 1, PlaceRail_Depot)) ShowBuildTrainDepotPicker();
+ if (HandlePlacePushButton(w, 9, _depot_cursors[_cur_railtype], 1, PlaceRail_Depot)) ShowBuildTrainDepotPicker();
+}
+
+static void BuildRailClick_Waypoint(Window *w)
+{
+ _waypoint_count = GetCustomStationsCount(STAT_CLASS_WAYP);
+ if (HandlePlacePushButton(w, 10, SPR_OPENTTD_BASE + 7, 1, PlaceRail_Waypoint)
+ && _waypoint_count > 1)
+ ShowBuildWaypointPicker();
}
static void BuildRailClick_Station(Window *w)
{
- if (HandlePlacePushButton(w, 12, 0x514, 1, PlaceRail_Station)) ShowStationBuilder();
+ if (HandlePlacePushButton(w, 11, 0x514, 1, PlaceRail_Station)) ShowStationBuilder();
}
static void BuildRailClick_AutoSignals(Window *w)
{
- HandlePlacePushButton(w, 13, ANIMCURSOR_BUILDSIGNALS , 1, PlaceRail_AutoSignals);
+ HandlePlacePushButton(w, 12, ANIMCURSOR_BUILDSIGNALS , 1, PlaceRail_AutoSignals);
}
static void BuildRailClick_Bridge(Window *w)
{
- HandlePlacePushButton(w, 14, 0xA21, 1, PlaceRail_Bridge);
+ HandlePlacePushButton(w, 13, 0xA21, 1, PlaceRail_Bridge);
}
static void BuildRailClick_Tunnel(Window *w)
{
- HandlePlacePushButton(w, 15, 0x982 + _cur_railtype, 3, PlaceRail_Tunnel);
+ HandlePlacePushButton(w, 14, 0x982 + _cur_railtype, 3, PlaceRail_Tunnel);
}
static void BuildRailClick_Remove(Window *w)
{
- if (w->disabled_state & (1<<16))
+ if (w->disabled_state & (1<<15))
return;
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
- _thd.make_square_red = !!((w->click_state ^= (1 << 16)) & (1<<16));
+ _thd.make_square_red = !!((w->click_state ^= (1 << 15)) & (1<<15));
MarkTileDirty(_thd.pos.x, _thd.pos.y);
- _remove_button_clicked = (w->click_state & (1 << 16)) != 0;
+ _remove_button_clicked = (w->click_state & (1 << 15)) != 0;
// handle station builder
- if( w->click_state & (1 << 12) )
+ if( w->click_state & (1 << 15) )
{
if(_remove_button_clicked)
SetTileSelectSize(1, 1);
@@ -303,22 +301,14 @@ static void BuildRailClick_Remove(Window *w)
}
}
-static void BuildRailClick_Sign(Window *w)
-{
- HandlePlacePushButton(w, 17, 0x12B8, 1, PlaceProc_BuyLand);
-}
-
-static void BuildRailClick_Waypoint(Window *w)
+static void BuildRailClick_Convert(Window *w)
{
- _waypoint_count = GetCustomStationsCount(STAT_CLASS_WAYP);
- if (HandlePlacePushButton(w, 18, SPR_OPENTTD_BASE + 7, 1, PlaceRail_Waypoint)
- && _waypoint_count > 1)
- ShowBuildWaypointPicker();
+ HandlePlacePushButton(w, 16, (SPR_OPENTTD_BASE + 26) + _cur_railtype * 2, 1, PlaceRail_ConvertRail);
}
-static void BuildRailClick_Convert(Window *w)
+static void BuildRailClick_Landscaping(Window *w)
{
- HandlePlacePushButton(w, 19, (SPR_OPENTTD_BASE + 26) + _cur_railtype * 2, 1, PlaceRail_ConvertRail);
+ ShowTerraformToolbar();
}
@@ -563,42 +553,39 @@ static void HandleAutoSignalPlacement()
}
static OnButtonClick * const _build_railroad_button_proc[] = {
- BuildRailClick_AutoRail,
BuildRailClick_N,
BuildRailClick_NE,
BuildRailClick_E,
BuildRailClick_NW,
+ BuildRailClick_AutoRail,
BuildRailClick_Demolish,
- BuildRailClick_Lower,
- BuildRailClick_Raise,
BuildRailClick_Depot,
+ BuildRailClick_Waypoint,
BuildRailClick_Station,
BuildRailClick_AutoSignals,
BuildRailClick_Bridge,
BuildRailClick_Tunnel,
BuildRailClick_Remove,
- BuildRailClick_Sign,
- BuildRailClick_Waypoint,
BuildRailClick_Convert,
+ BuildRailClick_Landscaping,
};
static const uint16 _rail_keycodes[] = {
- '5',
'1',
'2',
'3',
'4',
+ '5',
'6',
- '7',
- '8',
- 0, // depot
- 0, // station
- 'S',// signals
- 'B',// bridge
- 'T',// tunnel
- 'R',// remove
- 0, // sign
- 'C',// waypoint
+ '7', // depot
+ '8', // waypoint
+ '9', // station
+ 'S', // signals
+ 'B', // bridge
+ 'T', // tunnel
+ 'R', // remove
+ 'C', // convert rail
+ 'L', // landscaping
};
@@ -608,10 +595,10 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
{
switch(e->event) {
case WE_PAINT:
- w->disabled_state &= ~(1 << 16);
- if (!(w->click_state & ((1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<12)|(1<<13)|(1<<18)))) {
- w->disabled_state |= (1 << 16);
- w->click_state &= ~(1<<16);
+ w->disabled_state &= ~(1 << 15);
+ if (!(w->click_state & ((1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<10)|(1<<11)|(1<<12)))) {
+ w->disabled_state |= (1 << 15);
+ w->click_state &= ~(1<<15);
}
DrawWindowWidgets(w);
break;
@@ -691,38 +678,37 @@ static void BuildRailToolbWndProc(Window *w, WindowEvent *e)
}
}
+
static const Widget _build_railroad_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 417, 0, 13, STR_100A_RAILROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_CAPTION, 7, 11, 371, 0, 13, STR_100A_RAILROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL},
-{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 0, STR_BUILD_AUTORAIL_TIP},
+{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL},
{ WWT_PANEL, 7, 0, 21, 14, 35, 0x4E3, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 22, 43, 14, 35, 0x4E4, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 44, 65, 14, 35, 0x4E5, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 66, 87, 14, 35, 0x4E6, STR_1018_BUILD_RAILROAD_TRACK},
+{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 0, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 136, 157, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 158, 179, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 180, 201, 14, 35, 0x50E, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
+{ WWT_PANEL, 7, 136, 157, 14, 35, 0x50E, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
+{ WWT_PANEL, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
-{ WWT_PANEL, 7, 224, 265, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
-{ WWT_PANEL, 7, 266, 287, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
-{ WWT_PANEL, 7, 288, 329, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
-{ WWT_PANEL, 7, 330, 351, 14, 35, 0x97E, STR_101D_BUILD_RAILROAD_TUNNEL},
-{ WWT_PANEL, 7, 352, 373, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
-{ WWT_PANEL, 7, 374, 395, 14, 35, 0x12B7, STR_0329_PURCHASE_LAND_FOR_FUTURE},
+{ WWT_PANEL, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
+{ WWT_PANEL, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
+{ WWT_PANEL, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
+{ WWT_PANEL, 7, 286, 305, 14, 35, 0x97E, STR_101D_BUILD_RAILROAD_TUNNEL},
+{ WWT_PANEL, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
+{ WWT_PANEL, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 25, STR_CONVERT_RAIL_TIP},
-{ WWT_PANEL, 7, 202, 223, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
-{ WWT_PANEL, 7, 396, 417, 14, 35, SPR_OPENTTD_BASE + 25, STR_CONVERT_RAIL_TIP},
+{ WWT_PANEL, 7, 350, 371, 14, 35, SPR_IMG_LANDSCAPING_S, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END},
};
static const WindowDesc _build_railroad_desc = {
- 640-418, 22, 418, 36,
+ 640-372, 22, 372, 36,
WC_BUILD_TOOLBAR,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_railroad_widgets,
@@ -731,35 +717,34 @@ static const WindowDesc _build_railroad_desc = {
static const Widget _build_monorail_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 417, 0, 13, STR_100B_MONORAIL_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_CAPTION, 7, 11, 371, 0, 13, STR_100B_MONORAIL_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL},
-{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 1, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 0, 21, 14, 35, 0x4E7, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 22, 43, 14, 35, 0x4E8, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 44, 65, 14, 35, 0x4E9, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 66, 87, 14, 35, 0x4EA, STR_1018_BUILD_RAILROAD_TRACK},
+{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 1, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 136, 157, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 158, 179, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 180, 201, 14, 35, SPR_OPENTTD_BASE + 12, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
-
-{ WWT_PANEL, 7, 224, 265, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
-{ WWT_PANEL, 7, 266, 287, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
-{ WWT_PANEL, 7, 288, 329, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
-{ WWT_PANEL, 7, 330, 351, 14, 35, 0x97F, STR_101D_BUILD_RAILROAD_TUNNEL},
-{ WWT_PANEL, 7, 352, 373, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
-{ WWT_PANEL, 7, 374, 395, 14, 35, 0x12B7, STR_0329_PURCHASE_LAND_FOR_FUTURE},
-
-{ WWT_PANEL, 7, 202, 223, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
-{ WWT_PANEL, 7, 396, 417, 14, 35, SPR_OPENTTD_BASE + 27, STR_CONVERT_RAIL_TIP},
+{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE + 12, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
+{ WWT_PANEL, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
+
+{ WWT_PANEL, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
+{ WWT_PANEL, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
+{ WWT_PANEL, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
+{ WWT_PANEL, 7, 286, 305, 14, 35, 0x97F, STR_101D_BUILD_RAILROAD_TUNNEL},
+{ WWT_PANEL, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
+{ WWT_PANEL, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 27, STR_CONVERT_RAIL_TIP},
+
+{ WWT_PANEL, 7, 350, 371, 14, 35, 742, STR_LANDSCAPING_TOOLBAR_TIP},
+
{ WIDGETS_END},
};
static const WindowDesc _build_monorail_desc = {
- 640-418, 22, 418, 36,
+ 640-372, 22, 372, 36,
WC_BUILD_TOOLBAR,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_monorail_widgets,
@@ -768,35 +753,34 @@ static const WindowDesc _build_monorail_desc = {
static const Widget _build_maglev_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5,STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 417, 0, 13, STR_100C_MAGLEV_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_CAPTION, 7, 11, 371, 0, 13, STR_100C_MAGLEV_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL},
-{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 2, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 0, 21, 14, 35, 0x4EB, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 22, 43, 14, 35, 0x4EC, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 44, 65, 14, 35, 0x4EE, STR_1018_BUILD_RAILROAD_TRACK},
{ WWT_PANEL, 7, 66, 87, 14, 35, 0x4ED, STR_1018_BUILD_RAILROAD_TRACK},
+{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_OPENTTD_BASE + 2, STR_BUILD_AUTORAIL_TIP},
{ WWT_PANEL, 7, 114, 135, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 136, 157, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 158, 179, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 180, 201, 14, 35, SPR_OPENTTD_BASE + 13, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
-
-{ WWT_PANEL, 7, 224, 265, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
-{ WWT_PANEL, 7, 266, 287, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
-{ WWT_PANEL, 7, 288, 329, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
-{ WWT_PANEL, 7, 330, 351, 14, 35, 0x980, STR_101D_BUILD_RAILROAD_TUNNEL},
-{ WWT_PANEL, 7, 352, 373, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
-{ WWT_PANEL, 7, 374, 395, 14, 35, 0x12B7, STR_0329_PURCHASE_LAND_FOR_FUTURE},
-
-{ WWT_PANEL, 7, 202, 223, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
-{ WWT_PANEL, 7, 396, 417, 14, 35, SPR_OPENTTD_BASE + 29, STR_CONVERT_RAIL_TIP},
+{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE + 13, STR_1019_BUILD_TRAIN_DEPOT_FOR_BUILDING},
+{ WWT_PANEL, 7, 158, 179, 14, 35, SPR_OPENTTD_BASE + 3, STR_CONVERT_RAIL_TO_WAYPOINT_TIP},
+
+{ WWT_PANEL, 7, 180, 221, 14, 35, 0x512, STR_101A_BUILD_RAILROAD_STATION},
+{ WWT_PANEL, 7, 222, 243, 14, 35, 0x50B, STR_101B_BUILD_RAILROAD_SIGNALS},
+{ WWT_PANEL, 7, 244, 285, 14, 35, 0xA22, STR_101C_BUILD_RAILROAD_BRIDGE},
+{ WWT_PANEL, 7, 286, 305, 14, 35, 0x980, STR_101D_BUILD_RAILROAD_TUNNEL},
+{ WWT_PANEL, 7, 306, 327, 14, 35, 0x2CA, STR_101E_TOGGLE_BUILD_REMOVE_FOR},
+{ WWT_PANEL, 7, 328, 349, 14, 35, SPR_OPENTTD_BASE + 29, STR_CONVERT_RAIL_TIP},
+
+{ WWT_PANEL, 7, 350, 371, 14, 35, 742, STR_LANDSCAPING_TOOLBAR_TIP},
+
{ WIDGETS_END},
};
static const WindowDesc _build_maglev_desc = {
- 640-418, 22, 418, 36,
+ 640-372, 22, 372, 36,
WC_BUILD_TOOLBAR,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_maglev_widgets,
diff --git a/road_gui.c b/road_gui.c
index 4368b1e40..8374786b4 100644
--- a/road_gui.c
+++ b/road_gui.c
@@ -120,80 +120,68 @@ static void BuildRoadClick_Demolish(Window *w)
HandlePlacePushButton(w, 4, ANIMCURSOR_DEMOLISH, 1, PlaceRoad_DemolishArea);
}
-static void BuildRoadClick_Lower(Window *w)
-{
- HandlePlacePushButton(w, 5, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LowerLand);
-}
-
-static void BuildRoadClick_Raise(Window *w)
-{
- HandlePlacePushButton(w, 6, ANIMCURSOR_RAISELAND, 2, PlaceProc_RaiseLand);
-}
-
static void BuildRoadClick_Depot(Window *w)
{
- if (HandlePlacePushButton(w, 7, 0x511, 1, PlaceRoad_Depot)) ShowRoadDepotPicker();
+ if (HandlePlacePushButton(w, 5, 0x511, 1, PlaceRoad_Depot)) ShowRoadDepotPicker();
}
static void BuildRoadClick_BusStation(Window *w)
{
- if (HandlePlacePushButton(w, 8, 0xAA5, 1, PlaceRoad_BusStation)) ShowBusStationPicker();
+ if (HandlePlacePushButton(w, 6, 0xAA5, 1, PlaceRoad_BusStation)) ShowBusStationPicker();
}
static void BuildRoadClick_TruckStation(Window *w)
{
- if (HandlePlacePushButton(w, 9, 0xAA6, 1, PlaceRoad_TruckStation)) ShowTruckStationPicker();
+ if (HandlePlacePushButton(w, 7, 0xAA6, 1, PlaceRoad_TruckStation)) ShowTruckStationPicker();
}
static void BuildRoadClick_Bridge(Window *w)
{
_build_road_flag = 0;
- HandlePlacePushButton(w, 10, 0xA21, 1, PlaceRoad_Bridge);
+ HandlePlacePushButton(w, 8, 0xA21, 1, PlaceRoad_Bridge);
}
static void BuildRoadClick_Tunnel(Window *w)
{
_build_road_flag = 0;
- HandlePlacePushButton(w, 11, 0x981, 3, PlaceRoad_Tunnel);
+ HandlePlacePushButton(w, 9, 0x981, 3, PlaceRoad_Tunnel);
}
static void BuildRoadClick_Remove(Window *w)
{
- if (w->disabled_state & (1<<12))
+ if (w->disabled_state & (1<<10))
return;
SetWindowDirty(w);
SndPlayFx(SND_15_BEEP);
- _thd.make_square_red = !!((w->click_state ^= (1 << 12)) & (1<<12));
+ _thd.make_square_red = !!((w->click_state ^= (1 << 10)) & (1<<10));
MarkTileDirty(_thd.pos.x, _thd.pos.y);
}
-static void BuildRoadClick_Purchase(Window *w)
+static void BuildRoadClick_Landscaping(Window *w)
{
- HandlePlacePushButton(w, 13, 0x12B8, 1, PlaceProc_BuyLand);
+ ShowTerraformToolbar();
}
static OnButtonClick * const _build_road_button_proc[] = {
BuildRoadClick_NE,
BuildRoadClick_NW,
BuildRoadClick_Demolish,
- BuildRoadClick_Lower,
- BuildRoadClick_Raise,
BuildRoadClick_Depot,
BuildRoadClick_BusStation,
BuildRoadClick_TruckStation,
BuildRoadClick_Bridge,
BuildRoadClick_Tunnel,
BuildRoadClick_Remove,
- BuildRoadClick_Purchase,
+ BuildRoadClick_Landscaping,
};
static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) {
switch(e->event) {
case WE_PAINT:
- w->disabled_state &= ~(1 << 12);
- if (!(w->click_state & 12)) {
- w->disabled_state |= (1 << 12);
- w->click_state &= ~(1<<12);
+ w->disabled_state &= ~(1 << 10);
+ if (!(w->click_state & ((1<<2)|(1<<3)))) {
+ w->disabled_state |= (1 << 10);
+ w->click_state &= ~(1<<10);
}
DrawWindowWidgets(w);
break;
@@ -208,11 +196,13 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) {
case '1': BuildRoadClick_NE(w); break;
case '2': BuildRoadClick_NW(w); break;
case '3': BuildRoadClick_Demolish(w); break;
- case '4': BuildRoadClick_Lower(w); break;
- case '5': BuildRoadClick_Raise(w); break;
+ case '4': BuildRoadClick_Depot(w); break;
+ case '5': BuildRoadClick_BusStation(w); break;
+ case '6': BuildRoadClick_TruckStation(w); break;
case 'B': BuildRoadClick_Bridge(w); break;
case 'T': BuildRoadClick_Tunnel(w); break;
case 'R': BuildRoadClick_Remove(w); break;
+ case 'L': BuildRoadClick_Landscaping(w); break;
default:
return;
}
@@ -220,7 +210,7 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) {
break;
case WE_PLACE_OBJ:
- _remove_button_clicked = (w->click_state & (1 << 12)) != 0;
+ _remove_button_clicked = (w->click_state & (1 << 10)) != 0;
_place_proc(e->place.tile);
break;
@@ -283,24 +273,23 @@ static void BuildRoadToolbWndProc(Window *w, WindowEvent *e) {
static const Widget _build_road_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 283, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
-{ WWT_PANEL, 7, 0, 21, 14, 35, 0x51D, STR_180B_BUILD_ROAD_SECTION},
-{ WWT_PANEL, 7, 22, 43, 14, 35, 0x51E, STR_180B_BUILD_ROAD_SECTION},
-{ WWT_PANEL, 7, 44, 65, 14, 35, 0x2BF, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 66, 87, 14, 35, 0x2B7, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 88, 109, 14, 35, 0x2B6, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 110, 131, 14, 35, 0x50F, STR_180C_BUILD_ROAD_VEHICLE_DEPOT},
-{ WWT_PANEL, 7, 132, 153, 14, 35, 0x2ED, STR_180D_BUILD_BUS_STATION},
-{ WWT_PANEL, 7, 154, 175, 14, 35, 0x2EE, STR_180E_BUILD_TRUCK_LOADING_BAY},
-{ WWT_PANEL, 7, 176, 217, 14, 35, 0xA22, STR_180F_BUILD_ROAD_BRIDGE},
-{ WWT_PANEL, 7, 218, 239, 14, 35, 0x97D, STR_1810_BUILD_ROAD_TUNNEL},
-{ WWT_PANEL, 7, 240, 261, 14, 35, 0x2CA, STR_1811_TOGGLE_BUILD_REMOVE_FOR},
-{ WWT_PANEL, 7, 262, 283, 14, 35, 0x12B7, STR_0329_PURCHASE_LAND_FOR_FUTURE},
+{ WWT_CAPTION, 7, 11, 239, 0, 13, STR_1802_ROAD_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS},
+
+{ WWT_PANEL, 7, 0, 21, 14, 35, SPR_IMG_ROAD_NW, STR_180B_BUILD_ROAD_SECTION},
+{ WWT_PANEL, 7, 22, 43, 14, 35, SPR_IMG_ROAD_NE, STR_180B_BUILD_ROAD_SECTION},
+{ WWT_PANEL, 7, 44, 65, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC},
+{ WWT_PANEL, 7, 66, 87, 14, 35, SPR_IMG_ROAD_DEPOT, STR_180C_BUILD_ROAD_VEHICLE_DEPOT},
+{ WWT_PANEL, 7, 88, 109, 14, 35, SPR_IMG_BUS_STATION, STR_180D_BUILD_BUS_STATION},
+{ WWT_PANEL, 7, 110, 131, 14, 35, SPR_IMG_TRUCK_BAY, STR_180E_BUILD_TRUCK_LOADING_BAY},
+{ WWT_PANEL, 7, 132, 173, 14, 35, SPR_IMG_BRIDGE, STR_180F_BUILD_ROAD_BRIDGE},
+{ WWT_PANEL, 7, 174, 195, 14, 35, SPR_IMG_ROAD_TUNNEL, STR_1810_BUILD_ROAD_TUNNEL},
+{ WWT_PANEL, 7, 196, 217, 14, 35, SPR_IMG_REMOVE, STR_1811_TOGGLE_BUILD_REMOVE_FOR},
+{ WWT_PANEL, 7, 218, 239, 14, 35, SPR_IMG_LANDSCAPING_S, STR_LANDSCAPING_TOOLBAR_TIP},
{ WIDGETS_END},
};
static const WindowDesc _build_road_desc = {
- 356, 22, 284, 36,
+ 640-240, 22, 240, 36,
WC_BUILD_TOOLBAR,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_build_road_widgets,
diff --git a/table/sprites.h b/table/sprites.h
index 740cd306b..9978445ab 100644
--- a/table/sprites.h
+++ b/table/sprites.h
@@ -714,7 +714,18 @@ enum Sprites {
SPR_OTTD_A = 4838,
SPR_OTTD_S = 4840,
SPR_OTTD_Y = 4843,
- SPR_OTTD_C = 4844
+ SPR_OTTD_C = 4844,
+
+ /* road_gui.c */
+ SPR_IMG_ROAD_NW = 1309,
+ SPR_IMG_ROAD_NE = 1310,
+ 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_LANDSCAPING_S = 742
};
/* Cursor sprite numbers */
diff --git a/terraform_gui.c b/terraform_gui.c
index 1076c3c82..647072c30 100644
--- a/terraform_gui.c
+++ b/terraform_gui.c
@@ -32,13 +32,13 @@ static void GenericRaiseLowerLand(uint tile, int mode)
typedef void OnButtonClick(Window *w);
static const uint16 _terraform_keycodes[] = {
- '1',
- '2',
- '3',
- '4',
- '5',
+ 'Q',
+ 'W',
+ 'E',
0,
- '7',
+ 'Z',
+ 'U',
+ 'I',
};
void PlaceProc_DemolishArea(uint tile)
@@ -66,26 +66,19 @@ void PlaceProc_PlantTree(uint tile)
}
-
-
-static void TerraformClick_Dynamite(Window *w)
-{
- HandlePlacePushButton(w, 2, ANIMCURSOR_DEMOLISH, 1, PlaceProc_DemolishArea);
-}
-
static void TerraformClick_Lower(Window *w)
{
- HandlePlacePushButton(w, 3, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LowerLand);
+ HandlePlacePushButton(w, 2, ANIMCURSOR_LOWERLAND, 2, PlaceProc_LowerLand);
}
static void TerraformClick_Raise(Window *w)
{
- HandlePlacePushButton(w, 4, ANIMCURSOR_RAISELAND, 2, PlaceProc_RaiseLand);
+ HandlePlacePushButton(w, 3, ANIMCURSOR_RAISELAND, 2, PlaceProc_RaiseLand);
}
static void TerraformClick_Level(Window *w)
{
- HandlePlacePushButton(w, 5, SPR_OPENTTD_BASE+69, 2, PlaceProc_LevelLand);
+ HandlePlacePushButton(w, 4, SPR_OPENTTD_BASE+69, 2, PlaceProc_LevelLand);
}
static void TerraformClick_BuyLand(Window *w)
@@ -95,22 +88,21 @@ static void TerraformClick_BuyLand(Window *w)
static void TerraformClick_Trees(Window *w)
{
- if (HandlePlacePushButton(w, 8, 0, 1, PlaceProc_PlantTree)) ShowBuildTreesToolbar();
+ if (HandlePlacePushButton(w, 7, 0, 1, PlaceProc_PlantTree)) ShowBuildTreesToolbar();
}
static void TerraformClick_PlaceSign(Window *w)
{
- HandlePlacePushButton(w, 9, 722, 1, PlaceProc_Sign);
+ HandlePlacePushButton(w, 8, 722, 1, PlaceProc_Sign);
}
static OnButtonClick * const _terraform_button_proc[] = {
- TerraformClick_Dynamite,
TerraformClick_Lower,
TerraformClick_Raise,
TerraformClick_Level,
- TerraformClick_BuyLand,
0,
+ TerraformClick_BuyLand,
TerraformClick_Trees,
TerraformClick_PlaceSign,
};
@@ -124,7 +116,7 @@ static void TerraformToolbWndProc(Window *w, WindowEvent *e)
DrawWindowWidgets(w);
break;
case WE_CLICK:
- if (e->click.widget >= 2 && e->click.widget != 7) {
+ if (e->click.widget >= 2 && e->click.widget != 5) {
_terraform_button_proc[e->click.widget - 2](w);
}
break;
@@ -185,22 +177,23 @@ static void TerraformToolbWndProc(Window *w, WindowEvent *e)
static const Widget _terraform_widgets[] = {
{ WWT_CLOSEBOX, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW},
-{ WWT_CAPTION, 7, 11, 157, 0, 13, STR_LANDSCAPING_TOOLBAR, STR_018C_WINDOW_TITLE_DRAG_THIS},
+{ WWT_CAPTION, 7, 11, 135, 0, 13, STR_LANDSCAPING_TOOLBAR, STR_018C_WINDOW_TITLE_DRAG_THIS},
+
+{ WWT_PANEL, 7, 0, 21, 14, 35, 695, STR_018E_LOWER_A_CORNER_OF_LAND},
+{ WWT_PANEL, 7, 22, 43, 14, 35, 694, STR_018F_RAISE_A_CORNER_OF_LAND},
+{ WWT_PANEL, 7, 44, 65, 14, 35, SPR_OPENTTD_BASE+68, STR_LEVEL_LAND_TOOLTIP},
+
+{ WWT_PANEL, 7, 66, 69, 14, 35, 0x0, STR_NULL},
-{ WWT_PANEL, 7, 0, 21, 14, 35, 703, STR_018D_DEMOLISH_BUILDINGS_ETC},
-{ WWT_PANEL, 7, 22, 43, 14, 35, 695, STR_018E_LOWER_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 44, 65, 14, 35, 694, STR_018F_RAISE_A_CORNER_OF_LAND},
-{ WWT_PANEL, 7, 66, 87, 14, 35, SPR_OPENTTD_BASE+68, STR_LEVEL_LAND_TOOLTIP},
-{ WWT_PANEL, 7, 88, 109, 14, 35, 4791, STR_0329_PURCHASE_LAND_FOR_FUTURE},
-{ WWT_PANEL, 7, 110, 113, 14, 35, 0x0, STR_NULL},
-{ WWT_PANEL, 7, 114, 135, 14, 35, 742, STR_0185_PLANT_TREES_PLACE_SIGNS},
-{ WWT_PANEL, 7, 136, 157, 14, 35, SPR_OPENTTD_BASE+70, STR_0289_PLACE_SIGN},
+{ WWT_PANEL, 7, 70, 91, 14, 35, 4791, STR_0329_PURCHASE_LAND_FOR_FUTURE},
+{ WWT_PANEL, 7, 92, 113, 14, 35, 742, STR_0185_PLANT_TREES_PLACE_SIGNS},
+{ WWT_PANEL, 7, 114, 135, 14, 35, SPR_OPENTTD_BASE+70, STR_0289_PLACE_SIGN},
{ WIDGETS_END},
};
static const WindowDesc _terraform_desc = {
- 640-158, 22+36, 158, 36,
+ 640-136, 22+36, 136, 36,
WC_SCEN_LAND_GEN,0,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
_terraform_widgets,
diff --git a/ttd.h b/ttd.h
index 201814844..0265d21f1 100644
--- a/ttd.h
+++ b/ttd.h
@@ -419,12 +419,12 @@ enum {
WC_ENGINE_PREVIEW = 0x35,
WC_MUSIC_WINDOW = 0x36,
WC_MUSIC_TRACK_SELECTION = 0x37,
- WC_SCEN_LAND_GEN = 0x38,
+ WC_SCEN_LAND_GEN = 0x38, // also used for landscaping toolbar
WC_ASK_RESET_LANDSCAPE = 0x39,
WC_SCEN_TOWN_GEN = 0x3A,
WC_SCEN_INDUSTRY = 0x3B,
WC_SCEN_BUILD_ROAD = 0x3C,
- WC_SCEN_BUILD_TREES = 0x3D,
+ WC_BUILD_TREES = 0x3D,
WC_SEND_NETWORK_MSG = 0x3E,
WC_DROPDOWN_MENU = 0x3F,
WC_BUILD_INDUSTRY = 0x40,