[#6661] More generalized and configurable rest management#6709
Open
Aioros wants to merge 1 commit intofoundryvtt:5.3.xfrom
Open
[#6661] More generalized and configurable rest management#6709Aioros wants to merge 1 commit intofoundryvtt:5.3.xfrom
Aioros wants to merge 1 commit intofoundryvtt:5.3.xfrom
Conversation
krbz999
reviewed
Feb 11, 2026
Contributor
krbz999
left a comment
There was a problem hiding this comment.
Though I've not tested this locally, this would likely unblock some work we would like to implement in Grim Hollow where we have a new type of rest.
| config = foundry.utils.mergeObject({ | ||
| type: "short", dialog: true, chat: true, newDay: false, advanceTime: false, autoHD: false, autoHDThreshold: 3, | ||
| duration: CONFIG.DND5E.restTypes.short.duration[game.settings.get("dnd5e", "restVariant")], | ||
| type, dialog: true, dialogClass: restConfig.dialogClass ?? BaseRestDialog, chat: !!restConfig.chat, |
Contributor
There was a problem hiding this comment.
I think a mergeObject here might mutate the dialogClass. It might need to be moved outside.
Contributor
Author
There was a problem hiding this comment.
Thanks Zhell, but I'll have to admit that I'm not sure what you meant (and take the chance to actually learn something here). What are we trying to avoid?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An attempt to generalize some rest logic to allow developers to define new types of rest that are then directly usable from actor sheets.
Adds a few property to RestTypeConfiguration:
dialog(already present in RestConfiguration);dialogClass(also added to RestConfiguration), to allow a fully custom configuration dialog;chat, which controls the result chat message.Common blocks of the existing rest dialogs have been extracted into partials, which should make it a little easier to integrate into any custom dialog.
One part that I don't feel great about is the generic rest hooks, which use the rest
typeto compose their actual name. If that's too questionable, we might want to switch to a fixed generic name plus specific ones for typesshortandlong.Closes #6661