Accept true/false values in English if preferred

This commit is contained in:
PikaMug 2020-02-24 18:20:03 -05:00
parent 2a86b00e97
commit 232b636022
2 changed files with 8 additions and 3 deletions

View File

@ -164,7 +164,8 @@ public class OptionsPrompt extends QuestsEditorNumericPrompt {
&& input.equalsIgnoreCase(Lang.get("cmdClear")) == false) {
try {
boolean b = Boolean.parseBoolean(input);
if (input.equalsIgnoreCase("t") || input.equalsIgnoreCase(Lang.get("true"))
if (input.equalsIgnoreCase("t") || input.equalsIgnoreCase("true")
|| input.equalsIgnoreCase(Lang.get("true"))
|| input.equalsIgnoreCase(Lang.get("yesWord"))) {
b = true;
}

View File

@ -663,9 +663,13 @@ public class RequirementsPrompt extends QuestsEditorNumericPrompt {
String[] args = input.split(" ");
LinkedList<Boolean> booleans = new LinkedList<Boolean>();
for (String s : args) {
if (s.equalsIgnoreCase(Lang.get("true")) || s.equalsIgnoreCase(Lang.get("yesWord"))) {
if (input.equalsIgnoreCase("t") || input.equalsIgnoreCase("true")
|| s.equalsIgnoreCase(Lang.get("true"))
|| s.equalsIgnoreCase(Lang.get("yesWord"))) {
booleans.add(true);
} else if (s.equalsIgnoreCase(Lang.get("false")) || s.equalsIgnoreCase(Lang.get("noWord"))) {
} else if (input.equalsIgnoreCase("f") || input.equalsIgnoreCase("false")
|| s.equalsIgnoreCase(Lang.get("false"))
|| s.equalsIgnoreCase(Lang.get("noWord"))) {
booleans.add(false);
} else {
String text = Lang.get("reqTrueFalseError");