Allow partial list of command display overrides, fixes #960

This commit is contained in:
PikaMug 2019-10-10 01:45:11 -04:00
parent c34342df25
commit 6e5d130322
2 changed files with 11 additions and 7 deletions

View File

@ -653,12 +653,10 @@ public class Quest {
int index = 0;
for (String s : rews.getCommands()) {
if (rews.getCommandsOverrideDisplay().isEmpty() == false && rews.getCommandsOverrideDisplay().size()
>= index) {
if (rews.getCommandsOverrideDisplay().size() > index) {
if (!rews.getCommandsOverrideDisplay().get(index).trim().equals("")) {
player.sendMessage("- " + ChatColor.DARK_GREEN
+ rews.getCommandsOverrideDisplay().get(index));
}
> index) {
if (!rews.getCommandsOverrideDisplay().get(index).trim().equals("")) {
player.sendMessage("- " + ChatColor.DARK_GREEN
+ rews.getCommandsOverrideDisplay().get(index));
}
} else {
player.sendMessage("- " + ChatColor.DARK_GREEN + s);

View File

@ -166,7 +166,13 @@ public class RewardsPrompt extends NumericPrompt {
List<String> overrides = (List<String>) context.getSessionData(CK.REW_COMMAND_OVERRIDE_DISPLAY);
int index = 0;
for (String cmd : commands) {
text += ChatColor.GRAY + " - " + ChatColor.AQUA + cmd + (overrides != null ? ChatColor.GRAY + " (\"" + ChatColor.AQUA + overrides.get(index) + ChatColor.GRAY + "\")" : "") + "\n";
text += ChatColor.GRAY + " - " + ChatColor.AQUA + cmd;
if (overrides != null) {
if (index < overrides.size()) {
text += ChatColor.GRAY + " (\"" + ChatColor.AQUA + overrides.get(index) + ChatColor.GRAY + "\")";
}
}
text += "\n";
index++;
}
return text;