Changeset - r15910:d159c4eed185
[Not reviewed]
master
0 4 0
yexo - 14 years ago 2010-08-23 22:25:50
yexo@openttd.org
(svn r20604) -Feature: add a reset button to the newgrf parameters window
4 files changed with 15 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/ai/ai_gui.cpp
Show inline comments
 
@@ -203,7 +203,7 @@ static const NWidgetPart _nested_ai_list
 
	EndContainer(),
 
	NWidget(WWT_PANEL, COLOUR_MAUVE, AIL_WIDGET_INFO_BG), SetMinimalTextLines(8, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM), SetResize(1, 0),
 
	EndContainer(),
 
		NWidget(NWID_HORIZONTAL),
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(NWID_HORIZONTAL, NC_EQUALSIZE),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_ACCEPT), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_LIST_ACCEPT, STR_AI_LIST_ACCEPT_TOOLTIP),
 
			NWidget(WWT_PUSHTXTBTN, COLOUR_MAUVE, AIL_WIDGET_CANCEL), SetResize(1, 0), SetFill(1, 0), SetDataTip(STR_AI_LIST_CANCEL, STR_AI_LIST_CANCEL_TOOLTIP),
src/lang/english.txt
Show inline comments
 
@@ -2398,6 +2398,8 @@ STR_NEWGRF_SETTINGS_PARAMETER_QUERY     
 
# NewGRF parameters window
 
STR_NEWGRF_PARAMETERS_CAPTION                                   :{WHITE}Change NewGRF parameters
 
STR_NEWGRF_PARAMETERS_CLOSE                                     :{BLACK}Close
 
STR_NEWGRF_PARAMETERS_RESET                                     :{BLACK}Reset
 
STR_NEWGRF_PARAMETERS_RESET_TOOLTIP                             :{BLACK}Set all parameters to their default value
 
STR_NEWGRF_PARAMETERS_DEFAULT_NAME                              :Parameter {NUM}
 
STR_NEWGRF_PARAMETERS_SETTING                                   :{STRING1}: {ORANGE}{STRING1}
 

	
src/newgrf_config.cpp
Show inline comments
 
@@ -101,6 +101,9 @@ const char *GRFConfig::GetDescription() 
 
/** Set the default value for all parameters as specified by action14. */
 
void GRFConfig::SetParameterDefaults()
 
{
 
	this->num_params = 0;
 
	MemSetT<uint32>(this->param, 0, lengthof(this->param));
 

	
 
	if (!this->has_param_defaults) return;
 

	
 
	for (uint i = 0; i < this->param_info.Length(); i++) {
src/newgrf_gui.cpp
Show inline comments
 
@@ -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 W
 
				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_
 
	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(),
 
};
0 comments (0 inline, 0 general)