From e8af9d47ae23ca445c0258087d93f49a3fe80cde Mon Sep 17 00:00:00 2001 From: EMERALD Date: Sat, 27 Aug 2022 16:34:53 -0500 Subject: [PATCH] Remove deprecated reload plugin button --- src/index.tsx | 58 --------------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 9608148..a1516dc 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -28,7 +28,6 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { gamesRunning, setActiveSound, soundPacks, - setSoundPacks, menuMusic, setMenuMusic, selectedMusic, @@ -62,54 +61,6 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { } } - function reloadPlugin() { - dummyFuncTest(); - python.resolve(python.reloadPacksDir(), () => { - python.resolve(python.getSoundPacks(), (data: any) => { - setSoundPacks(data); - }); - }); - - python.resolve(python.getConfig(), (data: any) => { - // This just has fallbacks incase the fetch fails or the config is improperly formatted - setActiveSound(data?.selected_pack || "Default"); - setSelectedMusic(data?.selected_music || "None"); - }); - - restartMusicPlayer(selectedMusic); - - unpatch( - AudioParent.GamepadUIAudio.m_AudioPlaybackManager.__proto__, - "PlayAudioURL" - ); - - beforePatch( - AudioParent.GamepadUIAudio.m_AudioPlaybackManager.__proto__, - "PlayAudioURL", - (args) => { - let newSoundURL: string = ""; - switch (activeSound) { - case "Default": - newSoundURL = args[0]; - break; - default: - const currentPack = soundPacks.find((e) => e.name === activeSound); - if (currentPack?.ignore.includes(args[0].slice(8))) { - newSoundURL = args[0]; - break; - } - newSoundURL = args[0].replace( - "sounds/", - `sounds_custom/${currentPack?.path || "/error"}/` - ); - break; - } - args[0] = newSoundURL; - return [newSoundURL]; - } - ); - } - const SoundPackDropdownOptions = useMemo(() => { return [ { label: "Default", data: -1 }, @@ -208,15 +159,6 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { Manage Packs - - reloadPlugin()} - > - Reload Plugin - - );