Skip to content

Comments

[#6661] More generalized and configurable rest management#6709

Open
Aioros wants to merge 1 commit intofoundryvtt:5.3.xfrom
Aioros:rest-config-improvements
Open

[#6661] More generalized and configurable rest management#6709
Aioros wants to merge 1 commit intofoundryvtt:5.3.xfrom
Aioros:rest-config-improvements

Conversation

@Aioros
Copy link
Contributor

@Aioros Aioros commented Feb 9, 2026

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 type to compose their actual name. If that's too questionable, we might want to switch to a fixed generic name plus specific ones for types short and long.

Closes #6661

@Fyorl Fyorl added the strategic Requires sign-off from a core Foundry VTT developer before merge. label Feb 10, 2026
Copy link
Contributor

@krbz999 krbz999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a mergeObject here might mutate the dialogClass. It might need to be moved outside.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium strategic Requires sign-off from a core Foundry VTT developer before merge. system: rests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rest buttons do not infer from CONFIG

4 participants