mirror of https://github.com/PikaMug/Quests.git
Update more editor toggles
This commit is contained in:
parent
ea6e50a49f
commit
a02ca87d79
|
@ -157,14 +157,14 @@ public class BukkitActionFactory implements ActionFactory, ConversationAbandoned
|
|||
context.setSessionData(CK.E_MESSAGE, event.getMessage());
|
||||
}
|
||||
if (event.isClearInv()) {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("yesWord"));
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, true);
|
||||
} else {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("noWord"));
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, false);
|
||||
}
|
||||
if (event.isFailQuest()) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("yesWord"));
|
||||
context.setSessionData(CK.E_FAIL_QUEST, true);
|
||||
} else {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
||||
context.setSessionData(CK.E_FAIL_QUEST, false);
|
||||
}
|
||||
if (event.getItems() != null && !event.getItems().isEmpty()) {
|
||||
final LinkedList<ItemStack> items = new LinkedList<>(event.getItems());
|
||||
|
@ -350,14 +350,14 @@ public class BukkitActionFactory implements ActionFactory, ConversationAbandoned
|
|||
section.set("message", context.getSessionData(CK.E_MESSAGE));
|
||||
}
|
||||
if (context.getSessionData(CK.E_CLEAR_INVENTORY) != null) {
|
||||
final String s = (String) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
if (s != null && s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
if (b != null) {
|
||||
section.set("clear-inventory", true);
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.E_FAIL_QUEST) != null) {
|
||||
final String s = (String) context.getSessionData(CK.E_FAIL_QUEST);
|
||||
if (s != null && s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_FAIL_QUEST);
|
||||
if (b != null) {
|
||||
section.set("fail-quest", true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,9 +88,9 @@ public class BukkitConditionFactory implements ConditionFactory, ConversationAba
|
|||
|
||||
public void loadData(final ICondition condition, final ConversationContext context) {
|
||||
if (condition.isFailQuest()) {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, Lang.get("yesWord"));
|
||||
context.setSessionData(CK.C_FAIL_QUEST, true);
|
||||
} else {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, Lang.get("noWord"));
|
||||
context.setSessionData(CK.C_FAIL_QUEST, false);
|
||||
}
|
||||
if (condition.getEntitiesWhileRiding() != null && !condition.getEntitiesWhileRiding().isEmpty()) {
|
||||
final LinkedList<String> entities = new LinkedList<>(condition.getEntitiesWhileRiding());
|
||||
|
@ -209,9 +209,9 @@ public class BukkitConditionFactory implements ConditionFactory, ConversationAba
|
|||
final ConfigurationSection section = data.createSection("conditions." + context.getSessionData(CK.C_NAME));
|
||||
editingConditionNames.remove((String) context.getSessionData(CK.C_NAME));
|
||||
if (context.getSessionData(CK.C_FAIL_QUEST) != null) {
|
||||
final String s = (String) context.getSessionData(CK.C_FAIL_QUEST);
|
||||
if (s != null && s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
section.set("fail-quest", true);
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.C_FAIL_QUEST);
|
||||
if (b != null) {
|
||||
section.set("fail-quest", b);
|
||||
}
|
||||
}
|
||||
if (context.getSessionData(CK.C_WHILE_RIDING_ENTITY) != null) {
|
||||
|
|
|
@ -170,10 +170,12 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
}
|
||||
case 8:
|
||||
if (context.getSessionData(CK.E_FAIL_QUEST) == null) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
||||
return ChatColor.GRAY + "(" + ChatColor.RED + Lang.get("false") + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
final Boolean failOpt = (Boolean) context.getSessionData(CK.E_FAIL_QUEST);
|
||||
return ChatColor.GRAY + "(" + (Boolean.TRUE.equals(failOpt) ? ChatColor.GREEN + Lang.get("true")
|
||||
: ChatColor.RED + Lang.get("false")) + ChatColor.GRAY + ")";
|
||||
}
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_FAIL_QUEST) + ChatColor.GRAY
|
||||
+ ")";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -219,11 +221,11 @@ public class ActionMainPrompt extends ActionsEditorNumericPrompt {
|
|||
return new ActionMainPrompt(context);
|
||||
}
|
||||
case 8:
|
||||
final String s = (String) context.getSessionData(CK.E_FAIL_QUEST);
|
||||
if (s != null && s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("noWord"));
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_FAIL_QUEST);
|
||||
if (Boolean.TRUE.equals(b)) {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, false);
|
||||
} else {
|
||||
context.setSessionData(CK.E_FAIL_QUEST, Lang.get("yesWord"));
|
||||
context.setSessionData(CK.E_FAIL_QUEST, true);
|
||||
}
|
||||
return new ActionMainPrompt(context);
|
||||
case 9:
|
||||
|
|
|
@ -27,7 +27,6 @@ import me.blackvein.quests.util.MiscUtil;
|
|||
import me.blackvein.quests.util.RomanNumeral;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.conversations.ConversationContext;
|
||||
import org.bukkit.conversations.Prompt;
|
||||
|
@ -197,8 +196,13 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
return text.toString();
|
||||
}
|
||||
case 9:
|
||||
return ChatColor.GRAY + "(" + ChatColor.AQUA + context.getSessionData(CK.E_CLEAR_INVENTORY) + ChatColor.GRAY
|
||||
+ ")";
|
||||
if (context.getSessionData(CK.E_CLEAR_INVENTORY) == null) {
|
||||
return ChatColor.GRAY + "(" + ChatColor.RED + Lang.get("false") + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
final Boolean clearOpt = (Boolean) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
return ChatColor.GRAY + "(" + (Boolean.TRUE.equals(clearOpt) ? ChatColor.GREEN + Lang.get("true")
|
||||
: ChatColor.RED + Lang.get("false")) + ChatColor.GRAY + ")";
|
||||
}
|
||||
case 10:
|
||||
return "";
|
||||
default:
|
||||
|
@ -209,7 +213,7 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
@Override
|
||||
public @NotNull String getBasicPromptText(final ConversationContext context) {
|
||||
if (context.getSessionData(CK.E_CLEAR_INVENTORY) == null) {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("noWord"));
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, false);
|
||||
}
|
||||
|
||||
final ActionsEditorPostOpenNumericPromptEvent event
|
||||
|
@ -258,13 +262,11 @@ public class PlayerPrompt extends ActionsEditorNumericPrompt {
|
|||
return new PlayerPrompt(context);
|
||||
}
|
||||
case 9:
|
||||
final String s = (String) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
if (s != null) {
|
||||
if (s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("noWord"));
|
||||
} else {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, Lang.get("yesWord"));
|
||||
}
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.E_CLEAR_INVENTORY);
|
||||
if (Boolean.TRUE.equals(b)) {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, false);
|
||||
} else {
|
||||
context.setSessionData(CK.E_CLEAR_INVENTORY, true);
|
||||
}
|
||||
return new PlayerPrompt(context);
|
||||
case 10:
|
||||
|
|
|
@ -90,7 +90,7 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
case 5:
|
||||
return ChatColor.YELLOW + Lang.get("conditionEditorCheckPlaceholder");
|
||||
case 6:
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorFailQuest") + ":";
|
||||
return ChatColor.YELLOW + Lang.get("eventEditorFailQuest");
|
||||
case 7:
|
||||
return ChatColor.GREEN + Lang.get("save");
|
||||
case 8:
|
||||
|
@ -113,9 +113,12 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
return "";
|
||||
case 6:
|
||||
if (context.getSessionData(CK.C_FAIL_QUEST) == null) {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, Lang.get("noWord"));
|
||||
return ChatColor.GRAY + "(" + ChatColor.RED + Lang.get("false") + ChatColor.GRAY + ")";
|
||||
} else {
|
||||
final Boolean failOpt = (Boolean) context.getSessionData(CK.C_FAIL_QUEST);
|
||||
return ChatColor.GRAY + "(" + (Boolean.TRUE.equals(failOpt) ? ChatColor.GREEN + Lang.get("true")
|
||||
: ChatColor.RED + Lang.get("false")) + ChatColor.GRAY + ")";
|
||||
}
|
||||
return "" + ChatColor.AQUA + context.getSessionData(CK.C_FAIL_QUEST);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -151,11 +154,11 @@ public class ConditionMainPrompt extends ConditionsEditorNumericPrompt {
|
|||
case 5:
|
||||
return new ConditionPlaceholderListPrompt(context);
|
||||
case 6:
|
||||
final String s = (String) context.getSessionData(CK.C_FAIL_QUEST);
|
||||
if (s != null && s.equalsIgnoreCase(Lang.get("yesWord"))) {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, Lang.get("noWord"));
|
||||
final Boolean b = (Boolean) context.getSessionData(CK.C_FAIL_QUEST);
|
||||
if (Boolean.TRUE.equals(b)) {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, false);
|
||||
} else {
|
||||
context.setSessionData(CK.C_FAIL_QUEST, Lang.get("yesWord"));
|
||||
context.setSessionData(CK.C_FAIL_QUEST, true);
|
||||
}
|
||||
return new ConditionMainPrompt(context);
|
||||
case 7:
|
||||
|
|
Loading…
Reference in New Issue