Enhance interface
This commit is contained in:
@@ -40,6 +40,7 @@ export class MournbladeActorSheet extends ActorSheet {
|
||||
data: actorData,
|
||||
effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)),
|
||||
limited: this.object.limited,
|
||||
skills: duplicate(this.actor.getSkills()),
|
||||
weapons: duplicate(this.actor.getWeapons()),
|
||||
armors: duplicate(this.actor.getArmors()),
|
||||
//equipments: duplicate(this.actor.getEquipments()),
|
||||
@@ -69,10 +70,10 @@ export class MournbladeActorSheet extends ActorSheet {
|
||||
|
||||
// Update Inventory Item
|
||||
html.find('.item-edit').click(ev => {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
let itemId = li.data("item-id");
|
||||
const item = this.actor.items.get( itemId );
|
||||
item.sheet.render(true);
|
||||
const li = $(ev.currentTarget).parents(".item")
|
||||
let itemId = li.data("item-id")
|
||||
const item = this.actor.items.get( itemId )
|
||||
item.sheet.render(true)
|
||||
});
|
||||
// Delete Inventory Item
|
||||
html.find('.item-delete').click(ev => {
|
||||
|
@@ -34,11 +34,11 @@ export class MournbladeActor extends Actor {
|
||||
return actor;
|
||||
}
|
||||
|
||||
if (data.type == 'character') {
|
||||
if (data.type == 'personnage') {
|
||||
const skills = await MournbladeUtility.loadCompendium("fvtt-mournblade.skills")
|
||||
data.items = skills.map(i => i.toObject());
|
||||
}
|
||||
if (data.type == 'npc') {
|
||||
if (data.type == 'pnj') {
|
||||
}
|
||||
|
||||
return super.create(data, options);
|
||||
@@ -52,6 +52,11 @@ export class MournbladeActor extends Actor {
|
||||
getArmors() {
|
||||
return this.data.items.filter(item => item.type == "protection" )
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getSkills() {
|
||||
return this.data.items.filter(item => item.type == "competence" )
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
prepareBaseData() {
|
||||
}
|
||||
|
@@ -1,6 +1,18 @@
|
||||
import { MournbladeUtility } from "./mournblade-utility.js";
|
||||
|
||||
export const defaultItemImg = {
|
||||
competence: "systems/fvtt-mournblade/assets/icons/competence.webp",
|
||||
arme: "systems/fvtt-mournblade/assets/icons/arme.webp",
|
||||
capacite: "systems/fvtt-mournblade/assets/icons/capacite.webp",
|
||||
don: "systems/fvtt-mournblade/assets/icons/don.webp",
|
||||
equipement: "systems/fvtt-mournblade/assets/icons/equipement.webp",
|
||||
monnaie: "systems/fvtt-mournblade/assets/icons/monnaie.webp",
|
||||
pacte: "systems/fvtt-mournblade/assets/icons/pacte.webp",
|
||||
predilection: "systems/fvtt-mournblade/assets/icons/predilection.webp",
|
||||
protection: "systems/fvtt-mournblade/assets/icons/protection.webp",
|
||||
rune: "systems/fvtt-mournblade/assets/icons/rune.webp",
|
||||
tendance: "systems/fvtt-mournblade/assets/icons/tendance.webp",
|
||||
traitchaotique: "systems/fvtt-mournblade/assets/icons/traitchaotique.webp",
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -50,11 +50,11 @@ Hooks.once("init", async function () {
|
||||
/* -------------------------------------------- */
|
||||
// Register sheet application classes
|
||||
Actors.unregisterSheet("core", ActorSheet);
|
||||
Actors.registerSheet("fvtt-mournblade", MournbladeActorSheet, { types: ["character"], makeDefault: true });
|
||||
Actors.registerSheet("fvtt-mournblade", MournbladeActorSheet, { types: ["personnage"], makeDefault: true })
|
||||
//Actors.registerSheet("fvtt-mournblade", MournbladeNPCSheet, { types: ["npc"], makeDefault: false });
|
||||
|
||||
Items.unregisterSheet("core", ItemSheet);
|
||||
Items.registerSheet("fvtt-mournblade", MournbladeItemSheet, { makeDefault: true });
|
||||
Items.registerSheet("fvtt-mournblade", MournbladeItemSheet, { makeDefault: true })
|
||||
|
||||
MournbladeUtility.init();
|
||||
|
||||
@@ -66,7 +66,7 @@ function welcomeMessage() {
|
||||
user: game.user.id,
|
||||
whisper: [game.user.id],
|
||||
content: `<div id="welcome-message-Mournblade"><span class="rdd-roll-part">
|
||||
<strong>Welcome to Mournblade RPG.</strong>
|
||||
<strong>Bienvenue dans les Jeunes Royaumes de Mournblade !</strong>
|
||||
` });
|
||||
}
|
||||
|
||||
@@ -78,9 +78,9 @@ Hooks.once("ready", function () {
|
||||
MournbladeUtility.ready();
|
||||
// User warning
|
||||
if (!game.user.isGM && game.user.character == undefined) {
|
||||
ui.notifications.info("Warning ! No character linked to your user !");
|
||||
ui.notifications.info("Attention ! Aucun personnage n'est relié au joueur !");
|
||||
ChatMessage.create({
|
||||
content: "<b>WARNING</b> The player " + game.user.name + " is not linked to a character !",
|
||||
content: "<b>ATTENTION</b> Le joueur " + game.user.name + " n'est relié à aucun personnage !",
|
||||
user: game.user._id
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user