• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › Development Discussion v
« Previous 1 ... 25 26 27 28 29 ... 117 Next »

Dolphin Android SingleChoiceClick String instead of int?
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Dolphin Android SingleChoiceClick String instead of int?
02-16-2017, 09:02 AM (This post was last modified: 02-16-2017, 09:14 AM by nitro001.)
#1
nitro001 Offline
Junior Member
**
Posts: 24
Threads: 6
Joined: Jun 2016
Question 
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:
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
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(..):
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
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Dolphin Android SingleChoiceClick String instead of int? - nitro001 - 02-16-2017, 09:02 AM
RE: Dolphin Android SingleChoiceClick String instead of int? - JosJuice - 02-16-2017, 05:21 PM
RE: Dolphin Android SingleChoiceClick String instead of int? - nitro001 - 02-17-2017, 05:21 AM
RE: Dolphin Android SingleChoiceClick String instead of int? - JosJuice - 02-17-2017, 05:26 AM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode