From 471485071d7265ad57bbddd6fa4b052d463ffb4e Mon Sep 17 00:00:00 2001 From: zackhow Date: Sun, 14 Oct 2018 15:09:21 -0400 Subject: [PATCH] Android: Move profile check to when it is saving --- .../features/settings/utils/SettingsFile.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java index 04b36cb84f..79315dbe90 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/utils/SettingsFile.java @@ -499,6 +499,22 @@ public final class SettingsFile { String profile = gameId + "_Wii" + padId; + String wiiConfigPath = + DirectoryInitialization.getUserDirectory() + "/Config/Profiles/Wiimote/" + + profile + ".ini"; + File wiiProfile = new File(wiiConfigPath); + // If it doesn't exist, create it + if (!wiiProfile.exists()) + { + String defautlWiiProfilePath = + DirectoryInitialization.getUserDirectory() + + "/Config/Profiles/Wiimote/WiimoteProfile.ini"; + DirectoryInitialization.copyFile(defautlWiiProfilePath, wiiConfigPath); + + NativeLibrary.SetProfileSetting(profile, Settings.SECTION_PROFILE, "Device", + "Android/" + (Integer.valueOf(padId) + 4) + "/Touchscreen"); + } + NativeLibrary.SetProfileSetting(profile, Settings.SECTION_PROFILE, key, value); @@ -565,19 +581,7 @@ public final class SettingsFile DirectoryInitialization.getUserDirectory() + "/Config/Profiles/Wiimote/" + profile + ".ini"; - File wiiProfile = new File(wiiConfigPath); - // If it doesn't exist, create it - if (!wiiProfile.exists()) - { - String defautlWiiProfilePath = - DirectoryInitialization.getUserDirectory() + - "/Config/Profiles/Wiimote/WiimoteProfile.ini"; - DirectoryInitialization.copyFile(defautlWiiProfilePath, wiiConfigPath); - - NativeLibrary.SetProfileSetting(profile, Settings.SECTION_PROFILE, "Device", - "Android/" + (Integer.valueOf(padId) + 4) + "/Touchscreen"); - } - return wiiProfile; + return new File(wiiConfigPath); } private static SettingSection sectionFromLine(String line, boolean isCustomGame)