From 293cb23c13da3ddb359ebf031ccb86c03a36b6cd Mon Sep 17 00:00:00 2001 From: jopeek Date: Sat, 11 Mar 2023 18:05:53 -0800 Subject: [PATCH] 2.3.10 --- module.json | 61 ++++++++++++++++++++++++++------------------- token-info-icons.js | 60 ++++++++++++++++++++++---------------------- 2 files changed, 66 insertions(+), 55 deletions(-) diff --git a/module.json b/module.json index aff5ce8..f302aa9 100644 --- a/module.json +++ b/module.json @@ -1,30 +1,16 @@ { - "name": "token-info-icons", - "id": "token-info-icons", "title": "Token Info Icons", "description": "Simple module that displays Speed, AC, and Passive Perception on Tokens for the GM or optionally players.", - "version": "2.3.9", - "minimumCoreVersion": "0.8.0", - "compatibleCoreVersion": "10", - "author": "Jan Ole Peek (ChalkOne)", - "authors": [ { "name" : "Jan Ole Peek (ChalkOne)" } ], - "system": [ - "dnd5e", - "pf2e", - "pf1", - "dcc" + "version": "2.3.10", + "authors": [ + { + "name": "Jan Ole Peek (ChalkOne)", + "flags": {} + } ], - "compatibility" : { - "minimum" : "0.8.0", - "verified" : "10" - }, - "relationships" : { - "systems" : [ - { "id" : "dnd5e", "type": "system" }, - { "id" : "pf2e", "type": "system" }, - { "id" : "pf1", "type": "system" }, - { "id" : "dcc", "type": "system" } - ] + "compatibility": { + "minimum": "10", + "verified": "10" }, "scripts": [ "/token-info-icons.js" @@ -34,5 +20,30 @@ ], "url": "https://github.com/jopeek/fvtt-token-info-icons", "manifest": "https://raw.githubusercontent.com/jopeek/fvtt-token-info-icons/master/module.json", - "download": "https://github.com/jopeek/fvtt-token-info-icons/archive/refs/heads/master.zip" -} + "download": "https://github.com/jopeek/fvtt-token-info-icons/archive/refs/heads/master.zip", + "id": "token-info-icons", + "relationships": { + "systems": [ + { + "id": "dnd5e", + "type": "system", + "compatibility": {} + }, + { + "id": "pf2e", + "type": "system", + "compatibility": {} + }, + { + "id": "pf1", + "type": "system", + "compatibility": {} + }, + { + "id": "dcc", + "type": "system", + "compatibility": {} + } + ] + } +} \ No newline at end of file diff --git a/token-info-icons.js b/token-info-icons.js index e482f23..268cd6a 100644 --- a/token-info-icons.js +++ b/token-info-icons.js @@ -5,64 +5,64 @@ class TokenInfoIcons { if (actor === undefined) return; let ac = 10 - if (game.world.data.system === "pf1") { - ac = actor.data.data.attributes.ac.normal.total + if (game.world.system === "pf1") { + ac = actor.system.attributes.ac.normal.total } - else if (game.world.data.system === "dcc") { - ac = actor.data.data.attributes.ac.value + else if (game.world.system === "dcc") { + ac = actor.system.attributes.ac.value } else { - ac = (isNaN(parseInt(actor.data.data.attributes.ac.value)) || parseInt(actor.data.data.attributes.ac.value) === 0) ? 10 : parseInt(actor.data.data.attributes.ac.value); + ac = (isNaN(parseInt(actor.system.attributes.ac.value)) || parseInt(actor.system.attributes.ac.value) === 0) ? 10 : parseInt(actor.system.attributes.ac.value); } let perceptionTitle = "Passive Perception"; let perception = 10; - if (game.world.data.system === "pf1") { - perception = actor.data.data.skills.per.mod + if (game.world.system === "pf1") { + perception = actor.system.skills.per.mod perceptionTitle = "Perception Mod"; - } else if (game.world.data.system === "pf2e") { - perception = perception + actor.data.data.attributes.perception.value; + } else if (game.world.system === "pf2e") { + perception = perception + actor.system.attributes.perception.value; perceptionTitle = "Perception DC"; } - else if (game.world.data.system === "dcc") { + else if (game.world.system === "dcc") { perception = 0 perceptionTitle = "Perception DC"; } else { - perception = actor.data.data.skills.prc.passive; + perception = actor.system.skills.prc.passive; } //console.log("TokenInfoIcons", actor); let speed = ""; - if (game.world.data.system === "pf2e") { + if (game.world.system === "pf2e") { if (actor.data.type === "npc") { - speed = ' ' + actor.data.data.attributes.speed.value + ''; + speed = ' ' + actor.system.attributes.speed.value + ''; } else if (actor.data.type === "familiar") { // Familiars seem to get either 25 ft. land or water speed // It can be modified by other abilities but they will be revising these later so this will likely change speed = ' 25'; } else { - speed = ' ' + actor.data.data.attributes.speed.total + ''; + speed = ' ' + actor.system.attributes.speed.total + ''; } - } else if (game.world.data.system === "pf1") { - speed = ' ' + actor.data.data.attributes.speed.land.total + ''; - } else if (game.world.data.system === "dcc") { - speed = ' ' + actor.data.data.attributes.speed.base + ''; + } else if (game.world.system === "pf1") { + speed = ' ' + actor.system.attributes.speed.land.total + ''; + } else if (game.world.system === "dcc") { + speed = ' ' + actor.system.attributes.speed.base + ''; } else { - if (actor.data.data.attributes.movement.walk != 0 && actor.data.data.attributes.movement.walk != null) speed += ' ' + actor.data.data.attributes.movement.walk + ' ' + actor.data.data.attributes.movement.units + ""; - if (actor.data.data.attributes.movement.swim != 0 && actor.data.data.attributes.movement.swim != null) speed += ' ' + actor.data.data.attributes.movement.swim + ' ' + actor.data.data.attributes.movement.units + ""; - if (actor.data.data.attributes.movement.fly != 0 && actor.data.data.attributes.movement.fly != null) speed += ' ' + actor.data.data.attributes.movement.fly + ' ' + actor.data.data.attributes.movement.units + ""; - if (actor.data.data.attributes.movement.burrow != 0 && actor.data.data.attributes.movement.burrow != null) speed += ' ' + actor.data.data.attributes.movement.burrow + ' ' + actor.data.data.attributes.movement.units + ""; - if (actor.data.data.attributes.movement.climb != 0 && actor.data.data.attributes.movement.climb != null) speed += ' ' + actor.data.data.attributes.movement.climb + ' ' + actor.data.data.attributes.movement.units + ""; + if (actor.system.attributes.movement.walk != 0 && actor.system.attributes.movement.walk != null) speed += ' ' + actor.system.attributes.movement.walk + ' ' + actor.system.attributes.movement.units + ""; + if (actor.system.attributes.movement.swim != 0 && actor.system.attributes.movement.swim != null) speed += ' ' + actor.system.attributes.movement.swim + ' ' + actor.system.attributes.movement.units + ""; + if (actor.system.attributes.movement.fly != 0 && actor.system.attributes.movement.fly != null) speed += ' ' + actor.system.attributes.movement.fly + ' ' + actor.system.attributes.movement.units + ""; + if (actor.system.attributes.movement.burrow != 0 && actor.system.attributes.movement.burrow != null) speed += ' ' + actor.system.attributes.movement.burrow + ' ' + actor.system.attributes.movement.units + ""; + if (actor.system.attributes.movement.climb != 0 && actor.system.attributes.movement.climb != null) speed += ' ' + actor.system.attributes.movement.climb + ' ' + actor.system.attributes.movement.units + ""; } // DCC luck let luck = null; - if (game.world.data.system === "dcc") { + if (game.world.system === "dcc") { if (actor.data.type === "Player") { - luck = actor.data.data.abilities.lck.value; + luck = actor.system.abilities.lck.value; } } @@ -71,7 +71,7 @@ class TokenInfoIcons { let position = game.settings.get('token-info-icons', 'position'); let defaultButtons = '
' + speed + '
' + ac + '
'; - if (game.world.data.system !== "dcc"){ + if (game.world.system !== "dcc"){ defaultButtons += '
' + perception + '
' }else{ // dcc specific @@ -82,10 +82,10 @@ class TokenInfoIcons { let passiveSensesButtons = ''; - if (!['pf2e', 'pf1'].includes(game.world.data.system) && game.settings.get('token-info-icons', 'allPassiveSenses')) { - const investigation = actor.data.data.skills.inv.passive; - const insight = actor.data.data.skills.ins.passive; - const stealth = actor.data.data.skills.ste.passive; + if (!['pf2e', 'pf1'].includes(game.world.system) && game.settings.get('token-info-icons', 'allPassiveSenses')) { + const investigation = actor.system.skills.inv.passive; + const insight = actor.system.skills.ins.passive; + const stealth = actor.system.skills.ste.passive; const passiveInvestigationButton = `
${investigation}
`; const passiveInsightButton = `
${insight}
`;