OpenTTD Source
12.0-beta2
|
#include "stdafx.h"
#include "core/backup_type.hpp"
#include "clear_map.h"
#include "company_func.h"
#include "company_base.h"
#include "gui.h"
#include "window_gui.h"
#include "window_func.h"
#include "viewport_func.h"
#include "command_func.h"
#include "signs_func.h"
#include "sound_func.h"
#include "base_station_base.h"
#include "textbuf_gui.h"
#include "genworld.h"
#include "tree_map.h"
#include "landscape_type.h"
#include "tilehighlight_func.h"
#include "strings_func.h"
#include "newgrf_object.h"
#include "object.h"
#include "hotkeys.h"
#include "engine_base.h"
#include "terraform_gui.h"
#include "zoom_func.h"
#include "widgets/terraform_widget.h"
#include "table/strings.h"
#include "safeguards.h"
Go to the source code of this file.
Data Structures | |
struct | TerraformToolbarWindow |
Terra form toolbar managing class. More... | |
struct | ScenarioEditorLandscapeGenerationWindow |
Landscape generation window handler in the scenario editor. More... | |
Functions | |
void | CcTerraform (const CommandCost &result, TileIndex tile, uint32 p1, uint32 p2, uint32 cmd) |
static void | GenerateDesertArea (TileIndex end, TileIndex start) |
Scenario editor command that generates desert areas. | |
static void | GenerateRockyArea (TileIndex end, TileIndex start) |
Scenario editor command that generates rocky areas. | |
bool | GUIPlaceProcDragXY (ViewportDragDropSelectionProcess proc, TileIndex start_tile, TileIndex end_tile) |
A central place to handle all X_AND_Y dragged GUI functions. More... | |
void | PlaceProc_DemolishArea (TileIndex tile) |
Start a drag for demolishing an area. More... | |
static EventState | TerraformToolbarGlobalHotkeys (int hotkey) |
Handler for global hotkeys of the TerraformToolbarWindow. More... | |
Window * | ShowTerraformToolbar (Window *link) |
Show the toolbar for terraforming in the game. More... | |
static void | CommonRaiseLowerBigLand (TileIndex tile, int mode) |
Raise/Lower a bigger chunk of land at the same time in the editor. More... | |
static void | ResetLandscapeConfirmationCallback (Window *w, bool confirmed) |
Callback function for the scenario editor 'reset landscape' confirmation window. More... | |
static EventState | TerraformToolbarEditorGlobalHotkeys (int hotkey) |
Handler for global hotkeys of the ScenarioEditorLandscapeGenerationWindow. More... | |
Window * | ShowEditorTerraformToolbar () |
Show the toolbar for terraforming in the scenario editor. More... | |
Variables | |
static Hotkey | terraform_hotkeys [] |
static const NWidgetPart | _nested_terraform_widgets [] |
static WindowDesc | _terraform_desc (WDP_MANUAL, "toolbar_landscape", 0, 0, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, _nested_terraform_widgets, lengthof(_nested_terraform_widgets), &TerraformToolbarWindow::hotkeys) |
static byte | _terraform_size = 1 |
static const int8 | _multi_terraform_coords [][2] |
static const NWidgetPart | _nested_scen_edit_land_gen_widgets [] |
static Hotkey | terraform_editor_hotkeys [] |
static WindowDesc | _scen_edit_land_gen_desc (WDP_AUTO, "toolbar_landscape_scen", 0, 0, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, _nested_scen_edit_land_gen_widgets, lengthof(_nested_scen_edit_land_gen_widgets), &ScenarioEditorLandscapeGenerationWindow::hotkeys) |
GUI related to terraforming the map.
Definition in file terraform_gui.cpp.
|
static |
Raise/Lower a bigger chunk of land at the same time in the editor.
When raising get the lowest point, when lowering the highest point, and set all tiles in the selection to that height.
tile | The top-left tile where the terraforming will start |
mode | 1 for raising, 0 for lowering land |
Definition at line 392 of file terraform_gui.cpp.
Referenced by ScenarioEditorLandscapeGenerationWindow::OnPlaceObject().
bool GUIPlaceProcDragXY | ( | ViewportDragDropSelectionProcess | proc, |
TileIndex | start_tile, | ||
TileIndex | end_tile | ||
) |
A central place to handle all X_AND_Y dragged GUI functions.
proc | Procedure related to the dragging |
start_tile | Begin of the dragging |
end_tile | End of the dragging |
Definition at line 107 of file terraform_gui.cpp.
References _ctrl_pressed, _settings_game, CMD_CLEAR_AREA, CMD_MSG, GameSettings::construction, DDSP_DEMOLISH_AREA, DoCommandP(), ConstructionSettings::freeform_edges, MapMaxX(), MapMaxY(), TileDiffXY(), TileX(), and TileY().
Referenced by BuildAirToolbarWindow::OnPlaceMouseUp(), and BuildDocksToolbarWindow::OnPlaceMouseUp().
void PlaceProc_DemolishArea | ( | TileIndex | tile | ) |
Start a drag for demolishing an area.
tile | Position of one corner. |
Definition at line 146 of file terraform_gui.cpp.
References DDSP_DEMOLISH_AREA, VPM_X_AND_Y, and VpStartPlaceSizing().
Referenced by BuildAirToolbarWindow::OnPlaceObject(), TerraformToolbarWindow::OnPlaceObject(), BuildRailToolbarWindow::OnPlaceObject(), and ScenarioEditorLandscapeGenerationWindow::OnPlaceObject().
|
static |
Callback function for the scenario editor 'reset landscape' confirmation window.
w | Window unused |
confirmed | boolean value, true when yes was clicked, false otherwise |
Definition at line 496 of file terraform_gui.cpp.
References _generating_world.
Window* ShowEditorTerraformToolbar | ( | ) |
Show the toolbar for terraforming in the scenario editor.
nullptr
. Definition at line 749 of file terraform_gui.cpp.
Show the toolbar for terraforming in the game.
link | The toolbar we might want to link to. |
nullptr
. Definition at line 357 of file terraform_gui.cpp.
References _local_company, and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().
Referenced by MenuClickForest().
|
static |
Handler for global hotkeys of the ScenarioEditorLandscapeGenerationWindow.
hotkey | Hotkey |
Definition at line 716 of file terraform_gui.cpp.
|
static |
Handler for global hotkeys of the TerraformToolbarWindow.
hotkey | Hotkey |
Definition at line 292 of file terraform_gui.cpp.
|
static |
Definition at line 431 of file terraform_gui.cpp.
|
static |
Definition at line 313 of file terraform_gui.cpp.
|
static |
Definition at line 724 of file terraform_gui.cpp.
|
static |
Definition at line 300 of file terraform_gui.cpp.