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

[#3751] Add ability to automatically manually sort compendiums #5005

Open
wants to merge 1 commit into
base: 4.2.x
Choose a base branch
from

Conversation

arbron
Copy link
Collaborator

@arbron arbron commented Jan 15, 2025

Adds a new compendium flag dnd5e.sorting that sets the default sorting for a compendium if the user hasn't already adjusted the sorting. This allows for setting a compendium to be manually sorted.

To implement this a new setupModulePacks method has been added to the module registration system that is called during setup and sets compendium applications and the sorting mode.

Also adds a new log utility method that adds the "D&D 5e | " prefix automatically with a nice red color to make system-specific logs distinct from Foundry core logs.

Closes #3751

Adds a new compendium flag `dnd5e.sorting` that sets the default
sorting for a compendium if the user hasn't already adjusted the
sorting. This allows for setting a compendium to be manually
sorted.

To implement this a new `setupModulePacks` method has been added
to the module registration system that is called during setup and
sets compendium applications and the sorting mode.

Also adds a new `log` utility method that adds the "D&D 5e | "
prefix automatically with a nice red color to make system-specific
logs distinct from Foundry core logs.

Closes #3751
@arbron arbron added this to the D&D5E 4.2.0 milestone Jan 15, 2025
@arbron arbron self-assigned this Jan 15, 2025
log(`Error setting up ${pack.metadata.label}\n`, { extras: [err.message], level: "error" });
}
}
console.groupEnd();
Copy link
Contributor

Choose a reason for hiding this comment

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

Feel pretty strongly about not using log groups. Too often they hide valuable errors during package development.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, everything in here is synchronous system code, so there isn't really any chance of it hiding module errors.

@arbron arbron modified the milestones: D&D5E 4.2.0, D&D5E 4.3.0 Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Compendium Content] Folder Colors in Spells Compendium
2 participants