Add some TAF-specific links into the settings sidebar

This commit is contained in:
Oliver 2026-05-10 23:45:00 -06:00
parent 849da4bb54
commit 8cadd8318b
8 changed files with 122 additions and 4 deletions

View file

@ -0,0 +1,30 @@
import { filePath } from "../../consts.mjs";
const { renderTemplate } = foundry.applications.handlebars;
const { Settings } = foundry.applications.sidebar.tabs;
export class TAFSettingsSidebar extends Settings {
// #region Lifecycle
async _onRender() {
// remove the row from the HTML
const systemRow = this.element.querySelector(`.info .system`);
systemRow?.remove();
// add the more customized system info into the sidebar
const systemBlock = this.element.querySelector(`section.system`);
if (!systemBlock) {
const htmlString = await renderTemplate(
filePath(`templates/settings-sidebar-addition.hbs`),
{ system: game.system, },
);
const temp = document.createElement(`div`);
temp.innerHTML = htmlString;
const rendered = temp.firstChild;
const info = this.element.querySelector(`section.info`);
info.insertAdjacentElement(`afterend`, rendered);
};
};
// #endregion Lifecycle
};