Add tweak to allow changing the right-sidebar tab order #46
1 changed files with 25 additions and 1 deletions
|
|
@ -32,8 +32,32 @@ export function rearrangeSidebarTabs() {
|
|||
// #endregion Registration
|
||||
|
||||
// #region Implementation
|
||||
// TODO: do this
|
||||
updateTabOrder();
|
||||
// #endregion Implementation
|
||||
|
||||
status[key] = SettingStatusEnum.Registered;
|
||||
};
|
||||
|
||||
function updateTabOrder() {
|
||||
const order = game.settings.get(__ID__, `${key}User`)
|
||||
?? game.settings.get(__ID__, `${key}World`)
|
||||
?? null;
|
||||
if (!order) { return };
|
||||
|
||||
const tabs = CONFIG.ui.sidebar.TABS;
|
||||
const replaced = {};
|
||||
|
||||
// Sort all of the tabs that are provided
|
||||
for (const tabID of order) {
|
||||
if (!tabs[tabID]) { continue };
|
||||
replaced[tabID] = tabs[tabID];
|
||||
};
|
||||
|
||||
// Add any tabs that are not in the ordering yet
|
||||
for (const tabID in tabs) {
|
||||
if (replaced[tabID] != null) { continue };
|
||||
replaced[tabID] = tabs[tabID];
|
||||
};
|
||||
|
||||
CONFIG.ui.sidebar.TABS = replaced;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue