Item structure

This commit is contained in:
2021-04-01 22:35:03 +02:00
parent cc46ce867e
commit e205ca186a
6 changed files with 74 additions and 60 deletions

View File

@ -11,7 +11,7 @@ export class VadentisActorSheet extends ActorSheet {
/** @override */
static get defaultOptions() {
return mergeObject(super.defaultOptions, {
classes: ["sos", "sheet", "actor"],
classes: ["vadentis", "sheet", "actor"],
template: "systems/foundryvtt-vadentis/templates/actor-sheet.html",
width: 640,
height: 720,
@ -25,8 +25,9 @@ export class VadentisActorSheet extends ActorSheet {
getData() {
let data = super.getData();
this.actor.checkDeck();
data.stats = this.actor.stats;
data.combat = this.actor.combat;
data.magie = this.actor.magie;
return data;
}
@ -128,14 +129,6 @@ export class VadentisActorSheet extends ActorSheet {
}
/* -------------------------------------------- */
async _onDrop(event) {
let toSuper = await SoSUtility.processItemDropEvent(this, event);
if ( toSuper) {
super._onDrop(event);
}
}
/* -------------------------------------------- */
/** @override */
setPosition(options = {}) {

View File

@ -32,12 +32,12 @@ export class VadentisActor extends Actor {
return actor;
}
data.items = [];
/*data.items = [];
let compendiumName = "foundryvtt-vadentis.competences";
if ( compendiumName ) {
let skills = await SoSUtility.loadCompendium(compendiumName);
data.items = data.items.concat( skills );
}
}*/
return super.create(data, options);
}

View File

@ -8,9 +8,9 @@
/* -------------------------------------------- */
// Import Modules
import { VadentisActor } from "./actor.js";
import { VadentisItemSheet } from "./item-sheet.js";
import { VadentisActorSheet } from "./actor-sheet.js";
import { VadentisActor } from "./vadentis-actor.js";
import { VadentisItemSheet } from "./vadentis-item-sheet.js";
import { VadentisActorSheet } from "./vadentis-actor-sheet.js";
import { VadentisUtility } from "./vadentis-utility.js";
import { VadentisCombat } from "./vadentis-combat.js";
@ -48,7 +48,7 @@ Hooks.once("init", async function () {
/* -------------------------------------------- */
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("foundryvtt-vadentis", VadentisActorSheet, { types: ["character"], makeDefault: true });
Actors.registerSheet("foundryvtt-vadentis", VadentisActorSheet, { types: ["personnage"], makeDefault: true });
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("foundryvtt-vadentis", VadentisItemSheet, { makeDefault: true });

View File

@ -9,11 +9,18 @@ export class VadentisUtility extends Entity {
const templatePaths = [
'systems/foundryvtt-vadentis/templates/actor-sheet.html',
'systems/foundryvtt-vadentis/templates/item-sheet.html'
'systems/foundryvtt-vadentis/templates/item-sheet.html',
'systems/foundryvtt-vadentis/templates/score-option-list.html',
'systems/foundryvtt-vadentis/templates/editor-notes-gm.html'
]
return loadTemplates(templatePaths);
}
/* -------------------------------------------- */
static registerChatCallbacks( ) {
}
/* -------------------------------------------- */
static fillRange (start, end) {
return Array(end - start + 1).fill().map((item, index) => start + index);