summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dock_gui.cpp85
-rw-r--r--src/gui.h1
-rw-r--r--src/lang/english.txt5
-rw-r--r--src/road_gui.cpp2
-rw-r--r--src/terraform_gui.cpp55
-rw-r--r--src/toolbar_gui.cpp35
-rw-r--r--src/window_type.h2
7 files changed, 106 insertions, 79 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index bf729d6eb..dd9982774 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -61,7 +61,7 @@ static void PlaceDocks_Buoy(TileIndex tile)
static void PlaceDocks_BuildCanal(TileIndex tile)
{
- VpStartPlaceSizing(tile, VPM_X_OR_Y, DDSP_CREATE_WATER);
+ VpStartPlaceSizing(tile, (_game_mode == GM_EDITOR) ? VPM_X_AND_Y : VPM_X_OR_Y, DDSP_CREATE_WATER);
}
static void PlaceDocks_BuildLock(TileIndex tile)
@@ -69,6 +69,11 @@ static void PlaceDocks_BuildLock(TileIndex tile)
DoCommandP(tile, 0, 0, CcBuildDocks, CMD_BUILD_LOCK | CMD_MSG(STR_CANT_BUILD_LOCKS));
}
+static void PlaceDocks_BuildRiver(TileIndex tile)
+{
+ VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_RIVER);
+}
+
static void PlaceDocks_Aqueduct(TileIndex tile)
{
VpStartPlaceSizing(tile, VPM_X_OR_Y, DDSP_BUILD_BRIDGE);
@@ -89,6 +94,7 @@ enum DockToolbarWidgets {
DTW_DEPOT, ///< Build depot button
DTW_STATION, ///< Build station button
DTW_BUOY, ///< Build buoy button
+ DTW_RIVER, ///< Build river button (in scenario editor)
DTW_BUILD_AQUEDUCT, ///< Build aqueduct button
DTW_END, ///< End of toolbar widgets
};
@@ -96,6 +102,7 @@ enum DockToolbarWidgets {
static void BuildDocksClick_Canal(Window *w)
{
+
HandlePlacePushButton(w, DTW_CANAL, SPR_CURSOR_CANAL, VHM_RECT, PlaceDocks_BuildCanal);
}
@@ -127,6 +134,12 @@ static void BuildDocksClick_Buoy(Window *w)
HandlePlacePushButton(w, DTW_BUOY, SPR_CURSOR_BOUY, VHM_RECT, PlaceDocks_Buoy);
}
+static void BuildDocksClick_River(Window *w)
+{
+ if (_game_mode != GM_EDITOR) return;
+ HandlePlacePushButton(w, DTW_RIVER, SPR_CURSOR_RIVER, VHM_RECT, PlaceDocks_BuildRiver);
+}
+
static void BuildDocksClick_Aqueduct(Window *w)
{
HandlePlacePushButton(w, DTW_BUILD_AQUEDUCT, SPR_CURSOR_AQUEDUCT, VHM_RECT, PlaceDocks_Aqueduct);
@@ -142,6 +155,7 @@ static OnButtonClick * const _build_docks_button_proc[] = {
BuildDocksClick_Depot,
BuildDocksClick_Dock,
BuildDocksClick_Buoy,
+ BuildDocksClick_River,
BuildDocksClick_Aqueduct
};
@@ -177,8 +191,9 @@ struct BuildDocksToolbarWindow : Window {
case '4': BuildDocksClick_Depot(this); break;
case '5': BuildDocksClick_Dock(this); break;
case '6': BuildDocksClick_Buoy(this); break;
+ case '7': BuildDocksClick_River(this); break;
case 'B':
- case '7': BuildDocksClick_Aqueduct(this); break;
+ case '8': BuildDocksClick_Aqueduct(this); break;
default: return ES_NOT_HANDLED;
}
return ES_HANDLED;
@@ -207,7 +222,10 @@ struct BuildDocksToolbarWindow : Window {
GUIPlaceProcDragXY(select_proc, start_tile, end_tile);
break;
case DDSP_CREATE_WATER:
- DoCommandP(end_tile, start_tile, 0, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_BUILD_CANALS));
+ DoCommandP(end_tile, start_tile, (_game_mode == GM_EDITOR ? _ctrl_pressed : 0), CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_BUILD_CANALS));
+ break;
+ case DDSP_CREATE_RIVER:
+ DoCommandP(end_tile, start_tile, 2, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_PLACE_RIVERS));
break;
default: break;
@@ -233,24 +251,25 @@ struct BuildDocksToolbarWindow : Window {
};
static const Widget _build_docks_toolb_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // DTW_CLOSEBOX
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 145, 0, 13, STR_9801_DOCK_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // DTW_CAPTION
-{ WWT_STICKYBOX, RESIZE_NONE, 7, 146, 157, 0, 13, 0x0, STR_STICKY_BUTTON}, // DTW_STICKY
-{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_BUILD_CANAL, STR_BUILD_CANALS_TIP}, // DTW_CANAL
-{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_BUILD_LOCK, STR_BUILD_LOCKS_TIP}, // DTW_LOCK
-
-{ WWT_PANEL, RESIZE_NONE, 7, 44, 47, 14, 35, 0x0, STR_NULL}, // DTW_SEPERATOR
-
-{ WWT_IMGBTN, RESIZE_NONE, 7, 48, 69, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // DTW_DEMOLISH
-{ WWT_IMGBTN, RESIZE_NONE, 7, 70, 91, 14, 35, SPR_IMG_SHIP_DEPOT, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING}, // DTW_DEPOT
-{ WWT_IMGBTN, RESIZE_NONE, 7, 92, 113, 14, 35, SPR_IMG_SHIP_DOCK, STR_981D_BUILD_SHIP_DOCK}, // DTW_STATION
-{ WWT_IMGBTN, RESIZE_NONE, 7, 114, 135, 14, 35, SPR_IMG_BOUY, STR_9834_POSITION_BUOY_WHICH_CAN}, // DTW_BUOY
-{ WWT_IMGBTN, RESIZE_NONE, 7, 136, 157, 14, 35, SPR_IMG_AQUEDUCT, STR_BUILD_AQUEDUCT}, // DTW_BUILD_AQUEDUCT
+{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // DTW_CLOSEBOX
+{ WWT_CAPTION, RESIZE_NONE, 7, 11, 147, 0, 13, STR_9801_WATERWAYS_CONSTRUCTION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // DTW_CAPTION
+{ WWT_STICKYBOX, RESIZE_NONE, 7, 148, 159, 0, 13, 0x0, STR_STICKY_BUTTON}, // DTW_STICKY
+{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_BUILD_CANAL, STR_BUILD_CANALS_TIP}, // DTW_CANAL
+{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_BUILD_LOCK, STR_BUILD_LOCKS_TIP}, // DTW_LOCK
+
+{ WWT_PANEL, RESIZE_NONE, 7, 44, 48, 14, 35, 0x0, STR_NULL}, // DTW_SEPERATOR
+
+{ WWT_IMGBTN, RESIZE_NONE, 7, 49, 70, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // DTW_DEMOLISH
+{ WWT_IMGBTN, RESIZE_NONE, 7, 71, 92, 14, 35, SPR_IMG_SHIP_DEPOT, STR_981E_BUILD_SHIP_DEPOT_FOR_BUILDING}, // DTW_DEPOT
+{ WWT_IMGBTN, RESIZE_NONE, 7, 93, 114, 14, 35, SPR_IMG_SHIP_DOCK, STR_981D_BUILD_SHIP_DOCK}, // DTW_STATION
+{ WWT_IMGBTN, RESIZE_NONE, 7, 115, 136, 14, 35, SPR_IMG_BOUY, STR_9834_POSITION_BUOY_WHICH_CAN}, // DTW_BUOY
+{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, // DTW_RIVER
+{ WWT_IMGBTN, RESIZE_NONE, 7, 137, 159, 14, 35, SPR_IMG_AQUEDUCT, STR_BUILD_AQUEDUCT}, // DTW_BUILD_AQUEDUCT
{ WIDGETS_END},
};
static const WindowDesc _build_docks_toolbar_desc = {
- WDP_ALIGN_TBR, 22, 158, 36, 158, 36,
+ WDP_ALIGN_TBR, 22, 160, 36, 160, 36,
WC_BUILD_TOOLBAR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_build_docks_toolb_widgets,
@@ -264,6 +283,38 @@ void ShowBuildDocksToolbar()
AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
}
+/* Widget definition for the build docks in scenario editor window */
+static const Widget _build_docks_scen_toolb_widgets[] = {
+{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // DTW_CLOSEBOX
+{ WWT_CAPTION, RESIZE_NONE, 7, 11, 102, 0, 13, STR_9801_WATERWAYS_CONSTRUCTION_SE, STR_018C_WINDOW_TITLE_DRAG_THIS}, // DTW_CAPTION
+{ WWT_STICKYBOX, RESIZE_NONE, 7, 103, 114, 0, 13, 0x0, STR_STICKY_BUTTON}, // DTW_STICKY
+{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 14, 35, SPR_IMG_BUILD_CANAL, STR_CREATE_LAKE}, // DTW_CANAL
+{ WWT_IMGBTN, RESIZE_NONE, 7, 22, 43, 14, 35, SPR_IMG_BUILD_LOCK, STR_BUILD_LOCKS_TIP}, // DTW_LOCK
+
+{ WWT_PANEL, RESIZE_NONE, 7, 44, 48, 14, 35, 0x0, STR_NULL}, // DTW_SEPERATOR
+
+{ WWT_IMGBTN, RESIZE_NONE, 7, 49, 70, 14, 35, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // DTW_DEMOLISH
+{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, // DTW_DEPOT
+{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, // DTW_STATION
+{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL}, // DTW_BUOY
+{ WWT_IMGBTN, RESIZE_NONE, 7, 71, 92, 14, 35, SPR_IMG_BUILD_RIVER, STR_CREATE_RIVER}, // DTW_RIVER
+{ WWT_IMGBTN, RESIZE_NONE, 7, 93, 114, 14, 35, SPR_IMG_AQUEDUCT, STR_BUILD_AQUEDUCT}, // DTW_BUILD_AQUEDUCT
+{ WIDGETS_END},
+};
+
+/* Window definition for the build docks in scenario editor window */
+static const WindowDesc _build_docks_scen_toolbar_desc = {
+ WDP_AUTO, WDP_AUTO, 115, 36, 115, 36,
+ WC_SCEN_BUILD_TOOLBAR, WC_NONE,
+ WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
+ _build_docks_scen_toolb_widgets,
+};
+
+void ShowBuildDocksScenToolbar()
+{
+ AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_scen_toolbar_desc, TRANSPORT_WATER);
+}
+
struct BuildDocksStationWindow : public PickerWindowBase {
private:
enum BuildDockStationWidgets {
diff --git a/src/gui.h b/src/gui.h
index bc54f3062..d7e35f41e 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -40,6 +40,7 @@ void ShowOrdersWindow(const Vehicle *v);
/* dock_gui.cpp */
void ShowBuildDocksToolbar();
+void ShowBuildDocksScenToolbar();
/* aircraft_gui.cpp */
void ShowBuildAirToolbar();
diff --git a/src/lang/english.txt b/src/lang/english.txt
index bc9e36279..26b9273d8 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -2957,8 +2957,9 @@ STR_REFIT_ROAD_VEHICLE_CAN_T :{WHITE}Can't re
STR_ROAD_SELECT_TYPE_OF_CARGO_FOR :{BLACK}Select type of cargo for road vehicle to carry
##id 0x9800
-STR_9800_DOCK_CONSTRUCTION :Dock construction
-STR_9801_DOCK_CONSTRUCTION :{WHITE}Dock construction
+STR_9800_WATERWAYS_CONSTRUCTION :Waterways construction
+STR_9801_WATERWAYS_CONSTRUCTION :{WHITE}Waterways construction
+STR_9801_WATERWAYS_CONSTRUCTION_SE :{WHITE}Waterways
STR_9802_CAN_T_BUILD_DOCK_HERE :{WHITE}Can't build dock here...
STR_9803_SHIP_DEPOT :{WHITE}{TOWN} Ship Depot
STR_9804_NEW_SHIPS :{BLACK}New Ships
diff --git a/src/road_gui.cpp b/src/road_gui.cpp
index 9d56c7192..89784d1c4 100644
--- a/src/road_gui.cpp
+++ b/src/road_gui.cpp
@@ -704,7 +704,7 @@ static const Widget _build_road_scen_widgets[] = {
static const WindowDesc _build_road_scen_desc = {
WDP_AUTO, WDP_AUTO, 197, 36, 197, 36,
- WC_SCEN_BUILD_ROAD, WC_NONE,
+ WC_SCEN_BUILD_TOOLBAR, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_build_road_scen_widgets,
};
diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp
index 8e84c0165..b8114739a 100644
--- a/src/terraform_gui.cpp
+++ b/src/terraform_gui.cpp
@@ -131,12 +131,6 @@ bool GUIPlaceProcDragXY(ViewportDragDropSelectionProcess proc, TileIndex start_t
case DDSP_CREATE_DESERT:
GenerateDesertArea(end_tile, start_tile);
break;
- case DDSP_CREATE_WATER:
- DoCommandP(end_tile, start_tile, _ctrl_pressed, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_BUILD_CANALS));
- break;
- case DDSP_CREATE_RIVER:
- DoCommandP(end_tile, start_tile, 2, CcBuildCanal, CMD_BUILD_CANAL | CMD_MSG(STR_CANT_PLACE_RIVERS));
- break;
default:
return false;
}
@@ -443,34 +437,23 @@ static void PlaceProc_DesertArea(TileIndex tile)
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_DESERT);
}
-static void PlaceProc_WaterArea(TileIndex tile)
-{
- VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_WATER);
-}
-
-static void PlaceProc_RiverArea(TileIndex tile)
-{
- VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_RIVER);
-}
static const Widget _scen_edit_land_gen_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, 7, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, // ETTW_CLOSEBOX
-{ WWT_CAPTION, RESIZE_NONE, 7, 11, 191, 0, 13, STR_0223_LAND_GENERATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // ETTW_CAPTION
-{ WWT_STICKYBOX, RESIZE_NONE, 7, 192, 203, 0, 13, STR_NULL, STR_STICKY_BUTTON}, // ETTW_STICKY
-{ WWT_PANEL, RESIZE_NONE, 7, 0, 203, 14, 102, 0x0, STR_NULL}, // ETTW_BACKGROUND
+{ WWT_CAPTION, RESIZE_NONE, 7, 11, 150, 0, 13, STR_0223_LAND_GENERATION, STR_018C_WINDOW_TITLE_DRAG_THIS}, // ETTW_CAPTION
+{ WWT_STICKYBOX, RESIZE_NONE, 7, 151, 162, 0, 13, STR_NULL, STR_STICKY_BUTTON}, // ETTW_STICKY
+{ WWT_PANEL, RESIZE_NONE, 7, 0, 162, 14, 102, 0x0, STR_NULL}, // ETTW_BACKGROUND
{ WWT_IMGBTN, RESIZE_NONE, 14, 2, 23, 16, 37, SPR_IMG_DYNAMITE, STR_018D_DEMOLISH_BUILDINGS_ETC}, // ETTW_DEMOLISH
{ WWT_IMGBTN, RESIZE_NONE, 14, 24, 45, 16, 37, SPR_IMG_TERRAFORM_DOWN, STR_018E_LOWER_A_CORNER_OF_LAND}, // ETTW_LOWER_LAND
{ WWT_IMGBTN, RESIZE_NONE, 14, 46, 67, 16, 37, SPR_IMG_TERRAFORM_UP, STR_018F_RAISE_A_CORNER_OF_LAND}, // ETTW_RAISE_LAND
{ WWT_IMGBTN, RESIZE_NONE, 14, 68, 89, 16, 37, SPR_IMG_LEVEL_LAND, STR_LEVEL_LAND_TOOLTIP}, // ETTW_LEVEL_LAND
-{ WWT_IMGBTN, RESIZE_NONE, 14, 90, 111, 16, 37, SPR_IMG_BUILD_CANAL, STR_CREATE_LAKE}, // ETTW_BUILD_CANAL
-{ WWT_IMGBTN, RESIZE_NONE, 14, 112, 133, 16, 37, SPR_IMG_BUILD_RIVER, STR_CREATE_RIVER}, // ETTW_BUILD_RIVER
-{ WWT_IMGBTN, RESIZE_NONE, 14, 134, 156, 16, 37, SPR_IMG_ROCKS, STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE}, // ETTW_PLACE_ROCKS
-{ WWT_IMGBTN, RESIZE_NONE, 14, 157, 179, 16, 37, SPR_IMG_LIGHTHOUSE_DESERT, STR_NULL}, // ETTW_PLACE_DESERT_LIGHTHOUSE XXX - dynamic
-{ WWT_IMGBTN, RESIZE_NONE, 14, 180, 201, 16, 37, SPR_IMG_TRANSMITTER, STR_028E_PLACE_TRANSMITTER}, // ETTW_PLACE_TRANSMITTER
+{ WWT_IMGBTN, RESIZE_NONE, 14, 90, 111, 16, 37, SPR_IMG_ROCKS, STR_028C_PLACE_ROCKY_AREAS_ON_LANDSCAPE}, // ETTW_PLACE_ROCKS
+{ WWT_IMGBTN, RESIZE_NONE, 14, 112, 133, 16, 37, SPR_IMG_LIGHTHOUSE_DESERT, STR_NULL}, // ETTW_PLACE_DESERT_LIGHTHOUSE XXX - dynamic
+{ WWT_IMGBTN, RESIZE_NONE, 14, 134, 156, 16, 37, SPR_IMG_TRANSMITTER, STR_028E_PLACE_TRANSMITTER}, // ETTW_PLACE_TRANSMITTER
{ WWT_IMGBTN, RESIZE_NONE, 14, 150, 161, 45, 56, SPR_ARROW_UP, STR_0228_INCREASE_SIZE_OF_LAND_AREA}, // ETTW_INCREASE_SIZE
{ WWT_IMGBTN, RESIZE_NONE, 14, 150, 161, 58, 69, SPR_ARROW_DOWN, STR_0229_DECREASE_SIZE_OF_LAND_AREA}, // ETTW_DECREASE_SIZE
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 24, 179, 76, 87, STR_SE_NEW_WORLD, STR_022A_GENERATE_RANDOM_LAND}, // ETTW_NEW_SCENARIO
-{ WWT_TEXTBTN, RESIZE_NONE, 14, 24, 179, 89, 100, STR_022B_RESET_LANDSCAPE, STR_RESET_LANDSCAPE_TOOLTIP}, // ETTW_RESET_LANDSCAPE
+{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 161, 76, 87, STR_SE_NEW_WORLD, STR_022A_GENERATE_RANDOM_LAND}, // ETTW_NEW_SCENARIO
+{ WWT_TEXTBTN, RESIZE_NONE, 14, 2, 161, 89, 100, STR_022B_RESET_LANDSCAPE, STR_RESET_LANDSCAPE_TOOLTIP}, // ETTW_RESET_LANDSCAPE
{ WIDGETS_END},
};
@@ -497,8 +480,6 @@ enum EditorTerraformToolbarWidgets {
ETTW_LOWER_LAND, ///< Lower land button
ETTW_RAISE_LAND, ///< Raise land button
ETTW_LEVEL_LAND, ///< Level land button
- ETTW_BUILD_CANAL, ///< Build canal button
- ETTW_BUILD_RIVER, ///< Build river button
ETTW_PLACE_ROCKS, ///< Place rocks button
ETTW_PLACE_DESERT_LIGHTHOUSE, ///< Place desert button (in tropical climate) / place lighthouse button (else)
ETTW_PLACE_TRANSMITTER, ///< Place transmitter button
@@ -533,16 +514,6 @@ static void EditorTerraformClick_LevelLand(Window *w)
HandlePlacePushButton(w, ETTW_LEVEL_LAND, SPR_CURSOR_LEVEL_LAND, VHM_POINT, PlaceProc_LevelLand);
}
-static void EditorTerraformClick_WaterArea(Window *w)
-{
- HandlePlacePushButton(w, ETTW_BUILD_CANAL, SPR_CURSOR_CANAL, VHM_RECT, PlaceProc_WaterArea);
-}
-
-static void EditorTerraformClick_RiverArea(Window *w)
-{
- HandlePlacePushButton(w, ETTW_BUILD_RIVER, SPR_CURSOR_RIVER, VHM_RECT, PlaceProc_RiverArea);
-}
-
static void EditorTerraformClick_RockyArea(Window *w)
{
HandlePlacePushButton(w, ETTW_PLACE_ROCKS, SPR_CURSOR_ROCKY_AREA, VHM_RECT, PlaceProc_RockyArea);
@@ -565,9 +536,7 @@ static const uint16 _editor_terraform_keycodes[] = {
'E',
'R',
'T',
- 'Y',
- 'U',
- 'I'
+ 'Y'
};
typedef void OnButtonClick(Window *w);
@@ -576,8 +545,6 @@ static OnButtonClick * const _editor_terraform_button_proc[] = {
EditorTerraformClick_LowerBigLand,
EditorTerraformClick_RaiseBigLand,
EditorTerraformClick_LevelLand,
- EditorTerraformClick_WaterArea,
- EditorTerraformClick_RiverArea,
EditorTerraformClick_RockyArea,
EditorTerraformClick_DesertLightHouse,
EditorTerraformClick_Transmitter
@@ -708,8 +675,6 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
default: NOT_REACHED();
case DDSP_CREATE_ROCKS:
case DDSP_CREATE_DESERT:
- case DDSP_CREATE_WATER:
- case DDSP_CREATE_RIVER:
case DDSP_RAISE_AND_LEVEL_AREA:
case DDSP_LOWER_AND_LEVEL_AREA:
case DDSP_LEVEL_AREA:
@@ -728,7 +693,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
};
static const WindowDesc _scen_edit_land_gen_desc = {
- WDP_AUTO, WDP_AUTO, 204, 103, 204, 103,
+ WDP_AUTO, WDP_AUTO, 163, 103, 163, 103,
WC_SCEN_LAND_GEN, WC_NONE,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
_scen_edit_land_gen_widgets,
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 76b04f23a..9c0a7734e 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -105,6 +105,7 @@ enum ToolbarScenEditorWidgets {
TBSE_TOWNGENERATE,
TBSE_INDUSTRYGENERATE,
TBSE_BUILDROAD,
+ TBSE_BUILDDOCKS,
TBSE_PLANTTREES,
TBSE_PLACESIGNS,
};
@@ -556,7 +557,7 @@ static void MenuClickBuildRoad(int index)
static void ToolbarBuildWaterClick(Window *w)
{
- PopupMainToolbMenu(w, TBN_WATER, STR_9800_DOCK_CONSTRUCTION, 1);
+ PopupMainToolbMenu(w, TBN_WATER, STR_9800_WATERWAYS_CONSTRUCTION, 1);
}
static void MenuClickBuildWater(int index)
@@ -738,6 +739,13 @@ static void ToolbarScenBuildRoad(Window *w)
ShowBuildRoadScenToolbar();
}
+static void ToolbarScenBuildDocks(Window *w)
+{
+ w->HandleButtonClick(TBSE_BUILDDOCKS);
+ SndPlayFx(SND_15_BEEP);
+ ShowBuildDocksScenToolbar();
+}
+
static void ToolbarScenPlantTrees(Window *w)
{
w->HandleButtonClick(TBSE_PLANTTREES);
@@ -1068,6 +1076,7 @@ static ToolbarButtonProc * const _scen_toolbar_button_procs[] = {
ToolbarScenGenTown,
ToolbarScenGenIndustry,
ToolbarScenBuildRoad,
+ ToolbarScenBuildDocks,
ToolbarScenPlantTrees,
ToolbarScenPlaceSign,
NULL,
@@ -1076,7 +1085,6 @@ static ToolbarButtonProc * const _scen_toolbar_button_procs[] = {
NULL,
NULL,
NULL,
- NULL,
ToolbarMusicClick,
NULL,
ToolbarHelpClick,
@@ -1131,10 +1139,11 @@ public:
case WKC_F5: ToolbarScenGenTown(this); break;
case WKC_F6: ToolbarScenGenIndustry(this); break;
case WKC_F7: ToolbarScenBuildRoad(this); break;
- case WKC_F8: ToolbarScenPlantTrees(this); break;
- case WKC_F9: ToolbarScenPlaceSign(this); break;
- case WKC_F10: ShowMusicWindow(); break;
- case WKC_F11: PlaceLandBlockInfo(); break;
+ case WKC_F8: ToolbarScenBuildDocks(this); break;
+ case WKC_F9: ToolbarScenPlantTrees(this); break;
+ case WKC_F10: ToolbarScenPlaceSign(this); break;
+ case WKC_F11: ShowMusicWindow(); break;
+ case WKC_F12: PlaceLandBlockInfo(); break;
case WKC_CTRL | 'S': MenuClickSmallScreenshot(); break;
case WKC_CTRL | 'G': MenuClickWorldScreenshot(); break;
@@ -1171,17 +1180,17 @@ public:
uint buttons_width;
uint spacing;
- static int normal_min_width = (15 * 22) + (2 * 130);
- static int one_less_panel_min_width = (15 * 22) + 130;
+ static int normal_min_width = (16 * 22) + (2 * 130);
+ static int one_less_panel_min_width = (16 * 22) + 130;
if (this->width >= one_less_panel_min_width) {
- buttons_width = 15 * 22;
+ buttons_width = 16 * 22;
spacing = this->width - ((this->width >= normal_min_width) ? normal_min_width : one_less_panel_min_width);
} else {
buttons_width = this->width - 130;
spacing = 0;
}
- uint extra_spacing_at[] = { 3, 4, 7, 8, 10, 16, 0 };
+ static const uint extra_spacing_at[] = { 3, 4, 7, 8, 10, 17, 0 };
for (uint i = 0, x = 0, j = 0, b = 0; i < this->widget_count; i++) {
switch (i) {
@@ -1213,9 +1222,9 @@ public:
if (this->widget[i].bottom == 0) continue;
this->widget[i].left = x;
- x += buttons_width / (15 - b);
+ x += buttons_width / (16 - b);
this->widget[i].right = x - 1;
- buttons_width -= buttons_width / (15 - b);
+ buttons_width -= buttons_width / (16 - b);
b++;
break;
}
@@ -1269,6 +1278,7 @@ static const Widget _toolb_scen_widgets[] = {
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_TOWN, STR_022F_TOWN_GENERATION},
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_INDUSTRY, STR_0230_INDUSTRY_GENERATION},
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_BUILDROAD, STR_0231_ROAD_CONSTRUCTION},
+{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_BUILDWATER, STR_0183_BUILD_SHIP_DOCKS},
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_PLANTTREES, STR_0288_PLANT_TREES},
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_SIGN, STR_0289_PLACE_SIGN},
@@ -1278,7 +1288,6 @@ static const Widget _toolb_scen_widgets[] = {
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
-{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_MUSIC, STR_01D4_SHOW_SOUND_MUSIC_WINDOW},
{ WWT_EMPTY, RESIZE_NONE, 0, 0, 0, 0, 0, 0x0, STR_NULL},
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 0, 0, 21, SPR_IMG_QUERY, STR_0186_LAND_BLOCK_INFORMATION},
diff --git a/src/window_type.h b/src/window_type.h
index 62f226527..2dc4ba584 100644
--- a/src/window_type.h
+++ b/src/window_type.h
@@ -66,7 +66,7 @@ enum WindowClass {
WC_SCEN_LAND_GEN,
WC_SCEN_TOWN_GEN,
WC_SCEN_INDUSTRY,
- WC_SCEN_BUILD_ROAD,
+ WC_SCEN_BUILD_TOOLBAR,
WC_BUILD_TREES,
WC_SEND_NETWORK_MSG,
WC_DROPDOWN_MENU,