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

config: add config ui for trigger set options #5357

Merged
merged 1 commit into from
Apr 22, 2023
Merged

Conversation

quisquous
Copy link
Owner

This adds a new config entry to trigger sets that can add field entries to the top of the trigger set under the raidboss section in the config ui. Trigger sets must have an id to have any config loaded, saved, or displayed.

Triggers can use data.triggerSetConfig['optionId'] here to access anything listed in the config section by id. The Data type for a trigger set can be extended in a way that will type check ids and add field names.

To avoid naming collisions, not all trigger set config values are loaded. Trigger sets get their own config's values loaded implicitly, but if they need to load some other trigger set's values, they can use loadConfigs and specify other trigger sets by id.

For backwards compat, data.triggerSetConfig contains all saved values (even ones that no longer have a config entry). Also, it is possible to use loadConfigs to load trigger set ids that no longer exist.

To also support backwards compat, ConfigEntry.default can now be a function that reads from options. See the e8s/TEA changes for how this works.

This adds a new `config` entry to trigger sets that can add
field entries to the top of the trigger set under the raidboss
section in the config ui. Trigger sets must have an id to
have any config loaded, saved, or displayed.

Triggers can use `data.triggerSetConfig['optionId']` here
to access anything listed in the `config` section by id.
The `Data` type for a trigger set can be extended in a way
that will type check ids and add field names.

To avoid naming collisions, not all trigger set config values
are loaded. Trigger sets get their own config's values loaded
implicitly, but if they need to load some other trigger set's
values, they can use `loadConfigs` and specify other trigger
sets by id.

For backwards compat, `data.triggerSetConfig` contains all
saved values (even ones that no longer have a `config` entry).
Also, it is possible to use `loadConfigs` to load trigger set
ids that no longer exist.

To also support backwards compat, `ConfigEntry.default` can now
be a function that reads from options. See the e8s/TEA changes
for how this works.
@quisquous
Copy link
Owner Author

@valarnin FYI if you're interested in taking a look

@valarnin
Copy link
Collaborator

I think this PR covered all the points I raised in our conversation. I won't have time to do more than a cursory examination at the code, but it looks good as far as my use cases are concerned.

@quisquous quisquous merged commit f7d621d into main Apr 22, 2023
@quisquous quisquous deleted the triggerset_options branch April 22, 2023 22:06
github-actions bot pushed a commit that referenced this pull request Apr 22, 2023
This adds a new `config` entry to trigger sets that can add field
entries to the top of the trigger set under the raidboss section in the
config ui. Trigger sets must have an id to have any config loaded,
saved, or displayed.

Triggers can use `data.triggerSetConfig['optionId']` here to access
anything listed in the `config` section by id. The `Data` type for a
trigger set can be extended in a way that will type check ids and add
field names.

To avoid naming collisions, not all trigger set config values are
loaded. Trigger sets get their own config's values loaded implicitly,
but if they need to load some other trigger set's values, they can use
`loadConfigs` and specify other trigger sets by id.

For backwards compat, `data.triggerSetConfig` contains all saved values
(even ones that no longer have a `config` entry). Also, it is possible
to use `loadConfigs` to load trigger set ids that no longer exist.

To also support backwards compat, `ConfigEntry.default` can now be a
function that reads from options. See the e8s/TEA changes for how this
works. f7d621d
github-actions bot pushed a commit that referenced this pull request Apr 22, 2023
This adds a new `config` entry to trigger sets that can add field
entries to the top of the trigger set under the raidboss section in the
config ui. Trigger sets must have an id to have any config loaded,
saved, or displayed.

Triggers can use `data.triggerSetConfig['optionId']` here to access
anything listed in the `config` section by id. The `Data` type for a
trigger set can be extended in a way that will type check ids and add
field names.

To avoid naming collisions, not all trigger set config values are
loaded. Trigger sets get their own config's values loaded implicitly,
but if they need to load some other trigger set's values, they can use
`loadConfigs` and specify other trigger sets by id.

For backwards compat, `data.triggerSetConfig` contains all saved values
(even ones that no longer have a `config` entry). Also, it is possible
to use `loadConfigs` to load trigger set ids that no longer exist.

To also support backwards compat, `ConfigEntry.default` can now be a
function that reads from options. See the e8s/TEA changes for how this
works. f7d621d
quisquous added a commit that referenced this pull request Apr 23, 2023
quisquous added a commit that referenced this pull request Apr 23, 2023
quisquous added a commit that referenced this pull request Apr 28, 2023
For trigger set config ui that has a select box, the default was not
being set.  This would only have broken #5367 at this point.

Huge thanks to @Legends0 for a ton of help tracking this down.
quisquous added a commit that referenced this pull request Apr 28, 2023
For trigger set config ui that has a select box, the default was not
being set. This would only have broken #5367 at this point.

Huge thanks to @Legends0 for a ton of help tracking this down.
github-actions bot pushed a commit that referenced this pull request Apr 28, 2023
For trigger set config ui that has a select box, the default was not
being set. This would only have broken #5367 at this point.

Huge thanks to @Legends0 for a ton of help tracking this down. c5c12b1
@Souma-Sumire
Copy link
Contributor

I love this new feature, thanks for developing it.

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.

3 participants