merge
This commit is contained in:
@@ -39,12 +39,12 @@ export class HelpersL5r5e {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the default list from settings
|
// Get the default list from settings
|
||||||
let defaultList = game.settings.get(CONFIG.l5r5e.systemName, "defaultSkillsList") || [];
|
let defaultList = game.settings.get(CONFIG.l5r5e.namespace, "defaultSkillsList") || [];
|
||||||
|
|
||||||
// If empty, refill with default values
|
// If empty, refill with default values
|
||||||
if (foundry.utils.isEmpty(defaultList)) {
|
if (foundry.utils.isEmpty(defaultList)) {
|
||||||
defaultList = HelpersL5r5e.getDefaultSkillsUuidFromPack();
|
defaultList = HelpersL5r5e.getDefaultSkillsUuidFromPack();
|
||||||
await game.settings.set(CONFIG.l5r5e.systemName, "defaultSkillsList", defaultList);
|
await game.settings.set(CONFIG.l5r5e.namespace, "defaultSkillsList", defaultList);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultList = await Promise.all(defaultList.map(async uuid => await fromUuid(uuid)));
|
defaultList = await Promise.all(defaultList.map(async uuid => await fromUuid(uuid)));
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export class DefaultSkillsDialogL5r5e extends FormApplication {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const skillListUuids = game.settings.get(CONFIG.l5r5e.systemName, DefaultSkillsDialogL5r5e.skillsLisKey) || [];
|
const skillListUuids = game.settings.get(CONFIG.l5r5e.namespace, DefaultSkillsDialogL5r5e.skillsLisKey) || [];
|
||||||
|
|
||||||
// Dropped an item with same "id" as one owned
|
// Dropped an item with same "id" as one owned
|
||||||
if (skillListUuids.some((embedItem) => embedItem.uuid === item.uuid)) {
|
if (skillListUuids.some((embedItem) => embedItem.uuid === item.uuid)) {
|
||||||
@@ -99,7 +99,7 @@ export class DefaultSkillsDialogL5r5e extends FormApplication {
|
|||||||
|
|
||||||
// Add the uuid and save
|
// Add the uuid and save
|
||||||
skillListUuids.push(item.uuid);
|
skillListUuids.push(item.uuid);
|
||||||
await game.settings.set(CONFIG.l5r5e.systemName, DefaultSkillsDialogL5r5e.skillsLisKey, skillListUuids);
|
await game.settings.set(CONFIG.l5r5e.namespace, DefaultSkillsDialogL5r5e.skillsLisKey, skillListUuids);
|
||||||
|
|
||||||
// Refresh
|
// Refresh
|
||||||
this.render(false);
|
this.render(false);
|
||||||
@@ -139,8 +139,8 @@ export class DefaultSkillsDialogL5r5e extends FormApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove and save
|
// Remove and save
|
||||||
const skillListUuids = game.settings.get(CONFIG.l5r5e.systemName, DefaultSkillsDialogL5r5e.skillsLisKey) || [];
|
const skillListUuids = game.settings.get(CONFIG.l5r5e.namespace, DefaultSkillsDialogL5r5e.skillsLisKey) || [];
|
||||||
await game.settings.set(CONFIG.l5r5e.systemName, DefaultSkillsDialogL5r5e.skillsLisKey, skillListUuids.filter((uuid) => uuid !== itemUuid));
|
await game.settings.set(CONFIG.l5r5e.namespace, DefaultSkillsDialogL5r5e.skillsLisKey, skillListUuids.filter((uuid) => uuid !== itemUuid));
|
||||||
|
|
||||||
// Refresh
|
// Refresh
|
||||||
this.render(false);
|
this.render(false);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user