Skip to content

Commit

Permalink
2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jopeek committed Jan 11, 2021
1 parent bf46edb commit a0a8c62
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "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.2.0",
"version": "2.2.1",
"minimumCoreVersion": "0.7.7",
"compatibleCoreVersion": "0.7.9",
"compatibleCoreVersion": "0.7.8",
"author": "Jan Ole Peek (ChalkOne)",
"systems": [
"dnd5e",
Expand Down
18 changes: 7 additions & 11 deletions token-info-icons.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
const MODULE_NAME = 'token-info-icons';
const GMONLY_MODULE_SETTING = 'gmOnly';
const ALL_PASSIVE_SENSES_MODULE_SETTING = 'allPassiveSenses';
const POSITION_MODULE_SETTING = 'position';

class TokenInfoIcons {
static async addTokenInfoButtons(app, html, data) {
let actor = canvas.tokens.get(data._id).actor;
Expand Down Expand Up @@ -59,12 +54,12 @@ class TokenInfoIcons {

let newdiv = '<div class="token-info-container">';

let position = game.settings.get(MODULE_NAME, POSITION_MODULE_SETTING);
let position = game.settings.get('token-info-icons', 'position');

let defaultButtons = '<div class="control-icon token-info-icon">' + speed + '</div><div class="control-icon token-info-icon" title="Armor Class: ' + ac + '"><i class="fas fa-shield-alt"></i> ' + ac + '</div><div class="control-icon token-info-icon" title="Passive Perception: ' + perception + '"><i class="fas fa-eye"></i> ' + perception + '</div>'

let passiveSensesButtons = '';
if (!['pf2e', 'pf1'].includes(game.world.system) && game.settings.get(MODULE_NAME, ALL_PASSIVE_SENSES_MODULE_SETTING)) {
if (!['pf2e', 'pf1'].includes(game.world.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;
Expand All @@ -83,7 +78,7 @@ class TokenInfoIcons {
}

Hooks.on('ready', () => {
const gmOnly = game.settings.get(MODULE_NAME, GMONLY_MODULE_SETTING);
const gmOnly = game.settings.get('token-info-icons', 'gmOnly');

if (gmOnly) {
if (game.user.isGM) {
Expand All @@ -99,7 +94,8 @@ Hooks.on('ready', () => {
});

Hooks.once("init", () => {
game.settings.register(MODULE_NAME, GMONLY_MODULE_SETTING, {

game.settings.register('token-info-icons', 'gmOnly', {
name: "GM only?",
hint: "Show the token info to the GM only or to all players?",
scope: "world",
Expand All @@ -108,7 +104,7 @@ Hooks.once("init", () => {
type: Boolean
});

game.settings.register(MODULE_NAME, ALL_PASSIVE_SENSES_MODULE_SETTING, {
game.settings.register('token-info-icons', 'allPassiveSenses', {
name: 'Show all passive senses (dnd5e)',
hint: 'Show passive perception/investigation/insight/stealth instead of just passive perception',
scope: "world",
Expand All @@ -117,7 +113,7 @@ Hooks.once("init", () => {
type: Boolean
});

game.settings.register(MODULE_NAME, POSITION_MODULE_SETTING, {
game.settings.register('token-info-icons', 'position', {
name: "Token Position",
hint: "Which side of the token should the info appear on?",
scope: "world",
Expand Down

0 comments on commit a0a8c62

Please sign in to comment.