New option, start with virtual mouse on (#2399)

This commit is contained in:
SerpentSpirale 2022-01-06 22:59:00 +01:00
parent 5d61619243
commit 2867ef3ad2
4 changed files with 15 additions and 0 deletions

View file

@ -2,6 +2,7 @@ package net.kdt.pojavlaunch;
import static net.kdt.pojavlaunch.Architecture.ARCH_X86;
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_VIRTUAL_MOUSE_START;
import static org.lwjgl.glfw.CallbackBridge.sendKeyPress;
import static org.lwjgl.glfw.CallbackBridge.windowHeight;
@ -127,6 +128,10 @@ public class BaseMainActivity extends BaseActivity {
minecraftGLView.setSurfaceReadyListener(() -> {
try {
// Setup virtual mouse right before launching
if (PREF_VIRTUAL_MOUSE_START)
touchpad.switchState();
runCraft();
}catch (Throwable e){
Tools.showError(getApplicationContext(), e, true);

View file

@ -36,6 +36,7 @@ public class LauncherPreferences
public static boolean PREF_SUSTAINED_PERFORMANCE = false;
public static String PREF_GLES_SHRINK_HACK = "0";
public static boolean PREF_VBO_DISABLE_HACK = false;
public static boolean PREF_VIRTUAL_MOUSE_START = false;
public static void loadPreferences(Context ctx) {
@ -67,6 +68,7 @@ public class LauncherPreferences
PREF_SUSTAINED_PERFORMANCE = DEFAULT_PREF.getBoolean("sustainedPerformance", false);
PREF_GLES_SHRINK_HACK = DEFAULT_PREF.getString("gl4es_shrink_hack", "0");
PREF_VBO_DISABLE_HACK = DEFAULT_PREF.getBoolean("vbo_disable_hack", false);
PREF_VIRTUAL_MOUSE_START = DEFAULT_PREF.getBoolean("mouse_start", false);
/*
if (PREF_CUSTOM_JAVA_ARGS.isEmpty()) {

View file

@ -265,6 +265,8 @@
<string name="preference_control_offset_title">Control side offsets</string>
<string name="preference_control_offset_description">Set a custom offset to each side of the screen</string>
<string name="preference_mouse_start_title">Start with virtual mouse on</string>
<string name="preference_mouse_start_description">Using this option will get you judged by Mathias-Boulay</string>
<string name="preference_video_title">Video and renderer</string>
<string name="preference_video_description">Resolution, scaling type, and renderer</string>
<string name="preference_control_title">Control customization</string>

View file

@ -60,6 +60,12 @@
app2:selectable="false"
app2:seekBarIncrement="5"
app2:showSeekBarValue="true" />
<SwitchPreference
android:key="mouse_start"
android:title="@string/preference_mouse_start_title"
android:summary="@string/preference_mouse_start_description"
/>
</PreferenceCategory>