Save/restore pack_code and cycle_prefix in the deck task settings

This commit is contained in:
Adam Goldsmith 2021-09-17 15:54:17 -04:00
parent d471e39b45
commit 25262e64cf

View File

@ -261,9 +261,9 @@ function copyCount(copies_list, name) {
}
}
function settingsDialog() {
const pack_code_field = textField("", 15);
const cycle_prefix_field = textField("", 3);
function settingsDialog(task_settings) {
const pack_code_field = textField(task_settings.get("arkhamdb_pack_code"), 15);
const cycle_prefix_field = textField(task_settings.get("arkhamdb_cycle_prefix"), 15);
const panel = new Grid();
panel.place(
"Pack Code", "",
@ -296,12 +296,16 @@ function run() {
},
perform: function perform(project, task, member) {
member = ProjectUtilities.simplify(project, task, member);
const [close_button, pack_code, cycle_prefix] = settingsDialog();
const task_settings = member.getSettings();
const [close_button, pack_code, cycle_prefix] = settingsDialog(task_settings);
// User canceled the dialog or closed it without pressing ok
if (close_button != 1) {
return;
}
task_settings.set("arkhamdb_pack_code", pack_code);
task_settings.set("arkhamdb_cycle_prefix", cycle_prefix);
member.writeTaskSettings();
Eons.setWaitCursor(true);
try {