summaryrefslogtreecommitdiff
path: root/src/settings_gui.cpp
diff options
context:
space:
mode:
authorYexo <Yexo@openttd.org>2009-01-19 01:16:50 +0000
committerYexo <Yexo@openttd.org>2009-01-19 01:16:50 +0000
commite84ff99a8bc1a0d0b4781cc7383f91bc1e2b5d63 (patch)
treedcdc93b44d361dd4888710622c6fd6f28accfb9a /src/settings_gui.cpp
parent80af9b446ad761b8adb1f082c8f882049e841df5 (diff)
downloadopenttd-e84ff99a8bc1a0d0b4781cc7383f91bc1e2b5d63.tar.xz
(svn r15148) -Cleanup: Remove the options "competitor start time" and "competitor intelligence" from the difficulty options because they already were unused.
Diffstat (limited to 'src/settings_gui.cpp')
-rw-r--r--src/settings_gui.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index 349ee5c29..fc455ceb3 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -457,8 +457,11 @@ public:
uint i;
const SettingDesc *sd = GetPatchFromName("difficulty.max_no_competitors", &i);
int y = GAMEDIFF_WND_TOP_OFFSET;
+ StringID str = STR_6805_MAXIMUM_NO_COMPETITORS;
for (i = 0; i < GAME_DIFFICULTY_NUM; i++, sd++) {
const SettingDescBase *sdb = &sd->desc;
+ /* skip deprecated difficulty options */
+ if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) continue;
int32 value = (int32)ReadValue(GetVariableAddress(&this->opt_mod_temp, &sd->save), sd->save.conv);
bool editable = (_game_mode == GM_MENU || (sdb->flags & SGF_NEWGAME_ONLY) == 0);
@@ -469,9 +472,10 @@ public:
value += sdb->str;
SetDParam(0, value);
- DrawString(30, y, STR_6805_MAXIMUM_NO_COMPETITORS + i, TC_FROMSTRING);
+ DrawString(30, y, str, TC_FROMSTRING);
y += GAMEDIFF_WND_ROWSIZE + 2; // space items apart a bit
+ str++;
}
}
@@ -489,7 +493,9 @@ public:
if (y < 0) return;
/* Get button from Y coord. */
- const uint8 btn = y / (GAMEDIFF_WND_ROWSIZE + 2);
+ uint8 btn = y / (GAMEDIFF_WND_ROWSIZE + 2);
+ if (btn >= 1) btn++; // Skip the deprecated option "competitor start time"
+ if (btn >= 8) btn++; // Skip the deprecated option "competitor intelligence"
if (btn >= GAME_DIFFICULTY_NUM || y % (GAMEDIFF_WND_ROWSIZE + 2) >= 9) return;
uint i;