Merge pull request #7292 from mahdihijazi/settings_refactor
Android: Settings refactor & Fix custom game settings
This commit is contained in:
commit
bfbf9ed2ee
|
@ -54,7 +54,7 @@
|
|||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".ui.settings.SettingsActivity"
|
||||
android:name=".features.settings.ui.SettingsActivity"
|
||||
android:theme="@style/DolphinSettingsGamecube"
|
||||
android:label="@string/preferences_settings"/>
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ import org.dolphinemu.dolphinemu.R;
|
|||
import org.dolphinemu.dolphinemu.activities.EmulationActivity;
|
||||
import org.dolphinemu.dolphinemu.model.GameFile;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.utils.PicassoUtils;
|
||||
import org.dolphinemu.dolphinemu.viewholders.GameViewHolder;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@ import org.dolphinemu.dolphinemu.R;
|
|||
import org.dolphinemu.dolphinemu.model.GameFile;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.ui.platform.Platform;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.utils.PicassoUtils;
|
||||
import org.dolphinemu.dolphinemu.viewholders.TvGameViewHolder;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import android.view.InputDevice;
|
|||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
public final class BooleanSetting extends Setting
|
||||
{
|
||||
private boolean mValue;
|
||||
|
||||
public BooleanSetting(String key, String section, int file, boolean value)
|
||||
public BooleanSetting(String key, String section, boolean value)
|
||||
{
|
||||
super(key, section, file);
|
||||
super(key, section);
|
||||
mValue = value;
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
public final class FloatSetting extends Setting
|
||||
{
|
||||
private float mValue;
|
||||
|
||||
public FloatSetting(String key, String section, int file, float value)
|
||||
public FloatSetting(String key, String section, float value)
|
||||
{
|
||||
super(key, section, file);
|
||||
super(key, section);
|
||||
mValue = value;
|
||||
}
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
|
||||
public final class IntSetting extends Setting
|
||||
{
|
||||
private int mValue;
|
||||
private MenuTag menuTag;
|
||||
|
||||
public IntSetting(String key, String section, int file, int value)
|
||||
public IntSetting(String key, String section, int value)
|
||||
{
|
||||
super(key, section, file);
|
||||
super(key, section);
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
public IntSetting(String key, String section, int file, int value, MenuTag menuTag)
|
||||
public IntSetting(String key, String section, int value, MenuTag menuTag)
|
||||
{
|
||||
super(key, section, file);
|
||||
super(key, section);
|
||||
mValue = value;
|
||||
this.menuTag = menuTag;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
/**
|
||||
* Abstraction for a setting item as read from / written to Dolphin's configuration ini files.
|
||||
|
@ -10,20 +10,17 @@ public abstract class Setting
|
|||
{
|
||||
private String mKey;
|
||||
private String mSection;
|
||||
private int mFile;
|
||||
|
||||
/**
|
||||
* Base constructor.
|
||||
*
|
||||
* @param key Everything to the left of the = in a line from the ini file.
|
||||
* @param section The corresponding recent section header; e.g. [Core] or [Enhancements] without the brackets.
|
||||
* @param file The ini file the Setting is stored in.
|
||||
*/
|
||||
public Setting(String key, String section, int file)
|
||||
public Setting(String key, String section)
|
||||
{
|
||||
mKey = key;
|
||||
mSection = section;
|
||||
mFile = file;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -44,14 +41,6 @@ public abstract class Setting
|
|||
return mSection;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The ini file the Setting is stored in.
|
||||
*/
|
||||
public int getFile()
|
||||
{
|
||||
return mFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A representation of this Setting's backing value converted to a String (e.g. for serialization).
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
@ -52,4 +52,12 @@ public final class SettingSection
|
|||
{
|
||||
return mSettings;
|
||||
}
|
||||
|
||||
public void mergeSection(SettingSection settingSection)
|
||||
{
|
||||
for (Setting setting : settingSection.mSettings.values())
|
||||
{
|
||||
putSetting(setting);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,179 @@
|
|||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivityView;
|
||||
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class Settings
|
||||
{
|
||||
public static final String SECTION_INI_CORE = "Core";
|
||||
public static final String SECTION_INI_INTERFACE = "Interface";
|
||||
|
||||
public static final String SECTION_GFX_SETTINGS = "Settings";
|
||||
public static final String SECTION_GFX_ENHANCEMENTS = "Enhancements";
|
||||
public static final String SECTION_GFX_HACKS = "Hacks";
|
||||
|
||||
public static final String SECTION_STEREOSCOPY = "Stereoscopy";
|
||||
|
||||
public static final String SECTION_WIIMOTE = "Wiimote";
|
||||
|
||||
public static final String SECTION_BINDINGS = "Android";
|
||||
|
||||
private String gameId;
|
||||
|
||||
private static final Map<String, List<String>> configFileSectionsMap = new HashMap<>();
|
||||
|
||||
static
|
||||
{
|
||||
configFileSectionsMap.put(SettingsFile.FILE_NAME_DOLPHIN, Arrays.asList(SECTION_INI_CORE, SECTION_INI_INTERFACE, SECTION_BINDINGS));
|
||||
configFileSectionsMap.put(SettingsFile.FILE_NAME_GFX, Arrays.asList(SECTION_GFX_SETTINGS, SECTION_GFX_ENHANCEMENTS, SECTION_GFX_HACKS, SECTION_STEREOSCOPY));
|
||||
configFileSectionsMap.put(SettingsFile.FILE_NAME_WIIMOTE, Arrays.asList(SECTION_WIIMOTE + 1, SECTION_WIIMOTE + 2, SECTION_WIIMOTE + 3, SECTION_WIIMOTE + 4));
|
||||
}
|
||||
|
||||
/**
|
||||
* A HashMap<String, SettingSection> that constructs a new SettingSection instead of returning null
|
||||
* when getting a key not already in the map
|
||||
*/
|
||||
public static final class SettingsSectionMap extends HashMap<String, SettingSection>
|
||||
{
|
||||
@Override
|
||||
public SettingSection get(Object key)
|
||||
{
|
||||
if (!(key instanceof String))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String stringKey = (String) key;
|
||||
|
||||
if (!super.containsKey(stringKey))
|
||||
{
|
||||
SettingSection section = new SettingSection(stringKey);
|
||||
super.put(stringKey, section);
|
||||
return section;
|
||||
}
|
||||
return super.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<String, SettingSection> sections = new Settings.SettingsSectionMap();
|
||||
|
||||
public SettingSection getSection(String sectionName)
|
||||
{
|
||||
return sections.get(sectionName);
|
||||
}
|
||||
|
||||
public boolean isEmpty()
|
||||
{
|
||||
return sections.isEmpty();
|
||||
}
|
||||
|
||||
public HashMap<String, SettingSection> getSections()
|
||||
{
|
||||
return sections;
|
||||
}
|
||||
|
||||
public void loadSettings(SettingsActivityView view)
|
||||
{
|
||||
sections = new Settings.SettingsSectionMap();
|
||||
|
||||
HashSet<String> filesToExclude = new HashSet<>();
|
||||
if (!TextUtils.isEmpty(gameId))
|
||||
{
|
||||
// for per-game settings, don't load the WiiMoteNew.ini settings
|
||||
filesToExclude.add(SettingsFile.FILE_NAME_WIIMOTE);
|
||||
}
|
||||
|
||||
loadDolphinSettings(view, filesToExclude);
|
||||
|
||||
if (!TextUtils.isEmpty(gameId))
|
||||
{
|
||||
loadGenericGameSettings(gameId, view);
|
||||
loadCustomGameSettings(gameId, view);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadDolphinSettings(SettingsActivityView view, HashSet<String> filesToExclude)
|
||||
{
|
||||
for (Map.Entry<String, List<String>> entry : configFileSectionsMap.entrySet())
|
||||
{
|
||||
String fileName = entry.getKey();
|
||||
if(filesToExclude == null || !filesToExclude.contains(fileName))
|
||||
{
|
||||
sections.putAll(SettingsFile.readFile(fileName, view));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void loadGenericGameSettings(String gameId, SettingsActivityView view)
|
||||
{
|
||||
// generic game settings
|
||||
mergeSections(SettingsFile.readGenericGameSettings(gameId, view));
|
||||
mergeSections(SettingsFile.readGenericGameSettingsForAllRegions(gameId, view));
|
||||
}
|
||||
|
||||
private void loadCustomGameSettings(String gameId, SettingsActivityView view)
|
||||
{
|
||||
// custom game settings
|
||||
mergeSections(SettingsFile.readCustomGameSettings(gameId, view));
|
||||
}
|
||||
|
||||
private void mergeSections(HashMap<String, SettingSection> updatedSections)
|
||||
{
|
||||
for (Map.Entry<String, SettingSection> entry : updatedSections.entrySet())
|
||||
{
|
||||
if (sections.containsKey(entry.getKey()))
|
||||
{
|
||||
SettingSection originalSection = sections.get(entry.getKey());
|
||||
SettingSection updatedSection = entry.getValue();
|
||||
originalSection.mergeSection(updatedSection);
|
||||
}
|
||||
else
|
||||
{
|
||||
sections.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadSettings(String gameId, SettingsActivityView view)
|
||||
{
|
||||
this.gameId = gameId;
|
||||
loadSettings(view);
|
||||
}
|
||||
|
||||
public void saveSettings(SettingsActivityView view)
|
||||
{
|
||||
if (TextUtils.isEmpty(gameId))
|
||||
{
|
||||
view.showToastMessage("Saved settings to INI files");
|
||||
|
||||
for (Map.Entry<String, List<String>> entry : configFileSectionsMap.entrySet())
|
||||
{
|
||||
String fileName = entry.getKey();
|
||||
List<String> sectionNames = entry.getValue();
|
||||
TreeMap<String, SettingSection> iniSections = new TreeMap<>();
|
||||
for (String section : sectionNames)
|
||||
{
|
||||
iniSections.put(section, sections.get(section));
|
||||
}
|
||||
|
||||
SettingsFile.saveFile(fileName, iniSections, view);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// custom game settings
|
||||
view.showToastMessage("Saved settings for " + gameId);
|
||||
SettingsFile.saveCustomGameSettings(gameId, sections);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model;
|
||||
|
||||
public final class StringSetting extends Setting
|
||||
{
|
||||
private String mValue;
|
||||
|
||||
public StringSetting(String key, String section, int file, String value)
|
||||
public StringSetting(String key, String section, String value)
|
||||
{
|
||||
super(key, section, file);
|
||||
super(key, section);
|
||||
mValue = value;
|
||||
}
|
||||
|
|
@ -1,15 +1,15 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
|
||||
public final class CheckBoxSetting extends SettingsItem
|
||||
{
|
||||
private boolean mDefaultValue;
|
||||
|
||||
public CheckBoxSetting(String key, String section, int file, int titleId, int descriptionId, boolean defaultValue, Setting setting)
|
||||
public CheckBoxSetting(String key, String section, int titleId, int descriptionId, boolean defaultValue, Setting setting)
|
||||
{
|
||||
super(key, section, file, setting, titleId, descriptionId);
|
||||
super(key, section, setting, titleId, descriptionId);
|
||||
mDefaultValue = defaultValue;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ public final class CheckBoxSetting extends SettingsItem
|
|||
{
|
||||
if (getSetting() == null)
|
||||
{
|
||||
BooleanSetting setting = new BooleanSetting(getKey(), getSection(), getFile(), checked);
|
||||
BooleanSetting setting = new BooleanSetting(getKey(), getSection(), checked);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
|
@ -1,12 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
|
||||
public final class HeaderSetting extends SettingsItem
|
||||
{
|
||||
public HeaderSetting(String key, Setting setting, int titleId, int descriptionId)
|
||||
{
|
||||
super(key, null, 0, setting, titleId, descriptionId);
|
||||
super(key, null, setting, titleId, descriptionId);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,14 +1,13 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
|
||||
|
||||
public final class InputBindingSetting extends SettingsItem
|
||||
{
|
||||
public InputBindingSetting(String key, String section, int file, int titleId, Setting setting)
|
||||
public InputBindingSetting(String key, String section, int titleId, Setting setting)
|
||||
{
|
||||
super(key, section, file, setting, titleId, 0);
|
||||
super(key, section, setting, titleId, 0);
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
|
@ -33,7 +32,7 @@ public final class InputBindingSetting extends SettingsItem
|
|||
{
|
||||
if (getSetting() == null)
|
||||
{
|
||||
StringSetting setting = new StringSetting(getKey(), getSection(), getFile(), bind);
|
||||
StringSetting setting = new StringSetting(getKey(), getSection(), bind);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
|
||||
/**
|
||||
* ViewModel abstraction for an Item in the RecyclerView powering SettingsFragments.
|
||||
|
@ -21,7 +22,6 @@ public abstract class SettingsItem
|
|||
|
||||
private String mKey;
|
||||
private String mSection;
|
||||
private int mFile;
|
||||
|
||||
private Setting mSetting;
|
||||
|
||||
|
@ -38,11 +38,10 @@ public abstract class SettingsItem
|
|||
* @param nameId Resource ID for a text string to be displayed as this setting's name.
|
||||
* @param descriptionId Resource ID for a text string to be displayed as this setting's description.
|
||||
*/
|
||||
public SettingsItem(String key, String section, int file, Setting setting, int nameId, int descriptionId)
|
||||
public SettingsItem(String key, String section, Setting setting, int nameId, int descriptionId)
|
||||
{
|
||||
mKey = key;
|
||||
mSection = section;
|
||||
mFile = file;
|
||||
mSetting = setting;
|
||||
mNameId = nameId;
|
||||
mDescriptionId = descriptionId;
|
||||
|
@ -66,14 +65,6 @@ public abstract class SettingsItem
|
|||
return mSection;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The file the backing Setting is saved to.
|
||||
*/
|
||||
public int getFile()
|
||||
{
|
||||
return mFile;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -110,7 +101,7 @@ public abstract class SettingsItem
|
|||
}
|
||||
|
||||
/**
|
||||
* Used by {@link org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter}'s onCreateViewHolder()
|
||||
* Used by {@link SettingsAdapter}'s onCreateViewHolder()
|
||||
* method to determine which type of ViewHolder should be created.
|
||||
*
|
||||
* @return An integer (ideally, one of the constants defined in this file)
|
|
@ -1,8 +1,8 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
|
||||
public final class SingleChoiceSetting extends SettingsItem
|
||||
{
|
||||
|
@ -12,18 +12,18 @@ public final class SingleChoiceSetting extends SettingsItem
|
|||
private int mValuesId;
|
||||
private MenuTag menuTag;
|
||||
|
||||
public SingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting, MenuTag menuTag)
|
||||
public SingleChoiceSetting(String key, String section, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting, MenuTag menuTag)
|
||||
{
|
||||
super(key, section, file, setting, titleId, descriptionId);
|
||||
super(key, section, setting, titleId, descriptionId);
|
||||
mValuesId = valuesId;
|
||||
mChoicesId = choicesId;
|
||||
mDefaultValue = defaultValue;
|
||||
this.menuTag = menuTag;
|
||||
}
|
||||
|
||||
public SingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting)
|
||||
public SingleChoiceSetting(String key, String section, int titleId, int descriptionId, int choicesId, int valuesId, int defaultValue, Setting setting)
|
||||
{
|
||||
this(key, section, file, titleId, descriptionId, choicesId, valuesId, defaultValue, setting, null);
|
||||
this(key, section, titleId, descriptionId, choicesId, valuesId, defaultValue, setting, null);
|
||||
}
|
||||
|
||||
public int getChoicesId()
|
||||
|
@ -65,7 +65,7 @@ public final class SingleChoiceSetting extends SettingsItem
|
|||
{
|
||||
if (getSetting() == null)
|
||||
{
|
||||
IntSetting setting = new IntSetting(getKey(), getSection(), getFile(), selection);
|
||||
IntSetting setting = new IntSetting(getKey(), getSection(), selection);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.FloatSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.FloatSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
import org.dolphinemu.dolphinemu.utils.SettingsFile;
|
||||
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
|
||||
|
||||
public final class SliderSetting extends SettingsItem
|
||||
{
|
||||
|
@ -13,9 +13,9 @@ public final class SliderSetting extends SettingsItem
|
|||
|
||||
private String mUnits;
|
||||
|
||||
public SliderSetting(String key, String section, int file, int titleId, int descriptionId, int max, String units, int defaultValue, Setting setting)
|
||||
public SliderSetting(String key, String section, int titleId, int descriptionId, int max, String units, int defaultValue, Setting setting)
|
||||
{
|
||||
super(key, section, file, setting, titleId, descriptionId);
|
||||
super(key, section, setting, titleId, descriptionId);
|
||||
mMax = max;
|
||||
mUnits = units;
|
||||
mDefaultValue = defaultValue;
|
||||
|
@ -71,7 +71,7 @@ public final class SliderSetting extends SettingsItem
|
|||
{
|
||||
if (getSetting() == null)
|
||||
{
|
||||
IntSetting setting = new IntSetting(getKey(), getSection(), getFile(), selection);
|
||||
IntSetting setting = new IntSetting(getKey(), getSection(), selection);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public final class SliderSetting extends SettingsItem
|
|||
{
|
||||
if (getSetting() == null)
|
||||
{
|
||||
FloatSetting setting = new FloatSetting(getKey(), getSection(), getFile(), selection);
|
||||
FloatSetting setting = new FloatSetting(getKey(), getSection(), selection);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
|
||||
|
||||
public class StringSingleChoiceSetting extends SettingsItem
|
||||
{
|
||||
|
@ -10,9 +10,9 @@ public class StringSingleChoiceSetting extends SettingsItem
|
|||
private String[] mChoicesId;
|
||||
private String[] mValuesId;
|
||||
|
||||
public StringSingleChoiceSetting(String key, String section, int file, int titleId, int descriptionId, String[] choicesId, String[] valuesId, String defaultValue, Setting setting)
|
||||
public StringSingleChoiceSetting(String key, String section, int titleId, int descriptionId, String[] choicesId, String[] valuesId, String defaultValue, Setting setting)
|
||||
{
|
||||
super(key, section, file, setting, titleId, descriptionId);
|
||||
super(key, section, setting, titleId, descriptionId);
|
||||
mValuesId = valuesId;
|
||||
mChoicesId = choicesId;
|
||||
mDefaultValue = defaultValue;
|
||||
|
@ -75,7 +75,7 @@ public class StringSingleChoiceSetting extends SettingsItem
|
|||
{
|
||||
if (getSetting() == null)
|
||||
{
|
||||
StringSetting setting = new StringSetting(getKey(), getSection(), getFile(), selection);
|
||||
StringSetting setting = new StringSetting(getKey(), getSection(), selection);
|
||||
setSetting(setting);
|
||||
return setting;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package org.dolphinemu.dolphinemu.model.settings.view;
|
||||
package org.dolphinemu.dolphinemu.features.settings.model.view;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
|
||||
public final class SubmenuSetting extends SettingsItem
|
||||
{
|
||||
|
@ -9,7 +9,7 @@ public final class SubmenuSetting extends SettingsItem
|
|||
|
||||
public SubmenuSetting(String key, Setting setting, int titleId, int descriptionId, MenuTag menuKey)
|
||||
{
|
||||
super(key, null, 0, setting, titleId, descriptionId);
|
||||
super(key, null, setting, titleId, descriptionId);
|
||||
mMenuKey = menuKey;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
public enum MenuTag
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
|
@ -15,12 +15,10 @@ import android.view.MenuItem;
|
|||
import android.widget.Toast;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.utils.DirectoryStateReceiver;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public final class SettingsActivity extends AppCompatActivity implements SettingsActivityView
|
||||
|
@ -187,19 +185,19 @@ public final class SettingsActivity extends AppCompatActivity implements Setting
|
|||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, SettingSection> getSettings(int file)
|
||||
public org.dolphinemu.dolphinemu.features.settings.model.Settings getSettings()
|
||||
{
|
||||
return mPresenter.getSettings(file);
|
||||
return mPresenter.getSettings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSettings(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
public void setSettings(org.dolphinemu.dolphinemu.features.settings.model.Settings settings)
|
||||
{
|
||||
mPresenter.setSettings(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSettingsFileLoaded(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
public void onSettingsFileLoaded(org.dolphinemu.dolphinemu.features.settings.model.Settings settings)
|
||||
{
|
||||
SettingsFragmentView fragment = getFragment();
|
||||
|
|
@ -0,0 +1,206 @@
|
|||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService.DirectoryInitializationState;
|
||||
import org.dolphinemu.dolphinemu.utils.DirectoryStateReceiver;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
public final class SettingsActivityPresenter
|
||||
{
|
||||
private static final String KEY_SHOULD_SAVE = "should_save";
|
||||
|
||||
private SettingsActivityView mView;
|
||||
|
||||
private Settings mSettings = new Settings();
|
||||
|
||||
private int mStackCount;
|
||||
|
||||
private boolean mShouldSave;
|
||||
|
||||
private DirectoryStateReceiver directoryStateReceiver;
|
||||
|
||||
private MenuTag menuTag;
|
||||
private String gameId;
|
||||
|
||||
SettingsActivityPresenter(SettingsActivityView view)
|
||||
{
|
||||
mView = view;
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState, MenuTag menuTag, String gameId)
|
||||
{
|
||||
if (savedInstanceState == null)
|
||||
{
|
||||
this.menuTag = menuTag;
|
||||
this.gameId = gameId;
|
||||
}
|
||||
else
|
||||
{
|
||||
mShouldSave = savedInstanceState.getBoolean(KEY_SHOULD_SAVE);
|
||||
}
|
||||
}
|
||||
|
||||
public void onStart()
|
||||
{
|
||||
prepareDolphinDirectoriesIfNeeded();
|
||||
}
|
||||
|
||||
private void loadSettingsUI()
|
||||
{
|
||||
if (mSettings.isEmpty())
|
||||
{
|
||||
if (!TextUtils.isEmpty(gameId))
|
||||
{
|
||||
mSettings.loadSettings(gameId, mView);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSettings.loadSettings(mView);
|
||||
}
|
||||
}
|
||||
|
||||
mView.showSettingsFragment(menuTag, null, false, gameId);
|
||||
mView.onSettingsFileLoaded(mSettings);
|
||||
}
|
||||
|
||||
private void prepareDolphinDirectoriesIfNeeded()
|
||||
{
|
||||
if (DirectoryInitializationService.areDolphinDirectoriesReady())
|
||||
{
|
||||
loadSettingsUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.showLoading();
|
||||
IntentFilter statusIntentFilter = new IntentFilter(
|
||||
DirectoryInitializationService.BROADCAST_ACTION);
|
||||
|
||||
directoryStateReceiver =
|
||||
new DirectoryStateReceiver(directoryInitializationState ->
|
||||
{
|
||||
if (directoryInitializationState == DirectoryInitializationState.DOLPHIN_DIRECTORIES_INITIALIZED)
|
||||
{
|
||||
mView.hideLoading();
|
||||
loadSettingsUI();
|
||||
}
|
||||
else if (directoryInitializationState == DirectoryInitializationState.EXTERNAL_STORAGE_PERMISSION_NEEDED)
|
||||
{
|
||||
mView.showPermissionNeededHint();
|
||||
mView.hideLoading();
|
||||
}
|
||||
else if (directoryInitializationState == DirectoryInitializationState.CANT_FIND_EXTERNAL_STORAGE)
|
||||
{
|
||||
mView.showExternalStorageNotMountedHint();
|
||||
mView.hideLoading();
|
||||
}
|
||||
});
|
||||
|
||||
mView.startDirectoryInitializationService(directoryStateReceiver, statusIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSettings(Settings settings)
|
||||
{
|
||||
mSettings = settings;
|
||||
}
|
||||
|
||||
public Settings getSettings()
|
||||
{
|
||||
return mSettings;
|
||||
}
|
||||
|
||||
public void onStop(boolean finishing)
|
||||
{
|
||||
if (directoryStateReceiver != null)
|
||||
{
|
||||
mView.stopListeningToDirectoryInitializationService(directoryStateReceiver);
|
||||
directoryStateReceiver = null;
|
||||
}
|
||||
|
||||
if (mSettings != null && finishing && mShouldSave)
|
||||
{
|
||||
Log.debug("[SettingsActivity] Settings activity stopping. Saving settings to INI...");
|
||||
mSettings.saveSettings(mView);
|
||||
}
|
||||
}
|
||||
|
||||
public void addToStack()
|
||||
{
|
||||
mStackCount++;
|
||||
}
|
||||
|
||||
public void onBackPressed()
|
||||
{
|
||||
if (mStackCount > 0)
|
||||
{
|
||||
mView.popBackStack();
|
||||
mStackCount--;
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.finish();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleOptionsItem(int itemId)
|
||||
{
|
||||
switch (itemId)
|
||||
{
|
||||
case R.id.menu_save_exit:
|
||||
mView.finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onSettingChanged()
|
||||
{
|
||||
mShouldSave = true;
|
||||
}
|
||||
|
||||
public void saveState(Bundle outState)
|
||||
{
|
||||
outState.putBoolean(KEY_SHOULD_SAVE, mShouldSave);
|
||||
}
|
||||
|
||||
public void onGcPadSettingChanged(MenuTag key, int value)
|
||||
{
|
||||
if (value != 0) // Not disabled
|
||||
{
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(SettingsFragmentPresenter.ARG_CONTROLLER_TYPE, value / 6);
|
||||
mView.showSettingsFragment(key, bundle, true, gameId);
|
||||
}
|
||||
}
|
||||
|
||||
public void onWiimoteSettingChanged(MenuTag menuTag, int value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case 1:
|
||||
mView.showSettingsFragment(menuTag, null, true, gameId);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mView.showToastMessage("Please make sure Continuous Scanning is enabled in Core Settings.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onExtensionSettingChanged(MenuTag menuTag, int value)
|
||||
{
|
||||
if (value != 0) // None
|
||||
{
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(SettingsFragmentPresenter.ARG_CONTROLLER_TYPE, value);
|
||||
mView.showSettingsFragment(menuTag, bundle, true, gameId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,14 +1,11 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
import org.dolphinemu.dolphinemu.utils.DirectoryStateReceiver;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Abstraction for the Activity that manages SettingsFragments.
|
||||
*/
|
||||
|
@ -27,10 +24,9 @@ public interface SettingsActivityView
|
|||
* loaded from disk, so that each Fragment doesn't need to perform its own
|
||||
* read operation.
|
||||
*
|
||||
* @param file The settings file to load.
|
||||
* @return A possibly null HashMap of Settings.
|
||||
*/
|
||||
HashMap<String, SettingSection> getSettings(int file);
|
||||
Settings getSettings();
|
||||
|
||||
/**
|
||||
* Used to provide the Activity with Settings HashMaps if a Fragment already
|
||||
|
@ -39,14 +35,14 @@ public interface SettingsActivityView
|
|||
*
|
||||
* @param settings The ArrayList of all the Settings HashMaps.
|
||||
*/
|
||||
void setSettings(ArrayList<HashMap<String, SettingSection>> settings);
|
||||
void setSettings(Settings settings);
|
||||
|
||||
/**
|
||||
* Called when an asynchronous load operation completes.
|
||||
*
|
||||
* @param settings The (possibly null) result of the ini load operation.
|
||||
*/
|
||||
void onSettingsFileLoaded(ArrayList<HashMap<String, SettingSection>> settings);
|
||||
void onSettingsFileLoaded(Settings settings);
|
||||
|
||||
/**
|
||||
* Called when an asynchronous load operation fails.
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
|
@ -14,26 +14,27 @@ import android.widget.TextView;
|
|||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.dialogs.MotionAlertDialog;
|
||||
import org.dolphinemu.dolphinemu.model.settings.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.FloatSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.CheckBoxSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SliderSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.StringSingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SubmenuSetting;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.CheckBoxSettingViewHolder;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.HeaderViewHolder;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.InputBindingSettingViewHolder;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.SettingViewHolder;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.SingleChoiceViewHolder;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.SliderViewHolder;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.viewholder.SubmenuViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.FloatSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.CheckBoxSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SliderSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.StringSingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SubmenuSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.CheckBoxSettingViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.HeaderViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.InputBindingSettingViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SettingViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SingleChoiceViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SliderViewHolder;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.viewholder.SubmenuViewHolder;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
import org.dolphinemu.dolphinemu.utils.SettingsFile;
|
||||
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
@ -143,7 +144,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
|||
|
||||
if (item.getKey().equals(SettingsFile.KEY_SKIP_EFB) || item.getKey().equals(SettingsFile.KEY_IGNORE_FORMAT))
|
||||
{
|
||||
mView.putSetting(new BooleanSetting(item.getKey(), item.getSection(), item.getFile(), !checked));
|
||||
mView.putSetting(new BooleanSetting(item.getKey(), item.getSection(), !checked));
|
||||
}
|
||||
|
||||
mView.onSettingChanged();
|
||||
|
@ -227,7 +228,7 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
|||
});
|
||||
dialog.setOnDismissListener(dialog1 ->
|
||||
{
|
||||
StringSetting setting = new StringSetting(item.getKey(), item.getSection(), item.getFile(), item.getValue());
|
||||
StringSetting setting = new StringSetting(item.getKey(), item.getSection(), item.getValue());
|
||||
notifyItemChanged(position);
|
||||
|
||||
if (setting != null)
|
||||
|
@ -404,35 +405,34 @@ public final class SettingsAdapter extends RecyclerView.Adapter<SettingViewHolde
|
|||
return -1;
|
||||
}
|
||||
|
||||
public void putVideoBackendSetting(int which)
|
||||
private void putVideoBackendSetting(int which)
|
||||
{
|
||||
StringSetting gfxBackend = null;
|
||||
switch (which)
|
||||
{
|
||||
case 0:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, Settings.SECTION_INI_CORE, "OGL");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, Settings.SECTION_INI_CORE, "Vulkan");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, Settings.SECTION_INI_CORE, "Software Renderer");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, Settings.SECTION_INI_CORE, "Null");
|
||||
break;
|
||||
}
|
||||
|
||||
mView.putSetting(gfxBackend);
|
||||
}
|
||||
|
||||
private void putExtensionSetting(int which, int wiimoteNumber)
|
||||
{
|
||||
StringSetting gfxBackend = null;
|
||||
switch (which)
|
||||
{
|
||||
case 0:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, "OGL");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, "Vulkan");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, "Software Renderer");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
gfxBackend = new StringSetting(SettingsFile.KEY_VIDEO_BACKEND, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, "Null");
|
||||
break;
|
||||
}
|
||||
|
||||
mView.putSetting(gfxBackend);
|
||||
}
|
||||
|
||||
public void putExtensionSetting(int which, int wiimoteNumber)
|
||||
{
|
||||
StringSetting extension = new StringSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + wiimoteNumber,
|
||||
SettingsFile.SETTINGS_WIIMOTE, mContext.getResources().getStringArray(R.array.wiimoteExtensionsEntries)[which]);
|
||||
StringSetting extension = new StringSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, Settings.SECTION_WIIMOTE + wiimoteNumber, mContext.getResources().getStringArray(R.array.wiimoteExtensionsEntries)[which]);
|
||||
mView.putSetting(extension);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
|
@ -12,14 +12,11 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.ui.DividerItemDecoration;
|
||||
import org.dolphinemu.dolphinemu.utils.SettingsFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public final class SettingsFragment extends Fragment implements SettingsFragmentView
|
||||
{
|
||||
|
@ -105,13 +102,7 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
|||
recyclerView.addItemDecoration(new DividerItemDecoration(getActivity(), null));
|
||||
|
||||
SettingsActivityView activity = (SettingsActivityView) getActivity();
|
||||
|
||||
ArrayList<HashMap<String, SettingSection>> settings = new ArrayList<>();
|
||||
settings.add(SettingsFile.SETTINGS_DOLPHIN, activity.getSettings(SettingsFile.SETTINGS_DOLPHIN));
|
||||
settings.add(SettingsFile.SETTINGS_GFX, activity.getSettings(SettingsFile.SETTINGS_GFX));
|
||||
settings.add(SettingsFile.SETTINGS_WIIMOTE, activity.getSettings(SettingsFile.SETTINGS_WIIMOTE));
|
||||
|
||||
mPresenter.onViewCreated(settings);
|
||||
mPresenter.onViewCreated(activity.getSettings());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -127,13 +118,13 @@ public final class SettingsFragment extends Fragment implements SettingsFragment
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onSettingsFileLoaded(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
public void onSettingsFileLoaded(org.dolphinemu.dolphinemu.features.settings.model.Settings settings)
|
||||
{
|
||||
mPresenter.setSettings(settings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void passSettingsToActivity(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
public void passSettingsToActivity(org.dolphinemu.dolphinemu.features.settings.model.Settings settings)
|
||||
{
|
||||
if (mActivity != null)
|
||||
{
|
|
@ -0,0 +1,974 @@
|
|||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.CheckBoxSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.HeaderSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SliderSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.StringSingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SubmenuSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.utils.SettingsFile;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.utils.EGLHelper;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public final class SettingsFragmentPresenter
|
||||
{
|
||||
private SettingsFragmentView mView;
|
||||
|
||||
public static final String ARG_CONTROLLER_TYPE = "controller_type";
|
||||
private MenuTag mMenuTag;
|
||||
private String mGameID;
|
||||
|
||||
private Settings mSettings;
|
||||
private ArrayList<SettingsItem> mSettingsList;
|
||||
|
||||
private int mControllerNumber;
|
||||
private int mControllerType;
|
||||
|
||||
public SettingsFragmentPresenter(SettingsFragmentView view)
|
||||
{
|
||||
mView = view;
|
||||
}
|
||||
|
||||
public void onCreate(MenuTag menuTag, String gameId, Bundle extras)
|
||||
{
|
||||
mGameID = gameId;
|
||||
|
||||
this.mMenuTag = menuTag;
|
||||
if (menuTag.isGCPadMenu() || menuTag.isWiimoteExtensionMenu())
|
||||
{
|
||||
mControllerNumber = menuTag.getSubType();
|
||||
mControllerType = extras.getInt(ARG_CONTROLLER_TYPE);
|
||||
}
|
||||
else if (menuTag.isWiimoteMenu())
|
||||
{
|
||||
mControllerNumber = menuTag.getSubType();
|
||||
}
|
||||
else
|
||||
{
|
||||
mMenuTag = menuTag;
|
||||
}
|
||||
}
|
||||
|
||||
public void onViewCreated(Settings settings)
|
||||
{
|
||||
setSettings(settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the screen is rotated, the Activity will forget the settings map. This fragment
|
||||
* won't, though; so rather than have the Activity reload from disk, have the fragment pass
|
||||
* the settings map back to the Activity.
|
||||
*/
|
||||
public void onAttach()
|
||||
{
|
||||
if (mSettings != null)
|
||||
{
|
||||
mView.passSettingsToActivity(mSettings);
|
||||
}
|
||||
}
|
||||
|
||||
public void putSetting(Setting setting)
|
||||
{
|
||||
mSettings.getSection(setting.getSection()).putSetting(setting);
|
||||
}
|
||||
|
||||
public void loadDefaultSettings()
|
||||
{
|
||||
loadSettingsList();
|
||||
}
|
||||
|
||||
public void setSettings(Settings settings)
|
||||
{
|
||||
if (mSettingsList == null && settings != null)
|
||||
{
|
||||
mSettings = settings;
|
||||
|
||||
loadSettingsList();
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.showSettingsList(mSettingsList);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadSettingsList()
|
||||
{
|
||||
if (!TextUtils.isEmpty(mGameID))
|
||||
{
|
||||
mView.getActivity().setTitle("Game Settings: " + mGameID);
|
||||
}
|
||||
ArrayList<SettingsItem> sl = new ArrayList<>();
|
||||
|
||||
switch (mMenuTag)
|
||||
{
|
||||
case CONFIG:
|
||||
addConfigSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_GENERAL:
|
||||
addGeneralSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_INTERFACE:
|
||||
addInterfaceSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_GAME_CUBE:
|
||||
addGameCubeSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_WII:
|
||||
addWiiSettings(sl);
|
||||
break;
|
||||
|
||||
case GRAPHICS:
|
||||
addGraphicsSettings(sl);
|
||||
break;
|
||||
|
||||
case GCPAD_TYPE:
|
||||
addGcPadSettings(sl);
|
||||
break;
|
||||
|
||||
case WIIMOTE:
|
||||
addWiimoteSettings(sl);
|
||||
break;
|
||||
|
||||
case ENHANCEMENTS:
|
||||
addEnhanceSettings(sl);
|
||||
break;
|
||||
|
||||
case HACKS:
|
||||
addHackSettings(sl);
|
||||
break;
|
||||
|
||||
case GCPAD_1:
|
||||
case GCPAD_2:
|
||||
case GCPAD_3:
|
||||
case GCPAD_4:
|
||||
addGcPadSubSettings(sl, mControllerNumber, mControllerType);
|
||||
break;
|
||||
|
||||
case WIIMOTE_1:
|
||||
case WIIMOTE_2:
|
||||
case WIIMOTE_3:
|
||||
case WIIMOTE_4:
|
||||
addWiimoteSubSettings(sl, mControllerNumber);
|
||||
break;
|
||||
|
||||
case WIIMOTE_EXTENSION_1:
|
||||
case WIIMOTE_EXTENSION_2:
|
||||
case WIIMOTE_EXTENSION_3:
|
||||
case WIIMOTE_EXTENSION_4:
|
||||
addExtensionTypeSettings(sl, mControllerNumber, mControllerType);
|
||||
break;
|
||||
|
||||
case STEREOSCOPY:
|
||||
addStereoSettings(sl);
|
||||
break;
|
||||
|
||||
default:
|
||||
mView.showToastMessage("Unimplemented menu");
|
||||
return;
|
||||
}
|
||||
|
||||
mSettingsList = sl;
|
||||
mView.showSettingsList(mSettingsList);
|
||||
}
|
||||
|
||||
private void addConfigSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, MenuTag.CONFIG_GENERAL));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, MenuTag.CONFIG_INTERFACE));
|
||||
|
||||
sl.add(new SubmenuSetting(null, null, R.string.gamecube_submenu, 0, MenuTag.CONFIG_GAME_CUBE));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, 0, MenuTag.CONFIG_WII));
|
||||
}
|
||||
|
||||
private void addGeneralSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting cpuCore = null;
|
||||
Setting dualCore = null;
|
||||
Setting overclockEnable = null;
|
||||
Setting overclock = null;
|
||||
Setting speedLimit = null;
|
||||
Setting audioStretch = null;
|
||||
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
cpuCore = coreSection.getSetting(SettingsFile.KEY_CPU_CORE);
|
||||
dualCore = coreSection.getSetting(SettingsFile.KEY_DUAL_CORE);
|
||||
overclockEnable = coreSection.getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE);
|
||||
overclock = coreSection.getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT);
|
||||
speedLimit = coreSection.getSetting(SettingsFile.KEY_SPEED_LIMIT);
|
||||
audioStretch = coreSection.getSetting(SettingsFile.KEY_AUDIO_STRETCH);
|
||||
|
||||
// TODO: Having different emuCoresEntries/emuCoresValues for each architecture is annoying.
|
||||
// The proper solution would be to have one emuCoresEntries and one emuCoresValues
|
||||
// and exclude the values that aren't present in PowerPC::AvailableCPUCores().
|
||||
int defaultCpuCore = NativeLibrary.DefaultCPUCore();
|
||||
int emuCoresEntries;
|
||||
int emuCoresValues;
|
||||
if (defaultCpuCore == 1) // x86-64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesX86_64;
|
||||
emuCoresValues = R.array.emuCoresValuesX86_64;
|
||||
}
|
||||
else if (defaultCpuCore == 4) // AArch64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesARM64;
|
||||
emuCoresValues = R.array.emuCoresValuesARM64;
|
||||
}
|
||||
else
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesGeneric;
|
||||
emuCoresValues = R.array.emuCoresValuesGeneric;
|
||||
}
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_CPU_CORE, Settings.SECTION_INI_CORE, R.string.cpu_core, 0, emuCoresEntries, emuCoresValues, defaultCpuCore, cpuCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DUAL_CORE, Settings.SECTION_INI_CORE, R.string.dual_core, R.string.dual_core_description, true, dualCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERCLOCK_ENABLE, Settings.SECTION_INI_CORE, R.string.overclock_enable, R.string.overclock_enable_description, false, overclockEnable));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_OVERCLOCK_PERCENT, Settings.SECTION_INI_CORE, R.string.overclock_title, R.string.overclock_title_description, 400, "%", 100, overclock));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_SPEED_LIMIT, Settings.SECTION_INI_CORE, R.string.speed_limit, 0, 200, "%", 100, speedLimit));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, Settings.SECTION_INI_CORE, R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch));
|
||||
}
|
||||
|
||||
private void addInterfaceSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting usePanicHandlers = null;
|
||||
Setting onScreenDisplayMessages = null;
|
||||
|
||||
usePanicHandlers = mSettings.getSection(Settings.SECTION_INI_INTERFACE).getSetting(SettingsFile.KEY_USE_PANIC_HANDLERS);
|
||||
onScreenDisplayMessages = mSettings.getSection(Settings.SECTION_INI_INTERFACE).getSetting(SettingsFile.KEY_OSD_MESSAGES);
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_PANIC_HANDLERS, Settings.SECTION_INI_INTERFACE, R.string.panic_handlers, R.string.panic_handlers_description, true, usePanicHandlers));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OSD_MESSAGES, Settings.SECTION_INI_INTERFACE, R.string.osd_messages, R.string.osd_messages_description, true, onScreenDisplayMessages));
|
||||
}
|
||||
|
||||
private void addGameCubeSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting systemLanguage = null;
|
||||
Setting overrideGCLanguage = null;
|
||||
Setting slotADevice = null;
|
||||
Setting slotBDevice = null;
|
||||
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
systemLanguage = coreSection.getSetting(SettingsFile.KEY_GAME_CUBE_LANGUAGE);
|
||||
overrideGCLanguage = coreSection.getSetting(SettingsFile.KEY_OVERRIDE_GAME_CUBE_LANGUAGE);
|
||||
slotADevice = coreSection.getSetting(SettingsFile.KEY_SLOT_A_DEVICE);
|
||||
slotBDevice = coreSection.getSetting(SettingsFile.KEY_SLOT_B_DEVICE);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_GAME_CUBE_LANGUAGE, Settings.SECTION_INI_CORE, R.string.gamecube_system_language, 0, R.array.gameCubeSystemLanguageEntries, R.array.gameCubeSystemLanguageValues, 0, systemLanguage));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERRIDE_GAME_CUBE_LANGUAGE, Settings.SECTION_INI_CORE, R.string.override_gamecube_language, 0, false, overrideGCLanguage));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_A_DEVICE, Settings.SECTION_INI_CORE, R.string.slot_a_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 8, slotADevice));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_SLOT_B_DEVICE, Settings.SECTION_INI_CORE, R.string.slot_b_device, 0, R.array.slotDeviceEntries, R.array.slotDeviceValues, 255, slotBDevice));
|
||||
}
|
||||
|
||||
private void addWiiSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting continuousScan = null;
|
||||
Setting wiimoteSpeaker = null;
|
||||
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
continuousScan = coreSection.getSetting(SettingsFile.KEY_WIIMOTE_SCAN);
|
||||
wiimoteSpeaker = coreSection.getSetting(SettingsFile.KEY_WIIMOTE_SPEAKER);
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SCAN, Settings.SECTION_INI_CORE, R.string.wiimote_scanning, R.string.wiimote_scanning_description, true, continuousScan));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SPEAKER, Settings.SECTION_INI_CORE, R.string.wiimote_speaker, R.string.wiimote_speaker_description, true, wiimoteSpeaker));
|
||||
}
|
||||
|
||||
private void addGcPadSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
// TODO This controller_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order.
|
||||
Setting gcPadSetting = mSettings.getSection(Settings.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GCPAD_TYPE + i);
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_GCPAD_TYPE + i, Settings.SECTION_INI_CORE, R.string.controller_0 + i, 0, R.array.gcpadTypeEntries, R.array.gcpadTypeValues, 0, gcPadSetting, MenuTag.getGCPadMenuTag(i)));
|
||||
}
|
||||
}
|
||||
|
||||
private void addWiimoteSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
// TODO This wiimote_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order.
|
||||
Setting wiimoteSetting = mSettings.getSection(Settings.SECTION_WIIMOTE + (i + 1)).getSetting(SettingsFile.KEY_WIIMOTE_TYPE);
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_TYPE, Settings.SECTION_WIIMOTE + i, R.string.wiimote_4 + i, 0, R.array.wiimoteTypeEntries, R.array.wiimoteTypeValues, 0, wiimoteSetting, MenuTag.getWiimoteMenuTag(i+4)));
|
||||
}
|
||||
}
|
||||
|
||||
private void addGraphicsSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
IntSetting videoBackend = new IntSetting(SettingsFile.KEY_VIDEO_BACKEND_INDEX, Settings.SECTION_INI_CORE, getVideoBackendValue());
|
||||
Setting showFps = null;
|
||||
Setting shaderCompilationMode = null;
|
||||
Setting waitForShaders = null;
|
||||
Setting aspectRatio = null;
|
||||
|
||||
SettingSection gfxSection = mSettings.getSection(Settings.SECTION_GFX_SETTINGS);
|
||||
showFps = gfxSection.getSetting(SettingsFile.KEY_SHOW_FPS);
|
||||
shaderCompilationMode = gfxSection.getSetting(SettingsFile.KEY_SHADER_COMPILATION_MODE);
|
||||
waitForShaders = gfxSection.getSetting(SettingsFile.KEY_WAIT_FOR_SHADERS);
|
||||
aspectRatio = gfxSection.getSetting(SettingsFile.KEY_ASPECT_RATIO);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.graphics_general, 0));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_VIDEO_BACKEND_INDEX, Settings.SECTION_INI_CORE, R.string.video_backend, R.string.video_backend_description, R.array.videoBackendEntries, R.array.videoBackendValues, 0, videoBackend));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SHOW_FPS, Settings.SECTION_GFX_SETTINGS, R.string.show_fps, R.string.show_fps_description, false, showFps));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_SHADER_COMPILATION_MODE, Settings.SECTION_GFX_SETTINGS, R.string.shader_compilation_mode, R.string.shader_compilation_mode_description, R.array.shaderCompilationModeEntries, R.array.shaderCompilationModeValues, 0, shaderCompilationMode));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WAIT_FOR_SHADERS, Settings.SECTION_GFX_SETTINGS, R.string.wait_for_shaders, 0, false, waitForShaders));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, Settings.SECTION_GFX_SETTINGS, R.string.aspect_ratio, R.string.aspect_ratio_description, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.graphics_enhancements_and_hacks, 0));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, 0, MenuTag.ENHANCEMENTS));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, 0, MenuTag.HACKS));
|
||||
}
|
||||
|
||||
private void addEnhanceSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
SettingSection gfxSection = mSettings.getSection(Settings.SECTION_GFX_SETTINGS);
|
||||
SettingSection enhancementSection = mSettings.getSection(Settings.SECTION_GFX_ENHANCEMENTS);
|
||||
SettingSection hacksSection = mSettings.getSection(Settings.SECTION_GFX_HACKS);
|
||||
|
||||
Setting resolution = gfxSection.getSetting(SettingsFile.KEY_INTERNAL_RES);
|
||||
Setting fsaa = gfxSection.getSetting(SettingsFile.KEY_FSAA);
|
||||
Setting anisotropic = enhancementSection.getSetting(SettingsFile.KEY_ANISOTROPY);
|
||||
Setting shader = enhancementSection.getSetting(SettingsFile.KEY_POST_SHADER);
|
||||
Setting efbScaledCopy = hacksSection.getSetting(SettingsFile.KEY_SCALED_EFB);
|
||||
Setting perPixel = gfxSection.getSetting(SettingsFile.KEY_PER_PIXEL);
|
||||
Setting forceFilter = enhancementSection.getSetting(SettingsFile.KEY_FORCE_FILTERING);
|
||||
Setting disableFog = gfxSection.getSetting(SettingsFile.KEY_DISABLE_FOG);
|
||||
Setting disableCopyFilter = gfxSection.getSetting(SettingsFile.KEY_DISABLE_COPY_FILTER);
|
||||
Setting arbitraryMipmapDetection = gfxSection.getSetting(SettingsFile.KEY_ARBITRARY_MIPMAP_DETECTION);
|
||||
Setting wideScreenHack = enhancementSection.getSetting(SettingsFile.KEY_WIDE_SCREEN_HACK);
|
||||
Setting force24BitColor = gfxSection.getSetting(SettingsFile.KEY_FORCE_24_BIT_COLOR);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_INTERNAL_RES, Settings.SECTION_GFX_SETTINGS, R.string.internal_resolution, R.string.internal_resolution_description, R.array.internalResolutionEntries, R.array.internalResolutionValues, 1, resolution));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_FSAA, Settings.SECTION_GFX_SETTINGS, R.string.FSAA, R.string.FSAA_description, R.array.FSAAEntries, R.array.FSAAValues, 0, fsaa));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_ANISOTROPY, Settings.SECTION_GFX_ENHANCEMENTS, R.string.anisotropic_filtering, R.string.anisotropic_filtering_description, R.array.anisotropicFilteringEntries, R.array.anisotropicFilteringValues, 0, anisotropic));
|
||||
|
||||
IntSetting stereoModeValue = (IntSetting) gfxSection.getSetting(SettingsFile.KEY_STEREO_MODE);
|
||||
int anaglyphMode = 3;
|
||||
String subDir = stereoModeValue != null && stereoModeValue.getValue() == anaglyphMode ? "Anaglyph" : null;
|
||||
String[] shaderListEntries = getShaderList(subDir);
|
||||
String[] shaderListValues = new String[shaderListEntries.length];
|
||||
System.arraycopy(shaderListEntries, 0, shaderListValues, 0, shaderListEntries.length);
|
||||
shaderListValues[0] = "";
|
||||
sl.add(new StringSingleChoiceSetting(SettingsFile.KEY_POST_SHADER, Settings.SECTION_GFX_ENHANCEMENTS, R.string.post_processing_shader, R.string.post_processing_shader_description, shaderListEntries, shaderListValues, "", shader));
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SCALED_EFB, Settings.SECTION_GFX_HACKS, R.string.scaled_efb_copy, R.string.scaled_efb_copy_description, true, efbScaledCopy));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_PER_PIXEL, Settings.SECTION_GFX_SETTINGS, R.string.per_pixel_lighting, R.string.per_pixel_lighting_description, false, perPixel));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_FILTERING, Settings.SECTION_GFX_ENHANCEMENTS, R.string.force_texture_filtering, R.string.force_texture_filtering_description, false, forceFilter));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_24_BIT_COLOR, Settings.SECTION_GFX_SETTINGS, R.string.force_24bit_color, R.string.force_24bit_color_description, true, force24BitColor));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_FOG, Settings.SECTION_GFX_SETTINGS, R.string.disable_fog, R.string.disable_fog_description, false, disableFog));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_COPY_FILTER, Settings.SECTION_GFX_SETTINGS, R.string.disable_copy_filter, R.string.disable_copy_filter_description, false, disableCopyFilter));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_ARBITRARY_MIPMAP_DETECTION, Settings.SECTION_GFX_SETTINGS, R.string.arbitrary_mipmap_detection, R.string.arbitrary_mipmap_detection_description, true, arbitraryMipmapDetection));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WIDE_SCREEN_HACK, Settings.SECTION_GFX_ENHANCEMENTS, R.string.wide_screen_hack, R.string.wide_screen_hack_description, false, wideScreenHack));
|
||||
|
||||
/*
|
||||
Check if we support stereo
|
||||
If we support desktop GL then we must support at least OpenGL 3.2
|
||||
If we only support OpenGLES then we need both OpenGLES 3.1 and AEP
|
||||
*/
|
||||
EGLHelper helper = new EGLHelper(EGLHelper.EGL_OPENGL_ES2_BIT);
|
||||
|
||||
if ((helper.supportsOpenGL() && helper.GetVersion() >= 320) ||
|
||||
(helper.supportsGLES3() && helper.GetVersion() >= 310 && helper.SupportsExtension("GL_ANDROID_extension_pack_es31a")))
|
||||
{
|
||||
sl.add(new SubmenuSetting(SettingsFile.KEY_STEREO_MODE, null, R.string.stereoscopy_submenu, R.string.stereoscopy_submenu_description, MenuTag.STEREOSCOPY));
|
||||
}
|
||||
}
|
||||
|
||||
private String[] getShaderList(String subDir)
|
||||
{
|
||||
try
|
||||
{
|
||||
String shadersPath = DirectoryInitializationService.getDolphinInternalDirectory() + "/Shaders";
|
||||
if(!TextUtils.isEmpty(subDir)) {
|
||||
shadersPath += "/" + subDir;
|
||||
}
|
||||
|
||||
File file = new File(shadersPath);
|
||||
File[] shaderFiles = file.listFiles();
|
||||
if (shaderFiles != null)
|
||||
{
|
||||
String[] result = new String[shaderFiles.length + 1];
|
||||
result[0] = "Off";
|
||||
for (int i = 0; i < shaderFiles.length; i++)
|
||||
{
|
||||
String name = shaderFiles[i].getName();
|
||||
int extensionIndex = name.indexOf(".glsl");
|
||||
if (extensionIndex > 0)
|
||||
{
|
||||
name = name.substring(0, extensionIndex);
|
||||
}
|
||||
result[i+1] = name;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.debug("[Settings] Unable to find shader files");
|
||||
// return empty list
|
||||
}
|
||||
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
private void addHackSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
SettingSection gfxSection = mSettings.getSection(Settings.SECTION_GFX_SETTINGS);
|
||||
SettingSection hacksSection = mSettings.getSection(Settings.SECTION_GFX_HACKS);
|
||||
|
||||
boolean skipEFBValue = getInvertedBooleanValue(Settings.SECTION_GFX_HACKS, SettingsFile.KEY_SKIP_EFB, false);
|
||||
boolean ignoreFormatValue = getInvertedBooleanValue(Settings.SECTION_GFX_HACKS, SettingsFile.KEY_IGNORE_FORMAT, true);
|
||||
|
||||
BooleanSetting skipEFB = new BooleanSetting(SettingsFile.KEY_SKIP_EFB, Settings.SECTION_GFX_HACKS, skipEFBValue);
|
||||
BooleanSetting ignoreFormat = new BooleanSetting(SettingsFile.KEY_IGNORE_FORMAT, Settings.SECTION_GFX_HACKS, ignoreFormatValue);
|
||||
Setting efbToTexture = hacksSection.getSetting(SettingsFile.KEY_EFB_TEXTURE);
|
||||
Setting texCacheAccuracy = gfxSection.getSetting(SettingsFile.KEY_TEXCACHE_ACCURACY);
|
||||
Setting gpuTextureDecoding = gfxSection.getSetting(SettingsFile.KEY_GPU_TEXTURE_DECODING);
|
||||
Setting xfbToTexture = hacksSection.getSetting(SettingsFile.KEY_XFB_TEXTURE);
|
||||
Setting immediateXfb = hacksSection.getSetting(SettingsFile.KEY_IMMEDIATE_XFB);
|
||||
Setting fastDepth = hacksSection.getSetting(SettingsFile.KEY_FAST_DEPTH);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.embedded_frame_buffer, 0));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SKIP_EFB, Settings.SECTION_GFX_HACKS, R.string.skip_efb_access, R.string.skip_efb_access_description, false, skipEFB));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_IGNORE_FORMAT, Settings.SECTION_GFX_HACKS, R.string.ignore_format_changes, R.string.ignore_format_changes_description, true, ignoreFormat));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_EFB_TEXTURE, Settings.SECTION_GFX_HACKS, R.string.efb_copy_method, R.string.efb_copy_method_description, true, efbToTexture));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.texture_cache, 0));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_TEXCACHE_ACCURACY, Settings.SECTION_GFX_SETTINGS, R.string.texture_cache_accuracy, R.string.texture_cache_accuracy_description, R.array.textureCacheAccuracyEntries, R.array.textureCacheAccuracyValues, 128, texCacheAccuracy));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_GPU_TEXTURE_DECODING, Settings.SECTION_GFX_SETTINGS, R.string.gpu_texture_decoding, R.string.gpu_texture_decoding_description, false, gpuTextureDecoding));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.external_frame_buffer, 0));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_XFB_TEXTURE, Settings.SECTION_GFX_HACKS, R.string.xfb_copy_method, R.string.xfb_copy_method_description, true, xfbToTexture));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_IMMEDIATE_XFB, Settings.SECTION_GFX_HACKS, R.string.immediate_xfb, R.string.immediate_xfb_description, false, immediateXfb));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.other, 0));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FAST_DEPTH, Settings.SECTION_GFX_HACKS, R.string.fast_depth_calculation, R.string.fast_depth_calculation_description, true, fastDepth));
|
||||
}
|
||||
|
||||
private void addStereoSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
SettingSection stereoScopySection = mSettings.getSection(Settings.SECTION_STEREOSCOPY);
|
||||
|
||||
Setting stereoModeValue = stereoScopySection.getSetting(SettingsFile.KEY_STEREO_MODE);
|
||||
Setting stereoDepth = stereoScopySection.getSetting(SettingsFile.KEY_STEREO_DEPTH);
|
||||
Setting convergence = stereoScopySection.getSetting(SettingsFile.KEY_STEREO_CONV);
|
||||
Setting swapEyes = stereoScopySection.getSetting(SettingsFile.KEY_STEREO_SWAP);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_STEREO_MODE, Settings.SECTION_STEREOSCOPY, R.string.stereoscopy_mode, R.string.stereoscopy_mode_description, R.array.stereoscopyEntries, R.array.stereoscopyValues, 0, stereoModeValue));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_STEREO_DEPTH, Settings.SECTION_STEREOSCOPY, R.string.stereoscopy_depth, R.string.stereoscopy_depth_description, 100, "%", 20, stereoDepth));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_STEREO_CONV, Settings.SECTION_STEREOSCOPY, R.string.stereoscopy_convergence, R.string.stereoscopy_convergence_description, 200, "%", 0, convergence));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_STEREO_SWAP, Settings.SECTION_STEREOSCOPY, R.string.stereoscopy_swap_eyes, R.string.stereoscopy_swap_eyes_description, false, swapEyes));
|
||||
}
|
||||
|
||||
private void addGcPadSubSettings(ArrayList<SettingsItem> sl, int gcPadNumber, int gcPadType)
|
||||
{
|
||||
SettingSection bindingsSection = mSettings.getSection(Settings.SECTION_BINDINGS);
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
|
||||
if (gcPadType == 1) // Emulated
|
||||
{
|
||||
Setting bindA = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_A + gcPadNumber);
|
||||
Setting bindB = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_B + gcPadNumber);
|
||||
Setting bindX = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_X + gcPadNumber);
|
||||
Setting bindY = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_Y + gcPadNumber);
|
||||
Setting bindZ = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_Z + gcPadNumber);
|
||||
Setting bindStart = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_START + gcPadNumber);
|
||||
Setting bindControlUp = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_CONTROL_UP + gcPadNumber);
|
||||
Setting bindControlDown = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_CONTROL_DOWN + gcPadNumber);
|
||||
Setting bindControlLeft = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_CONTROL_LEFT + gcPadNumber);
|
||||
Setting bindControlRight = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_CONTROL_RIGHT + gcPadNumber);
|
||||
Setting bindCUp = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_C_UP + gcPadNumber);
|
||||
Setting bindCDown = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_C_DOWN + gcPadNumber);
|
||||
Setting bindCLeft = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_C_LEFT + gcPadNumber);
|
||||
Setting bindCRight = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_C_RIGHT + gcPadNumber);
|
||||
Setting bindTriggerL = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_L + gcPadNumber);
|
||||
Setting bindTriggerR = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_TRIGGER_R + gcPadNumber);
|
||||
Setting bindDPadUp = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_DPAD_UP + gcPadNumber);
|
||||
Setting bindDPadDown = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_DPAD_DOWN + gcPadNumber);
|
||||
Setting bindDPadLeft = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_DPAD_LEFT + gcPadNumber);
|
||||
Setting bindDPadRight = bindingsSection.getSetting(SettingsFile.KEY_GCBIND_DPAD_RIGHT + gcPadNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_A + gcPadNumber, Settings.SECTION_BINDINGS, R.string.button_a, bindA));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_B + gcPadNumber, Settings.SECTION_BINDINGS, R.string.button_b, bindB));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_X + gcPadNumber, Settings.SECTION_BINDINGS, R.string.button_x, bindX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_Y + gcPadNumber, Settings.SECTION_BINDINGS, R.string.button_y, bindY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_Z + gcPadNumber, Settings.SECTION_BINDINGS, R.string.button_z, bindZ));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_START + gcPadNumber, Settings.SECTION_BINDINGS, R.string.button_start, bindStart));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_control, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_UP + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindControlUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_DOWN + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindControlDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_LEFT + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindControlLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_RIGHT + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindControlRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_c, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_UP + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindCUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_DOWN + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindCDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_LEFT + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindCLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_RIGHT + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindCRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_trig, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_TRIGGER_L + gcPadNumber, Settings.SECTION_BINDINGS, R.string.trigger_left, bindTriggerL));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_TRIGGER_R + gcPadNumber, Settings.SECTION_BINDINGS, R.string.trigger_right, bindTriggerR));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_UP + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindDPadUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_DOWN + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindDPadDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_LEFT + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindDPadLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_RIGHT + gcPadNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindDPadRight));
|
||||
}
|
||||
else // Adapter
|
||||
{
|
||||
Setting rumble = coreSection.getSetting(SettingsFile.KEY_GCADAPTER_RUMBLE + gcPadNumber);
|
||||
Setting bongos = coreSection.getSetting(SettingsFile.KEY_GCADAPTER_BONGOS + gcPadNumber);
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_GCADAPTER_RUMBLE + gcPadNumber, Settings.SECTION_INI_CORE, R.string.gc_adapter_rumble, R.string.gc_adapter_rumble_description, false, rumble));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_GCADAPTER_BONGOS + gcPadNumber, Settings.SECTION_INI_CORE, R.string.gc_adapter_bongos, R.string.gc_adapter_bongos_description, false, bongos));
|
||||
}
|
||||
}
|
||||
|
||||
private void addWiimoteSubSettings(ArrayList<SettingsItem> sl, int wiimoteNumber)
|
||||
{
|
||||
SettingSection bindingsSection = mSettings.getSection(Settings.SECTION_BINDINGS);
|
||||
|
||||
// Bindings use controller numbers 4-7 (0-3 are GameCube), but the extension setting uses 1-4.
|
||||
IntSetting extension = new IntSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, Settings.SECTION_WIIMOTE + wiimoteNumber, getExtensionValue(wiimoteNumber), MenuTag.getWiimoteExtensionMenuTag(wiimoteNumber));
|
||||
Setting bindA = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_A + wiimoteNumber);
|
||||
Setting bindB = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_B + wiimoteNumber);
|
||||
Setting bind1 = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_1 + wiimoteNumber);
|
||||
Setting bind2 = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_2 + wiimoteNumber);
|
||||
Setting bindMinus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_MINUS + wiimoteNumber);
|
||||
Setting bindPlus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_PLUS + wiimoteNumber);
|
||||
Setting bindHome = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_HOME + wiimoteNumber);
|
||||
Setting bindIRUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_UP + wiimoteNumber);
|
||||
Setting bindIRDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_DOWN + wiimoteNumber);
|
||||
Setting bindIRLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_LEFT + wiimoteNumber);
|
||||
Setting bindIRRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_RIGHT + wiimoteNumber);
|
||||
Setting bindIRForward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_FORWARD + wiimoteNumber);
|
||||
Setting bindIRBackward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_BACKWARD + wiimoteNumber);
|
||||
Setting bindIRHide = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_IR_HIDE + wiimoteNumber);
|
||||
Setting bindSwingUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SWING_UP + wiimoteNumber);
|
||||
Setting bindSwingDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SWING_DOWN + wiimoteNumber);
|
||||
Setting bindSwingLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SWING_LEFT + wiimoteNumber);
|
||||
Setting bindSwingRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SWING_RIGHT + wiimoteNumber);
|
||||
Setting bindSwingForward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SWING_FORWARD + wiimoteNumber);
|
||||
Setting bindSwingBackward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SWING_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltForward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TILT_FORWARD + wiimoteNumber);
|
||||
Setting bindTiltBackward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TILT_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TILT_LEFT + wiimoteNumber);
|
||||
Setting bindTiltRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TILT_RIGHT + wiimoteNumber);
|
||||
Setting bindTiltModifier = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TILT_MODIFIER + wiimoteNumber);
|
||||
Setting bindShakeX = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SHAKE_X + wiimoteNumber);
|
||||
Setting bindShakeY = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SHAKE_Y + wiimoteNumber);
|
||||
Setting bindShakeZ = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_SHAKE_Z + wiimoteNumber);
|
||||
Setting bindDPadUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DPAD_UP + wiimoteNumber);
|
||||
Setting bindDPadDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DPAD_DOWN + wiimoteNumber);
|
||||
Setting bindDPadLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DPAD_LEFT + wiimoteNumber);
|
||||
Setting bindDPadRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DPAD_RIGHT + wiimoteNumber);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, Settings.SECTION_WIIMOTE + (wiimoteNumber - 3), R.string.wiimote_extensions, R.string.wiimote_extensions_description, R.array.wiimoteExtensionsEntries, R.array.wiimoteExtensionsValues, 0, extension, MenuTag.getWiimoteExtensionMenuTag(wiimoteNumber)));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_A + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_a, bindA));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_B + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_b, bindB));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_1 + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_one, bind1));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_2 + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_two, bind2));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_MINUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_minus, bindMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_PLUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_plus, bindPlus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_HOME + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_home, bindHome));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_ir, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindIRUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindIRDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindIRLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindIRRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_FORWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_forward, bindIRForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_BACKWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_backward, bindIRBackward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_HIDE + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.ir_hide, bindIRHide));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_swing, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindSwingUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindSwingDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindSwingLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindSwingRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_FORWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_forward, bindSwingForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_BACKWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_backward, bindSwingBackward));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_tilt, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_FORWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_forward, bindTiltForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_BACKWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_backward, bindTiltBackward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindTiltLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindTiltRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_MODIFIER + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.tilt_modifier, bindTiltModifier));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_shake, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SHAKE_X + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.shake_x, bindShakeX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SHAKE_Y + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.shake_y, bindShakeY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SHAKE_Z + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.shake_z, bindShakeZ));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindDPadUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindDPadDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindDPadLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindDPadRight));
|
||||
}
|
||||
|
||||
private void addExtensionTypeSettings(ArrayList<SettingsItem> sl, int wiimoteNumber, int extentionType)
|
||||
{
|
||||
SettingSection bindingsSection = mSettings.getSection(Settings.SECTION_BINDINGS);
|
||||
|
||||
switch (extentionType)
|
||||
{
|
||||
case 1: // Nunchuk
|
||||
Setting bindC = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_C + wiimoteNumber);
|
||||
Setting bindZ = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_Z + wiimoteNumber);
|
||||
Setting bindUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_UP + wiimoteNumber);
|
||||
Setting bindDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_DOWN + wiimoteNumber);
|
||||
Setting bindLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_LEFT + wiimoteNumber);
|
||||
Setting bindRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_RIGHT + wiimoteNumber);
|
||||
Setting bindSwingUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_UP + wiimoteNumber);
|
||||
Setting bindSwingDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_DOWN + wiimoteNumber);
|
||||
Setting bindSwingLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_LEFT + wiimoteNumber);
|
||||
Setting bindSwingRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_RIGHT + wiimoteNumber);
|
||||
Setting bindSwingForward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_FORWARD + wiimoteNumber);
|
||||
Setting bindSwingBackward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltForward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_FORWARD + wiimoteNumber);
|
||||
Setting bindTiltBackward = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_LEFT + wiimoteNumber);
|
||||
Setting bindTiltRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_RIGHT + wiimoteNumber);
|
||||
Setting bindTiltModifier = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_MODIFIER + wiimoteNumber);
|
||||
Setting bindShakeX = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_X + wiimoteNumber);
|
||||
Setting bindShakeY = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Y + wiimoteNumber);
|
||||
Setting bindShakeZ = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Z + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_C + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.nunchuk_button_c, bindC));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_Z + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_z, bindZ));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_swing, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindSwingUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindSwingDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindSwingLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindSwingRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_FORWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_forward, bindSwingForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_BACKWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_backward, bindSwingBackward));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_tilt, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_FORWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_forward, bindTiltForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_BACKWARD + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_backward, bindTiltBackward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindTiltLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindTiltRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_MODIFIER + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.tilt_modifier, bindTiltModifier));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_shake, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_X + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.shake_x, bindShakeX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Y + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.shake_y, bindShakeY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Z + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.shake_z, bindShakeZ));
|
||||
break;
|
||||
case 2: // Classic
|
||||
Setting bindA = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_A + wiimoteNumber);
|
||||
Setting bindB = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_B + wiimoteNumber);
|
||||
Setting bindX = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_X + wiimoteNumber);
|
||||
Setting bindY = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_Y + wiimoteNumber);
|
||||
Setting bindZL = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZL + wiimoteNumber);
|
||||
Setting bindZR = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZR + wiimoteNumber);
|
||||
Setting bindMinus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_MINUS + wiimoteNumber);
|
||||
Setting bindPlus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_PLUS + wiimoteNumber);
|
||||
Setting bindHome = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_HOME + wiimoteNumber);
|
||||
Setting bindLeftUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_UP + wiimoteNumber);
|
||||
Setting bindLeftDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_DOWN + wiimoteNumber);
|
||||
Setting bindLeftLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_LEFT + wiimoteNumber);
|
||||
Setting bindLeftRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_RIGHT + wiimoteNumber);
|
||||
Setting bindRightUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_UP + wiimoteNumber);
|
||||
Setting bindRightDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_DOWN + wiimoteNumber);
|
||||
Setting bindRightLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_LEFT + wiimoteNumber);
|
||||
Setting bindRightRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_RIGHT + wiimoteNumber);
|
||||
Setting bindL = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_L + wiimoteNumber);
|
||||
Setting bindR = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_R + wiimoteNumber);
|
||||
Setting bindDpadUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_UP + wiimoteNumber);
|
||||
Setting bindDpadDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_DOWN + wiimoteNumber);
|
||||
Setting bindDpadLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_LEFT + wiimoteNumber);
|
||||
Setting bindDpadRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_RIGHT + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_A + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_a, bindA));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_B + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_b, bindB));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_X + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_x, bindX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_Y + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_y, bindY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZL + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.classic_button_zl, bindZL));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZR + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.classic_button_zr, bindZR));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_MINUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_minus, bindMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_PLUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_plus, bindPlus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_HOME + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_home, bindHome));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.classic_leftstick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindLeftUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindLeftDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindLeftLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindLeftRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.classic_rightstick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindRightUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindRightDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindRightLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindRightRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_trig, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_L + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.trigger_left, bindR));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_R + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.trigger_right, bindL));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindDpadUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindDpadDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindDpadLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindDpadRight));
|
||||
break;
|
||||
case 3: // Guitar
|
||||
Setting bindFretGreen = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_GREEN + wiimoteNumber);
|
||||
Setting bindFretRed = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_RED + wiimoteNumber);
|
||||
Setting bindFretYellow = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_YELLOW + wiimoteNumber);
|
||||
Setting bindFretBlue = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_BLUE + wiimoteNumber);
|
||||
Setting bindFretOrange = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_ORANGE + wiimoteNumber);
|
||||
Setting bindStrumUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_UP + wiimoteNumber);
|
||||
Setting bindStrumDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_DOWN + wiimoteNumber);
|
||||
Setting bindGuitarMinus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_MINUS + wiimoteNumber);
|
||||
Setting bindGuitarPlus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_PLUS + wiimoteNumber);
|
||||
Setting bindGuitarUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_UP + wiimoteNumber);
|
||||
Setting bindGuitarDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_DOWN + wiimoteNumber);
|
||||
Setting bindGuitarLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_LEFT + wiimoteNumber);
|
||||
Setting bindGuitarRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_RIGHT + wiimoteNumber);
|
||||
Setting bindWhammyBar = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_GUITAR_WHAMMY_BAR + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.guitar_frets, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_GREEN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_green, bindFretGreen));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_RED + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_red, bindFretRed));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_YELLOW + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_yellow, bindFretYellow));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_BLUE + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_blue, bindFretBlue));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_ORANGE + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_orange, bindFretOrange));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.guitar_strum, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindStrumUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindStrumDown));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_MINUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_minus, bindGuitarMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_PLUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_plus, bindGuitarPlus));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindGuitarUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindGuitarDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindGuitarLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindGuitarRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.guitar_whammy, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_WHAMMY_BAR + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindWhammyBar));
|
||||
break;
|
||||
case 4: // Drums
|
||||
Setting bindPadRed = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_RED + wiimoteNumber);
|
||||
Setting bindPadYellow = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_YELLOW + wiimoteNumber);
|
||||
Setting bindPadBlue = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BLUE + wiimoteNumber);
|
||||
Setting bindPadGreen = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_GREEN + wiimoteNumber);
|
||||
Setting bindPadOrange = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_ORANGE + wiimoteNumber);
|
||||
Setting bindPadBass = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BASS + wiimoteNumber);
|
||||
Setting bindDrumsUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_UP + wiimoteNumber);
|
||||
Setting bindDrumsDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_DOWN + wiimoteNumber);
|
||||
Setting bindDrumsLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_LEFT + wiimoteNumber);
|
||||
Setting bindDrumsRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_RIGHT + wiimoteNumber);
|
||||
Setting bindDrumsMinus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_MINUS + wiimoteNumber);
|
||||
Setting bindDrumsPlus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PLUS + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.drums_pads, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_RED + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_red, bindPadRed));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_YELLOW + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_yellow, bindPadYellow));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BLUE + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_blue, bindPadBlue));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_GREEN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_green, bindPadGreen));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_ORANGE + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_orange, bindPadOrange));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BASS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.drums_pad_bass, bindPadBass));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindDrumsUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindDrumsDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindDrumsLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindDrumsRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_MINUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_minus, bindDrumsMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PLUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_plus, bindDrumsPlus));
|
||||
break;
|
||||
case 5: // Turntable
|
||||
Setting bindGreenLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_LEFT + wiimoteNumber);
|
||||
Setting bindRedLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_LEFT + wiimoteNumber);
|
||||
Setting bindBlueLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_LEFT + wiimoteNumber);
|
||||
Setting bindGreenRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_RIGHT + wiimoteNumber);
|
||||
Setting bindRedRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_RIGHT + wiimoteNumber);
|
||||
Setting bindBlueRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_RIGHT + wiimoteNumber);
|
||||
Setting bindTurntableMinus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_MINUS + wiimoteNumber);
|
||||
Setting bindTurntablePlus = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_PLUS + wiimoteNumber);
|
||||
Setting bindEuphoria = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EUPHORIA + wiimoteNumber);
|
||||
Setting bindTurntableLeftLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_LEFT + wiimoteNumber);
|
||||
Setting bindTurntableLeftRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_RIGHT + wiimoteNumber);
|
||||
Setting bindTurntableRightLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_LEFT + wiimoteNumber);
|
||||
Setting bindTurntableRightRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_RIGHT + wiimoteNumber);
|
||||
Setting bindTurntableUp = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_UP + wiimoteNumber);
|
||||
Setting bindTurntableDown = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_DOWN + wiimoteNumber);
|
||||
Setting bindTurntableLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_LEFT + wiimoteNumber);
|
||||
Setting bindTurntableRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_RIGHT + wiimoteNumber);
|
||||
Setting bindEffectDial = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EFFECT_DIAL + wiimoteNumber);
|
||||
Setting bindCrossfadeLeft = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_LEFT + wiimoteNumber);
|
||||
Setting bindCrossfadeRight = bindingsSection.getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_RIGHT + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_green_left, bindGreenLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_red_left, bindRedLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_blue_left, bindBlueLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_green_right, bindGreenRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_red_right, bindRedRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_blue_right, bindBlueRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_MINUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_minus, bindTurntableMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_PLUS + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.button_plus, bindTurntablePlus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EUPHORIA + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_button_euphoria, bindEuphoria));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_table_left, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindTurntableLeftLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindTurntableLeftRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_table_right, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindTurntableRightLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindTurntableRightRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_UP + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_up, bindTurntableUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_DOWN + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_down, bindTurntableDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindTurntableLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindTurntableRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_effect, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EFFECT_DIAL + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.turntable_effect_dial, bindEffectDial));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_crossfade, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_LEFT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_left, bindCrossfadeLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_RIGHT + wiimoteNumber, Settings.SECTION_BINDINGS, R.string.generic_right, bindCrossfadeRight));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean getInvertedBooleanValue(String section, String key, boolean defaultValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return !((BooleanSetting) mSettings.getSection(section).getSetting(key)).getValue();
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
private int getVideoBackendValue()
|
||||
{
|
||||
SettingSection coreSection = mSettings.getSection(Settings.SECTION_INI_CORE);
|
||||
|
||||
int videoBackendValue;
|
||||
|
||||
try
|
||||
{
|
||||
String videoBackend = ((StringSetting)coreSection.getSetting(SettingsFile.KEY_VIDEO_BACKEND)).getValue();
|
||||
if (videoBackend.equals("OGL"))
|
||||
{
|
||||
videoBackendValue = 0;
|
||||
}
|
||||
else if (videoBackend.equals("Vulkan"))
|
||||
{
|
||||
videoBackendValue = 1;
|
||||
}
|
||||
else if (videoBackend.equals("Software Renderer"))
|
||||
{
|
||||
videoBackendValue = 2;
|
||||
}
|
||||
else if (videoBackend.equals("Null"))
|
||||
{
|
||||
videoBackendValue = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
videoBackendValue = 0;
|
||||
}
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
videoBackendValue = 0;
|
||||
}
|
||||
|
||||
return videoBackendValue;
|
||||
}
|
||||
|
||||
private int getExtensionValue(int wiimoteNumber)
|
||||
{
|
||||
int extensionValue;
|
||||
|
||||
try
|
||||
{
|
||||
String extension = ((StringSetting)mSettings.getSection(Settings.SECTION_WIIMOTE + wiimoteNumber).getSetting(SettingsFile.KEY_WIIMOTE_EXTENSION)).getValue();
|
||||
if (extension.equals("None"))
|
||||
{
|
||||
extensionValue = 0;
|
||||
}
|
||||
else if (extension.equals("Nunchuk"))
|
||||
{
|
||||
extensionValue = 1;
|
||||
}
|
||||
else if (extension.equals("Classic"))
|
||||
{
|
||||
extensionValue = 2;
|
||||
}
|
||||
else if (extension.equals("Guitar"))
|
||||
{
|
||||
extensionValue = 3;
|
||||
}
|
||||
else if (extension.equals("Drums"))
|
||||
{
|
||||
extensionValue = 4;
|
||||
}
|
||||
else if (extension.equals("Turntable"))
|
||||
{
|
||||
extensionValue = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
extensionValue = 0;
|
||||
}
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
extensionValue = 0;
|
||||
}
|
||||
|
||||
return extensionValue;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Abstraction for a screen showing a list of settings. Instances of
|
||||
|
@ -21,7 +20,7 @@ public interface SettingsFragmentView
|
|||
*
|
||||
* @param settings The (possibly null) result of the ini load operation.
|
||||
*/
|
||||
void onSettingsFileLoaded(ArrayList<HashMap<String, SettingSection>> settings);
|
||||
void onSettingsFileLoaded(Settings settings);
|
||||
|
||||
/**
|
||||
* Pass a settings HashMap to the containing activity, so that it can
|
||||
|
@ -30,7 +29,7 @@ public interface SettingsFragmentView
|
|||
*
|
||||
* @param settings An ArrayList containing all the settings HashMaps.
|
||||
*/
|
||||
void passSettingsToActivity(ArrayList<HashMap<String, SettingSection>> settings);
|
||||
void passSettingsToActivity(Settings settings);
|
||||
|
||||
/**
|
||||
* Pass an ArrayList to the View so that it can be displayed on screen.
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
|
@ -1,13 +1,13 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.CheckBoxSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.CheckBoxSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class CheckBoxSettingViewHolder extends SettingViewHolder
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class HeaderViewHolder extends SettingViewHolder
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -7,9 +7,9 @@ import android.view.View;
|
|||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class InputBindingSettingViewHolder extends SettingViewHolder
|
||||
{
|
|
@ -1,10 +1,10 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public abstract class SettingViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener
|
||||
{
|
|
@ -1,13 +1,13 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.StringSingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.StringSingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class SingleChoiceViewHolder extends SettingViewHolder
|
||||
{
|
|
@ -1,12 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SliderSetting;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SliderSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class SliderViewHolder extends SettingViewHolder
|
||||
{
|
|
@ -1,12 +1,12 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings.viewholder;
|
||||
package org.dolphinemu.dolphinemu.features.settings.ui.viewholder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SubmenuSetting;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsAdapter;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.view.SubmenuSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsAdapter;
|
||||
|
||||
public final class SubmenuViewHolder extends SettingViewHolder
|
||||
{
|
|
@ -1,15 +1,19 @@
|
|||
package org.dolphinemu.dolphinemu.utils;
|
||||
package org.dolphinemu.dolphinemu.features.settings.utils;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import org.dolphinemu.dolphinemu.model.settings.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.FloatSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.model.settings.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.FloatSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Setting;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.Settings;
|
||||
import org.dolphinemu.dolphinemu.features.settings.model.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsActivityView;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivityView;
|
||||
import org.dolphinemu.dolphinemu.utils.BiMap;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
|
@ -20,63 +24,19 @@ import java.io.PrintWriter;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* A HashMap<String, SettingSection> that constructs a new SettingSection instead of returning null
|
||||
* when getting a key not already in the map
|
||||
*/
|
||||
final class SettingsSectionMap extends HashMap<String, SettingSection>
|
||||
{
|
||||
@Override
|
||||
public SettingSection get(Object key)
|
||||
{
|
||||
if (!(key instanceof String))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String stringKey = (String)key;
|
||||
|
||||
if (!super.containsKey(stringKey))
|
||||
{
|
||||
SettingSection section = new SettingSection(stringKey);
|
||||
super.put(stringKey, section);
|
||||
return section;
|
||||
}
|
||||
return super.get(key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Contains static methods for interacting with .ini files in which settings are stored.
|
||||
*/
|
||||
public final class SettingsFile
|
||||
{
|
||||
public static final int SETTINGS_DOLPHIN = 0;
|
||||
public static final int SETTINGS_GFX = 1;
|
||||
public static final int SETTINGS_WIIMOTE = 2;
|
||||
|
||||
public static final String FILE_NAME_DOLPHIN = "Dolphin";
|
||||
public static final String FILE_NAME_GFX = "GFX";
|
||||
public static final String FILE_NAME_GCPAD = "GCPadNew";
|
||||
public static final String FILE_NAME_WIIMOTE = "WiimoteNew";
|
||||
|
||||
public static final String SECTION_INI_CORE = "Core";
|
||||
public static final String SECTION_INI_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";
|
||||
public static final String SECTION_GFX_HACKS = "Hacks";
|
||||
|
||||
public static final String SECTION_STEREOSCOPY = "Stereoscopy";
|
||||
|
||||
public static final String SECTION_WIIMOTE = "Wiimote";
|
||||
|
||||
public static final String SECTION_BINDINGS = "Android";
|
||||
|
||||
public static final String KEY_CPU_CORE = "CPUCore";
|
||||
public static final String KEY_DUAL_CORE = "CPUThread";
|
||||
|
@ -281,24 +241,31 @@ public final class SettingsFile
|
|||
// Internal only, not actually found in settings file.
|
||||
public static final String KEY_VIDEO_BACKEND_INDEX = "VideoBackendIndex";
|
||||
|
||||
private static BiMap<String, String> sectionsMap = new BiMap<>();
|
||||
static {
|
||||
sectionsMap.add("Hardware", "Video_Hardware");
|
||||
sectionsMap.add("Settings", "Video_Settings");
|
||||
sectionsMap.add("Enhancements", "Video_Enhancements");
|
||||
sectionsMap.add("Stereoscopy", "Video_Stereoscopy");
|
||||
sectionsMap.add("Hacks", "Video_Hacks");
|
||||
sectionsMap.add("GameSpecific", "Video");
|
||||
}
|
||||
|
||||
private SettingsFile()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a given .ini file from disk and returns it as a HashMap of SettingSections, themselves
|
||||
* Reads a given .ini file from disk and returns it as a HashMap of Settings, themselves
|
||||
* effectively a HashMap of key/value settings. If unsuccessful, outputs an error telling why it
|
||||
* failed.
|
||||
*
|
||||
* @param fileName The name of the settings file without a path or extension.
|
||||
* @param view The current view.
|
||||
* @return An Observable that emits a HashMap of the file's contents, then completes.
|
||||
* @param ini The ini file to load the settings from
|
||||
* @param view The current view.
|
||||
*/
|
||||
public static HashMap<String, SettingSection> readFile(final String fileName, SettingsActivityView view)
|
||||
static HashMap<String, SettingSection> readFile(final File ini, boolean isCustomGame, SettingsActivityView view)
|
||||
{
|
||||
HashMap<String, SettingSection> sections = new SettingsSectionMap();
|
||||
|
||||
File ini = getSettingsFile(fileName);
|
||||
HashMap<String, SettingSection> sections = new Settings.SettingsSectionMap();
|
||||
|
||||
BufferedReader reader = null;
|
||||
|
||||
|
@ -311,12 +278,12 @@ public final class SettingsFile
|
|||
{
|
||||
if (line.startsWith("[") && line.endsWith("]"))
|
||||
{
|
||||
current = sectionFromLine(line);
|
||||
current = sectionFromLine(line, isCustomGame);
|
||||
sections.put(current.getName(), current);
|
||||
}
|
||||
else if ((current != null))
|
||||
{
|
||||
Setting setting = settingFromLine(current, line, fileName);
|
||||
Setting setting = settingFromLine(current, line);
|
||||
if (setting != null)
|
||||
{
|
||||
current.putSetting(setting);
|
||||
|
@ -326,12 +293,12 @@ public final class SettingsFile
|
|||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
Log.error("[SettingsFile] File not found: " + fileName + ".ini: " + e.getMessage());
|
||||
Log.error("[SettingsFile] File not found: " + ini.getAbsolutePath() + e.getMessage());
|
||||
view.onSettingsFileNotFound();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.error("[SettingsFile] Error reading from: " + fileName + ".ini: " + e.getMessage());
|
||||
Log.error("[SettingsFile] Error reading from: " + ini.getAbsolutePath()+ e.getMessage());
|
||||
view.onSettingsFileNotFound();
|
||||
}
|
||||
finally
|
||||
|
@ -344,19 +311,50 @@ public final class SettingsFile
|
|||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
Log.error("[SettingsFile] Error closing: " + fileName + ".ini: " + e.getMessage());
|
||||
Log.error("[SettingsFile] Error closing: " + ini.getAbsolutePath()+ e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return sections;
|
||||
}
|
||||
|
||||
public static HashMap<String, SettingSection> readFile(final String fileName, SettingsActivityView view)
|
||||
{
|
||||
HashMap<String, SettingSection> sections = readFile(getSettingsFile(fileName), false, view);
|
||||
|
||||
if (fileName.equals(SettingsFile.FILE_NAME_DOLPHIN))
|
||||
{
|
||||
addGcPadSettingsIfTheyDontExist(sections);
|
||||
}
|
||||
|
||||
return sections;
|
||||
return sections;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a given .ini file from disk and returns it as a HashMap of SettingSections, themselves
|
||||
* effectively a HashMap of key/value settings. If unsuccessful, outputs an error telling why it
|
||||
* failed.
|
||||
*
|
||||
* @param gameId the id of the game to load it's settings.
|
||||
* @param view The current view.
|
||||
*/
|
||||
public static HashMap<String, SettingSection> readCustomGameSettings(final String gameId, SettingsActivityView view)
|
||||
{
|
||||
return readFile(getCustomGameSettingsFile(gameId), true, view);
|
||||
}
|
||||
|
||||
public static HashMap<String, SettingSection> readGenericGameSettings(final String gameId, SettingsActivityView view)
|
||||
{
|
||||
return readFile(getGenericGameSettingsFile(gameId), true, view);
|
||||
}
|
||||
|
||||
public static HashMap<String, SettingSection> readGenericGameSettingsForAllRegions(final String gameId, SettingsActivityView view)
|
||||
{
|
||||
return readFile(getGenericGameSettingsForAllRegions(gameId), true, view);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves a Settings HashMap to a given .ini file on disk. If unsuccessful, outputs an error
|
||||
* telling why it failed.
|
||||
|
@ -364,9 +362,8 @@ public final class SettingsFile
|
|||
* @param fileName The target filename without a path or extension.
|
||||
* @param sections The HashMap containing the Settings we want to serialize.
|
||||
* @param view The current view.
|
||||
* @return An Observable representing the operation.
|
||||
*/
|
||||
public static void saveFile(final String fileName, final HashMap<String, SettingSection> sections, SettingsActivityView view)
|
||||
public static void saveFile(final String fileName, TreeMap<String, SettingSection> sections, SettingsActivityView view)
|
||||
{
|
||||
File ini = getSettingsFile(fileName);
|
||||
|
||||
|
@ -403,33 +400,93 @@ public final class SettingsFile
|
|||
}
|
||||
}
|
||||
|
||||
public static void saveCustomGameSettings(final String gameId, final HashMap<String, SettingSection> sections)
|
||||
{
|
||||
Set<String> sortedSections = new TreeSet<>(sections.keySet());
|
||||
|
||||
for (String sectionKey : sortedSections)
|
||||
{
|
||||
SettingSection section = sections.get(sectionKey);
|
||||
|
||||
HashMap<String, Setting> settings = section.getSettings();
|
||||
Set<String> sortedKeySet = new TreeSet<>(settings.keySet());
|
||||
|
||||
for (String settingKey : sortedKeySet)
|
||||
{
|
||||
Setting setting = settings.get(settingKey);
|
||||
NativeLibrary.SetUserSetting(gameId, mapSectionNameFromIni(section.getName()), setting.getKey(), setting.getValueAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static String mapSectionNameFromIni(String generalSectionName)
|
||||
{
|
||||
if (sectionsMap.getForward(generalSectionName) != null)
|
||||
{
|
||||
return sectionsMap.getForward(generalSectionName);
|
||||
}
|
||||
|
||||
return generalSectionName;
|
||||
}
|
||||
|
||||
private static String mapSectionNameToIni(String generalSectionName)
|
||||
{
|
||||
if (sectionsMap.getBackward(generalSectionName) != null)
|
||||
{
|
||||
return sectionsMap.getBackward(generalSectionName);
|
||||
}
|
||||
|
||||
return generalSectionName;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static File getSettingsFile(String fileName)
|
||||
{
|
||||
return new File(DirectoryInitializationService.getUserDirectory() + "/Config/" + fileName + ".ini");
|
||||
}
|
||||
|
||||
private static SettingSection sectionFromLine(String line)
|
||||
private static File getGenericGameSettingsForAllRegions(String gameId)
|
||||
{
|
||||
String sectionName = line.substring(1, line.length() - 1);
|
||||
return new SettingSection(sectionName);
|
||||
// Use the first 3 chars from the gameId to load the generic game settings for all regions
|
||||
gameId = gameId.substring(0, 3);
|
||||
return new File(DirectoryInitializationService.getDolphinInternalDirectory() + "/GameSettings/" + gameId + ".ini");
|
||||
}
|
||||
|
||||
private static File getGenericGameSettingsFile(String gameId)
|
||||
{
|
||||
return new File(DirectoryInitializationService.getDolphinInternalDirectory() + "/GameSettings/" + gameId + ".ini");
|
||||
}
|
||||
|
||||
private static File getCustomGameSettingsFile(String gameId)
|
||||
{
|
||||
return new File(DirectoryInitializationService.getUserDirectory() + "/GameSettings/" + gameId + ".ini");
|
||||
}
|
||||
|
||||
private static SettingSection sectionFromLine(String line, boolean isCustomGame)
|
||||
{
|
||||
String sectionName = line.substring(1, line.length() - 1);
|
||||
if (isCustomGame)
|
||||
{
|
||||
sectionName = mapSectionNameToIni(sectionName);
|
||||
}
|
||||
return new SettingSection(sectionName);
|
||||
}
|
||||
|
||||
private static void addGcPadSettingsIfTheyDontExist(HashMap<String, SettingSection> sections)
|
||||
{
|
||||
SettingSection coreSection = sections.get(SettingsFile.SECTION_INI_CORE);
|
||||
SettingSection coreSection = sections.get(Settings.SECTION_INI_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_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, 0);
|
||||
Setting gcPadSetting = new IntSetting(key, Settings.SECTION_INI_CORE,0);
|
||||
coreSection.putSetting(gcPadSetting);
|
||||
}
|
||||
}
|
||||
|
||||
sections.put(SettingsFile.SECTION_INI_CORE, coreSection);
|
||||
sections.put(Settings.SECTION_INI_CORE, coreSection);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -438,10 +495,9 @@ public final class SettingsFile
|
|||
*
|
||||
* @param current The section currently being parsed by the consuming method.
|
||||
* @param line The line of text being parsed.
|
||||
* @param fileName The name of the ini file the setting is in.
|
||||
* @return A typed Setting containing the key/value contained in the line.
|
||||
*/
|
||||
private static Setting settingFromLine(SettingSection current, String line, String fileName)
|
||||
private static Setting settingFromLine(SettingSection current, String line)
|
||||
{
|
||||
String[] splitLine = line.split("=");
|
||||
|
||||
|
@ -454,25 +510,11 @@ public final class SettingsFile
|
|||
String key = splitLine[0].trim();
|
||||
String value = splitLine[1].trim();
|
||||
|
||||
int file;
|
||||
switch (fileName)
|
||||
{
|
||||
case FILE_NAME_GFX:
|
||||
file = SETTINGS_GFX;
|
||||
break;
|
||||
case FILE_NAME_WIIMOTE:
|
||||
file = SETTINGS_WIIMOTE;
|
||||
break;
|
||||
default:
|
||||
file = SETTINGS_DOLPHIN;
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
int valueAsInt = Integer.valueOf(value);
|
||||
|
||||
return new IntSetting(key, current.getName(), file, valueAsInt);
|
||||
return new IntSetting(key, current.getName(), valueAsInt);
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
|
@ -482,7 +524,7 @@ public final class SettingsFile
|
|||
{
|
||||
float valueAsFloat = Float.valueOf(value);
|
||||
|
||||
return new FloatSetting(key, current.getName(), file, valueAsFloat);
|
||||
return new FloatSetting(key, current.getName(), valueAsFloat);
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
|
@ -491,11 +533,11 @@ public final class SettingsFile
|
|||
switch (value)
|
||||
{
|
||||
case "True":
|
||||
return new BooleanSetting(key, current.getName(), file, true);
|
||||
return new BooleanSetting(key, current.getName(), true);
|
||||
case "False":
|
||||
return new BooleanSetting(key, current.getName(), file, false);
|
||||
return new BooleanSetting(key, current.getName(), false);
|
||||
default:
|
||||
return new StringSetting(key, current.getName(), file, value);
|
||||
return new StringSetting(key, current.getName(), value);
|
||||
}
|
||||
}
|
||||
|
|
@ -21,8 +21,8 @@ import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
|||
import org.dolphinemu.dolphinemu.services.GameFileCacheService;
|
||||
import org.dolphinemu.dolphinemu.ui.platform.Platform;
|
||||
import org.dolphinemu.dolphinemu.ui.platform.PlatformGamesView;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
|
||||
import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
|
||||
import org.dolphinemu.dolphinemu.utils.StartupHandler;
|
||||
|
|
|
@ -10,7 +10,7 @@ import org.dolphinemu.dolphinemu.BuildConfig;
|
|||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.GameFileCache;
|
||||
import org.dolphinemu.dolphinemu.services.GameFileCacheService;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
|
||||
public final class MainPresenter
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.dolphinemu.dolphinemu.ui.main;
|
||||
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
|
||||
/**
|
||||
* Abstraction for the screen that shows on application launch.
|
||||
|
|
|
@ -24,8 +24,8 @@ import org.dolphinemu.dolphinemu.model.TvSettingsItem;
|
|||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.services.GameFileCacheService;
|
||||
import org.dolphinemu.dolphinemu.ui.platform.Platform;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.ui.settings.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.MenuTag;
|
||||
import org.dolphinemu.dolphinemu.features.settings.ui.SettingsActivity;
|
||||
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
|
||||
import org.dolphinemu.dolphinemu.utils.PermissionsHandler;
|
||||
import org.dolphinemu.dolphinemu.utils.StartupHandler;
|
||||
|
|
|
@ -1,230 +0,0 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService.DirectoryInitializationState;
|
||||
import org.dolphinemu.dolphinemu.utils.DirectoryStateReceiver;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
import org.dolphinemu.dolphinemu.utils.SettingsFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import rx.functions.Action1;
|
||||
|
||||
public final class SettingsActivityPresenter
|
||||
{
|
||||
private static final String KEY_SHOULD_SAVE = "should_save";
|
||||
|
||||
private SettingsActivityView mView;
|
||||
|
||||
private ArrayList<HashMap<String, SettingSection>> mSettings = new ArrayList<>();
|
||||
|
||||
private int mStackCount;
|
||||
|
||||
private boolean mShouldSave;
|
||||
|
||||
private DirectoryStateReceiver directoryStateReceiver;
|
||||
|
||||
private MenuTag menuTag;
|
||||
private String gameId;
|
||||
|
||||
public SettingsActivityPresenter(SettingsActivityView view)
|
||||
{
|
||||
mView = view;
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState, MenuTag menuTag, String gameId)
|
||||
{
|
||||
if (savedInstanceState == null)
|
||||
{
|
||||
this.menuTag = menuTag;
|
||||
this.gameId = gameId;
|
||||
}
|
||||
else
|
||||
{
|
||||
mShouldSave = savedInstanceState.getBoolean(KEY_SHOULD_SAVE);
|
||||
}
|
||||
}
|
||||
|
||||
public void onStart()
|
||||
{
|
||||
prepareDolphinDirectoriesIfNeeded();
|
||||
}
|
||||
|
||||
void loadSettingsUI()
|
||||
{
|
||||
if (mSettings.isEmpty())
|
||||
{
|
||||
if (!TextUtils.isEmpty(gameId))
|
||||
{
|
||||
mSettings.add(SettingsFile.SETTINGS_DOLPHIN, SettingsFile.readFile("../GameSettings/" + gameId, mView));
|
||||
mSettings.add(SettingsFile.SETTINGS_GFX, SettingsFile.readFile("../GameSettings/" + gameId, mView));
|
||||
mSettings.add(SettingsFile.SETTINGS_WIIMOTE, SettingsFile.readFile("../GameSettings/" + gameId, mView));
|
||||
}
|
||||
else
|
||||
{
|
||||
mSettings.add(SettingsFile.SETTINGS_DOLPHIN, SettingsFile.readFile(SettingsFile.FILE_NAME_DOLPHIN, mView));
|
||||
mSettings.add(SettingsFile.SETTINGS_GFX, SettingsFile.readFile(SettingsFile.FILE_NAME_GFX, mView));
|
||||
mSettings.add(SettingsFile.SETTINGS_WIIMOTE, SettingsFile.readFile(SettingsFile.FILE_NAME_WIIMOTE, mView));
|
||||
}
|
||||
}
|
||||
|
||||
mView.showSettingsFragment(menuTag, null, false, gameId);
|
||||
mView.onSettingsFileLoaded(mSettings);
|
||||
}
|
||||
|
||||
private void prepareDolphinDirectoriesIfNeeded()
|
||||
{
|
||||
if (DirectoryInitializationService.areDolphinDirectoriesReady()) {
|
||||
loadSettingsUI();
|
||||
} else {
|
||||
mView.showLoading();
|
||||
IntentFilter statusIntentFilter = new IntentFilter(
|
||||
DirectoryInitializationService.BROADCAST_ACTION);
|
||||
|
||||
directoryStateReceiver =
|
||||
new DirectoryStateReceiver(directoryInitializationState ->
|
||||
{
|
||||
if (directoryInitializationState == DirectoryInitializationState.DOLPHIN_DIRECTORIES_INITIALIZED)
|
||||
{
|
||||
mView.hideLoading();
|
||||
loadSettingsUI();
|
||||
}
|
||||
else if (directoryInitializationState == DirectoryInitializationState.EXTERNAL_STORAGE_PERMISSION_NEEDED)
|
||||
{
|
||||
mView.showPermissionNeededHint();
|
||||
mView.hideLoading();
|
||||
}
|
||||
else if (directoryInitializationState == DirectoryInitializationState.CANT_FIND_EXTERNAL_STORAGE)
|
||||
{
|
||||
mView.showExternalStorageNotMountedHint();
|
||||
mView.hideLoading();
|
||||
}
|
||||
});
|
||||
|
||||
mView.startDirectoryInitializationService(directoryStateReceiver, statusIntentFilter);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSettings(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
{
|
||||
mSettings = settings;
|
||||
}
|
||||
|
||||
public HashMap<String, SettingSection> getSettings(int file)
|
||||
{
|
||||
return mSettings.get(file);
|
||||
}
|
||||
|
||||
public void onStop(boolean finishing)
|
||||
{
|
||||
if (directoryStateReceiver != null)
|
||||
{
|
||||
mView.stopListeningToDirectoryInitializationService(directoryStateReceiver);
|
||||
directoryStateReceiver = null;
|
||||
}
|
||||
|
||||
if (mSettings != null && finishing && mShouldSave)
|
||||
{
|
||||
if (!TextUtils.isEmpty(gameId)) {
|
||||
Log.debug("[SettingsActivity] Settings activity stopping. Saving settings to INI...");
|
||||
// Needed workaround for now due to an odd bug in how it handles saving two different settings sections to the same file. It won't save GFX settings if it follows the normal saving pattern
|
||||
if (menuTag.equals(MenuTag.CONFIG))
|
||||
{
|
||||
SettingsFile.saveFile("../GameSettings/" + gameId, mSettings.get(SettingsFile.SETTINGS_DOLPHIN), mView);
|
||||
}
|
||||
else if (menuTag.equals(MenuTag.GRAPHICS))
|
||||
{
|
||||
SettingsFile.saveFile("../GameSettings/" + gameId, mSettings.get(SettingsFile.SETTINGS_GFX), mView);
|
||||
}
|
||||
mView.showToastMessage("Saved settings for " + gameId);
|
||||
} else {
|
||||
Log.debug("[SettingsActivity] Settings activity stopping. Saving settings to INI...");
|
||||
SettingsFile.saveFile(SettingsFile.FILE_NAME_DOLPHIN, mSettings.get(SettingsFile.SETTINGS_DOLPHIN), mView);
|
||||
SettingsFile.saveFile(SettingsFile.FILE_NAME_GFX, mSettings.get(SettingsFile.SETTINGS_GFX), mView);
|
||||
SettingsFile.saveFile(SettingsFile.FILE_NAME_WIIMOTE, mSettings.get(SettingsFile.SETTINGS_WIIMOTE), mView);
|
||||
mView.showToastMessage("Saved settings to INI files");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void addToStack()
|
||||
{
|
||||
mStackCount++;
|
||||
}
|
||||
|
||||
public void onBackPressed()
|
||||
{
|
||||
if (mStackCount > 0)
|
||||
{
|
||||
mView.popBackStack();
|
||||
mStackCount--;
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.finish();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean handleOptionsItem(int itemId)
|
||||
{
|
||||
switch (itemId)
|
||||
{
|
||||
case R.id.menu_save_exit:
|
||||
mView.finish();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onSettingChanged()
|
||||
{
|
||||
mShouldSave = true;
|
||||
}
|
||||
|
||||
public void saveState(Bundle outState)
|
||||
{
|
||||
outState.putBoolean(KEY_SHOULD_SAVE, mShouldSave);
|
||||
}
|
||||
|
||||
public void onGcPadSettingChanged(MenuTag key, int value)
|
||||
{
|
||||
if (value != 0) // Not disabled
|
||||
{
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(SettingsFragmentPresenter.ARG_CONTROLLER_TYPE, value/6);
|
||||
mView.showSettingsFragment(key, bundle, true, gameId);
|
||||
}
|
||||
}
|
||||
|
||||
public void onWiimoteSettingChanged(MenuTag menuTag, int value)
|
||||
{
|
||||
switch (value)
|
||||
{
|
||||
case 1:
|
||||
mView.showSettingsFragment(menuTag, null, true, gameId);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
mView.showToastMessage("Please make sure Continuous Scanning is enabled in Core Settings.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void onExtensionSettingChanged(MenuTag menuTag, int value)
|
||||
{
|
||||
if (value != 0) // None
|
||||
{
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putInt(SettingsFragmentPresenter.ARG_CONTROLLER_TYPE, value);
|
||||
mView.showSettingsFragment(menuTag, bundle, true, gameId);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,994 +0,0 @@
|
|||
package org.dolphinemu.dolphinemu.ui.settings;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||
import org.dolphinemu.dolphinemu.R;
|
||||
import org.dolphinemu.dolphinemu.model.settings.BooleanSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.IntSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.Setting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.SettingSection;
|
||||
import org.dolphinemu.dolphinemu.model.settings.StringSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.CheckBoxSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.HeaderSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.InputBindingSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SettingsItem;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SliderSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.StringSingleChoiceSetting;
|
||||
import org.dolphinemu.dolphinemu.model.settings.view.SubmenuSetting;
|
||||
import org.dolphinemu.dolphinemu.services.DirectoryInitializationService;
|
||||
import org.dolphinemu.dolphinemu.utils.EGLHelper;
|
||||
import org.dolphinemu.dolphinemu.utils.Log;
|
||||
import org.dolphinemu.dolphinemu.utils.SettingsFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public final class SettingsFragmentPresenter
|
||||
{
|
||||
private SettingsFragmentView mView;
|
||||
|
||||
public static final String ARG_CONTROLLER_TYPE = "controller_type";
|
||||
private MenuTag mMenuTag;
|
||||
private String mGameID;
|
||||
|
||||
private ArrayList<HashMap<String, SettingSection>> mSettings;
|
||||
private ArrayList<SettingsItem> mSettingsList;
|
||||
|
||||
private int mControllerNumber;
|
||||
private int mControllerType;
|
||||
|
||||
public SettingsFragmentPresenter(SettingsFragmentView view)
|
||||
{
|
||||
mView = view;
|
||||
}
|
||||
|
||||
public void onCreate(MenuTag menuTag, String gameId, Bundle extras)
|
||||
{
|
||||
mGameID = gameId;
|
||||
|
||||
this.mMenuTag = menuTag;
|
||||
if (menuTag.isGCPadMenu() || menuTag.isWiimoteExtensionMenu())
|
||||
{
|
||||
mControllerNumber = menuTag.getSubType();
|
||||
mControllerType = extras.getInt(ARG_CONTROLLER_TYPE);
|
||||
}
|
||||
else if (menuTag.isWiimoteMenu())
|
||||
{
|
||||
mControllerNumber = menuTag.getSubType();
|
||||
}
|
||||
else
|
||||
{
|
||||
mMenuTag = menuTag;
|
||||
}
|
||||
}
|
||||
|
||||
public void onViewCreated(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
{
|
||||
setSettings(settings);
|
||||
}
|
||||
|
||||
/**
|
||||
* If the screen is rotated, the Activity will forget the settings map. This fragment
|
||||
* won't, though; so rather than have the Activity reload from disk, have the fragment pass
|
||||
* the settings map back to the Activity.
|
||||
*/
|
||||
public void onAttach()
|
||||
{
|
||||
if (mSettings != null)
|
||||
{
|
||||
mView.passSettingsToActivity(mSettings);
|
||||
}
|
||||
}
|
||||
|
||||
public void putSetting(Setting setting)
|
||||
{
|
||||
mSettings.get(setting.getFile()).get(setting.getSection()).putSetting(setting);
|
||||
}
|
||||
|
||||
public void loadDefaultSettings()
|
||||
{
|
||||
loadSettingsList();
|
||||
}
|
||||
|
||||
public void setSettings(ArrayList<HashMap<String, SettingSection>> settings)
|
||||
{
|
||||
if (mSettingsList == null && settings != null)
|
||||
{
|
||||
mSettings = settings;
|
||||
|
||||
loadSettingsList();
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.showSettingsList(mSettingsList);
|
||||
}
|
||||
}
|
||||
|
||||
private void loadSettingsList()
|
||||
{
|
||||
if (!TextUtils.isEmpty(mGameID))
|
||||
{
|
||||
mView.getActivity().setTitle("Game Settings: " + mGameID);
|
||||
}
|
||||
ArrayList<SettingsItem> sl = new ArrayList<>();
|
||||
|
||||
switch (mMenuTag)
|
||||
{
|
||||
case CONFIG:
|
||||
addConfigSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_GENERAL:
|
||||
addGeneralSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_INTERFACE:
|
||||
addInterfaceSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_GAME_CUBE:
|
||||
addGameCubeSettings(sl);
|
||||
break;
|
||||
|
||||
case CONFIG_WII:
|
||||
addWiiSettings(sl);
|
||||
break;
|
||||
|
||||
case GRAPHICS:
|
||||
addGraphicsSettings(sl);
|
||||
break;
|
||||
|
||||
case GCPAD_TYPE:
|
||||
addGcPadSettings(sl);
|
||||
break;
|
||||
|
||||
case WIIMOTE:
|
||||
addWiimoteSettings(sl);
|
||||
break;
|
||||
|
||||
case ENHANCEMENTS:
|
||||
addEnhanceSettings(sl);
|
||||
break;
|
||||
|
||||
case HACKS:
|
||||
addHackSettings(sl);
|
||||
break;
|
||||
|
||||
case GCPAD_1:
|
||||
case GCPAD_2:
|
||||
case GCPAD_3:
|
||||
case GCPAD_4:
|
||||
addGcPadSubSettings(sl, mControllerNumber, mControllerType);
|
||||
break;
|
||||
|
||||
case WIIMOTE_1:
|
||||
case WIIMOTE_2:
|
||||
case WIIMOTE_3:
|
||||
case WIIMOTE_4:
|
||||
addWiimoteSubSettings(sl, mControllerNumber);
|
||||
break;
|
||||
|
||||
case WIIMOTE_EXTENSION_1:
|
||||
case WIIMOTE_EXTENSION_2:
|
||||
case WIIMOTE_EXTENSION_3:
|
||||
case WIIMOTE_EXTENSION_4:
|
||||
addExtensionTypeSettings(sl, mControllerNumber, mControllerType);
|
||||
break;
|
||||
|
||||
case STEREOSCOPY:
|
||||
addStereoSettings(sl);
|
||||
break;
|
||||
|
||||
default:
|
||||
mView.showToastMessage("Unimplemented menu");
|
||||
return;
|
||||
}
|
||||
|
||||
mSettingsList = sl;
|
||||
mView.showSettingsList(mSettingsList);
|
||||
}
|
||||
|
||||
private void addConfigSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, MenuTag.CONFIG_GENERAL));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, MenuTag.CONFIG_INTERFACE));
|
||||
|
||||
sl.add(new SubmenuSetting(null, null, R.string.gamecube_submenu, 0, MenuTag.CONFIG_GAME_CUBE));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, 0, MenuTag.CONFIG_WII));
|
||||
}
|
||||
|
||||
private void addGeneralSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting cpuCore = null;
|
||||
Setting dualCore = null;
|
||||
Setting overclockEnable = null;
|
||||
Setting overclock = null;
|
||||
Setting speedLimit = null;
|
||||
Setting audioStretch = null;
|
||||
|
||||
if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
||||
{
|
||||
cpuCore = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_CPU_CORE);
|
||||
dualCore = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_DUAL_CORE);
|
||||
overclockEnable = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_ENABLE);
|
||||
overclock = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_OVERCLOCK_PERCENT);
|
||||
speedLimit = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_SPEED_LIMIT);
|
||||
audioStretch = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_AUDIO_STRETCH);
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.passSettingsToActivity(mSettings);
|
||||
}
|
||||
|
||||
// TODO: Having different emuCoresEntries/emuCoresValues for each architecture is annoying.
|
||||
// The proper solution would be to have one emuCoresEntries and one emuCoresValues
|
||||
// and exclude the values that aren't present in PowerPC::AvailableCPUCores().
|
||||
int defaultCpuCore = NativeLibrary.DefaultCPUCore();
|
||||
int emuCoresEntries;
|
||||
int emuCoresValues;
|
||||
if (defaultCpuCore == 1) // x86-64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesX86_64;
|
||||
emuCoresValues = R.array.emuCoresValuesX86_64;
|
||||
}
|
||||
else if (defaultCpuCore == 4) // AArch64
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesARM64;
|
||||
emuCoresValues = R.array.emuCoresValuesARM64;
|
||||
}
|
||||
else
|
||||
{
|
||||
emuCoresEntries = R.array.emuCoresEntriesGeneric;
|
||||
emuCoresValues = R.array.emuCoresValuesGeneric;
|
||||
}
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_CPU_CORE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.cpu_core, 0, emuCoresEntries, emuCoresValues, defaultCpuCore, cpuCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DUAL_CORE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.dual_core, R.string.dual_core_description, true, dualCore));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OVERCLOCK_ENABLE, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.overclock_enable, R.string.overclock_enable_description, false, overclockEnable));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_OVERCLOCK_PERCENT, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.overclock_title, R.string.overclock_title_description, 400, "%", 100, overclock));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_SPEED_LIMIT, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.speed_limit, 0, 200, "%", 100, speedLimit));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_AUDIO_STRETCH, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.audio_stretch, R.string.audio_stretch_description, false, audioStretch));
|
||||
}
|
||||
|
||||
private void addInterfaceSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting usePanicHandlers = null;
|
||||
Setting onScreenDisplayMessages = null;
|
||||
|
||||
if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
||||
{
|
||||
usePanicHandlers = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_INTERFACE).getSetting(SettingsFile.KEY_USE_PANIC_HANDLERS);
|
||||
onScreenDisplayMessages = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_INTERFACE).getSetting(SettingsFile.KEY_OSD_MESSAGES);
|
||||
}
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_USE_PANIC_HANDLERS, SettingsFile.SECTION_INI_INTERFACE, SettingsFile.SETTINGS_DOLPHIN, R.string.panic_handlers, R.string.panic_handlers_description, true, usePanicHandlers));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_OSD_MESSAGES, SettingsFile.SECTION_INI_INTERFACE, SettingsFile.SETTINGS_DOLPHIN, R.string.osd_messages, R.string.osd_messages_description, true, onScreenDisplayMessages));
|
||||
}
|
||||
|
||||
private void addGameCubeSettings(ArrayList<SettingsItem> 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);
|
||||
}
|
||||
else
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
private void addWiiSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting continuousScan = null;
|
||||
Setting wiimoteSpeaker = null;
|
||||
if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
||||
{
|
||||
continuousScan = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_WIIMOTE_SCAN);
|
||||
wiimoteSpeaker = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_WIIMOTE_SPEAKER);
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.passSettingsToActivity(mSettings);
|
||||
}
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SCAN, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.wiimote_scanning, R.string.wiimote_scanning_description, true, continuousScan));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WIIMOTE_SPEAKER, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.wiimote_speaker, R.string.wiimote_speaker_description, true, wiimoteSpeaker));
|
||||
}
|
||||
|
||||
private void addGcPadSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
if (!mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
// TODO This controller_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order.
|
||||
Setting gcPadSetting = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GCPAD_TYPE + i);
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_GCPAD_TYPE + i, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.controller_0 + i, 0, R.array.gcpadTypeEntries, R.array.gcpadTypeValues, 0, gcPadSetting, MenuTag.getGCPadMenuTag(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addWiimoteSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
if (!mSettings.get(SettingsFile.SETTINGS_WIIMOTE).isEmpty())
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
// TODO This wiimote_0 + i business is quite the hack. It should work, but only if the definitions are kept together and in order.
|
||||
Setting wiimoteSetting = mSettings.get(SettingsFile.SETTINGS_WIIMOTE).get(SettingsFile.SECTION_WIIMOTE + (i + 1)).getSetting(SettingsFile.KEY_WIIMOTE_TYPE);
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_TYPE, SettingsFile.SECTION_WIIMOTE + i, SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_4 + i, 0, R.array.wiimoteTypeEntries, R.array.wiimoteTypeValues, 0, wiimoteSetting, MenuTag.getWiimoteMenuTag(i+4)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addGraphicsSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
IntSetting videoBackend = new IntSetting(SettingsFile.KEY_VIDEO_BACKEND_INDEX, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, getVideoBackendValue());
|
||||
Setting showFps = null;
|
||||
Setting shaderCompilationMode = null;
|
||||
Setting waitForShaders = null;
|
||||
Setting aspectRatio = null;
|
||||
|
||||
if (!mSettings.get(SettingsFile.SETTINGS_GFX).isEmpty())
|
||||
{
|
||||
showFps = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_SHOW_FPS);
|
||||
shaderCompilationMode = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_SHADER_COMPILATION_MODE);
|
||||
waitForShaders = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_WAIT_FOR_SHADERS);
|
||||
aspectRatio = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_ASPECT_RATIO);
|
||||
}
|
||||
else
|
||||
{
|
||||
mView.passSettingsToActivity(mSettings);
|
||||
}
|
||||
|
||||
if (mSettings.get(SettingsFile.SETTINGS_DOLPHIN).isEmpty())
|
||||
{
|
||||
mView.passSettingsToActivity(mSettings);
|
||||
}
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.graphics_general, 0));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_VIDEO_BACKEND_INDEX, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.video_backend, R.string.video_backend_description, R.array.videoBackendEntries, R.array.videoBackendValues, 0, videoBackend));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SHOW_FPS, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.show_fps, R.string.show_fps_description, false, showFps));
|
||||
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_description, 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 SingleChoiceSetting(SettingsFile.KEY_ASPECT_RATIO, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.aspect_ratio, R.string.aspect_ratio_description, R.array.aspectRatioEntries, R.array.aspectRatioValues, 0, aspectRatio));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.graphics_enhancements_and_hacks, 0));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.enhancements_submenu, 0, MenuTag.ENHANCEMENTS));
|
||||
sl.add(new SubmenuSetting(null, null, R.string.hacks_submenu, 0, MenuTag.HACKS));
|
||||
}
|
||||
|
||||
private void addEnhanceSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting resolution = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_INTERNAL_RES);
|
||||
Setting fsaa = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_FSAA);
|
||||
Setting anisotropic = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_ANISOTROPY);
|
||||
Setting shader = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_POST_SHADER);
|
||||
Setting efbScaledCopy = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_SCALED_EFB);
|
||||
Setting perPixel = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_PER_PIXEL);
|
||||
Setting forceFilter = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_FORCE_FILTERING);
|
||||
Setting disableFog = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_DISABLE_FOG);
|
||||
Setting disableCopyFilter = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_DISABLE_COPY_FILTER);
|
||||
Setting arbitraryMipmapDetection = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_ARBITRARY_MIPMAP_DETECTION);
|
||||
Setting wideScreenHack = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_ENHANCEMENTS).getSetting(SettingsFile.KEY_WIDE_SCREEN_HACK);
|
||||
Setting force24BitColor = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_FORCE_24_BIT_COLOR);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_INTERNAL_RES, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.internal_resolution, R.string.internal_resolution_description, R.array.internalResolutionEntries, R.array.internalResolutionValues, 1, resolution));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_FSAA, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.FSAA, R.string.FSAA_description, R.array.FSAAEntries, R.array.FSAAValues, 0, fsaa));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_ANISOTROPY, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.anisotropic_filtering, R.string.anisotropic_filtering_description, R.array.anisotropicFilteringEntries, R.array.anisotropicFilteringValues, 0, anisotropic));
|
||||
|
||||
IntSetting stereoModeValue = (IntSetting) mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_MODE);
|
||||
int anaglyphMode = 3;
|
||||
String subDir = stereoModeValue != null && stereoModeValue.getValue() == anaglyphMode ? "Anaglyph" : null;
|
||||
String[] shaderListEntries = getShaderList(subDir);
|
||||
String[] shaderListValues = new String[shaderListEntries.length];
|
||||
System.arraycopy(shaderListEntries, 0, shaderListValues, 0, shaderListEntries.length);
|
||||
shaderListValues[0] = "";
|
||||
sl.add(new StringSingleChoiceSetting(SettingsFile.KEY_POST_SHADER, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.post_processing_shader, R.string.post_processing_shader_description, shaderListEntries, shaderListValues, "", shader));
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SCALED_EFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.scaled_efb_copy, R.string.scaled_efb_copy_description, true, efbScaledCopy));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_PER_PIXEL, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.per_pixel_lighting, R.string.per_pixel_lighting_description, false, perPixel));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_FILTERING, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.force_texture_filtering, R.string.force_texture_filtering_description, false, forceFilter));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FORCE_24_BIT_COLOR, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.force_24bit_color, R.string.force_24bit_color_description, true, force24BitColor));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_FOG, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.disable_fog, R.string.disable_fog_description, false, disableFog));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_DISABLE_COPY_FILTER, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.disable_copy_filter, R.string.disable_copy_filter_description, false, disableCopyFilter));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_ARBITRARY_MIPMAP_DETECTION, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.arbitrary_mipmap_detection, R.string.arbitrary_mipmap_detection_description, true, arbitraryMipmapDetection));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_WIDE_SCREEN_HACK, SettingsFile.SECTION_GFX_ENHANCEMENTS, SettingsFile.SETTINGS_GFX, R.string.wide_screen_hack, R.string.wide_screen_hack_description, false, wideScreenHack));
|
||||
|
||||
/*
|
||||
Check if we support stereo
|
||||
If we support desktop GL then we must support at least OpenGL 3.2
|
||||
If we only support OpenGLES then we need both OpenGLES 3.1 and AEP
|
||||
*/
|
||||
EGLHelper helper = new EGLHelper(EGLHelper.EGL_OPENGL_ES2_BIT);
|
||||
|
||||
if ((helper.supportsOpenGL() && helper.GetVersion() >= 320) ||
|
||||
(helper.supportsGLES3() && helper.GetVersion() >= 310 && helper.SupportsExtension("GL_ANDROID_extension_pack_es31a")))
|
||||
{
|
||||
sl.add(new SubmenuSetting(SettingsFile.KEY_STEREO_MODE, null, R.string.stereoscopy_submenu, R.string.stereoscopy_submenu_description, MenuTag.STEREOSCOPY));
|
||||
}
|
||||
}
|
||||
|
||||
private String[] getShaderList(String subDir)
|
||||
{
|
||||
try
|
||||
{
|
||||
String shadersPath = DirectoryInitializationService.getDolphinInternalDirectory() + "/Shaders";
|
||||
if(!TextUtils.isEmpty(subDir)) {
|
||||
shadersPath += "/" + subDir;
|
||||
}
|
||||
|
||||
File file = new File(shadersPath);
|
||||
File[] shaderFiles = file.listFiles();
|
||||
if (shaderFiles != null)
|
||||
{
|
||||
String[] result = new String[shaderFiles.length + 1];
|
||||
result[0] = "Off";
|
||||
for (int i = 0; i < shaderFiles.length; i++)
|
||||
{
|
||||
String name = shaderFiles[i].getName();
|
||||
int extensionIndex = name.indexOf(".glsl");
|
||||
if (extensionIndex > 0)
|
||||
{
|
||||
name = name.substring(0, extensionIndex);
|
||||
}
|
||||
result[i+1] = name;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.debug("[Settings] Unable to find shader files");
|
||||
// return empty list
|
||||
}
|
||||
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
private void addHackSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
boolean skipEFBValue = getInvertedBooleanValue(SettingsFile.SETTINGS_GFX, SettingsFile.SECTION_GFX_HACKS, SettingsFile.KEY_SKIP_EFB, false);
|
||||
boolean ignoreFormatValue = getInvertedBooleanValue(SettingsFile.SETTINGS_GFX, SettingsFile.SECTION_GFX_HACKS, SettingsFile.KEY_IGNORE_FORMAT, true);
|
||||
|
||||
BooleanSetting skipEFB = new BooleanSetting(SettingsFile.KEY_SKIP_EFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, skipEFBValue);
|
||||
BooleanSetting ignoreFormat = new BooleanSetting(SettingsFile.KEY_IGNORE_FORMAT, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, ignoreFormatValue);
|
||||
Setting efbToTexture = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_EFB_TEXTURE);
|
||||
Setting texCacheAccuracy = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_TEXCACHE_ACCURACY);
|
||||
Setting gpuTextureDecoding = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_SETTINGS).getSetting(SettingsFile.KEY_GPU_TEXTURE_DECODING);
|
||||
Setting xfbToTexture = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_XFB_TEXTURE);
|
||||
Setting immediateXfb = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_IMMEDIATE_XFB);
|
||||
Setting fastDepth = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_GFX_HACKS).getSetting(SettingsFile.KEY_FAST_DEPTH);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.embedded_frame_buffer, 0));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_SKIP_EFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.skip_efb_access, R.string.skip_efb_access_description, false, skipEFB));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_IGNORE_FORMAT, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.ignore_format_changes, R.string.ignore_format_changes_description, true, ignoreFormat));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_EFB_TEXTURE, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.efb_copy_method, R.string.efb_copy_method_description, true, efbToTexture));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.texture_cache, 0));
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_TEXCACHE_ACCURACY, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.texture_cache_accuracy, R.string.texture_cache_accuracy_description, R.array.textureCacheAccuracyEntries, R.array.textureCacheAccuracyValues, 128, texCacheAccuracy));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_GPU_TEXTURE_DECODING, SettingsFile.SECTION_GFX_SETTINGS, SettingsFile.SETTINGS_GFX, R.string.gpu_texture_decoding, R.string.gpu_texture_decoding_description, false, gpuTextureDecoding));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.external_frame_buffer, 0));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_XFB_TEXTURE, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.xfb_copy_method, R.string.xfb_copy_method_description, true, xfbToTexture));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_IMMEDIATE_XFB, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.immediate_xfb, R.string.immediate_xfb_description, false, immediateXfb));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.other, 0));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_FAST_DEPTH, SettingsFile.SECTION_GFX_HACKS, SettingsFile.SETTINGS_GFX, R.string.fast_depth_calculation, R.string.fast_depth_calculation_description, true, fastDepth));
|
||||
}
|
||||
|
||||
private void addStereoSettings(ArrayList<SettingsItem> sl)
|
||||
{
|
||||
Setting stereoModeValue = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_MODE);
|
||||
Setting stereoDepth = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_DEPTH);
|
||||
Setting convergence = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_CONV);
|
||||
Setting swapEyes = mSettings.get(SettingsFile.SETTINGS_GFX).get(SettingsFile.SECTION_STEREOSCOPY).getSetting(SettingsFile.KEY_STEREO_SWAP);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_STEREO_MODE, SettingsFile.SECTION_STEREOSCOPY, SettingsFile.SETTINGS_GFX, R.string.stereoscopy_mode, R.string.stereoscopy_mode_description, R.array.stereoscopyEntries, R.array.stereoscopyValues, 0, stereoModeValue));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_STEREO_DEPTH, SettingsFile.SECTION_STEREOSCOPY, SettingsFile.SETTINGS_GFX, R.string.stereoscopy_depth, R.string.stereoscopy_depth_description, 100, "%", 20, stereoDepth));
|
||||
sl.add(new SliderSetting(SettingsFile.KEY_STEREO_CONV, SettingsFile.SECTION_STEREOSCOPY, SettingsFile.SETTINGS_GFX, R.string.stereoscopy_convergence, R.string.stereoscopy_convergence_description, 200, "%", 0, convergence));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_STEREO_SWAP, SettingsFile.SECTION_STEREOSCOPY, SettingsFile.SETTINGS_GFX, R.string.stereoscopy_swap_eyes, R.string.stereoscopy_swap_eyes_description, false, swapEyes));
|
||||
}
|
||||
|
||||
private void addGcPadSubSettings(ArrayList<SettingsItem> sl, int gcPadNumber, int gcPadType)
|
||||
{
|
||||
if (gcPadType == 1) // Emulated
|
||||
{
|
||||
Setting bindA = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_A + gcPadNumber);
|
||||
Setting bindB = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_B + gcPadNumber);
|
||||
Setting bindX = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_X + gcPadNumber);
|
||||
Setting bindY = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_Y + gcPadNumber);
|
||||
Setting bindZ = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_Z + gcPadNumber);
|
||||
Setting bindStart = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_START + gcPadNumber);
|
||||
Setting bindControlUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_CONTROL_UP + gcPadNumber);
|
||||
Setting bindControlDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_CONTROL_DOWN + gcPadNumber);
|
||||
Setting bindControlLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_CONTROL_LEFT + gcPadNumber);
|
||||
Setting bindControlRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_CONTROL_RIGHT + gcPadNumber);
|
||||
Setting bindCUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_C_UP + gcPadNumber);
|
||||
Setting bindCDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_C_DOWN + gcPadNumber);
|
||||
Setting bindCLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_C_LEFT + gcPadNumber);
|
||||
Setting bindCRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_C_RIGHT + gcPadNumber);
|
||||
Setting bindTriggerL = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_TRIGGER_L + gcPadNumber);
|
||||
Setting bindTriggerR = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_TRIGGER_R + gcPadNumber);
|
||||
Setting bindDPadUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_DPAD_UP + gcPadNumber);
|
||||
Setting bindDPadDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_DPAD_DOWN + gcPadNumber);
|
||||
Setting bindDPadLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_DPAD_LEFT + gcPadNumber);
|
||||
Setting bindDPadRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_GCBIND_DPAD_RIGHT + gcPadNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_A + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_a, bindA));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_B + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_b, bindB));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_X + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_x, bindX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_Y + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_y, bindY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_Z + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_z, bindZ));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_START + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_start, bindStart));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_control, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_UP + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindControlUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_DOWN + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindControlDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_LEFT + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindControlLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_CONTROL_RIGHT + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindControlRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_c, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_UP + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindCUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_DOWN + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindCDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_LEFT + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindCLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_C_RIGHT + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindCRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_trig, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_TRIGGER_L + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.trigger_left, bindTriggerL));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_TRIGGER_R + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.trigger_right, bindTriggerR));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_UP + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindDPadUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_DOWN + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindDPadDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_LEFT + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindDPadLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_GCBIND_DPAD_RIGHT + gcPadNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindDPadRight));
|
||||
}
|
||||
else // Adapter
|
||||
{
|
||||
Setting rumble = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GCADAPTER_RUMBLE + gcPadNumber);
|
||||
Setting bongos = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_GCADAPTER_BONGOS + gcPadNumber);
|
||||
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_GCADAPTER_RUMBLE + gcPadNumber, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.gc_adapter_rumble, R.string.gc_adapter_rumble_description, false, rumble));
|
||||
sl.add(new CheckBoxSetting(SettingsFile.KEY_GCADAPTER_BONGOS + gcPadNumber, SettingsFile.SECTION_INI_CORE, SettingsFile.SETTINGS_DOLPHIN, R.string.gc_adapter_bongos, R.string.gc_adapter_bongos_description, false, bongos));
|
||||
}
|
||||
}
|
||||
|
||||
private void addWiimoteSubSettings(ArrayList<SettingsItem> sl, int wiimoteNumber)
|
||||
{
|
||||
// Bindings use controller numbers 4-7 (0-3 are GameCube), but the extension setting uses 1-4.
|
||||
IntSetting extension = new IntSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + wiimoteNumber, SettingsFile.SETTINGS_WIIMOTE, getExtensionValue(wiimoteNumber), MenuTag.getWiimoteExtensionMenuTag(wiimoteNumber));
|
||||
Setting bindA = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_A + wiimoteNumber);
|
||||
Setting bindB = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_B + wiimoteNumber);
|
||||
Setting bind1 = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_1 + wiimoteNumber);
|
||||
Setting bind2 = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_2 + wiimoteNumber);
|
||||
Setting bindMinus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_MINUS + wiimoteNumber);
|
||||
Setting bindPlus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_PLUS + wiimoteNumber);
|
||||
Setting bindHome = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_HOME + wiimoteNumber);
|
||||
Setting bindIRUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_UP + wiimoteNumber);
|
||||
Setting bindIRDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_DOWN + wiimoteNumber);
|
||||
Setting bindIRLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_LEFT + wiimoteNumber);
|
||||
Setting bindIRRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_RIGHT + wiimoteNumber);
|
||||
Setting bindIRForward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_FORWARD + wiimoteNumber);
|
||||
Setting bindIRBackward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_BACKWARD + wiimoteNumber);
|
||||
Setting bindIRHide = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_IR_HIDE + wiimoteNumber);
|
||||
Setting bindSwingUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SWING_UP + wiimoteNumber);
|
||||
Setting bindSwingDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SWING_DOWN + wiimoteNumber);
|
||||
Setting bindSwingLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SWING_LEFT + wiimoteNumber);
|
||||
Setting bindSwingRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SWING_RIGHT + wiimoteNumber);
|
||||
Setting bindSwingForward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SWING_FORWARD + wiimoteNumber);
|
||||
Setting bindSwingBackward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SWING_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltForward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TILT_FORWARD + wiimoteNumber);
|
||||
Setting bindTiltBackward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TILT_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TILT_LEFT + wiimoteNumber);
|
||||
Setting bindTiltRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TILT_RIGHT + wiimoteNumber);
|
||||
Setting bindTiltModifier = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TILT_MODIFIER + wiimoteNumber);
|
||||
Setting bindShakeX = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SHAKE_X + wiimoteNumber);
|
||||
Setting bindShakeY = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SHAKE_Y + wiimoteNumber);
|
||||
Setting bindShakeZ = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_SHAKE_Z + wiimoteNumber);
|
||||
Setting bindDPadUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DPAD_UP + wiimoteNumber);
|
||||
Setting bindDPadDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DPAD_DOWN + wiimoteNumber);
|
||||
Setting bindDPadLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DPAD_LEFT + wiimoteNumber);
|
||||
Setting bindDPadRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DPAD_RIGHT + wiimoteNumber);
|
||||
|
||||
sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIMOTE_EXTENSION, SettingsFile.SECTION_WIIMOTE + (wiimoteNumber - 3), SettingsFile.SETTINGS_WIIMOTE, R.string.wiimote_extensions, R.string.wiimote_extensions_description, R.array.wiimoteExtensionsEntries, R.array.wiimoteExtensionsValues, 0, extension, MenuTag.getWiimoteExtensionMenuTag(wiimoteNumber)));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_A + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_a, bindA));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_B + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_b, bindB));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_1 + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_one, bind1));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_2 + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_two, bind2));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_MINUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_minus, bindMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_PLUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_plus, bindPlus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_HOME + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_home, bindHome));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_ir, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindIRUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindIRDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindIRLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindIRRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_FORWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_forward, bindIRForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_BACKWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_backward, bindIRBackward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_IR_HIDE + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.ir_hide, bindIRHide));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_swing, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindSwingUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindSwingDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindSwingLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindSwingRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_FORWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_forward, bindSwingForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SWING_BACKWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_backward, bindSwingBackward));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_tilt, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_FORWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_forward, bindTiltForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_BACKWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_backward, bindTiltBackward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindTiltLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindTiltRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TILT_MODIFIER + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.tilt_modifier, bindTiltModifier));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_shake, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SHAKE_X + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.shake_x, bindShakeX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SHAKE_Y + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.shake_y, bindShakeY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_SHAKE_Z + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.shake_z, bindShakeZ));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindDPadUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindDPadDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindDPadLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DPAD_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindDPadRight));
|
||||
}
|
||||
|
||||
private void addExtensionTypeSettings(ArrayList<SettingsItem> sl, int wiimoteNumber, int extentionType)
|
||||
{
|
||||
switch (extentionType)
|
||||
{
|
||||
case 1: // Nunchuk
|
||||
Setting bindC = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_C + wiimoteNumber);
|
||||
Setting bindZ = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_Z + wiimoteNumber);
|
||||
Setting bindUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_UP + wiimoteNumber);
|
||||
Setting bindDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_DOWN + wiimoteNumber);
|
||||
Setting bindLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_LEFT + wiimoteNumber);
|
||||
Setting bindRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_RIGHT + wiimoteNumber);
|
||||
Setting bindSwingUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_UP + wiimoteNumber);
|
||||
Setting bindSwingDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_DOWN + wiimoteNumber);
|
||||
Setting bindSwingLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_LEFT + wiimoteNumber);
|
||||
Setting bindSwingRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_RIGHT + wiimoteNumber);
|
||||
Setting bindSwingForward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_FORWARD + wiimoteNumber);
|
||||
Setting bindSwingBackward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltForward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_FORWARD + wiimoteNumber);
|
||||
Setting bindTiltBackward = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_BACKWARD + wiimoteNumber);
|
||||
Setting bindTiltLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_LEFT + wiimoteNumber);
|
||||
Setting bindTiltRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_RIGHT + wiimoteNumber);
|
||||
Setting bindTiltModifier = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_MODIFIER + wiimoteNumber);
|
||||
Setting bindShakeX = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_X + wiimoteNumber);
|
||||
Setting bindShakeY = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Y + wiimoteNumber);
|
||||
Setting bindShakeZ = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Z + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_C + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.nunchuk_button_c, bindC));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_Z + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_z, bindZ));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_swing, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindSwingUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindSwingDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindSwingLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindSwingRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_FORWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_forward, bindSwingForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SWING_BACKWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_backward, bindSwingBackward));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_tilt, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_FORWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_forward, bindTiltForward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_BACKWARD + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_backward, bindTiltBackward));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindTiltLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindTiltRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_TILT_MODIFIER + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.tilt_modifier, bindTiltModifier));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.wiimote_shake, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_X + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.shake_x, bindShakeX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Y + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.shake_y, bindShakeY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_NUNCHUK_SHAKE_Z + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.shake_z, bindShakeZ));
|
||||
break;
|
||||
case 2: // Classic
|
||||
Setting bindA = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_A + wiimoteNumber);
|
||||
Setting bindB = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_B + wiimoteNumber);
|
||||
Setting bindX = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_X + wiimoteNumber);
|
||||
Setting bindY = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_Y + wiimoteNumber);
|
||||
Setting bindZL = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZL + wiimoteNumber);
|
||||
Setting bindZR = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZR + wiimoteNumber);
|
||||
Setting bindMinus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_MINUS + wiimoteNumber);
|
||||
Setting bindPlus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_PLUS + wiimoteNumber);
|
||||
Setting bindHome = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_HOME + wiimoteNumber);
|
||||
Setting bindLeftUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_UP + wiimoteNumber);
|
||||
Setting bindLeftDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_DOWN + wiimoteNumber);
|
||||
Setting bindLeftLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_LEFT + wiimoteNumber);
|
||||
Setting bindLeftRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_RIGHT + wiimoteNumber);
|
||||
Setting bindRightUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_UP + wiimoteNumber);
|
||||
Setting bindRightDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_DOWN + wiimoteNumber);
|
||||
Setting bindRightLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_LEFT + wiimoteNumber);
|
||||
Setting bindRightRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_RIGHT + wiimoteNumber);
|
||||
Setting bindL = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_L + wiimoteNumber);
|
||||
Setting bindR = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_R + wiimoteNumber);
|
||||
Setting bindDpadUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_UP + wiimoteNumber);
|
||||
Setting bindDpadDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_DOWN + wiimoteNumber);
|
||||
Setting bindDpadLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_LEFT + wiimoteNumber);
|
||||
Setting bindDpadRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_RIGHT + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_A + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_a, bindA));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_B + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_b, bindB));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_X + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_x, bindX));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_Y + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_y, bindY));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZL + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.classic_button_zl, bindZL));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_ZR + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.classic_button_zr, bindZR));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_MINUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_minus, bindMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_PLUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_plus, bindPlus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_HOME + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_home, bindHome));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.classic_leftstick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindLeftUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindLeftDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindLeftLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_LEFT_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindLeftRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.classic_rightstick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindRightUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindRightDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindRightLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_RIGHT_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindRightRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_trig, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_L + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.trigger_left, bindR));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_TRIGGER_R + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.trigger_right, bindL));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.controller_dpad, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindDpadUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindDpadDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindDpadLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_CLASSIC_DPAD_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindDpadRight));
|
||||
break;
|
||||
case 3: // Guitar
|
||||
Setting bindFretGreen = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_GREEN + wiimoteNumber);
|
||||
Setting bindFretRed = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_RED + wiimoteNumber);
|
||||
Setting bindFretYellow = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_YELLOW + wiimoteNumber);
|
||||
Setting bindFretBlue = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_BLUE + wiimoteNumber);
|
||||
Setting bindFretOrange = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_ORANGE + wiimoteNumber);
|
||||
Setting bindStrumUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_UP + wiimoteNumber);
|
||||
Setting bindStrumDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_DOWN + wiimoteNumber);
|
||||
Setting bindGuitarMinus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_MINUS + wiimoteNumber);
|
||||
Setting bindGuitarPlus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_PLUS + wiimoteNumber);
|
||||
Setting bindGuitarUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_UP + wiimoteNumber);
|
||||
Setting bindGuitarDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_DOWN + wiimoteNumber);
|
||||
Setting bindGuitarLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_LEFT + wiimoteNumber);
|
||||
Setting bindGuitarRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_RIGHT + wiimoteNumber);
|
||||
Setting bindWhammyBar = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_GUITAR_WHAMMY_BAR + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.guitar_frets, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_GREEN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_green, bindFretGreen));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_RED + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_red, bindFretRed));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_YELLOW + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_yellow, bindFretYellow));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_BLUE + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_blue, bindFretBlue));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_FRET_ORANGE + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_orange, bindFretOrange));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.guitar_strum, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindStrumUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STRUM_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindStrumDown));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_MINUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_minus, bindGuitarMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_PLUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_plus, bindGuitarPlus));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindGuitarUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindGuitarDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindGuitarLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_STICK_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindGuitarRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.guitar_whammy, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_GUITAR_WHAMMY_BAR + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindWhammyBar));
|
||||
break;
|
||||
case 4: // Drums
|
||||
Setting bindPadRed = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_RED + wiimoteNumber);
|
||||
Setting bindPadYellow = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_YELLOW + wiimoteNumber);
|
||||
Setting bindPadBlue = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BLUE + wiimoteNumber);
|
||||
Setting bindPadGreen = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_GREEN + wiimoteNumber);
|
||||
Setting bindPadOrange = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_ORANGE + wiimoteNumber);
|
||||
Setting bindPadBass = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BASS + wiimoteNumber);
|
||||
Setting bindDrumsUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_UP + wiimoteNumber);
|
||||
Setting bindDrumsDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_DOWN + wiimoteNumber);
|
||||
Setting bindDrumsLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_LEFT + wiimoteNumber);
|
||||
Setting bindDrumsRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_RIGHT + wiimoteNumber);
|
||||
Setting bindDrumsMinus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_MINUS + wiimoteNumber);
|
||||
Setting bindDrumsPlus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_DRUMS_PLUS + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.drums_pads, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_RED + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_red, bindPadRed));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_YELLOW + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_yellow, bindPadYellow));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BLUE + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_blue, bindPadBlue));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_GREEN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_green, bindPadGreen));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_ORANGE + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_orange, bindPadOrange));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PAD_BASS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.drums_pad_bass, bindPadBass));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindDrumsUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindDrumsDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindDrumsLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_STICK_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindDrumsRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_MINUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_minus, bindDrumsMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_DRUMS_PLUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_plus, bindDrumsPlus));
|
||||
break;
|
||||
case 5: // Turntable
|
||||
Setting bindGreenLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_LEFT + wiimoteNumber);
|
||||
Setting bindRedLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_LEFT + wiimoteNumber);
|
||||
Setting bindBlueLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_LEFT + wiimoteNumber);
|
||||
Setting bindGreenRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_RIGHT + wiimoteNumber);
|
||||
Setting bindRedRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_RIGHT + wiimoteNumber);
|
||||
Setting bindBlueRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_RIGHT + wiimoteNumber);
|
||||
Setting bindTurntableMinus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_MINUS + wiimoteNumber);
|
||||
Setting bindTurntablePlus = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_PLUS + wiimoteNumber);
|
||||
Setting bindEuphoria = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EUPHORIA + wiimoteNumber);
|
||||
Setting bindTurntableLeftLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_LEFT + wiimoteNumber);
|
||||
Setting bindTurntableLeftRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_RIGHT + wiimoteNumber);
|
||||
Setting bindTurntableRightLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_LEFT + wiimoteNumber);
|
||||
Setting bindTurntableRightRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_RIGHT + wiimoteNumber);
|
||||
Setting bindTurntableUp = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_UP + wiimoteNumber);
|
||||
Setting bindTurntableDown = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_DOWN + wiimoteNumber);
|
||||
Setting bindTurntableLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_LEFT + wiimoteNumber);
|
||||
Setting bindTurntableRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_RIGHT + wiimoteNumber);
|
||||
Setting bindEffectDial = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EFFECT_DIAL + wiimoteNumber);
|
||||
Setting bindCrossfadeLeft = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_LEFT + wiimoteNumber);
|
||||
Setting bindCrossfadeRight = mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_BINDINGS).getSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_RIGHT + wiimoteNumber);
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_buttons, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_green_left, bindGreenLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_red_left, bindRedLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_blue_left, bindBlueLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_GREEN_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_green_right, bindGreenRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RED_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_red_right, bindRedRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_BLUE_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_blue_right, bindBlueRight));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_MINUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_minus, bindTurntableMinus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_PLUS + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.button_plus, bindTurntablePlus));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EUPHORIA + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_button_euphoria, bindEuphoria));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_table_left, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindTurntableLeftLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_LEFT_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindTurntableLeftRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_table_right, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindTurntableRightLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_RIGHT_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindTurntableRightRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.generic_stick, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_UP + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_up, bindTurntableUp));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_DOWN + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_down, bindTurntableDown));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindTurntableLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_STICK_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindTurntableRight));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_effect, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_EFFECT_DIAL + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.turntable_effect_dial, bindEffectDial));
|
||||
|
||||
sl.add(new HeaderSetting(null, null, R.string.turntable_crossfade, 0));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_LEFT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_left, bindCrossfadeLeft));
|
||||
sl.add(new InputBindingSetting(SettingsFile.KEY_WIIBIND_TURNTABLE_CROSSFADE_RIGHT + wiimoteNumber, SettingsFile.SECTION_BINDINGS, SettingsFile.SETTINGS_DOLPHIN, R.string.generic_right, bindCrossfadeRight));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean getInvertedBooleanValue(int file, String section, String key, boolean defaultValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
return !((BooleanSetting) mSettings.get(file).get(section).getSetting(key)).getValue();
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
private int getVideoBackendValue()
|
||||
{
|
||||
int videoBackendValue;
|
||||
|
||||
try
|
||||
{
|
||||
String videoBackend = ((StringSetting)mSettings.get(SettingsFile.SETTINGS_DOLPHIN).get(SettingsFile.SECTION_INI_CORE).getSetting(SettingsFile.KEY_VIDEO_BACKEND)).getValue();
|
||||
if (videoBackend.equals("OGL"))
|
||||
{
|
||||
videoBackendValue = 0;
|
||||
}
|
||||
else if (videoBackend.equals("Vulkan"))
|
||||
{
|
||||
videoBackendValue = 1;
|
||||
}
|
||||
else if (videoBackend.equals("Software Renderer"))
|
||||
{
|
||||
videoBackendValue = 2;
|
||||
}
|
||||
else if (videoBackend.equals("Null"))
|
||||
{
|
||||
videoBackendValue = 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
videoBackendValue = 0;
|
||||
}
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
videoBackendValue = 0;
|
||||
}
|
||||
|
||||
return videoBackendValue;
|
||||
}
|
||||
|
||||
private int getExtensionValue(int wiimoteNumber)
|
||||
{
|
||||
int extensionValue;
|
||||
|
||||
try
|
||||
{
|
||||
String extension = ((StringSetting)mSettings.get(SettingsFile.SETTINGS_WIIMOTE).get(SettingsFile.SECTION_WIIMOTE + wiimoteNumber).getSetting(SettingsFile.KEY_WIIMOTE_EXTENSION)).getValue();
|
||||
if (extension.equals("None"))
|
||||
{
|
||||
extensionValue = 0;
|
||||
}
|
||||
else if (extension.equals("Nunchuk"))
|
||||
{
|
||||
extensionValue = 1;
|
||||
}
|
||||
else if (extension.equals("Classic"))
|
||||
{
|
||||
extensionValue = 2;
|
||||
}
|
||||
else if (extension.equals("Guitar"))
|
||||
{
|
||||
extensionValue = 3;
|
||||
}
|
||||
else if (extension.equals("Drums"))
|
||||
{
|
||||
extensionValue = 4;
|
||||
}
|
||||
else if (extension.equals("Turntable"))
|
||||
{
|
||||
extensionValue = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
extensionValue = 0;
|
||||
}
|
||||
}
|
||||
catch (NullPointerException ex)
|
||||
{
|
||||
extensionValue = 0;
|
||||
}
|
||||
|
||||
return extensionValue;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package org.dolphinemu.dolphinemu.utils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BiMap<K, V>
|
||||
{
|
||||
|
||||
private Map<K, V> forward = new HashMap<K, V>();
|
||||
private Map<V, K> backward = new HashMap<V, K>();
|
||||
|
||||
public synchronized void add(K key, V value)
|
||||
{
|
||||
forward.put(key, value);
|
||||
backward.put(value, key);
|
||||
}
|
||||
|
||||
public synchronized V getForward(K key)
|
||||
{
|
||||
return forward.get(key);
|
||||
}
|
||||
|
||||
public synchronized K getBackward(V key)
|
||||
{
|
||||
return backward.get(key);
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.dolphinemu.dolphinemu.ui.settings.SettingsFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<org.dolphinemu.dolphinemu.features.settings.ui.SettingsFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/list_settings"
|
||||
|
@ -12,4 +12,4 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</org.dolphinemu.dolphinemu.ui.settings.SettingsFrameLayout>
|
||||
</org.dolphinemu.dolphinemu.features.settings.ui.SettingsFrameLayout>
|
Loading…
Reference in New Issue