Changeset - r9588:95c71f2b1d5b
[Not reviewed]
master
0 7 0
skidd13 - 16 years ago 2008-06-25 17:30:16
skidd13@openttd.org
(svn r13628) -Feature: enable building of aqueducts in the scenario editor
-Codechange: related to this split the waterway based buttons from the landscape generation window
7 files changed with 104 insertions and 77 deletions:
0 comments (0 inline, 0 general)
src/dock_gui.cpp
Show inline comments
 
@@ -61,7 +61,7 @@ static void PlaceDocks_Buoy(TileIndex ti
 

	
 
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(TileInd
 
	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 
 
	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_dock
 
	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_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,    47,    14,    35, 0x0,                        STR_NULL},                                // DTW_SEPERATOR
 
{      WWT_PANEL,   RESIZE_NONE,     7,    44,    48,    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_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 {
src/gui.h
Show inline comments
 
@@ -40,6 +40,7 @@ void ShowOrdersWindow(const Vehicle *v);
 

	
 
/* dock_gui.cpp */
 
void ShowBuildDocksToolbar();
 
void ShowBuildDocksScenToolbar();
 

	
 
/* aircraft_gui.cpp */
 
void ShowBuildAirToolbar();
src/lang/english.txt
Show inline comments
 
@@ -2957,8 +2957,9 @@ STR_REFIT_ROAD_VEHICLE_CAN_T            
 
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
src/road_gui.cpp
Show inline comments
 
@@ -704,7 +704,7 @@ static const Widget _build_road_scen_wid
 

	
 
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,
 
};
src/terraform_gui.cpp
Show inline comments
 
@@ -131,12 +131,6 @@ bool GUIPlaceProcDragXY(ViewportDragDrop
 
		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(TileInd
 
	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_LevelLa
 
	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_ke
 
	'E',
 
	'R',
 
	'T',
 
	'Y',
 
	'U',
 
	'I'
 
	'Y'
 
};
 

	
 
typedef void OnButtonClick(Window *w);
 
@@ -576,8 +545,6 @@ static OnButtonClick * const _editor_ter
 
	EditorTerraformClick_LowerBigLand,
 
	EditorTerraformClick_RaiseBigLand,
 
	EditorTerraformClick_LevelLand,
 
	EditorTerraformClick_WaterArea,
 
	EditorTerraformClick_RiverArea,
 
	EditorTerraformClick_RockyArea,
 
	EditorTerraformClick_DesertLightHouse,
 
	EditorTerraformClick_Transmitter
 
@@ -708,8 +675,6 @@ struct ScenarioEditorLandscapeGeneration
 
				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 ScenarioEditorLandscapeGeneration
 
};
 

	
 
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,
src/toolbar_gui.cpp
Show inline comments
 
@@ -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 
 
	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_t
 
	ToolbarScenGenTown,
 
	ToolbarScenGenIndustry,
 
	ToolbarScenBuildRoad,
 
	ToolbarScenBuildDocks,
 
	ToolbarScenPlantTrees,
 
	ToolbarScenPlaceSign,
 
	NULL,
 
@@ -1076,7 +1085,6 @@ static ToolbarButtonProc * const _scen_t
 
	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},
src/window_type.h
Show inline comments
 
@@ -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,
0 comments (0 inline, 0 general)