diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractLegacySetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractLegacySetting.java index c10dd237a8..bd766ab58a 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractLegacySetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractLegacySetting.java @@ -13,6 +13,12 @@ public class AbstractLegacySetting implements AbstractSetting mKey = key; } + @Override + public boolean isOverridden(Settings settings) + { + return settings.isGameSpecific() && settings.getSection(mFile, mSection).exists(mKey); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java index e24565410b..732c348d98 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AbstractSetting.java @@ -2,5 +2,7 @@ package org.dolphinemu.dolphinemu.features.settings.model; public interface AbstractSetting { + boolean isOverridden(Settings settings); + boolean delete(Settings settings); } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java index ed14e064fe..99db56bf65 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/AdHocBooleanSetting.java @@ -20,6 +20,12 @@ public class AdHocBooleanSetting implements AbstractBooleanSetting } } + @Override + public boolean isOverridden(Settings settings) + { + return NativeConfig.isOverridden(mFile, mSection, mKey); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java index 3a5335cd9b..2cad72a672 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/BooleanSetting.java @@ -107,6 +107,15 @@ public enum BooleanSetting implements AbstractBooleanSetting mDefaultValue = defaultValue; } + @Override + public boolean isOverridden(Settings settings) + { + if (settings.isGameSpecific() && !NativeConfig.isSettingSaveable(mFile, mSection, mKey)) + return settings.getSection(mFile, mSection).exists(mKey); + else + return NativeConfig.isOverridden(mFile, mSection, mKey); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java index a2d50962ce..c71c2cd1c4 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/FloatSetting.java @@ -20,6 +20,15 @@ public enum FloatSetting implements AbstractFloatSetting mDefaultValue = defaultValue; } + @Override + public boolean isOverridden(Settings settings) + { + if (settings.isGameSpecific() && !NativeConfig.isSettingSaveable(mFile, mSection, mKey)) + return settings.getSection(mFile, mSection).exists(mKey); + else + return NativeConfig.isOverridden(mFile, mSection, mKey); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java index 12d0a5fb1f..df8e00997b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/IntSetting.java @@ -47,6 +47,15 @@ public enum IntSetting implements AbstractIntSetting mDefaultValue = defaultValue; } + @Override + public boolean isOverridden(Settings settings) + { + if (settings.isGameSpecific() && !NativeConfig.isSettingSaveable(mFile, mSection, mKey)) + return settings.getSection(mFile, mSection).exists(mKey); + else + return NativeConfig.isOverridden(mFile, mSection, mKey); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java index 78545bbace..51c29f833b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java @@ -13,6 +13,8 @@ public class NativeConfig public static native void save(int layer); + public static native boolean isOverridden(String file, String section, String key); + public static native boolean deleteKey(int layer, String file, String section, String key); public static native String getString(int layer, String file, String section, String key, diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java index 5862a452bd..bfc71bf3df 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/StringSetting.java @@ -33,6 +33,15 @@ public enum StringSetting implements AbstractStringSetting mDefaultValue = defaultValue; } + @Override + public boolean isOverridden(Settings settings) + { + if (settings.isGameSpecific() && !NativeConfig.isSettingSaveable(mFile, mSection, mKey)) + return settings.getSection(mFile, mSection).exists(mKey); + else + return NativeConfig.isOverridden(mFile, mSection, mKey); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/CheckBoxSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/CheckBoxSetting.java index b03ecb4b22..891d5e5346 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/CheckBoxSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/CheckBoxSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractBooleanSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; public class CheckBoxSetting extends SettingsItem @@ -28,4 +29,10 @@ public class CheckBoxSetting extends SettingsItem { return TYPE_CHECKBOX; } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/ConfirmRunnable.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/ConfirmRunnable.java index b1a17ca96a..f0a1dee5eb 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/ConfirmRunnable.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/ConfirmRunnable.java @@ -1,5 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; + public final class ConfirmRunnable extends SettingsItem { private int mAlertText; @@ -35,4 +37,10 @@ public final class ConfirmRunnable extends SettingsItem { return TYPE_CONFIRM_RUNNABLE; } + + @Override + public AbstractSetting getSetting() + { + return null; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java index 811f552a46..35e974a818 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FilePicker.java @@ -1,5 +1,6 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.AbstractStringSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; @@ -35,4 +36,10 @@ public final class FilePicker extends SettingsItem { return TYPE_FILE_PICKER; } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java index 6e750957d2..7d9df45056 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/FloatSliderSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractFloatSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; public class FloatSliderSetting extends SliderSetting @@ -23,4 +24,10 @@ public class FloatSliderSetting extends SliderSetting { mSetting.setFloat(settings, selection); } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/HeaderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/HeaderSetting.java index c793f9dac8..3e9a35d694 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/HeaderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/HeaderSetting.java @@ -1,5 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; + public final class HeaderSetting extends SettingsItem { public HeaderSetting(int titleId, int descriptionId) @@ -12,4 +14,10 @@ public final class HeaderSetting extends SettingsItem { return SettingsItem.TYPE_HEADER; } + + @Override + public AbstractSetting getSetting() + { + return null; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputBindingSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputBindingSetting.java index 706a6ef21d..a31348facb 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputBindingSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InputBindingSetting.java @@ -6,6 +6,7 @@ import android.view.InputDevice; import android.view.KeyEvent; import org.dolphinemu.dolphinemu.DolphinApplication; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; public class InputBindingSetting extends SettingsItem @@ -93,4 +94,10 @@ public class InputBindingSetting extends SettingsItem { return mGameId; } + + @Override + public AbstractSetting getSetting() + { + return null; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java index c731286205..9c54346bba 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/IntSliderSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractIntSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; public final class IntSliderSetting extends SliderSetting @@ -23,4 +24,10 @@ public final class IntSliderSetting extends SliderSetting { mSetting.setInt(settings, selection); } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedCheckBoxSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedCheckBoxSetting.java index 1cf37aa0f1..c2dc519fbf 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedCheckBoxSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/InvertedCheckBoxSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractBooleanSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; public final class InvertedCheckBoxSetting extends CheckBoxSetting @@ -22,4 +23,10 @@ public final class InvertedCheckBoxSetting extends CheckBoxSetting { mSetting.setBoolean(settings, !checked); } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java index a0294d4478..e0dbbc29d3 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/PercentSliderSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractFloatSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; public final class PercentSliderSetting extends FloatSliderSetting @@ -22,4 +23,10 @@ public final class PercentSliderSetting extends FloatSliderSetting { mSetting.setFloat(settings, selection / 100); } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RumbleBindingSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RumbleBindingSetting.java index fa0bfb95c5..90e87305a9 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RumbleBindingSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/RumbleBindingSetting.java @@ -6,6 +6,7 @@ import android.view.KeyEvent; import org.dolphinemu.dolphinemu.DolphinApplication; import org.dolphinemu.dolphinemu.R; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.utils.Rumble; @@ -55,4 +56,10 @@ public class RumbleBindingSetting extends InputBindingSetting { return TYPE_RUMBLE_BINDING; } + + @Override + public AbstractSetting getSetting() + { + return null; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java index a301f5ec19..f455066a94 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SettingsItem.java @@ -1,5 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; +import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter; /** @@ -57,4 +59,12 @@ public abstract class SettingsItem * @return An integer (ideally, one of the constants defined in this file) */ public abstract int getType(); + + protected abstract AbstractSetting getSetting(); + + public boolean isOverridden(Settings settings) + { + AbstractSetting setting = getSetting(); + return setting != null && setting.isOverridden(settings); + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java index f42343002d..121e83aae0 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractIntSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; @@ -58,4 +59,10 @@ public final class SingleChoiceSetting extends SettingsItem { return TYPE_SINGLE_CHOICE; } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java index d39e463d26..96320aee0e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SingleChoiceSettingDynamicDescriptions.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.features.settings.model.AbstractIntSetting; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; @@ -75,4 +76,10 @@ public final class SingleChoiceSettingDynamicDescriptions extends SettingsItem { return TYPE_SINGLE_CHOICE_DYNAMIC_DESCRIPTIONS; } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java index d1279aa4fd..e7badc8688 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/StringSingleChoiceSetting.java @@ -1,6 +1,7 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; import org.dolphinemu.dolphinemu.DolphinApplication; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.model.AbstractStringSetting; import org.dolphinemu.dolphinemu.features.settings.model.Settings; import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; @@ -102,6 +103,12 @@ public class StringSingleChoiceSetting extends SettingsItem { return TYPE_STRING_SINGLE_CHOICE; } + + @Override + public AbstractSetting getSetting() + { + return mSetting; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java index 598c0fc9cb..5add7ae5fe 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/view/SubmenuSetting.java @@ -1,5 +1,6 @@ package org.dolphinemu.dolphinemu.features.settings.model.view; +import org.dolphinemu.dolphinemu.features.settings.model.AbstractSetting; import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag; public final class SubmenuSetting extends SettingsItem @@ -22,4 +23,10 @@ public final class SubmenuSetting extends SettingsItem { return TYPE_SUBMENU; } + + @Override + public AbstractSetting getSetting() + { + return null; + } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java index e014c85260..d2fa34cee2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/SettingsFragmentPresenter.java @@ -293,6 +293,13 @@ public final class SettingsFragmentPresenter } } + @Override + public boolean isOverridden(Settings settings) + { + return BooleanSetting.MAIN_DSP_HLE.isOverridden(settings) || + BooleanSetting.MAIN_DSP_JIT.isOverridden(settings); + } + @Override public boolean delete(Settings settings) { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java index afecec4ebd..2b3c7fe38c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/CheckBoxSettingViewHolder.java @@ -59,6 +59,8 @@ public final class CheckBoxSettingViewHolder extends SettingViewHolder } mCheckbox.setChecked(mItem.isChecked(getAdapter().getSettings())); + + setStyle(mTextSettingName, mItem); } @Override @@ -67,5 +69,7 @@ public final class CheckBoxSettingViewHolder extends SettingViewHolder mCheckbox.toggle(); getAdapter().onBooleanClick(mItem, getAdapterPosition(), mCheckbox.isChecked()); + + setStyle(mTextSettingName, mItem); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java index e887fe4afb..88e5700d51 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/FilePickerViewHolder.java @@ -45,6 +45,8 @@ public final class FilePickerViewHolder extends SettingViewHolder { mTextSettingDescription.setText(mFilePicker.getSelectedValue(getAdapter().getSettings())); } + + setStyle(mTextSettingName, mItem); } @Override @@ -58,5 +60,7 @@ public final class FilePickerViewHolder extends SettingViewHolder { getAdapter().onFilePickerFileClick(mItem); } + + setStyle(mTextSettingName, mItem); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputBindingSettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputBindingSettingViewHolder.java index 8fcc63d941..5cccd85c49 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputBindingSettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/InputBindingSettingViewHolder.java @@ -44,11 +44,15 @@ public final class InputBindingSettingViewHolder extends SettingViewHolder mTextSettingName.setText(mItem.getNameId()); mTextSettingDescription .setText(sharedPreferences.getString(mItem.getKey() + mItem.getGameId(), "")); + + setStyle(mTextSettingName, mItem); } @Override public void onClick(View clicked) { getAdapter().onInputBindingClick(mItem, getAdapterPosition()); + + setStyle(mTextSettingName, mItem); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RumbleBindingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RumbleBindingViewHolder.java index a5b8d9c944..5f08cc685f 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RumbleBindingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/RumbleBindingViewHolder.java @@ -44,11 +44,15 @@ public class RumbleBindingViewHolder extends SettingViewHolder mTextSettingName.setText(item.getNameId()); mTextSettingDescription .setText(sharedPreferences.getString(mItem.getKey() + mItem.getGameId(), "")); + + setStyle(mTextSettingName, mItem); } @Override public void onClick(View clicked) { getAdapter().onInputBindingClick(mItem, getAdapterPosition()); + + setStyle(mTextSettingName, mItem); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java index 5fc91a6136..839e6fa2e1 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SettingViewHolder.java @@ -1,6 +1,8 @@ package org.dolphinemu.dolphinemu.features.settings.ui.viewholder; +import android.graphics.Typeface; import android.view.View; +import android.widget.TextView; import androidx.recyclerview.widget.RecyclerView; @@ -28,6 +30,12 @@ public abstract class SettingViewHolder extends RecyclerView.ViewHolder return mAdapter; } + protected void setStyle(TextView textView, SettingsItem settingsItem) + { + boolean overridden = settingsItem.isOverridden(mAdapter.getSettings()); + textView.setTypeface(null, overridden ? Typeface.BOLD : Typeface.NORMAL); + } + /** * Gets handles to all this ViewHolder's child views using their XML-defined identifiers. * diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java index f0f85a0755..154b858093 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SingleChoiceViewHolder.java @@ -80,6 +80,8 @@ public final class SingleChoiceViewHolder extends SettingViewHolder } } } + + setStyle(mTextSettingName, mItem); } @Override @@ -99,5 +101,7 @@ public final class SingleChoiceViewHolder extends SettingViewHolder getAdapter().onSingleChoiceDynamicDescriptionsClick( (SingleChoiceSettingDynamicDescriptions) mItem, position); } + + setStyle(mTextSettingName, mItem); } } diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java index ef359edb72..bde659b07c 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/ui/viewholder/SliderViewHolder.java @@ -49,12 +49,16 @@ public final class SliderViewHolder extends SettingViewHolder .getString(R.string.slider_setting_value, mItem.getSelectedValue(getAdapter().getSettings()), mItem.getUnits())); } + + setStyle(mTextSettingName, mItem); } @Override public void onClick(View clicked) { getAdapter().onSliderClick(mItem, getAdapterPosition()); + + setStyle(mTextSettingName, mItem); } } diff --git a/Source/Android/jni/NativeConfig.cpp b/Source/Android/jni/NativeConfig.cpp index 54c927a97e..3a3a5289c3 100644 --- a/Source/Android/jni/NativeConfig.cpp +++ b/Source/Android/jni/NativeConfig.cpp @@ -112,6 +112,15 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_Na return GetLayer(layer, {})->Save(); } +JNIEXPORT jboolean JNICALL +Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_isOverridden( + JNIEnv* env, jclass obj, jstring file, jstring section, jstring key) +{ + const Config::Location location = GetLocation(env, file, section, key); + const bool result = Config::GetActiveLayerForConfig(location) != Config::LayerType::Base; + return static_cast(result); +} + JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_features_settings_model_NativeConfig_deleteKey( JNIEnv* env, jclass obj, jint layer, jstring file, jstring section, jstring key)