Skip to content

Commit

Permalink
Always register all settings, but toggle visibility using config
Browse files Browse the repository at this point in the history
  • Loading branch information
janssen-io committed Jul 13, 2020
1 parent 93c827e commit 0a3120b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion PATCH_NOTES.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- Bug fix: Macros disappear from Custom Hotbar
- Always register all settings, but toggle visibility using `config`
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1 align="center">Token Hotbar</h1>
<p align="center">
<img src="https://github.com/janssen-io/foundry-token-hotbar/workflows/TokenHotbar%20CI/badge.svg" alt="build status" /> <img src="https://img.shields.io/github/downloads-pre/janssen-io/foundry-token-hotbar/v4.0.3/TokenHotbar.zip?label=v4.0.3" alt="v4.0.3 downloads" />
<img src="https://github.com/janssen-io/foundry-token-hotbar/workflows/TokenHotbar%20CI/badge.svg" alt="build status" /> <img src="https://img.shields.io/github/downloads-pre/janssen-io/foundry-token-hotbar/v4.0.4/TokenHotbar.zip?label=v4.0.4" alt="v4.0.4 downloads" />
</p>

Using this Foundry VTT module, you can assign one of the hotbar pages to remember macros per token.
Expand Down
19 changes: 9 additions & 10 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,15 @@ Hooks.on('init', () => {
game.settings.set(CONSTANTS.module.name, Settings.keys.useCustomHotbar, false);
}

if (!game.settings.get(CONSTANTS.module.name, Settings.keys.useCustomHotbar))
game.settings.register(CONSTANTS.module.name, Settings.keys.hotbarPage, {
name: 'TokenHotbar.settings.page.name',
hint: 'TokenHotbar.settings.page.hint',
scope: 'world',
config: true,
default: 5,
type: Number,
range: { min: 1, max: 5, step: 1 }
});
game.settings.register(CONSTANTS.module.name, Settings.keys.hotbarPage, {
name: 'TokenHotbar.settings.page.name',
hint: 'TokenHotbar.settings.page.hint',
scope: 'world',
config: !game.settings.get(CONSTANTS.module.name, Settings.keys.useCustomHotbar),
default: 5,
type: Number,
range: { min: 1, max: 5, step: 1 }
});

game.settings.register(CONSTANTS.module.name, Settings.keys.linkToLinkedActor, {
name: 'TokenHotbar.settings.linkToActor.name',
Expand Down

0 comments on commit 0a3120b

Please sign in to comment.