This commit is contained in:
Mirco Wittrien 2020-07-29 18:13:00 +02:00
parent c4fcb6308a
commit 7927389a7c
4 changed files with 32 additions and 25 deletions

View File

@ -185,7 +185,7 @@
if (!pluginName || !url) return;
let updateNotice = document.querySelector("#pluginNotice");
if (!updateNotice) {
updateNotice = BDFDB.NotificationUtils.notice(`${BDFDB.LanguageUtils.LibraryStrings.update_notice_update}&nbsp;&nbsp;<strong id="outdatedPlugins"></strong>`, {html:true, id:"pluginNotice", type:"info", btn:!BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) ? BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD : "", customicon:`<svg height="100%" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path style="filter: url(#shadow3)" d="M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z" fill="#171717" opacity="1"/><path style="filter: url(#shadow2)" d="M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z" fill="#3E82E5" opacity="1"/><path style="filter: url(#shadow1)" d="M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z" fill="#FFFFFF" opacity="1"/></g></svg>`});
updateNotice = BDFDB.NotificationUtils.notice(`${BDFDB.LanguageUtils.LibraryStrings.update_notice_update}&nbsp;&nbsp;&nbsp;&nbsp;<strong id="outdatedPlugins"></strong>`, {html:true, id:"pluginNotice", type:"info", btn:!BDFDB.BDUtils.getSettings(BDFDB.BDUtils.settingsIds.automaticLoading) ? BDFDB.LanguageUtils.LanguageStrings.ERRORS_RELOAD : "", customicon:`<svg height="100%" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" width="100%" version="1.1" viewBox="0 0 2000 2000"><metadata /><defs><filter id="shadow1"><feDropShadow dx="20" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter><filter id="shadow2"><feDropShadow dx="15" dy="0" stdDeviation="20" flood-color="rgba(255,255,255,0.15)"/></filter><filter id="shadow3"><feDropShadow dx="10" dy="0" stdDeviation="20" flood-color="rgba(0,0,0,0.35)"/></filter></defs><g><path style="filter: url(#shadow3)" d="M1195.44+135.442L1195.44+135.442L997.6+136.442C1024.2+149.742+1170.34+163.542+1193.64+179.742C1264.34+228.842+1319.74+291.242+1358.24+365.042C1398.14+441.642+1419.74+530.642+1422.54+629.642L1422.54+630.842L1422.54+632.042C1422.54+773.142+1422.54+1228.14+1422.54+1369.14L1422.54+1370.34L1422.54+1371.54C1419.84+1470.54+1398.24+1559.54+1358.24+1636.14C1319.74+1709.94+1264.44+1772.34+1193.64+1821.44C1171.04+1837.14+1025.7+1850.54+1000+1863.54L1193.54+1864.54C1539.74+1866.44+1864.54+1693.34+1864.54+1296.64L1864.54+716.942C1866.44+312.442+1541.64+135.442+1195.44+135.442Z" fill="#171717" opacity="1"/><path style="filter: url(#shadow2)" d="M1695.54+631.442C1685.84+278.042+1409.34+135.442+1052.94+135.442L361.74+136.442L803.74+490.442L1060.74+490.442C1335.24+490.442+1335.24+835.342+1060.74+835.342L1060.74+1164.84C1150.22+1164.84+1210.53+1201.48+1241.68+1250.87C1306.07+1353+1245.76+1509.64+1060.74+1509.64L361.74+1863.54L1052.94+1864.54C1409.24+1864.54+1685.74+1721.94+1695.54+1368.54C1695.54+1205.94+1651.04+1084.44+1572.64+999.942C1651.04+915.542+1695.54+794.042+1695.54+631.442Z" fill="#3E82E5" opacity="1"/><path style="filter: url(#shadow1)" d="M1469.25+631.442C1459.55+278.042+1183.05+135.442+826.65+135.442L135.45+135.442L135.45+1004C135.45+1004+135.427+1255.21+355.626+1255.21C575.825+1255.21+575.848+1004+575.848+1004L577.45+490.442L834.45+490.442C1108.95+490.442+1108.95+835.342+834.45+835.342L664.65+835.342L664.65+1164.84L834.45+1164.84C923.932+1164.84+984.244+1201.48+1015.39+1250.87C1079.78+1353+1019.47+1509.64+834.45+1509.64L135.45+1509.64L135.45+1864.54L826.65+1864.54C1182.95+1864.54+1459.45+1721.94+1469.25+1368.54C1469.25+1205.94+1424.75+1084.44+1346.35+999.942C1424.75+915.542+1469.25+794.042+1469.25+631.442Z" fill="#FFFFFF" opacity="1"/></g></svg>`});
updateNotice.style.setProperty("display", "block", "important");
updateNotice.style.setProperty("visibility", "visible", "important");
updateNotice.style.setProperty("opacity", "1", "important");
@ -3893,7 +3893,7 @@
BDFDB.BDUtils = {};
BDFDB.BDUtils.getPluginsFolder = function () {
if (LibraryRequires.process.env.injDir) return LibraryRequires.path.resolve(LibraryRequires.process.env.injDir, "plugins/");
switch (LibraryRequires.process.platform) {
else switch (LibraryRequires.process.platform) {
case "win32":
return LibraryRequires.path.resolve(LibraryRequires.process.env.appdata, "BetterDiscord/plugins/");
case "darwin":
@ -3905,7 +3905,7 @@
};
BDFDB.BDUtils.getThemesFolder = function () {
if (LibraryRequires.process.env.injDir) return LibraryRequires.path.resolve(LibraryRequires.process.env.injDir, "plugins/");
switch (LibraryRequires.process.platform) {
else switch (LibraryRequires.process.platform) {
case "win32":
return LibraryRequires.path.resolve(LibraryRequires.process.env.appdata, "BetterDiscord/themes/");
case "darwin":
@ -3915,30 +3915,23 @@
else return LibraryRequires.path.resolve(LibraryRequires.process.env.HOME, ".config/BetterDiscord/themes/");
}
};
BDFDB.BDUtils.checkRepoPage = function (usersettings = document.querySelector(BDFDB.dotCN.layer + `[layer-id="user-settings"]`)) {
if (!usersettings) return;
let folderbutton = usersettings.querySelector(BDFDB.dotCN._repofolderbutton);
if (!folderbutton) return;
let header = folderbutton.parentElement.querySelector("h2");
if (header && header.innerText) {
let headerText = header.innerText.toLowerCase();
if (headerText === "plugins" || headerText === "themes") return headerText;
}
};
BDFDB.BDUtils.isPluginEnabled = function (pluginName) {
if (BdApi.Plugins && typeof BdApi.Plugins.isEnabled == "function") return BdApi.Plugins.isEnabled(pluginName);
if (!window.BdApi) return null;
else if (BdApi.Plugins && typeof BdApi.Plugins.isEnabled == "function") return BdApi.Plugins.isEnabled(pluginName);
else if (typeof BdApi.isPluginEnabled == "function") return BdApi.isPluginEnabled(pluginName);
};
BDFDB.BDUtils.enablePlugin = function (pluginName) {
if (BdApi.Plugins && typeof BdApi.Plugins.enable == "function") BdApi.Plugins.enable(pluginName);
if (!window.BdApi) return;
else if (BdApi.Plugins && typeof BdApi.Plugins.enable == "function") BdApi.Plugins.enable(pluginName);
else if (window.pluginModule) window.pluginModule.startPlugin(pluginName);
};
BDFDB.BDUtils.disablePlugin = function (pluginName) {
if (BdApi.Plugins && typeof BdApi.Plugins.disable == "function") BdApi.Plugins.disable(pluginName);
if (!window.BdApi) return;
else if (BdApi.Plugins && typeof BdApi.Plugins.disable == "function") BdApi.Plugins.disable(pluginName);
else if (window.pluginModule) window.pluginModule.stopPlugin(pluginName);
};
BDFDB.BDUtils.getPlugin = function (pluginName, hasToBeEnabled = false, overHead = false) {
if (!hasToBeEnabled || BDFDB.BDUtils.isPluginEnabled(pluginName)) {
if (window.BdApi && !hasToBeEnabled || BDFDB.BDUtils.isPluginEnabled(pluginName)) {
if (BdApi.Plugins.get && typeof BdApi.Plugins.get == "function") {
let plugin = BdApi.Plugins.get(pluginName);
if (overHead) return plugin ? {filename: LibraryRequires.fs.existsSync(LibraryRequires.path.join(BDFDB.BDUtils.getPluginsFolder(), `${pluginName}.plugin.js`)) ? `${pluginName}.plugin.js` : null, id: pluginName, name: pluginName, plugin: plugin} : null;
@ -3949,25 +3942,28 @@
return null;
};
BDFDB.BDUtils.isThemeEnabled = function (themeName) {
if (BdApi.Themes && typeof BdApi.Themes.isEnabled == "function") return BdApi.Themes.isEnabled(themeName);
if (!window.BdApi) return null;
else if (BdApi.Themes && typeof BdApi.Themes.isEnabled == "function") return BdApi.Themes.isEnabled(themeName);
else if (typeof BdApi.isThemeEnabled == "function") return BdApi.isThemeEnabled(themeName);
};
BDFDB.BDUtils.enableTheme = function (themeName) {
if (BdApi.Themes && typeof BdApi.Themes.enable == "function") BdApi.Themes.enable(themeName);
if (!window.BdApi) return;
else if (BdApi.Themes && typeof BdApi.Themes.enable == "function") BdApi.Themes.enable(themeName);
else if (window.themeModule) window.themeModule.enableTheme(themeName);
};
BDFDB.BDUtils.disableTheme = function (themeName) {
if (BdApi.Themes && typeof BdApi.Themes.disable == "function") BdApi.Themes.disable(themeName);
if (!window.BdApi) return;
else if (BdApi.Themes && typeof BdApi.Themes.disable == "function") BdApi.Themes.disable(themeName);
else if (window.themeModule) window.themeModule.disableTheme(themeName);
};
BDFDB.BDUtils.getTheme = function (themeName, hasToBeEnabled = false) {
if (!hasToBeEnabled || BDFDB.BDUtils.isThemeEnabled(themeName)) {
if (window.BdApi && !hasToBeEnabled || BDFDB.BDUtils.isThemeEnabled(themeName)) {
if (BdApi.Themes && typeof BdApi.Themes.get == "function") return BdApi.Themes.get(themeName);
else if (window.bdthemes) window.bdthemes[themeName];
}
return null;
};
let oldSettings = !BDFDB.ArrayUtils.is(BdApi.settings);
let oldSettings = window.BdApi && !BDFDB.ArrayUtils.is(BdApi.settings);
BDFDB.BDUtils.settingsIds = oldSettings ? {
automaticLoading: "fork-ps-5",
coloredText: "bda-gs-7",
@ -3980,7 +3976,7 @@
showToasts: "settings.general.showToasts"
};
BDFDB.BDUtils.toggleSettings = function (key, state) {
if (typeof key == "string") {
if (window.BdApi && typeof key == "string") {
let path = key.split(".");
let currentState = BDFDB.BDUtils.getSettings(key);
if (state === true) {
@ -3993,6 +3989,7 @@
}
};
BDFDB.BDUtils.getSettings = function (key) {
if (!window.BdApi) return {};
if (typeof key == "string") return BdApi.isSettingEnabled(...key.split("."));
else return oldSettings ? BDFDB.ReactUtils.getValue(BdApi.getBDData("settings"), `${BDFDB.DiscordUtils.getBuilt()}.settings`) : BdApi.settings.map(n => n.settings.map(m => m.settings.map(l => ({id: [n.id, m.id, l.id].join("."), value:l.value})))).flat(10).reduce((newObj, setting) => (newObj[setting.id] = setting.value, newObj), {});
};
@ -4455,6 +4452,7 @@
DiscordClassModules.MenuReactButton = BDFDB.ModuleUtils.findByProperties("wrapper", "icon", "focused");
DiscordClassModules.MenuSlider = BDFDB.ModuleUtils.findByProperties("slider", "sliderContainer");
DiscordClassModules.Member = BDFDB.ModuleUtils.findByProperties("member", "ownerIcon");
DiscordClassModules.MembersThreads = BDFDB.ModuleUtils.findByProperties("tabBar", "thread");
DiscordClassModules.MembersWrap = BDFDB.ModuleUtils.findByProperties("membersWrap", "membersGroup");
DiscordClassModules.Message = BDFDB.ModuleUtils.findByProperties("message", "mentioned");
DiscordClassModules.MessageAccessory = BDFDB.ModuleUtils.findByProperties("embedWrapper", "gifFavoriteButton");
@ -5398,6 +5396,8 @@
memberpremiumicon: ["Member", "premiumIcon"],
members: ["MembersWrap", "members"],
membersgroup: ["MembersWrap", "membersGroup"],
memberstabbar: ["MembersThreads", "tabBar"],
membersthread: ["MembersThreads", "thread"],
memberswrap: ["MembersWrap", "membersWrap"],
memberusername: ["Member", "roleColor"],
mention: ["NotFound", "mention"],
@ -10020,6 +10020,9 @@
}
}
#pluginNotice .notice-message {
white-space: pre;
}
#pluginNotice #outdatedPlugins span {
-webkit-app-region: no-drag;
color: #FFF;
@ -10425,7 +10428,7 @@
};
InternalBDFDB.forceUpdateAll = function () {
settings = BDFDB.DataUtils.get(this, "settings");
if (LibraryRequires.path) settings = BDFDB.DataUtils.get(this, "settings");
BDFDB.MessageUtils.rerenderAll();
BDFDB.ModuleUtils.forceAllUpdates(BDFDB);

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,7 @@ body,
#app-mount REPLACE_CLASS_channels,
#app-mount REPLACE_CLASS_channelpanels,
#app-mount REPLACE_CLASS_memberswrap,
#app-mount REPLACE_CLASS_memberstabbar,
#app-mount REPLACE_CLASS_peoplesnowplayingcolumn {
background-color: rgba(0, 0, 0, 0.2);
}

View File

@ -205,6 +205,9 @@ body, /* body */
#app-mount .membersWrap-2h-GB4 { /* members container */
background-color: rgba(var(--vtransparencycolor), var(--vmemberlisttransparency));
}
#app-mount .tabBar-fg4VK9 { /* members tabbar */
background-color: rgba(var(--vtransparencycolor), var(--vmemberlisttransparency));
}
#app-mount .nowPlayingColumn-2sl4cE { /* peoples now playing */
background-color: rgba(var(--vtransparencycolor), var(--vmemberlisttransparency));
}