Merge branch 'ingame_rivers' into jgrpp
Conflicts: src/settings_gui.cpp src/settings_type.h
This commit is contained in:
@@ -101,6 +101,7 @@ struct BuildDocksToolbarWindow : Window {
|
||||
this->InitNested(window_number);
|
||||
this->OnInvalidateData();
|
||||
if (_settings_client.gui.link_terraform_toolbar) ShowTerraformToolbar(this);
|
||||
SetWidgetDisabledState(WID_DT_RIVER, !_settings_game.construction.enable_build_river);
|
||||
}
|
||||
|
||||
~BuildDocksToolbarWindow()
|
||||
@@ -160,7 +161,7 @@ struct BuildDocksToolbarWindow : Window {
|
||||
break;
|
||||
|
||||
case WID_DT_RIVER: // Build river button (in scenario editor)
|
||||
if (_game_mode != GM_EDITOR) return;
|
||||
if (_game_mode != GM_EDITOR && !_settings_game.construction.enable_build_river) return;
|
||||
HandlePlacePushButton(this, WID_DT_RIVER, SPR_CURSOR_RIVER, HT_RECT);
|
||||
break;
|
||||
|
||||
@@ -324,6 +325,7 @@ static const NWidgetPart _nested_build_docks_toolbar_widgets[] = {
|
||||
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_DEPOT), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_SHIP_DEPOT, STR_WATERWAYS_TOOLBAR_BUILD_DEPOT_TOOLTIP),
|
||||
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_STATION), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_SHIP_DOCK, STR_WATERWAYS_TOOLBAR_BUILD_DOCK_TOOLTIP),
|
||||
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_BUOY), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_BUOY, STR_WATERWAYS_TOOLBAR_BUOY_TOOLTIP),
|
||||
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_RIVER), SetMinimalSize(22, 22), SetFill(0, 1), SetDataTip(SPR_IMG_BUILD_RIVER, STR_WATERWAYS_TOOLBAR_CREATE_RIVER_TOOLTIP),
|
||||
NWidget(WWT_IMGBTN, COLOUR_DARK_GREEN, WID_DT_BUILD_AQUEDUCT), SetMinimalSize(23, 22), SetFill(0, 1), SetDataTip(SPR_IMG_AQUEDUCT, STR_WATERWAYS_TOOLBAR_BUILD_AQUEDUCT_TOOLTIP),
|
||||
EndContainer(),
|
||||
};
|
||||
|
@@ -1467,6 +1467,9 @@ STR_CONFIG_SETTING_PERSISTENT_BUILDINGTOOLS_HELPTEXT :Keep the buildi
|
||||
STR_CONFIG_SETTING_EXPENSES_LAYOUT :Group expenses in company finance window: {STRING2}
|
||||
STR_CONFIG_SETTING_EXPENSES_LAYOUT_HELPTEXT :Define the layout for the company expenses window
|
||||
|
||||
STR_CONFIG_SETTING_ENABLE_BUILD_RIVER :Enable building rivers: {STRING2}
|
||||
STR_CONFIG_SETTING_ENABLE_BUILD_RIVER_HELPTEXT :Enable building rivers outside of the scenario editor
|
||||
|
||||
STR_CONFIG_SETTING_SOUND_TICKER :News ticker: {STRING2}
|
||||
STR_CONFIG_SETTING_SOUND_TICKER_HELPTEXT :Play sound for summarised news messages
|
||||
STR_CONFIG_SETTING_SOUND_NEWS :Newspaper: {STRING2}
|
||||
|
@@ -1702,6 +1702,7 @@ static SettingsContainer &GetSettingsTree()
|
||||
limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road"));
|
||||
limitations->Add(new SettingEntry("vehicle.disable_elrails"));
|
||||
limitations->Add(new SettingEntry("construction.maximum_signal_evaluations"));
|
||||
limitations->Add(new SettingEntry("construction.enable_build_river"));
|
||||
}
|
||||
|
||||
SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS));
|
||||
|
@@ -347,6 +347,7 @@ struct ConstructionSettings {
|
||||
uint8 command_pause_level; ///< level/amount of commands that can't be executed while paused
|
||||
uint16 maximum_signal_evaluations; ///< maximum number of programmable signals which may be evaluated in one pass
|
||||
byte simulated_wormhole_signals; ///< simulate signals in tunnel
|
||||
bool enable_build_river; ///< enable building rivers in-game
|
||||
|
||||
uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames?
|
||||
uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed?
|
||||
|
@@ -457,6 +457,15 @@ str = STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL
|
||||
strhelp = STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_HELPTEXT
|
||||
strval = STR_CONFIG_SETTING_COMMAND_PAUSE_LEVEL_NO_ACTIONS
|
||||
|
||||
[SDT_BOOL]
|
||||
base = GameSettings
|
||||
var = construction.enable_build_river
|
||||
def = false
|
||||
cat = SC_BASIC
|
||||
str = STR_CONFIG_SETTING_ENABLE_BUILD_RIVER
|
||||
strhelp = STR_CONFIG_SETTING_ENABLE_BUILD_RIVER_HELPTEXT
|
||||
patxname = ""enable_build_river.construction.enable_build_river""
|
||||
|
||||
[SDT_VAR]
|
||||
base = GameSettings
|
||||
var = construction.terraform_per_64k_frames
|
||||
|
@@ -387,7 +387,7 @@ bool RiverModifyDesertZone(TileIndex tile, void *)
|
||||
* @param tile end tile of stretch-dragging
|
||||
* @param flags type of operation
|
||||
* @param p1 start tile of stretch-dragging
|
||||
* @param p2 waterclass to build. sea and river can only be built in scenario editor
|
||||
* @param p2 waterclass to build. sea and river can only be built in scenario editor, unless enable_build_river is enabled
|
||||
* @param text unused
|
||||
* @return the cost of this operation or an error
|
||||
*/
|
||||
@@ -397,7 +397,13 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
if (p1 >= MapSize() || wc == WATER_CLASS_INVALID) return CMD_ERROR;
|
||||
|
||||
/* Outside of the editor you can only build canals, not oceans */
|
||||
if (wc != WATER_CLASS_CANAL && _game_mode != GM_EDITOR) return CMD_ERROR;
|
||||
if (_game_mode != GM_EDITOR) {
|
||||
if (wc == WATER_CLASS_RIVER) {
|
||||
if (!_settings_game.construction.enable_build_river) return CMD_ERROR;
|
||||
} else if (wc != WATER_CLASS_CANAL) {
|
||||
return CMD_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
TileArea ta(tile, p1);
|
||||
|
||||
@@ -452,6 +458,9 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
}
|
||||
|
||||
cost.AddCost(_price[PR_BUILD_CANAL]);
|
||||
if (wc == WATER_CLASS_RIVER) {
|
||||
cost.AddCost(_price[PR_BUILD_CANAL] * 3);
|
||||
}
|
||||
}
|
||||
|
||||
if (cost.GetCost() == 0) {
|
||||
|
Reference in New Issue
Block a user