From 6471dd2363cb9fb0d016c8d7e3a810f6c0a59198 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Wed, 4 Sep 2013 10:58:31 +0200 Subject: [PATCH 1/2] Add another check to PopupMultiChoice --- UI/GameSettingsScreen.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 628008b02..381230310 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -63,6 +63,7 @@ public: I18NCategory *category, ScreenManager *screenManager, LayoutParams *layoutParams = 0) : Choice(text, "", false, layoutParams), value_(value), choices_(choices), minVal_(minVal), numChoices_(numChoices), category_(category), screenManager_(screenManager) { + if (*value >= numChoices) *value = numChoices-1; if (*value < minVal) *value = minVal; OnClick.Handle(this, &PopupMultiChoice::HandleClick); UpdateText(); From 77067094c786fdda8b1612e641466eae19188929 Mon Sep 17 00:00:00 2001 From: Kingcom Date: Wed, 4 Sep 2013 11:00:42 +0200 Subject: [PATCH 2/2] Take minVal into account --- UI/GameSettingsScreen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 381230310..887f7a5d1 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -63,7 +63,7 @@ public: I18NCategory *category, ScreenManager *screenManager, LayoutParams *layoutParams = 0) : Choice(text, "", false, layoutParams), value_(value), choices_(choices), minVal_(minVal), numChoices_(numChoices), category_(category), screenManager_(screenManager) { - if (*value >= numChoices) *value = numChoices-1; + if (*value >= numChoices+minVal) *value = numChoices+minVal-1; if (*value < minVal) *value = minVal; OnClick.Handle(this, &PopupMultiChoice::HandleClick); UpdateText();