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

Development flag is attached before the roll results are displayed #1548

Open
3 tasks done
ryotai-trpg opened this issue May 30, 2024 · 1 comment
Open
3 tasks done
Labels
bug Something isn't working dice-so-nice DsN related issue

Comments

@ryotai-trpg
Copy link
Contributor

Prerequisites.

Description.

When XP gain is on and "Display chat message immediately" option in the Dice So Nice module is disabled, the development flag is displayed before the role result is displayed and the success or failure of the skill is known.

Expected Behavior.

The development flag appear at the same time as chat cards.

Possible Fix.

Changing flagForDevelopement() in the link part of module/check.js as follows works pseudo.
I'm a JavaScript newbie, so there must be a better way.
https://github.com/Miskatonic-Investigative-Society/CoC7-FoundryVTT/blob/develop/module/check.js#L1423-L1426

before

  async flagForDevelopement () {
    this.flaggedForDevelopment = true
    if (this.skill) await this.skill.flagForDevelopement()
  }

after

  async flagForDevelopement () {
    if (game.modules.get('dice-so-nice')?.active && !game.settings.get("dice-so-nice", "immediatelyDisplayChatMessages")) {
      await new Promise(resolve => setTimeout(resolve, 2500))
    }
    this.flaggedForDevelopment = true
    if (this.skill) await this.skill.flagForDevelopement()
  }
@ryotai-trpg ryotai-trpg added the bug Something isn't working label May 30, 2024
@snap01 snap01 added dice-so-nice DsN related issue labels Jun 7, 2024
@snap01
Copy link
Collaborator

snap01 commented Jun 7, 2024

This function is called from multiple places. A refactor of the check system is needed to call this function at a later point depending on method of showing the 3d dice. This will not be completed before the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dice-so-nice DsN related issue
Projects
None yet
Development

No branches or pull requests

2 participants