• 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
02-16-2017, 05:21 PM (This post was last modified: 02-16-2017, 05:36 PM by JosJuice.)
#2
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,936
Threads: 7
Joined: Oct 2014
In recent development builds of Dolphin, the values "True" and "False" are used for this, not numbers. But I think there's some backwards compatibility thing that treats a 1 (or 1.0000000000000000?) in the INI the same way as a True.

EDIT: Wait a little... For some reason, we're saving it as Sideways Wii Remote in the INI now, not Sideways Wiimote. That has got to be a mistake from when we re-labeled it in the GUI. I'll look into changing it back.
Find
Reply
02-17-2017, 05:21 AM
#3
nitro001 Offline
Junior Member
**
Posts: 24
Threads: 6
Joined: Jun 2016
(02-16-2017, 05:21 PM)JosJuice Wrote: In recent development builds of Dolphin, the values "True" and "False" are used for this, not numbers. But I think there's some backwards compatibility thing that treats a 1 (or 1.0000000000000000?) in the INI the same way as a True.

EDIT: Wait a little... For some reason, we're saving it as Sideways Wii Remote in the INI now, not Sideways Wiimote. That has got to be a mistake from when we re-labeled it in the GUI. I'll look into changing it back.

I checked the history on the WiimoteEmu.cpp in the core where the Sideways Wii Remote is being checked.  It looks like the name reference was changed back on October 25th by Pringo in that file and others. I will test this with the new Options/Sideways Wii Remote and using a checkbox as well to see if it accepts it on the Shield.
Find
Reply
02-17-2017, 05:26 AM (This post was last modified: 02-17-2017, 05:28 AM by JosJuice.)
#4
JosJuice Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 8,936
Threads: 7
Joined: Oct 2014
Yeah, Pringo was the one who made the PR for changing "Wiimote" to "Wii Remote" in the GUI. I reviewed that PR, so this problem not getting caught is on me.

Feel free to try that out, but keep in mind that it might get changed back to Sideways Wiimote in later versions of Dolphin. We'll see how soon I'll be able to make a PR and if it will get accepted.
Find
Reply
« Next Oldest | Next Newest »


  • 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