Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Game settings enhancements #7434

Merged
merged 4 commits into from Oct 29, 2018

Conversation

zackhow
Copy link
Member

@zackhow zackhow commented Sep 25, 2018

Adds option to set controller source and bindings per game on the long press menu. Due to the way controller settings are saved for android, all bindings and settings can be set in the game file with the exception of the wii extension. So each emulated wii controller that is configured will have a controller profile created just to save the selected wii extension.

Also sped up the saving of game settings, it was previously opening the file to save each value, now it will only open/save a file per section.
gcset
wiiset

@@ -353,12 +360,13 @@ public static native String GetConfig(String configFile, String Section, String
/**
* Begins emulation.
*/
public static native void Run(String path, boolean firstOpen);
public static native void Run(String path, String gameId, boolean firstOpen);

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -38,6 +39,18 @@
* @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, Setting setting, int nameId, int descriptionId,

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -250,7 +250,7 @@ class InputDevice
float AxisValue(int padID, ButtonType axis);
};

void Init();
void Init(std::string);

This comment was marked as off-topic.

This comment was marked as off-topic.

@zackhow zackhow force-pushed the game-controller branch 2 times, most recently from a711129 to 8e0a3a5 Compare September 27, 2018 22:16
@zackhow zackhow force-pushed the game-controller branch 2 times, most recently from 02f2032 to 849d58d Compare October 5, 2018 21:31
@zackhow
Copy link
Member Author

zackhow commented Oct 5, 2018

Rebased to fix conflicts.

@mahdihijazi
Copy link
Contributor

Did a quick test on the Shield TV and it is working

.setItems(R.array.gameSettingsMenus, new DialogInterface.OnClickListener()
.setItems(holder.gameFile.getPlatform() == Platform.GAMECUBE.toInt() ?
R.array.gameSettingsMenusGC :
R.array.gameSettingsMenusWii, new DialogInterface.OnClickListener()

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -100,7 +100,9 @@ public boolean onLongClick(View view)

AlertDialog.Builder builder = new AlertDialog.Builder(activity);

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -212,7 +212,7 @@ private void saveInput(String bind, String ui)
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = preferences.edit();

editor.putString(setting.getKey(), ui);
editor.putString(setting.getKey() + setting.getGameId(), ui);

This comment was marked as off-topic.

This comment was marked as off-topic.

@@ -22,6 +22,7 @@

private String mKey;
private String mSection;
private String gameId;

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@zackhow zackhow force-pushed the game-controller branch 2 times, most recently from 22ba05c to f4d1aab Compare October 28, 2018 14:19
Previously would take several seconds to save, sometimes causing ANRs, which
was made worse when adding all the controller values. Now we only load/save
each section instead of doing it for each setting. Also added a method
to save an individual setting.
@delroth delroth merged commit dd01229 into dolphin-emu:master Oct 29, 2018
@zanzabarjones

This comment was marked as off-topic.

@brujo5
Copy link

brujo5 commented Oct 29, 2018

idk if related to this but some guy experienced a problem related to Certain settings menus are invisible since yesterday build when those changes merged.

more info in forum dolphin android, thx

@zackhow
Copy link
Member Author

zackhow commented Oct 29, 2018

I don't think it is. I've heard of this issue from people with LG phones but it seems to be sporadic.

@zackhow zackhow deleted the game-controller branch November 2, 2018 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants