diff --git a/src/dolphin/api.ts b/src/dolphin/api.ts index 649c89120..9296477ce 100644 --- a/src/dolphin/api.ts +++ b/src/dolphin/api.ts @@ -8,7 +8,6 @@ import { ipc_downloadDolphin, ipc_fetchGeckoCodes, ipc_hardResetDolphin, - ipc_importDolphinSettings, ipc_launchNetplayDolphin, ipc_openDolphinSettingsFolder, ipc_removePlayKeyFile, @@ -58,9 +57,6 @@ const dolphinApi: DolphinService = { async launchNetplayDolphin(options: { bootToCss?: boolean }): Promise { await ipc_launchNetplayDolphin.renderer!.trigger(options); }, - async importDolphinSettings(options: { toImportDolphinPath: string; dolphinType: DolphinLaunchType }): Promise { - await ipc_importDolphinSettings.renderer!.trigger(options); - }, async fetchGeckoCodes(dolphinType: DolphinLaunchType): Promise { const { result } = await ipc_fetchGeckoCodes.renderer!.trigger({ dolphinType }); return result.codes; diff --git a/src/dolphin/ipc.ts b/src/dolphin/ipc.ts index aa975978d..897fda7af 100644 --- a/src/dolphin/ipc.ts +++ b/src/dolphin/ipc.ts @@ -54,13 +54,6 @@ export const ipc_launchNetplayDolphin = makeEndpoint.main( _, ); -// toImportDolphin path must point to a "Slippi Dolphin.{exe,app}" -export const ipc_importDolphinSettings = makeEndpoint.main( - "importDolphinSettings", - <{ toImportDolphinPath: string; dolphinType: DolphinLaunchType }>_, - _, -); - export const ipc_fetchGeckoCodes = makeEndpoint.main( "fetchGeckoCodes", <{ dolphinType: DolphinLaunchType }>_, diff --git a/src/dolphin/setup.ts b/src/dolphin/setup.ts index 81436d281..f71cbf226 100644 --- a/src/dolphin/setup.ts +++ b/src/dolphin/setup.ts @@ -2,7 +2,6 @@ import { shell } from "electron"; import log from "electron-log"; import * as fs from "fs-extra"; import isEqual from "lodash/isEqual"; -import path from "path"; import { fileExists } from "utils/file_exists"; import { @@ -12,7 +11,6 @@ import { ipc_downloadDolphin, ipc_fetchGeckoCodes, ipc_hardResetDolphin, - ipc_importDolphinSettings, ipc_launchNetplayDolphin, ipc_openDolphinSettingsFolder, ipc_removePlayKeyFile, @@ -26,8 +24,6 @@ import { deletePlayKeyFile, writePlayKeyFile } from "./playkey"; import { DolphinLaunchType } from "./types"; import { fetchGeckoCodes, saveGeckoCodes, updateBootToCssCode } from "./util"; -const isMac = process.platform === "darwin"; - export default function setupDolphinIpc({ dolphinManager }: { dolphinManager: DolphinManager }) { dolphinManager.events.subscribe((event) => { void ipc_dolphinEvent.main!.trigger(event).catch(log.error); @@ -117,18 +113,6 @@ export default function setupDolphinIpc({ dolphinManager }: { dolphinManager: Do return { success: true }; }); - ipc_importDolphinSettings.main!.handle(async ({ toImportDolphinPath, dolphinType }) => { - let dolphinPath = toImportDolphinPath; - if (isMac) { - dolphinPath = path.join(dolphinPath, "Contents", "Resources"); - } else { - dolphinPath = path.dirname(dolphinPath); - } - - await dolphinManager.importConfig(dolphinType, dolphinPath); - return { success: true }; - }); - ipc_fetchGeckoCodes.main!.handle(async ({ dolphinType }) => { const installation = dolphinManager.getInstallation(dolphinType); const codes = await fetchGeckoCodes(installation); diff --git a/src/dolphin/types.ts b/src/dolphin/types.ts index b42259292..c4770ca0b 100644 --- a/src/dolphin/types.ts +++ b/src/dolphin/types.ts @@ -111,7 +111,6 @@ export interface DolphinService { removePlayKeyFile(): Promise; viewSlpReplay(files: ReplayQueueItem[]): Promise; launchNetplayDolphin(options: { bootToCss?: boolean }): Promise; - importDolphinSettings(options: { toImportDolphinPath: string; dolphinType: DolphinLaunchType }): Promise; fetchGeckoCodes(dolphinLaunchType: DolphinLaunchType): Promise; saveGeckoCodes(dolphinLaunchType: DolphinLaunchType, geckoCodes: GeckoCode[]): Promise; onEvent(eventType: T, handle: (event: DolphinEventMap[T]) => void): () => void; diff --git a/src/renderer/lib/dolphin/use_dolphin_actions.ts b/src/renderer/lib/dolphin/use_dolphin_actions.ts index 1b0ce9d05..59c1c91f6 100644 --- a/src/renderer/lib/dolphin/use_dolphin_actions.ts +++ b/src/renderer/lib/dolphin/use_dolphin_actions.ts @@ -8,7 +8,7 @@ import { useToasts } from "@/lib/hooks/use_toasts"; import { DolphinStatus, setDolphinOpened, useDolphinStore } from "./use_dolphin_store"; export const useDolphinActions = (dolphinService: DolphinService) => { - const { showError, showSuccess } = useToasts(); + const { showError } = useToasts(); const netplayStatus = useDolphinStore((store) => store.netplayStatus); const playbackStatus = useDolphinStore((store) => store.playbackStatus); @@ -114,18 +114,6 @@ export const useDolphinActions = (dolphinService: DolphinService) => { [getInstallStatus, dolphinService, showError], ); - const importDolphin = useCallback( - (toImportDolphinPath: string, dolphinType: DolphinLaunchType) => { - dolphinService - .importDolphinSettings({ toImportDolphinPath, dolphinType }) - .then(() => { - showSuccess(`${dolphinType} Dolphin settings successfully imported`); - }) - .catch(showError); - }, - [dolphinService, showError, showSuccess], - ); - const readGeckoCodes = useCallback( async (dolphinType: DolphinLaunchType) => { if (getInstallStatus(dolphinType) !== DolphinStatus.READY) { @@ -155,7 +143,6 @@ export const useDolphinActions = (dolphinService: DolphinService) => { hardResetDolphin, launchNetplay, viewReplays, - importDolphin, updateDolphin, readGeckoCodes, saveGeckoCodes, diff --git a/src/renderer/pages/settings/dolphin_settings/dolphin_settings.tsx b/src/renderer/pages/settings/dolphin_settings/dolphin_settings.tsx index 6f008222b..4a1f8c0b3 100644 --- a/src/renderer/pages/settings/dolphin_settings/dolphin_settings.tsx +++ b/src/renderer/pages/settings/dolphin_settings/dolphin_settings.tsx @@ -6,7 +6,6 @@ import FormControlLabel from "@mui/material/FormControlLabel"; import Radio from "@mui/material/Radio"; import RadioGroup from "@mui/material/RadioGroup"; import Typography from "@mui/material/Typography"; -import log from "electron-log"; import capitalize from "lodash/capitalize"; import React from "react"; @@ -20,8 +19,6 @@ import { useServices } from "@/services"; import { SettingItem } from "../setting_item_section"; import { GeckoCodes } from "./gecko_codes/gecko_codes"; -const { isMac, isWindows } = window.electron.bootstrap; - enum ResetType { SOFT, HARD, @@ -41,7 +38,7 @@ export const DolphinSettings = ({ dolphinType }: { dolphinType: DolphinLaunchTyp const [resetModalOpen, setResetModalOpen] = React.useState(false); const [isResetType, setResetType] = React.useState(null); const { dolphinService } = useServices(); - const { openConfigureDolphin, hardResetDolphin, softResetDolphin, importDolphin } = useDolphinActions(dolphinService); + const { openConfigureDolphin, hardResetDolphin, softResetDolphin } = useDolphinActions(dolphinService); const { showWarning } = useToasts(); const dolphinIsReady = dolphinStatus === DolphinStatus.READY && !dolphinIsOpen && isResetType === null; const versionString: string = @@ -78,11 +75,6 @@ export const DolphinSettings = ({ dolphinType }: { dolphinType: DolphinLaunchTyp setResetType(null); }; - const importDolphinHandler = (importPath: string) => { - log.info(`importing dolphin from ${importPath}`); - importDolphin(importPath, dolphinType); - }; - const dolphinTypeName = capitalize(dolphinType); return (
@@ -181,48 +173,6 @@ export const DolphinSettings = ({ dolphinType }: { dolphinType: DolphinLaunchTyp )} - {isWindows && ( - - )}
); }; - -const ImportDolphinConfigForm = ({ - dolphinType, - disabled, - onImportDolphin, -}: { - dolphinType: DolphinLaunchType; - disabled?: boolean; - onImportDolphin: (importPath: string) => void; -}) => { - const dolphinTypeName = capitalize(dolphinType); - const extension = isMac ? "app" : "exe"; - - const onImportClick = async () => { - const result = await window.electron.common.showOpenDialog({ - filters: [{ name: "Slippi Dolphin", extensions: [isMac ? "app" : "exe"] }], - }); - const res = result.filePaths; - if (result.canceled || res.length === 0) { - return; - } - onImportDolphin(res[0]); - }; - - return ( - - - - ); -}; diff --git a/src/renderer/services/dolphin/dolphin.service.mock.ts b/src/renderer/services/dolphin/dolphin.service.mock.ts index 9fd5a2675..cfaaa8731 100644 --- a/src/renderer/services/dolphin/dolphin.service.mock.ts +++ b/src/renderer/services/dolphin/dolphin.service.mock.ts @@ -85,14 +85,6 @@ class MockDolphinClient implements DolphinService { throw new Error("Method not implemented."); } - @delayAndMaybeError(SHOULD_ERROR) - public async importDolphinSettings(_options: { - toImportDolphinPath: string; - dolphinType: DolphinLaunchType; - }): Promise { - throw new Error("Method not implemented."); - } - @delayAndMaybeError(SHOULD_ERROR) public async openDolphinSettingsFolder(_dolphinType: DolphinLaunchType): Promise { throw new Error("Method not implemented.");