Remove Vibe

This commit is contained in:
smartfrigde 2023-07-15 14:21:49 +02:00
parent 4074a8ccd5
commit 81cb5093ea
8 changed files with 83 additions and 370 deletions

View file

@ -77,12 +77,21 @@ class RPCServer extends EventEmitter {
case "SET_ACTIVITY":
const {activity, pid} = args; // translate given parameters into what discord dispatch expects
if (!activity)
if (!activity) {
// Activity clear
socket.send?.({
cmd,
data: null,
evt: null,
nonce
});
return this.emit("activity", {
activity: null,
pid,
socketId: socket.socketId.toString()
});
}
const {buttons, timestamps, instance} = activity;

View file

@ -1,7 +1,7 @@
import {contextBridge, ipcRenderer} from "electron";
import {addStyle} from "../utils";
console.log("ArmCord Settings");
console.log(process.platform);
contextBridge.exposeInMainWorld("settings", {
save: (...args: any) => ipcRenderer.send("saveSettings", ...args),
restart: () => ipcRenderer.send("restart"),
@ -13,7 +13,8 @@ contextBridge.exposeInMainWorld("settings", {
openStorageFolder: () => ipcRenderer.send("openStorageFolder"),
openCrashesFolder: () => ipcRenderer.send("openCrashesFolder"),
copyDebugInfo: () => ipcRenderer.send("copyDebugInfo"),
crash: () => ipcRenderer.send("crash")
crash: () => ipcRenderer.send("crash"),
os: process.platform
});
ipcRenderer.on("themeLoader", (_event, message) => {

View file

@ -21,6 +21,7 @@
<option value="" disabled selected hidden data-string="settings-theme"></option>
<option value="default" data-string="settings-theme-default"></option>
<option value="native" data-string="settings-theme-native"></option>
<option value="transparent" windows-exclusive data-string="settings-theme-transparent"></option>
</select>
<p class="header" data-string="settings-theme"></p>
@ -32,6 +33,9 @@
<br />
<b data-string="settings-theme-native"></b> -
<span data-string="settings-theme-desc3"></span>
<br />
<b data-string="settings-theme-transparent"></b> -
<span data-string="settings-theme-desc4"></span>
</div>
</div>
<br />
@ -262,7 +266,11 @@
if (e.tagName == "SELECT") e.value = value;
else e.checked = value;
});
if (settings.os !== "win32") {
document.querySelectorAll("[windows-exclusive]").forEach(async (el) => {
el.disabled = true;
});
}
function saveSettings() {
const elements = Array.from(document.querySelectorAll("[data-setting]"));
const obj = Object.fromEntries(

View file

@ -132,11 +132,7 @@ export async function injectElectronFlags(): Promise<void> {
console.log("No performance modes set");
}
if ((await getConfig("windowStyle")) == "transparent" && process.platform === "win32") {
import("@pyke/vibe").then((vibe) => {
console.log("Transparent mode enabled");
vibe.setup(app);
transparency = true;
});
transparency = true;
}
}
export async function setLang(language: string): Promise<void> {

View file

@ -60,13 +60,10 @@ async function doAfterDefiningTheWindow(): Promise<void> {
mainWindow.hide(); // please don't flashbang the user
}
if (transparency && process.platform === "win32") {
import("@pyke/vibe").then(async (vibe) => {
vibe.applyEffect(mainWindow, "acrylic");
vibe.forceTheme(mainWindow, "dark");
if ((await getConfig("startMinimized")) == false) {
mainWindow.show();
}
});
mainWindow.setBackgroundMaterial("auto");
if ((await getConfig("startMinimized")) == false) {
mainWindow.show();
}
}
let ignoreProtocolWarning = await getConfig("ignoreProtocolWarning");
await checkIfConfigIsBroken();