Landscape generation window handler in the scenario editor. More...
Public Member Functions | |
ScenarioEditorLandscapeGenerationWindow (WindowDesc *desc, WindowNumber window_number) | |
virtual void | OnPaint () |
The window must be repainted. | |
virtual void | DrawWidget (const Rect &r, int widget) const |
Draw the contents of a nested widget. | |
virtual EventState | OnKeyPress (uint16 key, uint16 keycode) |
A key has been pressed. | |
virtual void | OnClick (Point pt, int widget, int click_count) |
A click with the left mouse button has been made on the window. | |
virtual void | OnTimeout () |
Called when this window's timeout has been reached. | |
virtual void | OnPlaceObject (Point pt, TileIndex tile) |
The user clicked some place on the map when a tile highlight mode has been set. | |
virtual void | OnPlaceDrag (ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt) |
The user is dragging over the map when the tile highlight mode has been set. | |
virtual void | OnPlaceMouseUp (ViewportPlaceMethod select_method, ViewportDragDropSelectionProcess select_proc, Point pt, TileIndex start_tile, TileIndex end_tile) |
The user has dragged over the map when the tile highlight mode has been set. | |
virtual void | OnPlaceObjectAbort () |
The user cancelled a tile highlight mode that has been set. | |
Data Fields | |
int | last_user_action |
Last started user action. | |
Static Public Attributes | |
static Hotkey < ScenarioEditorLandscapeGenerationWindow > | terraform_editor_hotkeys [] |
Landscape generation window handler in the scenario editor.
Definition at line 536 of file terraform_gui.cpp.
virtual void ScenarioEditorLandscapeGenerationWindow::DrawWidget | ( | const Rect & | r, | |
int | widget | |||
) | const [inline, virtual] |
Draw the contents of a nested widget.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 557 of file terraform_gui.cpp.
References DrawSprite(), RoundDivSU(), and WID_ETT_DOTS.
virtual void ScenarioEditorLandscapeGenerationWindow::OnClick | ( | Point | pt, | |
int | widget, | |||
int | click_count | |||
) | [inline, virtual] |
A click with the left mouse button has been made on the window.
pt | the point inside the window that has been clicked. | |
widget | the clicked widget. | |
click_count | Number of fast consecutive clicks at same position |
Reimplemented from Window.
Definition at line 582 of file terraform_gui.cpp.
References _settings_client, ANIMCURSOR_DEMOLISH, ANIMCURSOR_LOWERLAND, ANIMCURSOR_RAISELAND, SoundSettings::click_beep, Window::HandleButtonClick(), HandlePlacePushButton(), HT_DIAGONAL, HT_POINT, HT_RECT, IsInsideMM(), last_user_action, ResetLandscapeConfirmationCallback(), Window::SetDirty(), ShowBuildObjectPicker(), ShowCreateScenario(), ShowQuery(), ClientSettings::sound, WID_ETT_BUTTONS_START, WID_ETT_DECREASE_SIZE, WID_ETT_DEMOLISH, WID_ETT_INCREASE_SIZE, WID_ETT_LEVEL_LAND, WID_ETT_LOWER_LAND, WID_ETT_NEW_SCENARIO, WID_ETT_PLACE_DESERT, WID_ETT_PLACE_OBJECT, WID_ETT_PLACE_ROCKS, WID_ETT_RAISE_LAND, and WID_ETT_RESET_LANDSCAPE.
Referenced by OnKeyPress().
virtual EventState ScenarioEditorLandscapeGenerationWindow::OnKeyPress | ( | uint16 | key, | |
uint16 | keycode | |||
) | [inline, virtual] |
A key has been pressed.
key | the Unicode value of the key. | |
keycode | the untranslated key code including shift state. |
Reimplemented from Window.
Definition at line 574 of file terraform_gui.cpp.
References CheckHotkeyMatch(), and OnClick().
virtual void ScenarioEditorLandscapeGenerationWindow::OnPaint | ( | ) | [inline, virtual] |
The window must be repainted.
Reimplemented from Window.
Definition at line 548 of file terraform_gui.cpp.
References Window::DrawWidgets(), Window::IsWidgetLowered(), SetTileSelectSize(), WID_ETT_LOWER_LAND, and WID_ETT_RAISE_LAND.
virtual void ScenarioEditorLandscapeGenerationWindow::OnPlaceDrag | ( | ViewportPlaceMethod | select_method, | |
ViewportDragDropSelectionProcess | select_proc, | |||
Point | pt | |||
) | [inline, virtual] |
The user is dragging over the map when the tile highlight mode has been set.
select_method | the method of selection (allowed directions) | |
select_proc | what will be created when the drag is over. | |
pt | the exact point on the map where the mouse is. |
Reimplemented from Window.
Definition at line 697 of file terraform_gui.cpp.
References VpSelectTilesWithMethod().
virtual void ScenarioEditorLandscapeGenerationWindow::OnPlaceMouseUp | ( | ViewportPlaceMethod | select_method, | |
ViewportDragDropSelectionProcess | select_proc, | |||
Point | pt, | |||
TileIndex | start_tile, | |||
TileIndex | end_tile | |||
) | [inline, virtual] |
The user has dragged over the map when the tile highlight mode has been set.
select_method | the method of selection (allowed directions) | |
select_proc | what should be created. | |
pt | the exact point on the map where the mouse was released. | |
start_tile | the begin tile of the drag. | |
end_tile | the end tile of the drag. |
Reimplemented from Window.
Definition at line 702 of file terraform_gui.cpp.
References DDSP_CREATE_DESERT, DDSP_CREATE_ROCKS, DDSP_DEMOLISH_AREA, DDSP_LEVEL_AREA, DDSP_LOWER_AND_LEVEL_AREA, DDSP_RAISE_AND_LEVEL_AREA, and GUIPlaceProcDragXY().
virtual void ScenarioEditorLandscapeGenerationWindow::OnPlaceObject | ( | Point | pt, | |
TileIndex | tile | |||
) | [inline, virtual] |
The user clicked some place on the map when a tile highlight mode has been set.
pt | the exact point on the map that has been clicked. | |
tile | the tile on the map that has been clicked. |
Reimplemented from Window.
Definition at line 662 of file terraform_gui.cpp.
References CommonRaiseLowerBigLand(), DDSP_CREATE_DESERT, DDSP_CREATE_ROCKS, DDSP_LEVEL_AREA, last_user_action, PlaceProc_DemolishArea(), PlaceProc_Object(), VPM_X_AND_Y, VpStartPlaceSizing(), WID_ETT_DEMOLISH, WID_ETT_LEVEL_LAND, WID_ETT_LOWER_LAND, WID_ETT_PLACE_DESERT, WID_ETT_PLACE_OBJECT, WID_ETT_PLACE_ROCKS, and WID_ETT_RAISE_LAND.
Hotkey< ScenarioEditorLandscapeGenerationWindow > ScenarioEditorLandscapeGenerationWindow::terraform_editor_hotkeys [static] |
{ Hotkey<ScenarioEditorLandscapeGenerationWindow>('D' | WKC_GLOBAL_HOTKEY, "dynamite", WID_ETT_DEMOLISH), Hotkey<ScenarioEditorLandscapeGenerationWindow>('Q' | WKC_GLOBAL_HOTKEY, "lower", WID_ETT_LOWER_LAND), Hotkey<ScenarioEditorLandscapeGenerationWindow>('W' | WKC_GLOBAL_HOTKEY, "raise", WID_ETT_RAISE_LAND), Hotkey<ScenarioEditorLandscapeGenerationWindow>('E' | WKC_GLOBAL_HOTKEY, "level", WID_ETT_LEVEL_LAND), Hotkey<ScenarioEditorLandscapeGenerationWindow>('R', "rocky", WID_ETT_PLACE_ROCKS), Hotkey<ScenarioEditorLandscapeGenerationWindow>('T', "desert", WID_ETT_PLACE_DESERT), Hotkey<ScenarioEditorLandscapeGenerationWindow>('O', "object", WID_ETT_PLACE_OBJECT), }
Definition at line 726 of file terraform_gui.cpp.