Gestion de l'import skill/categories

This commit is contained in:
2024-08-10 00:24:15 +02:00
parent de884cbd22
commit 6cfedca162
26 changed files with 84 additions and 62 deletions

View File

@ -1,3 +1,5 @@
import { RFRPUtility } from "../../rfrp-utility.js";
export default class RMSSToolsSCImporter extends FormApplication {
constructor(selectOptions, character) {
@ -42,13 +44,13 @@ export default class RMSSToolsSCImporter extends FormApplication {
const skillCategoryData = await pack.getIndex();
console.log("Importing New Skills/Skill Categories.");
let gameSystem = RFRPUtility.getGameSystem();
for (const sc of skillCategoryData) {
const newitem = await pack.getDocument(sc._id);
let newDocuments = [];
if (newitem.type === itemType) {
console.log(newitem);
if (newitem.type === itemType && (newitem.system.game_system === "common" || newitem.system.game_system === gameSystem)) {
//console.log(newitem);
newDocuments.push(newitem);
}
if (newDocuments.length > 0) {