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

Feature: Allow GM to Set Default Tabs for Each Actor Type #75

Closed
kgar opened this issue Nov 24, 2023 · 3 comments
Closed

Feature: Allow GM to Set Default Tabs for Each Actor Type #75

kgar opened this issue Nov 24, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@kgar
Copy link
Owner

kgar commented Nov 24, 2023

In Tidy Alpha 0.1.10, I added Tab Selection for the individual actor, available to PCs, NPCs, and vehicles.

Unfortunately, for tables that categorically want simpler NPC sheets, for example, the user has to update each actor individually. If there are some universal reasons not to use tabs by default, then the GM should be able to set default tabs for each actor type, so sheets start with the most agreeable arrangement of default tabs to start, and the user can adjust the tabs for the exceptions to the general tab loadout.

This feature will also open the door for other modules' tabs to be configured as default or not default for a given world, saving on some additional effort.

For now, a selection listbox in Player, NPC, and Vehicle settings tabs will allow GMs to establish the default tabs. The data type will be an array of tab ID strings. This array will default to the current Tidy 5e default tabs for the given actor type. Whenever a list of default tabs is being pulled for tab selection, this list will filter through all registered tabs and apply sorting order.

@kgar kgar added the enhancement New feature or request label Nov 24, 2023
@kgar kgar self-assigned this Nov 24, 2023
@kgar
Copy link
Owner Author

kgar commented Nov 24, 2023

Settings:

image

image

image

@kgar
Copy link
Owner Author

kgar commented Nov 24, 2023

Added "Use Default" to get back to the config's default array of tabs:

image

kgar added a commit that referenced this issue Nov 24, 2023
* Added default tabs config settings to the config settings collection.

* Renamed settings defaultCharacterSheetTab to initialCharacterSheetTab. Same for NPCs and vehicles.

Renamed associated localization key.

Added UI for selecting default tabs for PCs, NPCs, and Vehicles.

Upgraded load and save for Sheet Settings to have room for additional data other than just the raw settings.

Adjusted data type of the default tabs settings to be an array of strings.

Made some adjustments to the application shell generic styles.

* Wired in the default tabs to PCs, NPCs, and vehicles.

Added reset to default functionality for the default tabs configs.

* Refactored and extracted shared code for mapping default tab selection fields. Shared that code across settings form setup and use default button handling.

* Added validation when saving settings.

Extracted `getData()` function in the settings form application.

Added English localization variables for tab selection validation errors.

Removed misc code comments.

* Extracted ListboxSetting component and shared in each actor type setting tab.

Updated Tab Selection to use the configured default tabs when an actor flag is not present.

* Changed the "Use Default" button to "Reset" to distinguish the button's purpose from the "Default Sheet Tabs" verbiage.

Extracted Reset logic to the sheet to keep the scripting in the settings components to a minimum.
@kgar
Copy link
Owner Author

kgar commented Nov 26, 2023

All done. 👏

@kgar kgar closed this as completed Nov 26, 2023
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