mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2026-04-20 09:37:07 -04:00
SDL: Add force use switch
This commit is contained in:
@@ -129,6 +129,7 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
|
||||
motionListener = (View.OnGenericMotionListener)
|
||||
runMethodbyReflection("org.libsdl.app.SDLActivity",
|
||||
"getMotionListener");
|
||||
if (LauncherPreferences.PREF_GAMEPAD_FORCEDSDL_PASSTHRU) Tools.SDL.initializeControllerSubsystems();
|
||||
} catch (UnsatisfiedLinkError ignored) {
|
||||
// Ignore because if SDL.setupJNI(); fails, SDL wasn't loaded.
|
||||
} catch (ReflectiveOperationException e) {
|
||||
|
||||
@@ -40,6 +40,7 @@ public class LauncherPreferences {
|
||||
public static boolean PREF_CHECK_LIBRARY_SHA = true;
|
||||
public static boolean PREF_DISABLE_GESTURES = false;
|
||||
public static boolean PREF_GAMEPAD_SDL_PASSTHRU = false;
|
||||
public static boolean PREF_GAMEPAD_FORCEDSDL_PASSTHRU = false;
|
||||
public static boolean PREF_DISABLE_SWAP_HAND = false;
|
||||
public static float PREF_MOUSESPEED = 1f;
|
||||
public static int PREF_RAM_ALLOCATION;
|
||||
@@ -91,6 +92,7 @@ public class LauncherPreferences {
|
||||
PREF_CHECK_LIBRARY_SHA = DEFAULT_PREF.getBoolean("checkLibraries",true);
|
||||
PREF_DISABLE_GESTURES = DEFAULT_PREF.getBoolean("disableGestures",false);
|
||||
PREF_GAMEPAD_SDL_PASSTHRU = DEFAULT_PREF.getBoolean("gamepadPassthru",false);
|
||||
PREF_GAMEPAD_FORCEDSDL_PASSTHRU = DEFAULT_PREF.getBoolean("gamepadPassthruForced",false);
|
||||
PREF_DISABLE_SWAP_HAND = DEFAULT_PREF.getBoolean("disableDoubleTap", false);
|
||||
PREF_RAM_ALLOCATION = DEFAULT_PREF.getInt("allocation", findBestRAMAllocation(ctx));
|
||||
PREF_CUSTOM_JAVA_ARGS = DEFAULT_PREF.getString("javaArgs", "");
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
<string name="dl_library_sha_unknown">Library %s can\'t be checked, have to assume it\'s good</string>
|
||||
<string name="dl_library_sha_pass">Library %s is fine and usable</string>
|
||||
<string name="mcl_gamepad_SDL">Enable SDL controller backend</string>
|
||||
<string name="mcl_gamepad_SDL_subtitle">Replaces the legacy GLFW controller handling with SDL. Has better mod support.</string>
|
||||
<string name="mcl_gamepad_SDL_subtitle">Enables SDL controller backend. Has better mod support. Falls back to GLFW if not used.</string>
|
||||
<string name="mcl_disable_gestures">Disable gestures</string>
|
||||
<string name="mcl_disable_gestures_subtitle">Disables gestures, such as hold to break block, and tap to place a block.</string>
|
||||
<string name="mcl_disable_swap_hand">Disable double tap to swap hands</string>
|
||||
@@ -476,4 +476,7 @@
|
||||
<string name="error_vanilla_json_corrupt">Vanilla json seems to be corrupt. Please send a bug report on github or discord.</string>
|
||||
<string name="preference_ask_for_microphone_title">Allow microphone</string>
|
||||
<string name="preference_ask_for_microphone_description">Click to re-request the notification permission, required for voice chat mods like Simple Voice Chat.</string>
|
||||
<string name="mcl_gamepad_forcedSDL_subtitle">Can allow old versions of Legacy4J to use SDL backend</string>
|
||||
<string name="mcl_gamepad_forcedSDL">Forcibly start SDL controller handling</string>
|
||||
<string name="preference_category_SDL_settings">SDL Settings</string>
|
||||
</resources>
|
||||
|
||||
@@ -12,14 +12,6 @@
|
||||
>
|
||||
<intent android:targetPackage="@string/application_package" android:targetClass="net.kdt.pojavlaunch.CustomControlsActivity" android:action=".CustomControlsActivity"/>
|
||||
</Preference>
|
||||
|
||||
<androidx.preference.SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_menu_custom_controls"
|
||||
android:key="gamepadPassthru"
|
||||
android:summary="@string/mcl_gamepad_SDL_subtitle"
|
||||
android:title="@string/mcl_gamepad_SDL"/>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/preference_category_gestures">
|
||||
|
||||
@@ -176,6 +168,22 @@
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/preference_category_SDL_settings">
|
||||
<androidx.preference.SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:icon="@drawable/ic_menu_custom_controls"
|
||||
android:key="gamepadPassthru"
|
||||
android:summary="@string/mcl_gamepad_SDL_subtitle"
|
||||
android:title="@string/mcl_gamepad_SDL"/>
|
||||
|
||||
<androidx.preference.SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="gamepadPassthruForced"
|
||||
android:summary="@string/mcl_gamepad_forcedSDL_subtitle"
|
||||
android:title="@string/mcl_gamepad_forcedSDL"/>
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/preference_category_touchcontroller_settings">
|
||||
<SwitchPreference
|
||||
|
||||
Reference in New Issue
Block a user