diff options
author | frosch <frosch@openttd.org> | 2012-11-11 16:07:46 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-11-11 16:07:46 +0000 |
commit | b998cbdff145cd005949b6a005f435a916b0ea06 (patch) | |
tree | e94ce652424a290b5feb66067ec8bdf18f9b36d0 /src/tree_gui.cpp | |
parent | cfccaff6457964db5245ac144e81b581146bfd75 (diff) | |
download | openttd-b998cbdff145cd005949b6a005f435a916b0ea06.tar.xz |
(svn r24697) -Codechange: Use WDF_UNCLICK_BUTTONS instead of duplicating the same functionality.
Diffstat (limited to 'src/tree_gui.cpp')
-rw-r--r-- | src/tree_gui.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 60dcde6e4..fbc4d5baa 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -134,8 +134,6 @@ public: break; case WID_BT_MANY_RANDOM: // place trees randomly over the landscape - this->LowerWidget(WID_BT_MANY_RANDOM); - this->SetTimeout(); SndPlayFx(SND_15_BEEP); PlaceTreesRandomly(); MarkWholeScreenDirty(); @@ -170,12 +168,6 @@ public: this->count = _tree_count_by_landscape[_settings_game.game_creation.landscape]; } - virtual void OnTimeout() - { - this->RaiseWidget(WID_BT_MANY_RANDOM); - this->SetWidgetDirty(WID_BT_MANY_RANDOM); - } - virtual void OnPlaceObjectAbort() { this->RaiseButtons(); @@ -238,7 +230,7 @@ static const NWidgetPart _nested_build_trees_widgets[] = { NWidget(NWID_SPACER), SetMinimalSize(0, 1), NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BT_TYPE_RANDOM), SetMinimalSize(139, 12), SetDataTip(STR_TREES_RANDOM_TYPE, STR_TREES_RANDOM_TYPE_TOOLTIP), NWidget(NWID_SPACER), SetMinimalSize(0, 1), - NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_BT_MANY_RANDOM), SetMinimalSize(139, 12), SetDataTip(STR_TREES_RANDOM_TREES_BUTTON, STR_TREES_RANDOM_TREES_TOOLTIP), + NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_BT_MANY_RANDOM), SetMinimalSize(139, 12), SetDataTip(STR_TREES_RANDOM_TREES_BUTTON, STR_TREES_RANDOM_TREES_TOOLTIP), NWidget(NWID_SPACER), SetMinimalSize(0, 2), EndContainer(), NWidget(NWID_SPACER), SetMinimalSize(2, 0), @@ -249,7 +241,7 @@ static const NWidgetPart _nested_build_trees_widgets[] = { static const WindowDesc _build_trees_desc( WDP_AUTO, 0, 0, WC_BUILD_TREES, WC_NONE, - WDF_CONSTRUCTION, + WDF_UNCLICK_BUTTONS | WDF_CONSTRUCTION, _nested_build_trees_widgets, lengthof(_nested_build_trees_widgets) ); |