Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5830fe9e4b | |||
| 9c19306cc1 |
4 changed files with 16 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ export class DevSettingsMenu extends OFTSettingsMenu {
|
|||
};
|
||||
|
||||
static get _SETTINGS() {
|
||||
if (!categories.has(`dev`)) { return [] };
|
||||
const devSettings = categories.get(`dev`);
|
||||
const settingIDs = [];
|
||||
for (const [settingID, shown] of devSettings.entries()) {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export class HotbarSettingsMenu extends OFTSettingsMenu {
|
|||
};
|
||||
|
||||
static get _SETTINGS() {
|
||||
if (!categories.has(`hotbar`)) { return [] };
|
||||
const settings = categories.get(`hotbar`);
|
||||
const settingIDs = [];
|
||||
for (const [settingID, shown] of settings.entries()) {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,10 @@ export class OFTSettingsMenu extends HAM(ApplicationV2) {
|
|||
};
|
||||
|
||||
static _SETTINGS = [];
|
||||
|
||||
static get isEmpty() {
|
||||
return this._SETTINGS.length === 0;
|
||||
};
|
||||
// #endregion Options
|
||||
|
||||
// #region Data Prep
|
||||
|
|
|
|||
|
|
@ -6,11 +6,19 @@ prevent it from being as attention-grabbing compared to being at the top of the
|
|||
list.
|
||||
*/
|
||||
Hooks.on(`renderSettingsConfig`, (app) => {
|
||||
// MARK: Hide empty menus
|
||||
for (const [key, config] of game.settings.menus) {
|
||||
if (!key.startsWith(__ID__)) { continue };
|
||||
if (config.type.isEmpty) {
|
||||
const entry = app.element.querySelector(`.form-group:has(button[data-key="${key}"])`);
|
||||
entry?.remove();
|
||||
};
|
||||
};
|
||||
|
||||
// MARK: devSettings Menu
|
||||
/** @type {Node | undefined} */
|
||||
const settingList = app.element.querySelector(`.tab[data-group="categories"][data-tab="oft"]`);
|
||||
|
||||
|
||||
// MARK: devSettings Menu
|
||||
/** @type {Node | undefined} */
|
||||
const devSettingsMenu = app.element.querySelector(`.form-group:has(button[data-key="${__ID__}.devSettings"])`);
|
||||
if (settingList && devSettingsMenu) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue