diff --git a/module/sheets/actors/rmss_player_sheet.js b/module/sheets/actors/rmss_player_sheet.js index 09a3ad9..804a6c3 100644 --- a/module/sheets/actors/rmss_player_sheet.js +++ b/module/sheets/actors/rmss_player_sheet.js @@ -251,7 +251,9 @@ export default class RMSSPlayerSheet extends ActorSheet { let selectOptions = {}; for (const pack of game.packs) { - selectOptions[pack.metadata.id] = pack.metadata.label; + if (pack.metadata.type === "Item") { + selectOptions[pack.metadata.id] = pack.metadata.label; + } } new game.rmss.applications.RMSSToolsSCImporter(selectOptions, this.actor).render(true); }); diff --git a/module/sheets/apps/rmss_import_skill_categories.js b/module/sheets/apps/rmss_import_skill_categories.js index da85e50..88069e9 100644 --- a/module/sheets/apps/rmss_import_skill_categories.js +++ b/module/sheets/apps/rmss_import_skill_categories.js @@ -27,23 +27,27 @@ export default class RMSSToolsSCImporter extends FormApplication { } async _updateObject(event, formData) { - console.log("Deleting Old Skill Categories."); + //console.log("Update ", event, formData); + let itemType = event.submitter.value; + let toDelete = []; for (const item of this.character.items) { - if (item.type === "skill_category") { - item.delete(); + if (item.type === itemType) { + toDelete.push(item.id); } } + this.character.deleteEmbeddedDocuments("Item", toDelete); - const pack = game.packs.get(formData.selectOptions); + let comp = (itemType == "skill") ? formData.selectOptionsSkills : formData.selectOptionsCategories; + const pack = game.packs.get(comp); const skillCategoryData = await pack.getIndex(); - console.log("Importing New Skill Categories."); + console.log("Importing New Skills/Skill Categories."); for (const sc of skillCategoryData) { const newitem = await pack.getDocument(sc._id); let newDocuments = []; - if (newitem.type === "skill_category") { + if (newitem.type === itemType) { console.log(newitem); newDocuments.push(newitem); } diff --git a/packs/skill_categories/000087.log b/packs/skill_categories/000102.log similarity index 100% rename from packs/skill_categories/000087.log rename to packs/skill_categories/000102.log diff --git a/packs/skill_categories/CURRENT b/packs/skill_categories/CURRENT index 814a4b7..ed5ac88 100644 --- a/packs/skill_categories/CURRENT +++ b/packs/skill_categories/CURRENT @@ -1 +1 @@ -MANIFEST-000085 +MANIFEST-000101 diff --git a/packs/skill_categories/LOG b/packs/skill_categories/LOG index 40df5e3..1a09a68 100644 --- a/packs/skill_categories/LOG +++ b/packs/skill_categories/LOG @@ -1,8 +1,3 @@ -2024/08/09-08:44:27.325541 7f339a0006c0 Recovering log #83 -2024/08/09-08:44:27.337335 7f339a0006c0 Delete type=3 #81 -2024/08/09-08:44:27.337439 7f339a0006c0 Delete type=0 #83 -2024/08/09-08:47:03.128372 7f33978006c0 Level-0 table #88: started -2024/08/09-08:47:03.128439 7f33978006c0 Level-0 table #88: 0 bytes OK -2024/08/09-08:47:03.134632 7f33978006c0 Delete type=0 #86 -2024/08/09-08:47:03.134834 7f33978006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end) -2024/08/09-08:47:03.134874 7f33978006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end) +2024/08/09-23:57:39.252249 7f92874006c0 Recovering log #99 +2024/08/09-23:57:39.263715 7f92874006c0 Delete type=3 #97 +2024/08/09-23:57:39.263837 7f92874006c0 Delete type=0 #99 diff --git a/packs/skill_categories/LOG.old b/packs/skill_categories/LOG.old index 3687a6c..cd64cb8 100644 --- a/packs/skill_categories/LOG.old +++ b/packs/skill_categories/LOG.old @@ -1,8 +1,8 @@ -2024/08/08-23:15:37.085427 7f3398c006c0 Recovering log #78 -2024/08/08-23:15:37.095822 7f3398c006c0 Delete type=3 #76 -2024/08/08-23:15:37.095882 7f3398c006c0 Delete type=0 #78 -2024/08/08-23:16:07.736809 7f33978006c0 Level-0 table #84: started -2024/08/08-23:16:07.736836 7f33978006c0 Level-0 table #84: 0 bytes OK -2024/08/08-23:16:07.742967 7f33978006c0 Delete type=0 #82 -2024/08/08-23:16:07.743117 7f33978006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end) -2024/08/08-23:16:07.743146 7f33978006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end) +2024/08/09-23:54:12.263425 7f92874006c0 Recovering log #95 +2024/08/09-23:54:12.272735 7f92874006c0 Delete type=3 #93 +2024/08/09-23:54:12.272785 7f92874006c0 Delete type=0 #95 +2024/08/09-23:56:47.698844 7f9285a006c0 Level-0 table #100: started +2024/08/09-23:56:47.698916 7f9285a006c0 Level-0 table #100: 0 bytes OK +2024/08/09-23:56:47.705094 7f9285a006c0 Delete type=0 #98 +2024/08/09-23:56:47.744132 7f9285a006c0 Manual compaction at level-0 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end) +2024/08/09-23:56:47.760291 7f9285a006c0 Manual compaction at level-1 from '!items!1HevhbCbvMonyQXe' @ 72057594037927935 : 1 .. '!items!yRIFroc5VC9Oj3qY' @ 0 : 0; will stop at (end) diff --git a/packs/skill_categories/MANIFEST-000085 b/packs/skill_categories/MANIFEST-000101 similarity index 76% rename from packs/skill_categories/MANIFEST-000085 rename to packs/skill_categories/MANIFEST-000101 index c6c9f71..b0b133a 100644 Binary files a/packs/skill_categories/MANIFEST-000085 and b/packs/skill_categories/MANIFEST-000101 differ diff --git a/packs/skills/000005.ldb b/packs/skills/000005.ldb deleted file mode 100644 index dc4948a..0000000 Binary files a/packs/skills/000005.ldb and /dev/null differ diff --git a/packs/skills/000010.ldb b/packs/skills/000010.ldb new file mode 100644 index 0000000..8d017a9 Binary files /dev/null and b/packs/skills/000010.ldb differ diff --git a/packs/skills/000004.log b/packs/skills/000020.log similarity index 100% rename from packs/skills/000004.log rename to packs/skills/000020.log diff --git a/packs/skills/CURRENT b/packs/skills/CURRENT index 1a84852..43c22f0 100644 --- a/packs/skills/CURRENT +++ b/packs/skills/CURRENT @@ -1 +1 @@ -MANIFEST-000002 +MANIFEST-000019 diff --git a/packs/skills/LOG b/packs/skills/LOG index 2da8436..58247ea 100644 --- a/packs/skills/LOG +++ b/packs/skills/LOG @@ -1,5 +1,3 @@ -2024/08/09-08:44:27.356894 7f33996006c0 Delete type=3 #1 -2024/08/09-08:47:03.112830 7f33978006c0 Level-0 table #5: started -2024/08/09-08:47:03.120597 7f33978006c0 Level-0 table #5: 145853 bytes OK -2024/08/09-08:47:03.127973 7f33978006c0 Delete type=0 #3 -2024/08/09-08:47:03.134815 7f33978006c0 Manual compaction at level-0 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end) +2024/08/09-23:57:39.267134 7f9287e006c0 Recovering log #17 +2024/08/09-23:57:39.276489 7f9287e006c0 Delete type=3 #15 +2024/08/09-23:57:39.276571 7f9287e006c0 Delete type=0 #17 diff --git a/packs/skills/LOG.old b/packs/skills/LOG.old new file mode 100644 index 0000000..c70ec0b --- /dev/null +++ b/packs/skills/LOG.old @@ -0,0 +1,8 @@ +2024/08/09-23:54:12.275641 7f928cc006c0 Recovering log #13 +2024/08/09-23:54:12.285878 7f928cc006c0 Delete type=3 #11 +2024/08/09-23:54:12.285936 7f928cc006c0 Delete type=0 #13 +2024/08/09-23:56:47.736686 7f9285a006c0 Level-0 table #18: started +2024/08/09-23:56:47.736717 7f9285a006c0 Level-0 table #18: 0 bytes OK +2024/08/09-23:56:47.743954 7f9285a006c0 Delete type=0 #16 +2024/08/09-23:56:47.760260 7f9285a006c0 Manual compaction at level-0 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end) +2024/08/09-23:56:47.760325 7f9285a006c0 Manual compaction at level-1 from '!folders!Lr9SCthdWWHecwEI' @ 72057594037927935 : 1 .. '!items!zvdsAxlRZnL6gqms' @ 0 : 0; will stop at (end) diff --git a/packs/skills/MANIFEST-000002 b/packs/skills/MANIFEST-000002 deleted file mode 100644 index 9d72314..0000000 Binary files a/packs/skills/MANIFEST-000002 and /dev/null differ diff --git a/packs/skills/MANIFEST-000019 b/packs/skills/MANIFEST-000019 new file mode 100644 index 0000000..7f88eda Binary files /dev/null and b/packs/skills/MANIFEST-000019 differ diff --git a/system.json b/system.json index 2baf389..4b04266 100644 --- a/system.json +++ b/system.json @@ -3,7 +3,7 @@ "title": "Rolemaster FRP System", "description": "The Rolemaster FRP system for FoundryVTT.", "manifest": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/raw/branch/develop/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/archive/v12.0.11.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-rolemaster-frp/archive/v12.0.12.zip", "authors": [ { "name": "Cynicide", @@ -14,7 +14,7 @@ "email": "" } ], - "version": "12.0.11", + "version": "12.0.12", "compatibility": { "minimum": "12", "verified": "12" diff --git a/templates/sheets/apps/app_skill_category_importer.html b/templates/sheets/apps/app_skill_category_importer.html index d6187d1..27710e4 100644 --- a/templates/sheets/apps/app_skill_category_importer.html +++ b/templates/sheets/apps/app_skill_category_importer.html @@ -1,17 +1,25 @@
-

Import Skill Categories

+ +

Import Skill Categories/Skills

- WARNING: This will erase your existing Skill Categories and import all Skill Categories from the selected Compendium. + WARNING: This will erase your existing Skill Categories or Skills and import all Skill Categories/Skills from the selected Compendium.
-
- Select Compendium: - {{selectOptions selectOptions}} -
-
- + +
+
+ Select Skills Compendium: + + +
+
\ No newline at end of file