Add tweak to allow changing the right-sidebar tab order #46

Merged
Oliver merged 7 commits from feature/rearrange-sidebar-tabs into main 2026-02-27 06:06:42 +00:00
Showing only changes of commit a682048852 - Show all commits

View file

@ -32,8 +32,32 @@ export function rearrangeSidebarTabs() {
// #endregion Registration // #endregion Registration
// #region Implementation // #region Implementation
// TODO: do this updateTabOrder();
// #endregion Implementation // #endregion Implementation
status[key] = SettingStatusEnum.Registered; 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;
};