File diff r23123:aa31147b532e → r23124:8fa6d269005b
src/newgrf_gui.cpp
Show inline comments
 
@@ -394,25 +394,25 @@ struct NewGRFParametersWindow : public W
 
							if (val < par_info->max_value) val++;
 
							this->clicked_increase = true;
 
						} else {
 
							/* Decrease button clicked */
 
							if (val > par_info->min_value) val--;
 
							this->clicked_increase = false;
 
						}
 
					}
 
					if (val != old_val) {
 
						par_info->SetValue(this->grf_config, val);
 

	
 
						this->clicked_button = num;
 
						this->timeout = 5;
 
						this->timeout = 150;
 
					}
 
				} else if (par_info->type == PTYPE_UINT_ENUM && !par_info->complete_labels && click_count >= 2) {
 
					/* Display a query box so users can enter a custom value. */
 
					SetDParam(0, old_val);
 
					ShowQueryString(STR_JUST_INT, STR_CONFIG_SETTING_QUERY_CAPTION, 10, this, CS_NUMERAL, QSF_NONE);
 
				}
 
				this->SetDirty();
 
				break;
 
			}
 

	
 
			case WID_NP_RESET:
 
				if (!this->editable) break;
 
@@ -474,27 +474,27 @@ struct NewGRFParametersWindow : public W
 
		if (!this->action14present) {
 
			this->SetWidgetDisabledState(WID_NP_NUMPAR_DEC, !this->editable || this->grf_config->num_params == 0);
 
			this->SetWidgetDisabledState(WID_NP_NUMPAR_INC, !this->editable || this->grf_config->num_params >= this->grf_config->num_valid_params);
 
		}
 

	
 
		this->vscroll->SetCount(this->action14present ? this->grf_config->num_valid_params : this->grf_config->num_params);
 
		if (this->clicked_row != UINT_MAX && this->clicked_row >= this->vscroll->GetCount()) {
 
			this->clicked_row = UINT_MAX;
 
			DeleteChildWindows(WC_QUERY_STRING);
 
		}
 
	}
 

	
 
	virtual void OnTick()
 
	virtual void OnRealtimeTick(uint delta_ms)
 
	{
 
		if (--this->timeout == 0) {
 
		if (TimerElapsed(this->timeout, delta_ms)) {
 
			this->clicked_button = UINT_MAX;
 
			this->SetDirty();
 
		}
 
	}
 
};
 
GRFParameterInfo NewGRFParametersWindow::dummy_parameter_info(0);
 

	
 

	
 
static const NWidgetPart _nested_newgrf_parameter_widgets[] = {
 
	NWidget(NWID_HORIZONTAL),
 
		NWidget(WWT_CLOSEBOX, COLOUR_MAUVE),
 
		NWidget(WWT_CAPTION, COLOUR_MAUVE), SetDataTip(STR_NEWGRF_PARAMETERS_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),