|
@@ -232,25 +232,25 @@ struct TerraformToolbarWindow : Window {
|
|
|
this->InitNested(desc, window_number);
|
|
|
}
|
|
|
|
|
|
~TerraformToolbarWindow()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
virtual void OnPaint()
|
|
|
{
|
|
|
this->DrawWidgets();
|
|
|
}
|
|
|
|
|
|
virtual void OnClick(Point pt, int widget)
|
|
|
virtual void OnClick(Point pt, int widget, int click_count)
|
|
|
{
|
|
|
if (widget >= TTW_BUTTONS_START) _terraform_button_proc[widget - TTW_BUTTONS_START](this);
|
|
|
}
|
|
|
|
|
|
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
|
|
{
|
|
|
for (uint i = 0; i != lengthof(_terraform_keycodes); i++) {
|
|
|
if (keycode == _terraform_keycodes[i]) {
|
|
|
_terraform_button_proc[i](this);
|
|
|
return ES_HANDLED;
|
|
|
}
|
|
|
}
|
|
@@ -664,25 +664,25 @@ struct ScenarioEditorLandscapeGeneration
|
|
|
|
|
|
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
|
|
{
|
|
|
for (uint i = 0; i != lengthof(_editor_terraform_keycodes); i++) {
|
|
|
if (keycode == _editor_terraform_keycodes[i]) {
|
|
|
_editor_terraform_button_proc[i](this);
|
|
|
return ES_HANDLED;
|
|
|
}
|
|
|
}
|
|
|
return ES_NOT_HANDLED;
|
|
|
}
|
|
|
|
|
|
virtual void OnClick(Point pt, int widget)
|
|
|
virtual void OnClick(Point pt, int widget, int click_count)
|
|
|
{
|
|
|
if (IsInsideMM(widget, ETTW_BUTTONS_START, ETTW_BUTTONS_END)) {
|
|
|
_editor_terraform_button_proc[widget - ETTW_BUTTONS_START](this);
|
|
|
} else {
|
|
|
switch (widget) {
|
|
|
case ETTW_INCREASE_SIZE:
|
|
|
case ETTW_DECREASE_SIZE: { // Increase/Decrease terraform size
|
|
|
int size = (widget == ETTW_INCREASE_SIZE) ? 1 : -1;
|
|
|
this->HandleButtonClick(widget);
|
|
|
size += _terraform_size;
|
|
|
|
|
|
if (!IsInsideMM(size, 1, 8 + 1)) return;
|