Import Picking and placing single houses in scenario editor patch
Minor whitespace fixes http://www.tt-forums.net/viewtopic.php?f=33&t=68894&view=unread#p1099696
This commit is contained in:

committed by
Jonathan G Rennison

parent
e6782df9ba
commit
19dcbb1cb9
@@ -32,6 +32,7 @@
|
||||
#include "hotkeys.h"
|
||||
#include "engine_base.h"
|
||||
#include "terraform_gui.h"
|
||||
#include "town_gui.h"
|
||||
#include "zoom_func.h"
|
||||
|
||||
#include "widgets/terraform_widget.h"
|
||||
@@ -465,6 +466,9 @@ static const NWidgetPart _nested_scen_edit_land_gen_widgets[] = {
|
||||
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_ETT_PLACE_OBJECT), SetMinimalSize(23, 22),
|
||||
SetFill(0, 1), SetDataTip(SPR_IMG_TRANSMITTER, STR_SCENEDIT_TOOLBAR_PLACE_OBJECT),
|
||||
NWidget(NWID_SPACER), SetFill(1, 0),
|
||||
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_ETT_PLACE_HOUSE), SetMinimalSize(23, 22),
|
||||
SetFill(0, 1), SetDataTip(SPR_IMG_TOWN, STR_SCENEDIT_TOOLBAR_PLACE_HOUSE),
|
||||
NWidget(NWID_SPACER), SetFill(1, 0),
|
||||
EndContainer(),
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(NWID_SPACER), SetFill(1, 0),
|
||||
@@ -609,6 +613,13 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
ShowBuildObjectPicker();
|
||||
break;
|
||||
|
||||
case WID_ETT_PLACE_HOUSE: // Place house button
|
||||
if (HandlePlacePushButton(this, WID_ETT_PLACE_HOUSE, SPR_CURSOR_TOWN, HT_RECT)) {
|
||||
ShowBuildHousePicker(this);
|
||||
this->last_user_action = widget;
|
||||
}
|
||||
break;
|
||||
|
||||
case WID_ETT_INCREASE_SIZE:
|
||||
case WID_ETT_DECREASE_SIZE: { // Increase/Decrease terraform size
|
||||
int size = (widget == WID_ETT_INCREASE_SIZE) ? 1 : -1;
|
||||
@@ -674,6 +685,10 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
VpStartPlaceSizing(tile, VPM_X_AND_Y, DDSP_CREATE_DESERT);
|
||||
break;
|
||||
|
||||
case WID_ETT_PLACE_HOUSE: // Place house button
|
||||
PlaceProc_House(tile);
|
||||
break;
|
||||
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
}
|
||||
@@ -705,6 +720,8 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
this->RaiseButtons();
|
||||
this->SetDirty();
|
||||
DeleteWindowById(WC_BUILD_OBJECT, 0);
|
||||
DeleteWindowById(WC_BUILD_HOUSE, 0);
|
||||
DeleteWindowById(WC_SELECT_STATION, 0);
|
||||
}
|
||||
|
||||
static HotkeyList hotkeys;
|
||||
@@ -731,6 +748,7 @@ static Hotkey terraform_editor_hotkeys[] = {
|
||||
Hotkey('R', "rocky", WID_ETT_PLACE_ROCKS),
|
||||
Hotkey('T', "desert", WID_ETT_PLACE_DESERT),
|
||||
Hotkey('O', "object", WID_ETT_PLACE_OBJECT),
|
||||
Hotkey('H', "house", WID_ETT_PLACE_HOUSE),
|
||||
HOTKEY_LIST_END
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user