EndlessFractal / yourTurn

Foundry Module that adds a visual display whenever the turn changes.
5 stars 2 forks source link

Hidden Actors setting toggle for not showing "Something Happens" does not function #11

Closed Arianya closed 5 months ago

Arianya commented 5 months ago

Under current coding in main.js the following occurs:

} else if (combat.combatant.hidden) {
        if (!game.user.isGM && (!Settings.getHideNextUpHidden() || Settings.getHideNextUpHidden())) {
                ytText = game.i18n.localize("YOUR-TURN.SomethingHappens");
                this.showHidden();
        } else {
                this.hideBanner();
                return;

Based on testing, this means that if a player ends their turn, the Something Happens banner is displayed if the next actor is hidden, but if the GM(s) are the one to end their turn, then nothing is displayed - however the behaviour in both cases may not be desirable, in such cases as:

By the wording of the current setting "Hide Next Up for Hidden enemies", it sounds like this is the intent - that if you have this enabled, the first use case should be done, and if not, the second - but the OR operator in (!Settings.getHideNextUpHidden() || Settings.getHideNextUpHidden()) is effectively showing this banner whether the relevant setting is enabled or not.

I don't have an environment set up to test this currently, but seems like a pretty quick easy win unless I've missed something.

EndlessFractal commented 5 months ago

You are correct!

The condition (!Settings.getHideNextUpHidden() || Settings.getHideNextUpHidden()) effectively always evaluates to true. Therefore, the banner "Something Happens" will always be shown when the combatant is hidden, regardless of the setting.

Will be fixed on 1.2.12, among other small things I've found.

Cheers!