Item sheets, WIP

This commit is contained in:
2022-11-03 15:40:16 +01:00
parent 1b04f6ce69
commit f039600065
47 changed files with 22 additions and 26 deletions

View File

@ -8,10 +8,10 @@ export class Avd12Commands {
static init() {
if (!game.system.avd12.commands) {
const crucibleCommands = new CrucibleCommands();
const avd12Commands = new Avd12Commands();
//crucibleCommands.registerCommand({ path: ["/char"], func: (content, msg, params) => crucibleCommands.createChar(msg), descr: "Create a new character" });
//crucibleCommands.registerCommand({ path: ["/pool"], func: (content, msg, params) => crucibleCommands.poolRoll(msg), descr: "Generic Roll Window" });
game.system.avd12.commands = crucibleCommands;
game.system.avd12.commands = avd12Commands;
}
}
constructor() {

View File

@ -11,7 +11,7 @@ export class Avd12ItemSheet extends ItemSheet {
return mergeObject(super.defaultOptions, {
classes: ["fvtt-avd12", "sheet", "item"],
template: "systems/fvtt-avd12/templates/item-sheet.html",
template: "systems/fvtt-avd12/templates/item-sheet.hbs",
dragDrop: [{ dragSelector: null, dropSelector: null }],
width: 620,
height: 550,
@ -150,7 +150,7 @@ export class Avd12ItemSheet extends ItemSheet {
/* -------------------------------------------- */
get template() {
let type = this.item.type;
return `systems/avd12/templates/items/item-${type}-sheet.html`
return `systems/fvtt-avd12/templates/items/item-${type}-sheet.hbs`
}
/* -------------------------------------------- */

View File

@ -1,18 +1,18 @@
import { Avd12Utility } from "./avd12-utility.js";
export const defaultItemImg = {
skill: "systems/fvtt-crucible-rpg/images/icons/icon_skill.webp",
armor: "systems/fvtt-crucible-rpg/images/icons/icon_armour.webp",
weapon: "systems/fvtt-crucible-rpg/images/icons/icon_weapon.webp",
equipment: "systems/fvtt-crucible-rpg/images/icons/icon_equipment.webp",
money: "systems/fvtt-crucible-rpg/images/icons/icon_money.webp",
skill: "systems/fvtt-avd12/images/icons/icon_skill.webp",
armor: "systems/fvtt-avd12/images/icons/icon_armour.webp",
weapon: "systems/fvtt-avd12/images/icons/icon_weapon.webp",
equipment: "systems/fvtt-avd12/images/icons/icon_equipment.webp",
money: "systems/fvtt-avd12/images/icons/icon_money.webp",
}
/**
* Extend the basic ItemSheet with some very simple modifications
* @extends {ItemSheet}
*/
export class CrucibleItem extends Item {
export class Avd12Item extends Item {
constructor(data, context) {
if (!data.img) {

View File

@ -6,7 +6,7 @@
import { Avd12Utility } from "./avd12-utility.js";
/* -------------------------------------------- */
export class CrucibleNPCSheet extends ActorSheet {
export class Avd12NPCSheet extends ActorSheet {
/** @override */
static get defaultOptions() {

View File

@ -17,7 +17,7 @@ export class Avd12Utility {
this.rollDataStore = {}
this.defenderStore = {}
CrucibleCommands.init();
Avd12Commands.init();
Handlebars.registerHelper('count', function (list) {
return list.length;
@ -98,7 +98,7 @@ export class Avd12Utility {
static async chatListeners(html) {
html.on("click", '.view-item-from-chat', event => {
game.system.crucible.creator.openItemView(event)
game.system.avd12.creator.openItemView(event)
})
html.on("click", '.roll-defense-melee', event => {
let rollId = $(event.currentTarget).data("roll-id")
@ -127,7 +127,9 @@ export class Avd12Utility {
'systems/fvtt-avd12/templates/actors/editor-notes-gm.hbs',
'systems/fvtt-avd12/templates/items/partial-item-nav.hbs',
'systems/fvtt-avd12/templates/items/partial-item-description.hbs',
'systems/fvtt-avd12/templates/items/partial-options-weapons-types.hbs'
'systems/fvtt-avd12/templates/items/partial-options-weapon-types.hbs',
'systems/fvtt-avd12/templates/items/partial-options-weapon-categories.hbs',
'systems/fvtt-avd12/templates/items/partial-common-item-fields.hbs'
]
return loadTemplates(templatePaths);
}
@ -200,7 +202,7 @@ export class Avd12Utility {
}
/* -------------------------------------------- */
static saveRollData(rollData) {
game.socket.emit("system.crucible-rpg", {
game.socket.emit("system.fvtt-avd12", {
name: "msg_update_roll", data: rollData
}); // Notify all other clients of the roll
this.updateRollData(rollData)
@ -426,7 +428,7 @@ export class Avd12Utility {
}
/* -------------------------------------------- */
static async rollCrucible(rollData) {
static async rollAvd12(rollData) {
let actor = game.actors.get(rollData.actorId)