Skip to content

Commit

Permalink
Merge pull request #2835 from Azmoria/Fix---issue-with-inspiration-co…
Browse files Browse the repository at this point in the history
…ndition-on-player-tokens-on-initial-load

Fix - issue with inspiration condition not appearing on player tokens on initial load
  • Loading branch information
Azmoria authored Jan 21, 2025
2 parents 57b8dde + 728cde1 commit e7979e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CharactersPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ const buffsDebuffs = {
"type": "class",
"class": "barbarian",
},
"Great Weapon Master (2024)": {
"tohit": "0",
"dmg": "+PB",
"save": "0",
"check": "0",
"type": "feat",
},
"Call the Hunt": {
"tohit": "0",
"dmg": "+d6",
Expand Down Expand Up @@ -624,10 +631,10 @@ function read_death_save_info(container = $(document)) {
}

function read_inspiration(container = $(document)) {
if (container.find(".ct-inspiration__status--active").length) {
if (container.find(".ct-inspiration__status--active, .ct-quick-info__inspiration svg.ddbc-inspiration-token-svg").length) {
return true;
}
if (container.find(".ct-status-summary-mobile__inspiration .ct-status-summary-mobile__button--active").length) {
if (container.find(".ct-status-summary-mobile__inspiration .ct-status-summary-mobile__button--active, [class*='styles_mobileWrapper'] [class*='styles_mobileButton'][role='checkbox'][aria-checked='true']").length) {
return true
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion Token.js
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ class Token {
cond_bar.width(symbolSize);
cond_bar.height(this.sizeWidth() - bar_width); // height or width???
})
if (this.options.inspiration){
if (this.isPlayer() && (this.options.inspiration || find_pc_by_player_id(this.options.id).inspiration)){
if (!this.hasCondition("Inspiration")){
this.addCondition("Inspiration")
}
Expand Down

0 comments on commit e7979e3

Please sign in to comment.