Skip to content

Commit

Permalink
Refactor again
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Sep 18, 2024
1 parent ec8165f commit 70bcd97
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 2 deletions.
10 changes: 9 additions & 1 deletion scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ import { localize, MODULE_ID, registerSetting } from "./helpers/misc.js";
import { SettingsConfigForm } from "./helpers/settingsConfigForm.js";

Hooks.on("init", () => {
loadTemplates([`modules/pf2e-rpg-numbers/templates/pf2e-rpg-settings-config.hbs`, 'modules/pf2e-rpg-numbers/templates/settings-tabs/main-tab.hbs'])
loadTemplates([
`modules/pf2e-rpg-numbers/templates/settings/pf2e-rpg-settings-config.hbs`,
'modules/pf2e-rpg-numbers/templates/settings/tabs/home.hbs',
'modules/pf2e-rpg-numbers/templates/settings/tabs/critical.hbs',
'modules/pf2e-rpg-numbers/templates/settings/tabs/misc.hbs',
'modules/pf2e-rpg-numbers/templates/settings/tabs/rolls.hbs',
'modules/pf2e-rpg-numbers/templates/settings/tabs/text.hbs',
'modules/pf2e-rpg-numbers/templates/settings/tabs/token.hbs'
])
Hooks.on("renderSettingsConfig", renderSettingsConfig);
//TODO finalize this
// game.settings.registerMenu(mod, 'settingsMenu', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,22 @@
<div class="tab" data-tab="{{tab.id}}" data-group="primary-tabs">
Fixed content for tab {{tab.title}}<br>
{{#if home}}
{{> 'modules/pf2e-rpg-numbers/templates/settings-tabs/main-tab.hbs' this}}
{{> 'modules/pf2e-rpg-numbers/templates/settings/tabs/home.hbs' this}}
{{/if}}
{{#if rolls}}
{{> 'modules/pf2e-rpg-numbers/templates/settings/tabs/rolls.hbs' this}}
{{/if}}
{{#if token}}
{{> 'modules/pf2e-rpg-numbers/templates/settings/tabs/token.hbs' this}}
{{/if}}
{{#if critical}}
{{> 'modules/pf2e-rpg-numbers/templates/settings/tabs/critical.hbs' this}}
{{/if}}
{{#if text}}
{{> 'modules/pf2e-rpg-numbers/templates/settings/tabs/text.hbs' this}}
{{/if}}
{{#if misc}}
{{> 'modules/pf2e-rpg-numbers/templates/settings/tabs/misc.hbs' this}}
{{/if}}
</div>
{{/each}}
Expand Down
5 changes: 5 additions & 0 deletions templates/settings/tabs/critical.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<form>
<h2>Critical</h2>
<h3>{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}</h3>
{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}
</form>
9 changes: 9 additions & 0 deletions templates/settings/tabs/home.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<form>
<h2>RPG #s</h2>
<div class="form-group">
<label for="settings.enabled">{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}</label>
<input type="checkbox" id="settings.enabled" name="settings.enabled" value="{{settings.enabled}}" />
</div>
<h3></h3>
{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}
</form>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<form>
<h2>Misc</h2>
<h3>{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}</h3>
{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}
</form>
5 changes: 5 additions & 0 deletions templates/settings/tabs/rolls.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<form>
<h2>Rolls</h2>
<h3>{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}</h3>
{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}
</form>
5 changes: 5 additions & 0 deletions templates/settings/tabs/text.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<form>
<h2>Text</h2>
<h3>{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}</h3>
{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}
</form>
5 changes: 5 additions & 0 deletions templates/settings/tabs/token.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<form>
<h2>Token</h2>
<h3>{{localize "pf2e-rpg-numbers.module-settings.enabled.name"}}</h3>
{{localize "pf2e-rpg-numbers.module-settings.enabled.hint"}}
</form>

0 comments on commit 70bcd97

Please sign in to comment.