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

Improve usability of Toggle Compendium Pack Visibility macro #231

Open
12 tasks
Jagusti opened this issue Jun 4, 2023 · 1 comment
Open
12 tasks

Improve usability of Toggle Compendium Pack Visibility macro #231

Jagusti opened this issue Jun 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@Jagusti
Copy link
Owner

Jagusti commented Jun 4, 2023

Context

  • Existing GM Toolkit macro: Toggle Compendium Pack Visibility

What is the motivation or use case?

The Toggle Compendium Pack Visibility macro script can be manually adjusted to restrict to packs from specific sources and/or package types. This change would provide a user interface to make it easier to select or specify constraints and configurations.

From v11, it is also possible to fallback to a defined default ownership configuration, which may be used to quickly reset changes.

What do you expect to happen?

  • Add dialog prompt to allow choice of new ownership levels
    • based on DOCUMENT_OWNERSHIP_LEVELS
    • default to LIMITED for non-GM users and OWNER for GM users
  • Add Reset option to set to Default Pack Ownership settings
  • Add Toggle option to switch between Limited and Observer for selected packs and roles
  • Add option to constrain to one or more package type (eg, "Actor","Item", "JournalEntry", "Scene", "Macro")
  • Add option to restrict to packs from specific sources, either
    • selected WFRP4e module
    • selected other compatible modules
    • manually defined list of modules
    • default: all available packs for the wfrp4e
  • Add Toolkit option to check and offer offer to toggle visibility of newly installed modules on load

Additional context

This probably won't be backwards compatible prior to v11.

References

Spun out of #225

@Jagusti Jagusti added the enhancement New feature or request label Jun 4, 2023
@Jagusti Jagusti added this to the 3 Later: Content Boost milestone Jun 4, 2023
@Jagusti
Copy link
Owner Author

Jagusti commented Jun 4, 2023

Add Toolkit option to check and offer offer to toggle visibility of newly installed modules on load

This might need a cunning / laborious hack, as there's no record of newly installed modules.

If instead I can intercept a save operation on the Module Management form app, ...
(maybe in or around ModuleManagement._updateObjector SettingsConfig.reloadConfirm)

... then I can retrieve the checked list of modules using

ModuleManagement.prototype.getData().modules.filter(m => m.active)

... and compare it with the actually active list of modules using

game.modules.filter(m => m.active)

If there's a meaningful difference, I can set a temporary world flag which I check on reload to prompt the GM about toggling compendium visibility. Once confirmed (either way), I can delete the flag.

There may be some benefit to using the hasPacks property to determine a meaningful difference, as I only really care about those modules with compendia.

ModuleManagement.prototype.getData().modules.filter(m => m.active && m.hasPacks)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant