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

move time only changes time after clicking stop advancing time [BUG] #576

Closed
dharkus5000 opened this issue Feb 7, 2024 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dharkus5000
Copy link

Describe the bug
today when i got in game simple calendar opened automatically as usual, i later pressed esc and accidentally closed it and reopened it from the settings, from then on the time would only change after clicking move time (forwards or backwards) after clicking stop advancing time button, at which point the amounts of time i'd added to the time updated properly, incl if i'd clicked a button multiple times while the time wasn't changing

Foundry Information

  • Foundry Version: 11.315
  • Game System: PF2e 5.13.3
  • Simple Calendar Version: 2.4.3
  • Simple Calendar Configuration: using in compact mode, have changed names of months in golarion calendar to reflect a tian-xia campaign

Browser (please complete the following information):

  • FF 122.0 (update is available...)
@dharkus5000 dharkus5000 added the bug Something isn't working label Feb 7, 2024
@rapus95
Copy link

rapus95 commented Feb 23, 2024

I also get this issue for dnd5e with the default calendar. Simple Calendar only updates its visuals when the real time clock ticks. So once per second and only if the real time progression is enabled. As soon as you stop the real time progression, it won't update day or time even if using the simple calendar buttons to progress an hour or a day. Meanwhile, the smalltime window right next to it successfully updates on each click within simple calendar in live sync.

It's as if the update script/event/hook was lost somewhere. So there are no updates except for the scheduled ones that depend on the setting within here (2nd from bottom, update frequency):
image

Ideally, we could enter 0 to have it update live. Instead of only when the time progression counter ticks.

@rapus95
Copy link

rapus95 commented Feb 23, 2024

After diving into it a bit more, I guess there's the problem:

  this.setDateTime(parsedDate, { updateApp: false, sync: false, save: GameSettings.IsGm() && SC.primary });

https://github.com/vigoren/foundryvtt-simple-calendar/blob/main/src/classes/calendar/index.ts#L1240

  this.setDateTime(parsedDate, { updateApp: false, sync: false, save: GameSettings.IsGm() && SC.primary });

https://github.com/vigoren/foundryvtt-simple-calendar/blob/main/src/classes/calendar/index.ts#L1253

In both of these lines, we have updateApp: false which simply never updates the ui as far as I understand it.

While the time progression runs, this line is executed:

  this.setDateTime(parsedDate, {
    updateApp: this.time.updateFrequency * this.time.gameTimeRatio !== changeAmount,
    sync: false,
    save: false,
    bypassPermissionCheck: true
  });

https://github.com/vigoren/foundryvtt-simple-calendar/blob/main/src/classes/calendar/index.ts#L1220-L1225
which sometimes evaluates to true in the argument of updateApp.

Thus, the proposal is: change both updateApp: false lines to updateApp: true.

@rapus95
Copy link

rapus95 commented Feb 23, 2024

Having edited both lines to true with Chrome Dev Tools, made the clock update again. But then deleting my changes, refreshing the page and even trying in an incognito browser, it kept working... Which is weird.

So I'm back at the beginning and have no clue what the problem is.

@vigoren
Copy link
Owner

vigoren commented Feb 28, 2024

I will be digging into this issue, and a few others, over the weekend when I have some free time.

@vigoren
Copy link
Owner

vigoren commented Mar 3, 2024

I have found the issue and will be releasing a fix for it in a couple of days (after I fix up a few other things)

@vigoren
Copy link
Owner

vigoren commented Mar 8, 2024

This has been fixed in version 2.4.8!

@vigoren vigoren closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants