Carrrièes, stat patch et log
This commit is contained in:
@ -37,32 +37,6 @@ Hooks.once('init', () => {
|
||||
return statParserFR( statString, type);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
game.wfrp4e.utility.handleConditionClick = function(event) {
|
||||
let cond = $(event.currentTarget).attr("data-cond")
|
||||
if (!cond)
|
||||
cond = event.target.text;
|
||||
cond = cond.trim();
|
||||
let condkey
|
||||
// En vo, les noms d'états sont égaux aux clés en minuscules
|
||||
if ( game.wfrp4e.config.conditions[cond.toLowerCase()] ) {
|
||||
condkey = cond.toLowerCase();
|
||||
} else {
|
||||
try {
|
||||
condkey = game.wfrp4e.utility.findKey(cond.toLowerCase(), game.wfrp4e.config.conditions, {caseInsensitive: true});
|
||||
}
|
||||
catch {
|
||||
ui.notifications.error("L'état est inconnu : " + cond);
|
||||
}
|
||||
}
|
||||
let condName = game.wfrp4e.config.conditions[condkey];
|
||||
let condDescr = game.wfrp4e.config.conditionDescriptions[condkey];
|
||||
let messageContent = `<b>${condName}</b><br>${condDescr}`
|
||||
|
||||
let chatData = game.wfrp4e.utility.chatDataSetup(messageContent)
|
||||
ChatMessage.create(chatData);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
game.wfrp4e.entities.ItemWfrp4e.prototype.computeSpellDamage = function(formula, isMagicMissile) {
|
||||
try {
|
||||
@ -510,3 +484,31 @@ Hooks.once('init', () => {
|
||||
|
||||
} );
|
||||
|
||||
/* -------------------------------------------- */
|
||||
// Register world usage statistics
|
||||
function registerUsageCount( registerKey ) {
|
||||
if ( game.user.isGM ) {
|
||||
game.settings.register(registerKey, "world-key", {
|
||||
name: "Unique world key",
|
||||
scope: "world",
|
||||
config: false,
|
||||
type: String
|
||||
});
|
||||
|
||||
let worldKey = game.settings.get(registerKey, "world-key")
|
||||
if ( worldKey == undefined || worldKey == "" ) {
|
||||
worldKey = randomID(32)
|
||||
game.settings.set(registerKey, "world-key", worldKey )
|
||||
}
|
||||
// Simple API counter
|
||||
$.ajax(`https://jdr.lahiette.com/fvtt_appcount/count.php?name="${registerKey}"&worldKey="${worldKey}"&version="${game.release.generation}.${game.release.build}"&system="${game.system.id}"&systemversion="${game.system.data.version}"`)
|
||||
/* -------------------------------------------- */
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
Hooks.once('ready', () => {
|
||||
|
||||
registerUsageCount("wh4-fr-translation")
|
||||
|
||||
});
|
Reference in New Issue
Block a user