Skip to content

Commit

Permalink
fix syncing settings when import dolphin config
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Sep 2, 2023
1 parent 1a1a34b commit c8c46c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/dolphin/install/installation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ export class DolphinInstallation {

// we shouldn't keep the old cache folder since it might be out of date
await this.clearCache();

// read the settings from the ini and update any settings
if (this.dolphinLaunchType === DolphinLaunchType.NETPLAY) {
const iniPath = path.join(this.userFolder, "Config", "Dolphin.ini");
const iniFile = await IniFile.init(iniPath);
await getSlippiSettings(iniFile, this.useBeta);
}
}

public async validate({
Expand Down
8 changes: 8 additions & 0 deletions src/dolphin/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,14 @@ export class DolphinManager {
return meleeIsoPath;
}

public async importConfig(launchType: DolphinLaunchType, dolphinPath: string): Promise<void> {
const installation = this.getInstallation(launchType);
await installation.importConfig(dolphinPath);
if (launchType === DolphinLaunchType.NETPLAY) {
await this._updateLauncherSettings(launchType);
}
}

private async _updateDolphinSettings(launchType: DolphinLaunchType) {
const installation = this.getInstallation(launchType);
await installation.updateSettings({
Expand Down
3 changes: 1 addition & 2 deletions src/dolphin/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ export default function setupDolphinIpc({ dolphinManager }: { dolphinManager: Do
dolphinPath = path.dirname(dolphinPath);
}

const installation = dolphinManager.getInstallation(dolphinType);
await installation.importConfig(dolphinPath);
await dolphinManager.importConfig(dolphinType, dolphinPath);
return { success: true };
});

Expand Down

0 comments on commit c8c46c1

Please sign in to comment.