Skip to content

Commit

Permalink
Update proficiency icons, add tooltips for checks and saving throws
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkinabout committed Sep 25, 2024
1 parent e2ddb30 commit be8e8de
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 9 deletions.
14 changes: 10 additions & 4 deletions scripts/action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,14 @@ Hooks.once("tokenActionHudCoreApiReady", async coreModule => {
name: (this.abbreviateSkills) ? coreModule.api.Utils.capitalize(abilityId) : name,
encodedValue: [actionType, abilityId].join(this.delimiter),
icon1: (groupId !== "checks") ? this.#getProficiencyIcon(abilities[abilityId].proficient) : "",
info1: (this.actor) ? { text: coreModule.api.Utils.getModifier(mod) } : null,
info2: (this.actor && groupId === "abilities") ? { text: `(${coreModule.api.Utils.getModifier(ability?.save)})` } : null,
info1: (this.actor) ? {
text: coreModule.api.Utils.getModifier(mod),
title: `${game.i18n.localize("DND5E.ActionAbil")}: ${coreModule.api.Utils.getModifier(mod)}`
} : null,
info2: (this.actor && groupId === "abilities") ? {
text: `(${coreModule.api.Utils.getModifier(ability?.save)})`,
title: `${game.i18n.localize("DND5E.SavingThrow")}: ${coreModule.api.Utils.getModifier(ability?.save)}`
} : null,
listName: this.#getListName(actionType, name)
};
});
Expand Down Expand Up @@ -882,7 +888,7 @@ Hooks.once("tokenActionHudCoreApiReady", async coreModule => {
encodedValue: [actionType, id].join(this.delimiter),
cssClass,
img: coreModule.api.Utils.getImage(entity),
icon1: this.#getActivationTypeIcon(entity.system?.activities?.contents[0]?.type),
icon1: this.#getActivationTypeIcon(entity.system?.activities?.contents[0]?.activation.type),
icon2: this.#getPreparedIcon(entity),
icon3: this.#getConcentrationIcon(entity),
info1: info?.info1,
Expand Down Expand Up @@ -1047,7 +1053,7 @@ Hooks.once("tokenActionHudCoreApiReady", async coreModule => {
if (!(uses?.max > 0)) return {};
const per = uses.recovery[0]?.period === "charges" ? "" : ` ${game.i18n.localize("DND5E.per")} `;
const period = CONFIG.DND5E.limitedUsePeriods[uses.recovery[0]?.period]?.label ?? uses.recovery[0]?.period;
const perPeriod = (period) ? `${per}${period}` : ''
const perPeriod = (period) ? `${per}${period}` : "";
const remainingUses = uses.max - (uses.spent ?? 0);
const text = `${remainingUses}/${uses.max}`;
const title = `${text}${perPeriod}`;
Expand Down
7 changes: 4 additions & 3 deletions scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ export const PREPARED_ICON = "fas fa-sun";
* Proficiency level icons
*/
export const PROFICIENCY_LEVEL_ICON = {
0.5: "fas fa-adjust",
1: "fas fa-check",
2: "fas fa-check-double"
0: "fa-regular fa-circle",
0.5: "fa-regular fa-circle-half-stroke",
1: "fa-solid fa-circle",
2: "fa-regular fa-circle-dot"
};

/**
Expand Down
2 changes: 1 addition & 1 deletion scripts/token-action-hud-dnd5e.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/token-action-hud-dnd5e.min.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions styles/tah-dnd5e.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@
.tah-tags .tah-tag.artifact {
border-color: #9d0289;
background-color: #9d0289;
}

.tah-icon > i {
font-size: 10px;
}

0 comments on commit be8e8de

Please sign in to comment.