
Hello,
I am trying to test out adding in the setting for:
Options/Sideways Wiimote
The problem I am having is that the setting in the file is not an integer but a double:
When it is enabled, it looks like:
Usually when it is disabled I don't see it in the file, but I assume that putting it like:
would invalidate it.
However, I am trying to find the best way to do this. In the SettingsFragmentPresenter.java file, in the addWiimoteSubsettings function, I first tried to add it as a new CheckBoxSetting(..). Unfortunately this adds it with an = true or = false value. I am now trying to add it as a new SingleChoiceSetting(..):
I have configured the SettingsFile variables properly, however since the values are doubles and there is no double-array support in the arrays.xml, I tried to use a string-array, like:
Unfortunately the code in the SettingsAdapter.java for the getSelectionForSingleChoiceValue looks only for integer value arrays, not string arrays.
I am not sure why the original code in windows spits it out as the double with that many 0's behind it. If it wasn't needed, I could just use an int with a 0 or 1, but I don't want to break compatibility with the file.
Would anyone have an idea on how to approach this?
Thanks,
Nathan
I am trying to test out adding in the setting for:
Options/Sideways Wiimote
The problem I am having is that the setting in the file is not an integer but a double:
When it is enabled, it looks like:
Code:
Options/Sideways Wiimote = 1.0000000000000000
Usually when it is disabled I don't see it in the file, but I assume that putting it like:
Code:
Options/Sideways Wiimote = 0.0000000000000000
However, I am trying to find the best way to do this. In the SettingsFragmentPresenter.java file, in the addWiimoteSubsettings function, I first tried to add it as a new CheckBoxSetting(..). Unfortunately this adds it with an = true or = false value. I am now trying to add it as a new SingleChoiceSetting(..):
Code:
sl.add(new HeaderSetting(null, null, R.string.wiimote_sideways, 0));
Setting wiimoteSetting = mSettings.get(SettingsFile.SETTINGS_WIIMOTE).get(SettingsFile.SECTION_WIIMOTE + (wiimoteNumber - 3)).getSetting(SettingsFile.KEY_WIIBIND_SIDEWAYS);
sl.add(new SingleChoiceSetting(SettingsFile.KEY_WIIBIND_SIDEWAYS, SettingsFile.SECTION_WIIMOTE + (wiimoteNumber - 3), SettingsFile.SETTINGS_WIIMOTE, R.string.generic_sideways, R.string.generic_sideways_descrip, R.array.wiimoteSidewaysEntries, R.array.wiimoteSidewaysValues, 0, wiimoteSetting));
I have configured the SettingsFile variables properly, however since the values are doubles and there is no double-array support in the arrays.xml, I tried to use a string-array, like:
Code:
<string-array name="wiimoteSidewaysEntries">
<item>Disabled</item>
<item>Enabled</item>
</string-array>
<string-array name="wiimoteSidewaysValues">
<item>0.0000000000000000</item>
<item>1.0000000000000000</item>
</string-array>
Unfortunately the code in the SettingsAdapter.java for the getSelectionForSingleChoiceValue looks only for integer value arrays, not string arrays.
I am not sure why the original code in windows spits it out as the double with that many 0's behind it. If it wasn't needed, I could just use an int with a 0 or 1, but I don't want to break compatibility with the file.
Would anyone have an idea on how to approach this?
Thanks,
Nathan