diff options
author | yexo <yexo@openttd.org> | 2010-08-23 22:25:50 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-08-23 22:25:50 +0000 |
commit | f6f218cf6b360fa8524f851d2e33aad275f1fe39 (patch) | |
tree | 5e736a48b08573c407c783e6121c4fb23432ec47 /src/newgrf_gui.cpp | |
parent | da4dc61f7619da291524c9f1dec6cff220adbdc8 (diff) | |
download | openttd-f6f218cf6b360fa8524f851d2e33aad275f1fe39.tar.xz |
(svn r20604) -Feature: add a reset button to the newgrf parameters window
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r-- | src/newgrf_gui.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 8bfc02843..bc20c61a4 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -128,6 +128,7 @@ enum ShowNewGRFParametersWidgets { GRFPAR_WIDGET_BACKGROUND, ///< Panel to draw the settings on GRFPAR_WIDGET_SCROLLBAR, ///< Scrollbar to scroll through all settings GRFPAR_WIDGET_ACCEPT, ///< Accept button + GRFPAR_WIDGET_RESET, ///< Reset button GRFPAR_WIDGET_DESCRIPTION, ///< Multi-line description of a parameter }; @@ -293,6 +294,10 @@ struct NewGRFParametersWindow : public Window { break; } + case GRFPAR_WIDGET_RESET: + this->grf_config->SetParameterDefaults(); + break; + case GRFPAR_WIDGET_ACCEPT: delete this; break; @@ -340,7 +345,10 @@ static const NWidgetPart _nested_newgrf_parameter_widgets[] = { NWidget(WWT_PANEL, COLOUR_MAUVE, GRFPAR_WIDGET_DESCRIPTION), SetResize(1, 0), SetFill(1, 0), EndContainer(), NWidget(NWID_HORIZONTAL), - NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, GRFPAR_WIDGET_ACCEPT), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NEWGRF_PARAMETERS_CLOSE, STR_NULL), + NWidget(NWID_HORIZONTAL, NC_EQUALSIZE), + NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, GRFPAR_WIDGET_ACCEPT), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NEWGRF_PARAMETERS_CLOSE, STR_NULL), + NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, GRFPAR_WIDGET_RESET), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_NEWGRF_PARAMETERS_RESET, STR_NEWGRF_PARAMETERS_RESET_TOOLTIP), + EndContainer(), NWidget(WWT_RESIZEBOX, COLOUR_MAUVE), EndContainer(), }; |