diff -r f94d9342ea5f src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Nov 02 16:01:16 2008 +0100 +++ b/src/settings_gui.cpp Sun Nov 02 16:04:06 2008 +0100 @@ -1286,14 +1286,14 @@ virtual void OnClick(Point pt, int widget) { if (widget == PATCHSEL_OPTIONSPANEL) { - int y = pt.y - SETTINGTREE_TOP_OFFSET; // Shift y coordinate - if (y < 0) return; // Clicked above first entry + int y = pt.y - SETTINGTREE_TOP_OFFSET; // Shift y coordinate + if (y < 0) return; // Clicked above first entry - int x = pt.x - SETTINGTREE_LEFT_OFFSET; // Shift x coordinate - if (x < 0) return; // Clicked left of the entry + int x = pt.x - SETTINGTREE_LEFT_OFFSET; // Shift x coordinate + if (x < 0) return; // Clicked left of the entry - byte btn = y / SETTING_HEIGHT; // Compute which setting is selected - if (y % SETTING_HEIGHT > SETTING_HEIGHT - 2) return; // Clicked too low at the setting + byte btn = y / SETTING_HEIGHT; // Compute which setting is selected + if (y % SETTING_HEIGHT > SETTING_HEIGHT - 2) return; // Clicked too low at the setting uint current_row = 0; TreeField *tf = _treeview.FindField(this->vscroll.pos + btn, ¤t_row); @@ -1312,22 +1312,22 @@ assert((tf->flags & TFK_KIND_MASK) == TFK_PATCH); /* clicked at a patch setting */ - const SettingDesc *sd = tf->df.patch.desc; + const SettingDesc *sd = tf->df.patch.desc; - /* return if action is only active in network, or only settable by server */ - if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) return; - if ((sd->desc.flags & SGF_NETWORK_ONLY) && !_networking) return; - if ((sd->desc.flags & SGF_NO_NETWORK) && _networking) return; + /* return if action is only active in network, or only settable by server */ + if (!(sd->save.conv & SLF_NETWORK_NO) && _networking && !_network_server) return; + if ((sd->desc.flags & SGF_NETWORK_ONLY) && !_networking) return; + if ((sd->desc.flags & SGF_NO_NETWORK) && _networking) return; - void *var = GetVariableAddress(patches_ptr, &sd->save); - int32 value = (int32)ReadValue(var, sd->save.conv); + void *var = GetVariableAddress(patches_ptr, &sd->save); + int32 value = (int32)ReadValue(var, sd->save.conv); - /* clicked on the icon on the left side. Either scroller or bool on/off */ - if (x < 21) { - const SettingDescBase *sdb = &sd->desc; - int32 oldvalue = value; + /* clicked on the icon on the left side. Either scroller or bool on/off */ + if (x < 21) { + const SettingDescBase *sdb = &sd->desc; + int32 oldvalue = value; - switch (sdb->cmd) { + switch (sdb->cmd) { case SDT_BOOLX: value ^= 1; break; case SDT_NUMX: { /* Add a dynamic step-size to the scroller. In a maximum of @@ -1360,23 +1360,23 @@ } } break; default: NOT_REACHED(); - } + } - if (value != oldvalue) { - SetPatchValue(tf->df.patch.index, value); - this->SetDirty(); - } - } else { - /* only open editbox for types that its sensible for */ - if (sd->desc.cmd != SDT_BOOLX && !(sd->desc.flags & SGF_MULTISTRING)) { - /* Show the correct currency-translated value */ - if (sd->desc.flags & SGF_CURRENCY) value *= _currency->rate; + if (value != oldvalue) { + SetPatchValue(tf->df.patch.index, value); + this->SetDirty(); + } + } else { + /* only open editbox for types that its sensible for */ + if (sd->desc.cmd != SDT_BOOLX && !(sd->desc.flags & SGF_MULTISTRING)) { + /* Show the correct currency-translated value */ + if (sd->desc.flags & SGF_CURRENCY) value *= _currency->rate; - tf_entry = tf; - SetDParam(0, value); - ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, this, CS_NUMERAL, QSF_NONE); - } + tf_entry = tf; + SetDParam(0, value); + ShowQueryString(STR_CONFIG_PATCHES_INT32, STR_CONFIG_PATCHES_QUERY_CAPT, 10, 100, this, CS_NUMERAL, QSF_NONE); } + } } }