Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TokenBar doesn't load properly when logged in as Gamemaster #522

Open
neologiker opened this issue Sep 16, 2024 · 5 comments
Open

Comments

@neologiker
Copy link

neologiker commented Sep 16, 2024

Describe the bug
In Foundry 12.331 and using D&D 4.0, TokenBar does not load properly. This only happens when logged in as Gamemaster.

The console contains the following error(s):

Error: Error thrown in hooked function 'ready' for hook 'ready'. "dnd5e.disableExperienceTracking" is not a registered game setting
    at Hooks.onError (foundry.js:654:24)
    at #call (foundry.js:636:36)
    at Hooks.callAll (foundry.js:589:17)
    at Game.setupGame (foundry.js:9098:11)
    at async Game._initializeGameView (foundry.js:10432:5)
    at async Game.initialize (foundry.js:8995:5)
Caused by: Error: "dnd5e.disableExperienceTracking" is not a registered game setting
    at #assertKey (foundry.js:3402:42)
    at ClientSettings.get (foundry.js:3334:26)
    at get showXP (dnd5e-rolls.js:69:31)
    at DnD5eRolls.getButtons (base-rolls.js:152:70)
    at new TokenBar (tokenbar.js:97:45)
    at Object.ready [as fn] (monks-tokenbar.js:434:38)
    at #call (foundry.js:632:20)
    at Hooks.callAll (foundry.js:589:17)
    at Game.setupGame (foundry.js:9098:11)
    at async Game._initializeGameView (foundry.js:10432:5)
Error: An error occurred while rendering TokenBar 36. this.buttons is not iterable
    at Hooks.onError (foundry.js:654:24)
    at foundry.js:5795:13
Caused by: TypeError: this.buttons is not iterable
    at TokenBar.activateListeners (tokenbar.js:474:36)
    at TokenBar._render (foundry.js:5867:10)
onError	@	foundry.js:655
(anonymous)	@	foundry.js:5795
Promise.catch		
render	@	foundry.js:5793
(anonymous)	@	tokenbar.js:203
setTimeout		
refresh	@	tokenbar.js:200
(anonymous)	@	tokenbar.js:16
#call	@	foundry.js:632
call	@	foundry.js:614
#draw	@	foundry.js:25090
Promise.finally		
draw	@	foundry.js:24947
view	@	foundry.js:21369
_onClickScene	@	foundry.js:83527
dispatch	@	jquery.min.js:2
(anonymous)	@	jquery.min.js:2

To Reproduce
Steps to reproduce the behavior:

  1. Open a world using D&D 4.0 and log in as Gamemaster.
  2. Deactivate all modules. Save/reload.
  3. Activate Monk's TokenBar. Save/reload.
  4. TokenBar will not render and the console contains the first error, above.
  5. Change scenes.
  6. TokenBar will render but you can't interact and the console will contain the second error, above.
  7. Further switching scenes will always reproduce 6.

Expected behavior
No errors in console and TokenBar will render and work properly.

Please complete as much of the following information as possible:

  • Browser: Chrome and Edge
  • Foundry Version: 12.331
  • System: D&D5e 4.0.0
  • Module version: TokenBar 12.02
  • Are there any errors in the console: see above
  • Have you tried using Find the Culprit to make sure it isn't a module interaction: All other modules are deactivated.

Additional context
Add any other context about the problem here.

@davidR1974
Copy link

below setting used in showXP() (modules/monks-tokenbar/systems/dnd5e-rolls.js Line 68) has been deprecated to include epic boons levelling mode (so now it's an option box with 3 choices)

    get showXP() {
        return !game.settings.get('dnd5e', 'disableExperienceTracking');
    }
replaced the function with :
    get showXP() {
        return ! (game.settings.get('dnd5e', 'levelingMode') == 'noxp' );
//        return !game.settings.get('dnd5e', 'disableExperienceTracking');
    }
to resume testing .. seems to work like a charm so far...

@neologiker
Copy link
Author

neologiker commented Sep 20, 2024

below setting used in showXP() (modules/monks-tokenbar/systems/dnd5e-rolls.js Line 68) has been deprecated to include epic boons levelling mode (so now it's an option box with 3 choices)

    get showXP() {
        return !game.settings.get('dnd5e', 'disableExperienceTracking');
    }
replaced the function with :
    get showXP() {
        return ! (game.settings.get('dnd5e', 'levelingMode') == 'noxp' );
//        return !game.settings.get('dnd5e', 'disableExperienceTracking');
    }
to resume testing .. seems to work like a charm so far...

Thanks, seems to work here, just in time for tonight's game!

@thystra
Copy link

thystra commented Sep 27, 2024

Is this fix something that we will need to manually do or will it be pushed out as an update?

@PhilippWitzmann
Copy link

@thystra you can do it manually for now (edit the file mentioned above in your foundry installation) and wait for someone to properly fix this in a PR

PhilippWitzmann added a commit to PhilippWitzmann/monks-tokenbar that referenced this issue Oct 1, 2024
@Nedrapter
Copy link

Any updates on this issue? I miss the Tokenbar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants