New basic loading of preferences on launch

This commit is contained in:
downthecrop 2023-10-16 22:57:39 -07:00
parent 1196fc8d86
commit dd25be1bb8
5 changed files with 8 additions and 3 deletions

3
.gitignore vendored
View file

@ -4,5 +4,6 @@
app_pojavlauncher/src/main/assets/components/jre
local.properties
.idea/
.DS_Store
app_pojavlauncher/.cxx/
.vs/
.vs/

View file

@ -1 +1 @@
1690945073108
1696645137999

View file

@ -1,6 +1,7 @@
package net.kdt.pojavlaunch;
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_DISABLE_SWAP_HAND;
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_INSET_X;
import static net.kdt.pojavlaunch.utils.MCOptionUtils.getMcScale;
import static org.lwjgl.glfw.CallbackBridge.sendKeyPress;
import static org.lwjgl.glfw.CallbackBridge.sendMouseButton;
@ -156,6 +157,7 @@ public class GLFWGLSurface extends View implements GrabListener {
/** Initialize the view and all its settings */
@SuppressLint("ClickableViewAccessibility")
public void start(){
System.out.println("Hello.. I can see the inset it: "+PREF_INSET_X);
scaleGestureDetector = new ScaleGestureDetector(this.getContext(), new ScaleListener());
if(LauncherPreferences.PREF_USE_ALTERNATE_SURFACE){
SurfaceView surfaceView = new SurfaceView(getContext());

View file

@ -38,6 +38,7 @@ public class LauncherPreferences {
public static boolean PREF_DISABLE_GESTURES = false;
public static boolean PREF_DISABLE_SWAP_HAND = false;
public static float PREF_MOUSESPEED = 1f;
public static float PREF_INSET_X = 0f;
public static int PREF_RAM_ALLOCATION;
public static String PREF_DEFAULT_RUNTIME;
public static boolean PREF_SUSTAINED_PERFORMANCE = false;
@ -72,6 +73,7 @@ public class LauncherPreferences {
PREF_BUTTONSIZE = DEFAULT_PREF.getInt("buttonscale", 100);
PREF_MOUSESCALE = DEFAULT_PREF.getInt("mousescale", 100);
PREF_MOUSESPEED = ((float)DEFAULT_PREF.getInt("mousespeed",100))/100f;
PREF_INSET_X = DEFAULT_PREF.getInt("xinset", 0);
PREF_HIDE_SIDEBAR = DEFAULT_PREF.getBoolean("hideSidebar", false);
PREF_IGNORE_NOTCH = DEFAULT_PREF.getBoolean("ignoreNotch", false);
PREF_VERTYPE_RELEASE = DEFAULT_PREF.getBoolean("vertype_release", true);

View file

@ -43,7 +43,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_setting_gesture_time"
android:key="timeLongPressTrigger"
android:key="xinset"
android:summary=""Hello""
android:title=""Example""
app2:seekBarIncrement="10"