mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-31 03:33:36 -05:00
Discord Reverted The Sound Stuff
This commit is contained in:
parent
eacb748570
commit
4b66c4e72e
1 changed files with 4 additions and 17 deletions
|
@ -10,7 +10,7 @@ import { DataStore } from "@api/index";
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs, EquicordDevs } from "@utils/constants";
|
import { Devs, EquicordDevs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { Alerts, React } from "@webpack/common";
|
import { React } from "@webpack/common";
|
||||||
|
|
||||||
import { SoundOverrideComponent } from "./components/SoundOverrideComponent";
|
import { SoundOverrideComponent } from "./components/SoundOverrideComponent";
|
||||||
import { makeEmptyOverride, SoundOverride, soundTypes } from "./types";
|
import { makeEmptyOverride, SoundOverride, soundTypes } from "./types";
|
||||||
|
@ -55,12 +55,12 @@ export default definePlugin({
|
||||||
patches: [
|
patches: [
|
||||||
// sound class
|
// sound class
|
||||||
{
|
{
|
||||||
find: '"_ensureAudioPromise"',
|
find: 'Error("could not play audio")',
|
||||||
replacement: [
|
replacement: [
|
||||||
// override URL
|
// override URL
|
||||||
{
|
{
|
||||||
match: /\i\([0-9]+\)\(.{1,20}(\i),"\.mp3"\)/,
|
match: /(?<=new Audio;\i\.src=)\i\([0-9]+\)\(.{0,20}\(this\.name,"\.mp3"\)/,
|
||||||
replace: "$self.findOverride($1)?.url || $&"
|
replace: "$self.findOverride(this.name)?.url || $&"
|
||||||
},
|
},
|
||||||
// override volume
|
// override volume
|
||||||
{
|
{
|
||||||
|
@ -81,19 +81,6 @@ export default definePlugin({
|
||||||
settings,
|
settings,
|
||||||
findOverride,
|
findOverride,
|
||||||
isOverriden,
|
isOverriden,
|
||||||
afterSave() {
|
|
||||||
Alerts.show({
|
|
||||||
title: "Restart required",
|
|
||||||
body: (
|
|
||||||
<>
|
|
||||||
<p>CustomSounds requires a restart for settings to activate.</p>
|
|
||||||
</>
|
|
||||||
),
|
|
||||||
confirmText: "Restart now",
|
|
||||||
cancelText: "Later!",
|
|
||||||
onConfirm: () => location.reload()
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async start() {
|
async start() {
|
||||||
overrides = await DataStore.get(OVERRIDES_KEY) ?? {};
|
overrides = await DataStore.get(OVERRIDES_KEY) ?? {};
|
||||||
for (const type of soundTypes)
|
for (const type of soundTypes)
|
||||||
|
|
Loading…
Reference in a new issue