#60 : Affichage spécial pour les joueurs non reliés à un personnage
This commit is contained in:
parent
725623374e
commit
a831e8b0b2
@ -71,17 +71,23 @@ export class RdDActor extends Actor {
|
|||||||
super.prepareData();
|
super.prepareData();
|
||||||
|
|
||||||
const actorData = this.data;
|
const actorData = this.data;
|
||||||
const data = actorData.data;
|
|
||||||
const flags = actorData.flags;
|
|
||||||
|
|
||||||
// Dynamic computing fields
|
// Dynamic computing fields
|
||||||
this.encombrementTotal = 0;
|
this.encombrementTotal = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Auto-resize token
|
||||||
|
if (this.isToken) {
|
||||||
|
let tokenSize = actorData.data.carac.taille.value/10;
|
||||||
|
this.token.update({height: tokenSize, width: tokenSize } );
|
||||||
|
}*/
|
||||||
|
|
||||||
// Make separate methods for each Actor type (character, npc, etc.) to keep
|
// Make separate methods for each Actor type (character, npc, etc.) to keep
|
||||||
// things organized.
|
// things organized.
|
||||||
if (actorData.type === 'personnage') this._prepareCharacterData(actorData);
|
if (actorData.type === 'personnage') this._prepareCharacterData(actorData);
|
||||||
if (actorData.type === 'creature') this.computeEtatGeneral(actorData);
|
if (actorData.type === 'creature') this.computeEtatGeneral(actorData);
|
||||||
if (actorData.type === 'humanoide') this.computeEtatGeneral(actorData);
|
if (actorData.type === 'humanoide') this.computeEtatGeneral(actorData);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -191,6 +191,7 @@ Hooks.once("renderApplication", () => {
|
|||||||
messageDeBienvenue();
|
messageDeBienvenue();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
function messageDeBienvenue(){
|
function messageDeBienvenue(){
|
||||||
game.messages
|
game.messages
|
||||||
.filter(it => it.user._id == game.user._id && it.data.content.match(/^Bienvenu(e)? dans le Rêve des Dragons/))
|
.filter(it => it.user._id == game.user._id && it.data.content.match(/^Bienvenu(e)? dans le Rêve des Dragons/))
|
||||||
@ -208,14 +209,34 @@ function messageDeBienvenue(){
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
Hooks.once("ready", function() {
|
Hooks.once("ready", function() {
|
||||||
/* Affiche le calendrier */
|
/* Affiche le calendrier */
|
||||||
let calendrier = new RdDCalendrier();
|
//let calendrier = new RdDCalendrier();
|
||||||
let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
//let templatePath = "systems/foundryvtt-reve-de-dragon/templates/calendar-template.html";
|
||||||
let templateData = {};
|
//let templateData = {};
|
||||||
/* DISABLEDrenderTemplate(templatePath, templateData).then(html => {
|
/* DISABLEDrenderTemplate(templatePath, templateData).then(html => {
|
||||||
calendrier.render(true);
|
calendrier.render(true);
|
||||||
} ); */
|
} ); */
|
||||||
|
// Avertissement si joueur sans personnage
|
||||||
|
if ( !game.user.isGM && game.user.character == undefined) {
|
||||||
|
ui.notifications.info( "Attention ! Vous n'êtes connecté à aucun personnage !" );
|
||||||
|
ChatMessage.create( { content:"<b>ATTENTION</b> Le joueur " + game.user.name + " n'est connecté à aucun personnage !",
|
||||||
|
user: game.user._id } );
|
||||||
|
//whisper: [ ChatMessage.getWhisperRecipients("GM") ] } );
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/* Abandonné pour l'instant
|
||||||
|
Hooks.on("preCreateToken", (scene, tokenData, options) => {
|
||||||
|
let actor = game.actors.get( tokenData.actorId )
|
||||||
|
if (actor) {
|
||||||
|
let tokenSize = actor.data.data.carac.taille.value / 10;
|
||||||
|
tokenData.width = tokenSize;
|
||||||
|
tokenData.height = tokenSize;
|
||||||
|
}
|
||||||
|
console.log("PRECREATE:", scene, tokenData, options);
|
||||||
|
});*/
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* Foundry VTT Initialization */
|
/* Foundry VTT Initialization */
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -705,6 +705,10 @@ export class RdDUtility {
|
|||||||
static _handleMsgDefense(data) {
|
static _handleMsgDefense(data) {
|
||||||
let defenderToken = canvas.tokens.get(data.defenderTokenId);
|
let defenderToken = canvas.tokens.get(data.defenderTokenId);
|
||||||
if (defenderToken) {
|
if (defenderToken) {
|
||||||
|
if ( !game.user.isGM && game.user.character == undefined) { // vérification / sanity check
|
||||||
|
ui.notifications.error("Le joueur " + game.user.name + " n'est connecté à aucun personnage. Impossible de continuer.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((game.user.isGM && !defenderToken.actor.hasPlayerOwner) || (defenderToken.actor.hasPlayerOwner && (game.user.character.id == defenderToken.actor.data._id))) {
|
if ((game.user.isGM && !defenderToken.actor.hasPlayerOwner) || (defenderToken.actor.hasPlayerOwner && (game.user.character.id == defenderToken.actor.data._id))) {
|
||||||
console.log("User is pushing message...", game.user.name);
|
console.log("User is pushing message...", game.user.name);
|
||||||
game.system.rdd.rollDataHandler[data.attackerid] = duplicate(data.rollData);
|
game.system.rdd.rollDataHandler[data.attackerid] = duplicate(data.rollData);
|
||||||
|
Loading…
Reference in New Issue
Block a user