summaryrefslogtreecommitdiff
path: root/Source/Android/app/src/main/java
diff options
context:
space:
mode:
authormahdihijazi <mahdi.hijaz@hotmail.com>2017-12-23 10:51:39 +0100
committermahdihijazi <mahdi.hijaz@hotmail.com>2017-12-23 16:39:26 +0100
commit58ee9d2a78fddff454088cc0ceb8bb46cbb811e8 (patch)
tree60e51b4f0697d92558359a856afb86dd4617e2c9 /Source/Android/app/src/main/java
parent8a9eff140437068f9ef485281970ad2fbe473baf (diff)
Fix a bug when you open the gc pad settings after fresh install of Dolphin
You will see an empty gc pad settings screen until you open any other settings screen and change something, at that moment the Dolphin.ini will be created and the gc pad settings will be loaded successfully the next time you open the screen. This fixes the bug by putting the default gc pad settings section even if the Dolphin.ini file doesn't exist
Diffstat (limited to 'Source/Android/app/src/main/java')
-rw-r--r--Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java
index 8a89cc83b5..a57b116e2a 100644
--- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java
+++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/utils/SettingsFile.java
@@ -336,6 +336,11 @@ public final class SettingsFile
}
}
+ if (fileName.equals(SettingsFile.FILE_NAME_DOLPHIN))
+ {
+ addGcPadSettingsIfTheyDontExist(sections);
+ }
+
return sections;
}
@@ -398,6 +403,23 @@ public final class SettingsFile
return new SettingSection(sectionName);
}
+ private static void addGcPadSettingsIfTheyDontExist(HashMap<String, SettingSection> sections)
+ {
+ SettingSection coreSection = sections.get(SettingsFile.SECTION_CORE);
+
+ for (int i = 0; i < 4; i++)
+ {
+ String key = SettingsFile.KEY_GCPAD_TYPE + i;
+ if (coreSection.getSetting(key) == null)
+ {
+ Setting gcPadSetting = new IntSetting(key, SettingsFile.SECTION_CORE, SettingsFile.SETTINGS_DOLPHIN, 0);
+ coreSection.putSetting(gcPadSetting);
+ }
+ }
+
+ sections.put(SettingsFile.SECTION_CORE, coreSection);
+ }
+
/**
* For a line of text, determines what type of data is being represented, and returns
* a Setting object containing this data.