Save the Planner cooldown/repeat-cycle as integer, fixes #1161

This commit is contained in:
PikaMug 2020-04-03 16:17:21 -04:00
parent 9305905d41
commit d36893ef0e
2 changed files with 4 additions and 4 deletions

View File

@ -1843,9 +1843,9 @@ public class QuestFactory implements ConversationAbandonedListener {
pln.set("end", context.getSessionData(CK.PLN_END_DATE) != null pln.set("end", context.getSessionData(CK.PLN_END_DATE) != null
? (String) context.getSessionData(CK.PLN_END_DATE) : null); ? (String) context.getSessionData(CK.PLN_END_DATE) : null);
pln.set("repeat", context.getSessionData(CK.PLN_REPEAT_CYCLE) != null pln.set("repeat", context.getSessionData(CK.PLN_REPEAT_CYCLE) != null
? (Long) context.getSessionData(CK.PLN_REPEAT_CYCLE) : null); ? ((Long) context.getSessionData(CK.PLN_REPEAT_CYCLE) / 1000) : null);
pln.set("cooldown", context.getSessionData(CK.PLN_COOLDOWN) != null pln.set("cooldown", context.getSessionData(CK.PLN_COOLDOWN) != null
? (Long) context.getSessionData(CK.PLN_COOLDOWN) : null); ? ((Long) context.getSessionData(CK.PLN_COOLDOWN) / 1000) : null);
if (pln.getKeys(false).isEmpty()) { if (pln.getKeys(false).isEmpty()) {
section.set("planner", null); section.set("planner", null);
} }

View File

@ -97,13 +97,13 @@ public class PlannerPrompt extends QuestsEditorNumericPrompt {
if (context.getSessionData(CK.PLN_START_DATE) == null) { if (context.getSessionData(CK.PLN_START_DATE) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
return ChatColor.YELLOW + " - " + getPrettyDate((String) context.getSessionData(CK.PLN_START_DATE)); return "\n" + ChatColor.YELLOW + " - " + getPrettyDate((String) context.getSessionData(CK.PLN_START_DATE));
} }
case 2: case 2:
if (context.getSessionData(CK.PLN_END_DATE) == null) { if (context.getSessionData(CK.PLN_END_DATE) == null) {
return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")"; return ChatColor.GRAY + "(" + Lang.get("noneSet") + ")";
} else { } else {
return ChatColor.YELLOW + " - " return "\n" + ChatColor.YELLOW + " - "
+ getPrettyDate((String) context.getSessionData(CK.PLN_END_DATE)); + getPrettyDate((String) context.getSessionData(CK.PLN_END_DATE));
} }
case 3: case 3: