forked from xdy/twodsix-foundryvtt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add dropdown with settings for rulesets
Previously the users needed to reference the documentation in order to set the correct values for a given rulset. This change adds a dropdown containing supported rulesets and populates the corresponding settings fields. Part of xdy#183
- Loading branch information
Showing
6 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {TWODSIX} from "../config"; | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
Hooks.on('renderSettingsConfig', async (app, html, data) => { | ||
html.find('[name="twodsix.ruleset"]').on('change', ev => { | ||
const ruleset = ev.target.value; | ||
const rulesetSettings = TWODSIX.RULESETS[ruleset].setttings; | ||
|
||
// Step through each option and update the corresponding field | ||
Object.entries(rulesetSettings).forEach(([settingName, value]) => { | ||
html.find(`[name="twodsix.${settingName}"]`).val(value); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters