Skip to content

Conversation

@CarlosFdez
Copy link

@CarlosFdez CarlosFdez commented Aug 15, 2025

Full update to V13, including the typescript types and tests. It also handles unlinked to scene v13 encounters when pausing during combat.

This updates the league foundry-vtt-types to version 13 and makes most of the changes it demands (such as replacing all literal number constants with the const equivalent, StoredDocument to JournalEntry.Stored, filling out flag/hook configs, etc). That update is most of the line diffs. I also removed some casts that are not necessary.

V13 breaking changes that are handled are:

  • Different folder api (folders are a document type)
  • Hiding calendar notes in scene config (if enabled)
  • Scene control buttons api change
  • Combat is now unlinked by default, and apply to all

I'm not super confident in the tests. I made the changes as best I could so that the tests pass, but tests in foundry feel somewhat finicky. The Render Journal Directory was commented out due to that method's change in v13 (folders are one of the big changes I've noticed).

I added a 4th version tag to distinguish from the real one once its finally out. My repo includes test builds with manifest links.

@CarlosFdez CarlosFdez mentioned this pull request Aug 15, 2025
@ottyn
Copy link

ottyn commented Aug 17, 2025

@CarlosFdez Tried the Test 2 version on your repo. It still has the same issue as others that have tried to fix SC. The realtime clock still keeps running during combat instead of pausing even though the setting for pausing during combat is on.

@CarlosFdez
Copy link
Author

out of curiousity, is it an issue in v12 as well? I'll take a look at that soon, I pushed up as soon as I managed to resolve all the type errors. There were so many 😓.

@ottyn
Copy link

ottyn commented Aug 17, 2025

No in v12 the clock would pause when a combat started. On each round advance the clock would advance 6 seconds. When combat ended it would start running the clock normally again.

@CarlosFdez
Copy link
Author

CarlosFdez commented Aug 17, 2025

@ottyn so I used simple calendar primarily for keeping track of notes on days over a year (season of ghosts). Can you send me the settings you used? This is configuration I actually don't use it for, where I prefer to keep it paused at all times.

EDIT: found it, play button!

@ottyn
Copy link

ottyn commented Aug 17, 2025

Here's the config export.
simple-calendar-export.json

@CarlosFdez
Copy link
Author

I've learned why. I need to research what changed in v13, but very likely simple calendar will have to change its settings. I'm down to handle it however @vigoren wants.

Specifically, you need to click this for it to pause. I will need to find out what changed in v13 specifically, but I think they're not linked to the scene by default anymore:
image

My suspicion is that simple calendar needs to allow it for any combat encounter period as an option, now that v13 no longer links scenes by default.

@ottyn
Copy link

ottyn commented Aug 17, 2025

Yep, changing the combat to be linked to the scene fixed the issue. I didn't even realize they changed that in v13 to be defaulted to unlinked. Good to know.

@CarlosFdez
Copy link
Author

While I wait for confirmation on what to do with the pause time thing, I fixed a bug I accidentally introduced while testing the types.

@davelamorte
Copy link

I'm so sorry to be asking this... but how can I pull your version? I usually download the files and replace them.. but in this case I think they need to be processed first as I see .ts and .hbs files...

Thank you for taking the time to help out with this great module!

@CarlosFdez
Copy link
Author

CarlosFdez commented Aug 17, 2025

You can go to the releases tab on my fork, and copy the manifest link. You'll might have to manually delete it when it finally updates for real though, not sure.

For building it, you can install node, and do npm ci followed by npm run build in a terminal (make sure the path is set up in the install), and then copy what's in the dist folder into a folder called foundryvtt-simple-calendar in the foundry modules folder.

@ottyn
Copy link

ottyn commented Aug 17, 2025

As a temporary work-around for the real-time clock/combat issue. I'm using the World Scripter module to add in a world script to link all combats to the active scene. This does work to have it auto-pause time when the combat starts.

// A sample world script to ensure new combats are always linked to the active scene

Hooks.on("createCombat", (combat, options, userId) => {
    // Check if the combat is not already linked to a scene
    if (!combat.scene) {
        // Link the combat to the currently active scene
        combat.update({ scene: canvas.scene.id });
    }
});

@ottyn
Copy link

ottyn commented Aug 17, 2025

@CarlosFdez
Not sure if this is something else you want to look at, but the Settings are doing some weird things. For instance, if you open the Settings window and do Quick Setup, choose the Pathfinder 2e calendar, and then save the configuration. All of the months have the 1st on Moonday instead of being on the day after the previous month ended. In the configuration for Months, in the Advance Settings for each month, it is set to Moonday. If you change it to Default for each month, it will correct the layout to be what you would expect from a normal calendar.

The problem arises that if you go back in to the Settings and change any other setting anywhere and Save Configuration again, it will reset the setting in Months again back to Moonday for each month. That's just one issue I found with the Settings, there may be more.

I did go through and get everything setup properly for the Pathfinder 2E calendar and managed to export it. Including getting the days of the week and lunar cycle setup.

The "startingWeekday": null setting is the one that controls the day each month starts on. By default the Pathfinder 2E calendar has this as Moonday, but if you set it to Default in the Settings, it sets it to null in the config. Not sure if this is what's causing the issue and it should be something else to get it to stick.
simple-calendar-export.json

@CarlosFdez
Copy link
Author

CarlosFdez commented Aug 17, 2025

If this is not an issue on v12 (I really should get a test v12 set up again to verify) I'll check it out later (maybe on monday), thanks for reporting.

@ottyn
Copy link

ottyn commented Aug 18, 2025

If this is not an issue on v12 (I really should get a test v12 set up again to verify) I'll check it out later (maybe on monday), thanks for reporting.

Sorry just saw this. Just went in and checked on v12. It looks like the settings had the same issue on v12. So this isn't an upgrade issue but an existing issue.
#657

@MasterZelgadis
Copy link
Contributor

Hm, I tried to download the v13 fork and replace the simple calendar files with it, but still doesn't work in v13. Console has multiple errors, but the most severe I think is:
Error: Error thrown in hooked function 'bound getSceneControlButtons' for hook 'getSceneControlButtons'. e.find is not a function [Detected 1 package: foundryvtt-simple-calendar(2.4.18.3)] at Hooks.onError (foundry.mjs:23813:24) at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54) at #call (foundry.mjs:23795:36) at Hooks.callAll (foundry.mjs:23750:17) at #prepareControls (foundry.mjs:116156:13) at SceneControls._configureRenderOptions (foundry.mjs:116061:89) at #render (foundry.mjs:27166:10) at #try (foundry.mjs:7154:23) at foundry.mjs:7127:16 at new Promise (<anonymous>) at Semaphore.add (foundry.mjs:7125:12) at SceneControls.render (foundry.mjs:27137:28) at #initialize (foundry.mjs:94461:23) at async #draw (foundry.mjs:94291:5) at async Canvas.draw (foundry.mjs:94153:5) at async Scene.view (foundry.mjs:46090:7) at async Game.initializeCanvas (foundry.mjs:169167:20) at async Game.setupGame (foundry.mjs:168934:5) at async #initializeGameView (foundry.mjs:170361:5) at async Game.initialize (foundry.mjs:168831:5) at async window.addEventListener.once (foundry.mjs:180874:3)Caused by: TypeError: e.find is not a function [Detected 1 package: foundryvtt-simple-calendar(2.4.18.3)] at tt.getSceneControlButtons (index.js:1:172029) at #call (foundry.mjs:23791:20) at Hooks.callAll (foundry.mjs:23750:17) at #prepareControls (foundry.mjs:116156:13) at SceneControls._configureRenderOptions (foundry.mjs:116061:89) at #render (foundry.mjs:27166:10) at #try (foundry.mjs:7154:23) at foundry.mjs:7127:16 at new Promise (<anonymous>) at Semaphore.add (foundry.mjs:7125:12) at SceneControls.render (foundry.mjs:27137:28) at #initialize (foundry.mjs:94461:23) at async #draw (foundry.mjs:94291:5) at async Canvas.draw (foundry.mjs:94153:5) at async Scene.view (foundry.mjs:46090:7) at async Game.initializeCanvas (foundry.mjs:169167:20) at async Game.setupGame (foundry.mjs:168934:5) at async #initializeGameView (foundry.mjs:170361:5) at async Game.initialize (foundry.mjs:168831:5) at async window.addEventListener.once (foundry.mjs:180874:3)

@ottyn
Copy link

ottyn commented Aug 21, 2025

Hm, I tried to download the v13 fork and replace the simple calendar files with it, but still doesn't work in v13. Console has multiple errors, but the most severe I think is: Error: Error thrown in hooked function 'bound getSceneControlButtons' for hook 'getSceneControlButtons'. e.find is not a function [Detected 1 package: foundryvtt-simple-calendar(2.4.18.3)] at Hooks.onError (foundry.mjs:23813:24) at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54) at #call (foundry.mjs:23795:36) at Hooks.callAll (foundry.mjs:23750:17) at #prepareControls (foundry.mjs:116156:13) at SceneControls._configureRenderOptions (foundry.mjs:116061:89) at #render (foundry.mjs:27166:10) at #try (foundry.mjs:7154:23) at foundry.mjs:7127:16 at new Promise (<anonymous>) at Semaphore.add (foundry.mjs:7125:12) at SceneControls.render (foundry.mjs:27137:28) at #initialize (foundry.mjs:94461:23) at async #draw (foundry.mjs:94291:5) at async Canvas.draw (foundry.mjs:94153:5) at async Scene.view (foundry.mjs:46090:7) at async Game.initializeCanvas (foundry.mjs:169167:20) at async Game.setupGame (foundry.mjs:168934:5) at async #initializeGameView (foundry.mjs:170361:5) at async Game.initialize (foundry.mjs:168831:5) at async window.addEventListener.once (foundry.mjs:180874:3)Caused by: TypeError: e.find is not a function [Detected 1 package: foundryvtt-simple-calendar(2.4.18.3)] at tt.getSceneControlButtons (index.js:1:172029) at #call (foundry.mjs:23791:20) at Hooks.callAll (foundry.mjs:23750:17) at #prepareControls (foundry.mjs:116156:13) at SceneControls._configureRenderOptions (foundry.mjs:116061:89) at #render (foundry.mjs:27166:10) at #try (foundry.mjs:7154:23) at foundry.mjs:7127:16 at new Promise (<anonymous>) at Semaphore.add (foundry.mjs:7125:12) at SceneControls.render (foundry.mjs:27137:28) at #initialize (foundry.mjs:94461:23) at async #draw (foundry.mjs:94291:5) at async Canvas.draw (foundry.mjs:94153:5) at async Scene.view (foundry.mjs:46090:7) at async Game.initializeCanvas (foundry.mjs:169167:20) at async Game.setupGame (foundry.mjs:168934:5) at async #initializeGameView (foundry.mjs:170361:5) at async Game.initialize (foundry.mjs:168831:5) at async window.addEventListener.once (foundry.mjs:180874:3)

Try completely uninstalling Simple Calendar and installing Carlos' fork from manifest in Foundry and see if that works. Make sure you clear your browser cache after loading into the world just in case.
https://github.com/CarlosFdez/foundryvtt-simple-calendar/releases/download/v2.4.18.3/module.json

@MasterZelgadis
Copy link
Contributor

MasterZelgadis commented Aug 21, 2025

What happens to the calendars I have created and use in my running games if I do that? Especially for Coriolis I have created a totally custom calendar

@CarlosFdez
Copy link
Author

What happens to the calendars I have created and use in my running games if I do that? Especially for Coriolis I have created a totally custom calendar

Its the same module id, so it should work. the calendar from my season of ghosts game still seems to work.

@MasterZelgadis
Copy link
Contributor

I'll give it a try

@CarlosFdez
Copy link
Author

@ottyn and anyone else, it should now treat unlinked combats as relevant for all scenes. I also moved the checks to a helper and checked in more places, so it should hopefully be resilient in more situations (such as activating a scene with combats if set to active combat). Let me know if there are any areas the checks fail (ex: I just noticed if you link a scene to the non-active scene if set to active, it fails to resume until you change scenes)

@Dyrnwyrm
Copy link

Thanks for the PR, and the hard work fixing issues

@ottyn
Copy link

ottyn commented Aug 27, 2025

@vigoren Any chance of this getting merged soon?

@MasterZelgadis
Copy link
Contributor

Tried removing the original module now and installing this PR via manifest. Worked.

@DoritoBob
Copy link

@CarlosFdez thank you for all the hard work. Glad there is a working version now. Is the old dev gone? What is the way forward the Simple Calendar module? I am not trying to ruffle any feathers, just excited for the future of the platform and the module.

@SteveK30
Copy link

SteveK30 commented Sep 8, 2025

@CarlosFdez Many thnaks for your work. So far it seems working with Symbaroum system as well!

@CarlosFdez
Copy link
Author

@CarlosFdez thank you for all the hard work. Glad there is a working version now. Is the old dev gone? What is the way forward the Simple Calendar module? I am not trying to ruffle any feathers, just excited for the future of the platform and the module.

I have no idea, but until I know I can at least maintain this PR for the duration of the campaign I'm running. After that, well, I dunno.

@SteveK30
Copy link

SteveK30 commented Sep 8, 2025

@CarlosFdez
I would assume the dev is busy lately. Lets see how things going with the updates later.

@AshOfCreativity
Copy link

Bump!

@RavK-ux
Copy link

RavK-ux commented Oct 13, 2025

This is great! Thank you. Simple Calender is a must for all of my games.

@james3dwards
Copy link

Can someone approve this pull requst?

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

Successfully merging this pull request may close these issues.

10 participants