From e7d295894a9166793edd18beeb93a182a0129368 Mon Sep 17 00:00:00 2001 From: mahdihijazi Date: Sun, 1 Jul 2018 21:12:11 +0200 Subject: [PATCH] Android: Support GameCube System Language --- .../ui/settings/SettingsFragmentPresenter.java | 7 +++++++ .../dolphinemu/utils/SettingsFile.java | 2 ++ .../Android/app/src/main/res/values/arrays.xml | 18 ++++++++++++++++++ .../app/src/main/res/values/strings.xml | 2 ++ 4 files changed, 29 insertions(+) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java index 029716cad9..40c3ed3c1f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/ui/settings/SettingsFragmentPresenter.java @@ -270,11 +270,16 @@ public final class SettingsFragmentPresenter private void addGameCubeSettings(ArrayList sl) { + Setting systemLanguage = null; + Setting overrideGCLanguage = null; Setting slotADevice = null; Setting slotBDevice = null; + if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty()) { + systemLanguage = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GAME_CUBE_LANGUAGE); + overrideGCLanguage = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_OVERRIDE_GAME_CUBE_LANGUAGE); slotADevice = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SLOT_A_DEVICE); slotBDevice = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SLOT_B_DEVICE); } @@ -283,6 +288,8 @@ public final class SettingsFragmentPresenter mView.passSettingsToActivity(mSettings); } + sl.add(new SingleChoiceSetting(SettingsFile.KEY_GAME_CUBE_LANGUAGE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.gamecube_system_language, 0, R.array.gameCubeSystemLanguageEntries, R.array.gameCubeSystemLanguageValues, 0, systemLanguage)); + sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERRIDE_GAME_CUBE_LANGUAGE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.override_gamecube_language, 0, false, overrideGCLanguage)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_A_DEVICE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.slot_a_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 8, slotADevice)); sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_B_DEVICE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.slot_b_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 255, slotBDevice)); } 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 f002b20acb..b53b2d4bcb 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 @@ -85,6 +85,8 @@ public final class SettingsFile public static final String KEY_SPEED_LIMIT = "EmulationSpeed"; public static final String KEY_VIDEO_BACKEND = "GFXBackend"; public static final String KEY_AUDIO_STRETCH = "AudioStretch"; + public static final String KEY_GAME_CUBE_LANGUAGE = "SelectedLanguage"; + public static final String KEY_OVERRIDE_GAME_CUBE_LANGUAGE = "OverrideGCLang"; public static final String KEY_SLOT_A_DEVICE = "SlotA"; public static final String KEY_SLOT_B_DEVICE = "SlotB"; diff --git a/Source/Android/app/src/main/res/values/arrays.xml b/Source/Android/app/src/main/res/values/arrays.xml index c9d6f9a414..21a5c4f7b3 100644 --- a/Source/Android/app/src/main/res/values/arrays.xml +++ b/Source/Android/app/src/main/res/values/arrays.xml @@ -33,6 +33,24 @@ 5 + + + English + German + French + Spanish + Italian + Dutch + + + 0 + 1 + 2 + 3 + 4 + 5 + + Nothing diff --git a/Source/Android/app/src/main/res/values/strings.xml b/Source/Android/app/src/main/res/values/strings.xml index 471912c75f..285235db89 100644 --- a/Source/Android/app/src/main/res/values/strings.xml +++ b/Source/Android/app/src/main/res/values/strings.xml @@ -121,6 +121,8 @@ Speed Limit WARNING: Changing this from the default (100%) WILL break games and cause glitches. Please do not report bugs that occur with a non-default clock. GameCube + System Language + Override Language on NTSC games GameCube Slot A Device GameCube Slot B Device Wii