diff -r f1e3a375de11 -r fb873780b4e4 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Sep 28 11:28:18 2008 +0200 +++ b/src/settings_gui.cpp Sun Sep 28 11:28:18 2008 +0200 @@ -749,6 +749,8 @@ }; struct PatchesSelectionWindow : Window { + static const int setting_height; ///< Height of a single advanced setting text + static GameSettings *patches_ptr; static int patches_max; ///< Maximal number of patches at a single page @@ -784,10 +786,10 @@ } /* Resize the window to fit the largest patch tab */ - ResizeWindowForWidget(this, PATCHSEL_OPTIONSPANEL, 0, patches_max * 11); + ResizeWindowForWidget(this, PATCHSEL_OPTIONSPANEL, 0, patches_max * setting_height); /* Recentre the window for the new size */ - this->top = this->top - (patches_max * 11) / 2; + this->top = this->top - (patches_max * setting_height) / 2; this->LowerWidget(PATCHSEL_INTERFACE); @@ -847,7 +849,7 @@ } } DrawString(30, y, (sdb->str) + disabled, TC_FROMSTRING); - y += 11; + y += setting_height; } } @@ -868,8 +870,8 @@ x = pt.x - 5; // Shift x coordinate if (x < 0) return; // Clicked left of the entry - btn = y / 11; // Compute which setting is selected - if (y % 11 > 9) return; // Clicked too low at the setting + btn = y / setting_height; // Compute which setting is selected + if (y % setting_height > (setting_height -2)) return; // Clicked too low at the setting if (btn >= page->num) return; // Clicked below the last setting of the page sd = page->entries[btn].setting; @@ -972,6 +974,7 @@ } }; +const int PatchesSelectionWindow::setting_height = 11; GameSettings *PatchesSelectionWindow::patches_ptr = NULL; int PatchesSelectionWindow::patches_max = 0;