Android: Initial implementation of Interface submenu

This commit is contained in:
Ryan Meredith 2018-03-23 03:41:14 -04:00
parent 54a6b0f50a
commit 25179258b7
4 changed files with 45 additions and 7 deletions

View File

@ -120,7 +120,15 @@ public final class SettingsFragmentPresenter
switch (mMenuTag)
{
case SettingsFile.FILE_NAME_DOLPHIN:
addCoreSettings(sl);
addConfigSettings(sl);
break;
case SettingsFile.SECTION_CONFIG_GENERAL:
addGeneralSettings(sl);
break;
case SettingsFile.SECTION_CONFIG_INTERFACE:
addInterfaceSettings(sl);
break;
case SettingsFile.FILE_NAME_GFX:
@ -168,7 +176,13 @@ public final class SettingsFragmentPresenter
mView.showSettingsList(mSettingsList);
}
private void addCoreSettings(ArrayList<SettingsItem> sl)
private void addConfigSettings(ArrayList<SettingsItem> sl)
{
sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, SettingsFile.SECTION_CONFIG_GENERAL));
sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, SettingsFile.SECTION_CONFIG_INTERFACE));
}
private void addGeneralSettings(ArrayList<SettingsItem> sl)
{
Setting cpuCore = null;
Setting dualCore = null;
@ -229,6 +243,17 @@ public final class SettingsFragmentPresenter
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, SettingsFile.SECTION_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch));
}
private void addInterfaceSettings(ArrayList<SettingsItem> sl)
{
Setting usePanicHandlers = null;
if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
{
usePanicHandlers = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INTERFACE).getSetting(SettingsFile.KEY_USE_PANIC_HANDLERS);
}
sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_PANIC_HANDLERS, SettingsFile.SECTION_INTERFACE, SettingsFile.SETTINGS_DOLPHIN, R.string.panic_handlers, R.string.panic_handlers_description, true, usePanicHandlers));
}
private void addGcPadSettings(ArrayList<SettingsItem> sl)
{
if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
@ -283,8 +308,8 @@ public final class SettingsFragmentPresenter
sl.add(new SingleChoiceSetting(SettingsFile.KEY_SHADER_COMPILATION_MODE, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.shader_compilation_mode, R.string.shader_compilation_mode_descrip, R.array.shaderCompilationModeEntries, R.array.shaderCompilationModeValues, 0, shaderCompilationMode));
sl.add(new CheckBoxSetting(SettingsFile.KEY_WAIT_FOR_SHADERS, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.wait_for_shaders, 0, false, waitForShaders));
sl.add(new SubmenuSetting(null, null, R.string.enhancements, 0, SettingsFile.SECTION_GFX_ENHANCEMENTS));
sl.add(new SubmenuSetting(null, null, R.string.hacks, 0, SettingsFile.SECTION_GFX_HACKS));
sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, 0, SettingsFile.SECTION_GFX_ENHANCEMENTS));
sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, 0, SettingsFile.SECTION_GFX_HACKS));
}
private void addEnhanceSettings(ArrayList<SettingsItem> sl)

View File

@ -63,6 +63,10 @@ public final class SettingsFile
public static final String FILE_NAME_WIIMOTE = "WiimoteNew";
public static final String SECTION_CORE = "Core";
public static final String SECTION_INTERFACE = "Interface";
public static final String SECTION_CONFIG_GENERAL = "General";
public static final String SECTION_CONFIG_INTERFACE = "Interface";
public static final String SECTION_GFX_SETTINGS = "Settings";
public static final String SECTION_GFX_ENHANCEMENTS = "Enhancements";
@ -83,6 +87,8 @@ public final class SettingsFile
public static final String KEY_SLOT_A_DEVICE = "SlotA";
public static final String KEY_SLOT_B_DEVICE = "SlotB";
public static final String KEY_USE_PANIC_HANDLERS = "UsePanicHandlers";
public static final String KEY_SHOW_FPS = "ShowFPS";
public static final String KEY_INTERNAL_RES = "InternalResolution";
public static final String KEY_FSAA = "MSAA";

View File

@ -108,7 +108,8 @@
<string name="turntable_effect_dial">Dial</string>
<string name="turntable_crossfade">Crossfade</string>
<!-- CPU Preference Fragment -->
<!-- General Preference Fragment -->
<string name="general_submenu">General</string>
<string name="cpu_core">CPU Core</string>
<string name="cpu_core_desc">%s</string>
<string name="dual_core">Dual Core</string>
@ -126,13 +127,18 @@
<string name="audio_stretch">Audio Stretching</string>
<string name="audio_stretch_description">Stretches audio to reduce stuttering. Increases latency.</string>
<!-- Interface Preference Fragment -->
<string name="interface_submenu">Interface</string>
<string name="panic_handlers">Use Panic Handlers</string>
<string name="panic_handlers_description">Show a message box when a potentially serious error has occurred. Disabling this may avoid annoying and non-fatal messages, but it may result in major crashes having no explanation at all.</string>
<!-- Video Preference Fragment -->
<string name="video_backend">Video Backend</string>
<string name="video_backend_descrip">Select the API used for graphics rendering.</string>
<string name="show_fps">Show FPS</string>
<string name="show_fps_descrip">Show the number of frames rendered per second as a measure of emulation speed.</string>
<string name="enhancements">Enhancements</string>
<string name="enhancements_submenu">Enhancements</string>
<string name="internal_resolution">Internal Resolution</string>
<string name="internal_resolution_descrip">Specifies the resolution used to render at. A high resolution will improve visual quality a lot but is also quite heavy on performance and might cause glitches in certain games.</string>
<string name="FSAA">Full-scene Anti-aliasing</string>
@ -162,7 +168,7 @@
<string name="sterescopy_swap_eyes">Swap Eyes</string>
<string name="sterescopy_swap_eyes_descrip">Swap the left and right eye, mostly useful if you want to view side-by-side cross-eyed.</string>
<string name="hacks">Hacks</string>
<string name="hacks_submenu">Hacks</string>
<string name="embedded_frame_buffer">Embedded Frame Buffer</string>
<string name="skip_efb_access">Skip EFB Access from CPU</string>
<string name="skip_efb_access_descrip">Ignore any requests from the CPU to read/write to the EFB.</string>

View File

@ -806,6 +806,7 @@ void SConfig::LoadDefaults()
iLatency = 20;
m_audio_stretch = false;
m_audio_stretch_max_latency = 80;
bUsePanicHandlers = true;
iPosX = INT_MIN;
iPosY = INT_MIN;