diff --git a/src/content/css/discord.css b/src/content/css/discord.css index 495c65d..f46ba2c 100644 --- a/src/content/css/discord.css +++ b/src/content/css/discord.css @@ -31,7 +31,8 @@ } div#themes:after, -div#armcord:after { +div#armcord:after, +div#forceQuit:after { content: url("https://raw.githubusercontent.com/ArmCord/BrandingStuff/main/ac_white_plug16x.png"); margin-right: 5px; } diff --git a/src/preload/preload.ts b/src/preload/preload.ts index 3201da0..5a24b05 100644 --- a/src/preload/preload.ts +++ b/src/preload/preload.ts @@ -100,12 +100,17 @@ setInterval(() => { } const acSettings = advanced.cloneNode(true) as HTMLElement; const tManager = advanced.cloneNode(true) as HTMLElement; + const fQuit = advanced.cloneNode(true) as HTMLElement; acSettings.textContent = "ArmCord"; acSettings.id = "armcord"; acSettings.onclick = () => ipcRenderer.send("openSettingsWindow"); tManager.textContent = "Themes"; tManager.id = "themes"; tManager.onclick = () => ipcRenderer.send("openManagerWindow"); + fQuit.textContent = "Force Quit"; + fQuit.id = "forceQuit"; + fQuit.onclick = () => ipcRenderer.send("win-quit"); advanced.insertAdjacentElement("afterend", acSettings); advanced.insertAdjacentElement("afterend", tManager); + advanced.insertAdjacentElement("afterend", fQuit); }, 1000); diff --git a/src/themeManager/main.ts b/src/themeManager/main.ts index 89feb66..836f53e 100644 --- a/src/themeManager/main.ts +++ b/src/themeManager/main.ts @@ -18,6 +18,8 @@ interface ThemeManifest { patreon?: string; website?: string; source?: string; + updateSrc?: string; + supportsArmCordTitlebar?: boolean; } function parseBDManifest(content: string) { const metaReg = /@([^ ]*) (.*)/g; @@ -161,6 +163,9 @@ export function createTManagerWindow(): void { fs.mkdirSync(themePath); console.log(`Created ${manifest.name} folder`); } + manifest.updateSrc = link; + if (code.includes(".titlebar")) manifest.supportsArmCordTitlebar = true; + else manifest.supportsArmCordTitlebar = false; fs.writeFileSync(path.join(themePath, "manifest.json"), JSON.stringify(manifest)); fs.writeFileSync(path.join(themePath, "src.css"), code); dialog.showMessageBoxSync({ diff --git a/src/themeManager/manager.html b/src/themeManager/manager.html index b7baff6..13f5095 100644 --- a/src/themeManager/manager.html +++ b/src/themeManager/manager.html @@ -280,6 +280,11 @@ .button { margin-right: 10px; } + img.themeInfoIcon { + height: 30px; + position: relative; + top: 5px; + } diff --git a/src/themeManager/preload.ts b/src/themeManager/preload.ts index e7ca51b..d08d6d7 100644 --- a/src/themeManager/preload.ts +++ b/src/themeManager/preload.ts @@ -16,7 +16,6 @@ ipcRenderer.on("themeManifest", (_event, json) => {
${manifest.description}
- ` ); @@ -24,6 +23,32 @@ ipcRenderer.on("themeManifest", (_event, json) => { document.getElementById("themeInfoModal")!.style.display = "block"; document.getElementById("themeInfoName")!.textContent = `${manifest.name} by ${manifest.author}`; document.getElementById("themeInfoDesc")!.textContent = `${manifest.description}\n\n${manifest.version}`; + if (manifest.supportsArmCordTitlebar !== undefined) { + document.getElementById( + "themeInfoButtons" + )!.innerHTML += `