summaryrefslogtreecommitdiff
path: root/src/newgrf_gui.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-05-27 18:02:55 +0000
committeryexo <yexo@openttd.org>2011-05-27 18:02:55 +0000
commitffdfa5a213719a1167ae4a9953a1026ba02848e1 (patch)
treeba82f4874469431b39c77221d693f52b79aa94a5 /src/newgrf_gui.cpp
parent56902191e47f863f21f462b9469996371e6ca8f0 (diff)
downloadopenttd-ffdfa5a213719a1167ae4a9953a1026ba02848e1.tar.xz
(svn r22499) -Fix: don't lower the arrow buttons in the newgrf/AI parameter windows if they're clicked when disabled
Diffstat (limited to 'src/newgrf_gui.cpp')
-rw-r--r--src/newgrf_gui.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 7e9e1f693..cc8413408 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -325,6 +325,7 @@ struct NewGRFParametersWindow : public Window {
/* One of the arrows is clicked */
if (IsInsideMM(x, 0, 21)) {
uint32 val = par_info->GetValue(this->grf_config);
+ uint32 old_val = val;
if (par_info->type == PTYPE_BOOL) {
val = !val;
} else {
@@ -338,17 +339,18 @@ struct NewGRFParametersWindow : public Window {
this->clicked_increase = false;
}
}
- par_info->SetValue(this->grf_config, val);
+ if (val != old_val) {
+ par_info->SetValue(this->grf_config, val);
- this->clicked_button = num;
- this->timeout = 5;
+ this->clicked_button = num;
+ this->timeout = 5;
+ this->SetDirty();
+ }
} else if (par_info->type == PTYPE_UINT_ENUM && click_count >= 2) {
/* Display a query box so users can enter a custom value. */
SetDParam(0, this->grf_config->param[num]);
ShowQueryString(STR_JUST_INT, STR_CONFIG_SETTING_QUERY_CAPTION, 10, this, CS_NUMERAL, QSF_NONE);
}
-
- this->SetDirty();
break;
}