diff --git a/FCL/src/main/AndroidManifest.xml b/FCL/src/main/AndroidManifest.xml index 2cd0deba..8f5a5105 100644 --- a/FCL/src/main/AndroidManifest.xml +++ b/FCL/src/main/AndroidManifest.xml @@ -53,7 +53,7 @@ android:networkSecurityConfig="@xml/network_security_config" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" - android:roundIcon="@mipmap/ic_launcher_round" + android:roundIcon="@mipmap/ic_launcher" android:supportsRtl="true" android:largeHeap="true" android:usesCleartextTraffic="true" diff --git a/FCL/src/main/java/com/tungsten/fcl/control/GameMenu.java b/FCL/src/main/java/com/tungsten/fcl/control/GameMenu.java index b1f7f13e..d3b9bafe 100644 --- a/FCL/src/main/java/com/tungsten/fcl/control/GameMenu.java +++ b/FCL/src/main/java/com/tungsten/fcl/control/GameMenu.java @@ -336,6 +336,7 @@ public class GameMenu implements MenuCallback, View.OnClickListener { FCLSeekBar itemBarScaleSeekbar = findViewById(R.id.item_bar_scale); FCLSeekBar windowScaleSeekbar = findViewById(R.id.window_scale); + FCLSeekBar cursorOffsetSeekbar = findViewById(R.id.cursor_offset); FCLSeekBar mouseSensitivitySeekbar = findViewById(R.id.mouse_sensitivity); FCLSeekBar mouseSizeSeekbar = findViewById(R.id.mouse_size); FCLSeekBar gamepadDeadzoneSeekbar = findViewById(R.id.gamepad_deadzone_size); @@ -344,6 +345,7 @@ public class GameMenu implements MenuCallback, View.OnClickListener { FCLTextView itemBarScaleText = findViewById(R.id.item_bar_scale_text); FCLTextView windowScaleText = findViewById(R.id.window_scale_text); + FCLTextView cursorOffsetText = findViewById(R.id.cursor_offset_text); FCLTextView mouseSensitivityText = findViewById(R.id.mouse_sensitivity_text); FCLTextView mouseSizeText = findViewById(R.id.mouse_size_text); FCLTextView gamepadDeadzoneText = findViewById(R.id.gamepad_deadzone_text); @@ -425,6 +427,25 @@ public class GameMenu implements MenuCallback, View.OnClickListener { }; windowScaleSeekbar.progressProperty().bindBidirectional(windowScaleProperty); + cursorOffsetSeekbar.addProgressListener(); + IntegerProperty cursorOffsetProperty = new SimpleIntegerProperty((int) (menuSetting.getCursorOffset())) { + @Override + protected void invalidated() { + super.invalidated(); + menuSetting.setCursorOffset(get()); + int screenWidth = AndroidUtils.getScreenWidth(FCLApplication.getCurrentActivity()); + int screenHeight = AndroidUtils.getScreenHeight(FCLApplication.getCurrentActivity()); + if (fclBridge != null) { + double scaleFactor = fclBridge.getScaleFactor(); + int width = (int) ((screenWidth + get()) * scaleFactor); + int height = (int) (screenHeight * scaleFactor); + fclBridge.getSurfaceTexture().setDefaultBufferSize(width, height); + fclBridge.pushEventWindow(width, height); + } + } + }; + cursorOffsetSeekbar.progressProperty().bindBidirectional(cursorOffsetProperty); + mouseSensitivitySeekbar.addProgressListener(); IntegerProperty mouseSensitivityProperty = new SimpleIntegerProperty((int) (menuSetting.getMouseSensitivity() * 100)) { @Override @@ -465,6 +486,7 @@ public class GameMenu implements MenuCallback, View.OnClickListener { itemBarScaleText.stringProperty().bind(Bindings.createStringBinding(() -> String.valueOf(itemBarScaleProperty.get()), itemBarScaleProperty)); windowScaleText.stringProperty().bind(Bindings.createStringBinding(() -> windowScaleProperty.get() + " %", windowScaleProperty)); + cursorOffsetText.stringProperty().bind(Bindings.createStringBinding(() -> String.valueOf(cursorOffsetProperty.get()), cursorOffsetProperty)); mouseSensitivityText.stringProperty().bind(Bindings.createStringBinding(() -> mouseSensitivityProperty.get() + " %", mouseSensitivityProperty)); mouseSizeText.stringProperty().bind(Bindings.createStringBinding(() -> menuSetting.mouseSizeProperty().get() + " dp", menuSetting.mouseSizeProperty())); gamepadDeadzoneText.stringProperty().bind(Bindings.createStringBinding(() -> gamepadDeadzoneProperty.get() + " %", gamepadDeadzoneProperty)); diff --git a/FCL/src/main/java/com/tungsten/fcl/setting/MenuSetting.java b/FCL/src/main/java/com/tungsten/fcl/setting/MenuSetting.java index f2a72e2c..cc4dc1cd 100644 --- a/FCL/src/main/java/com/tungsten/fcl/setting/MenuSetting.java +++ b/FCL/src/main/java/com/tungsten/fcl/setting/MenuSetting.java @@ -237,6 +237,20 @@ public class MenuSetting { this.windowScaleProperty.set(windowScale); } + private final DoubleProperty cursorOffsetProperty = new SimpleDoubleProperty(this, "cursorOffset", 0); + + public DoubleProperty cursorOffsetProperty() { + return cursorOffsetProperty; + } + + public double getCursorOffset() { + return cursorOffsetProperty.get(); + } + + public void setCursorOffset(double cursorOffset) { + this.cursorOffsetProperty.set(cursorOffset); + } + private final DoubleProperty mouseSensitivityProperty = new SimpleDoubleProperty(this, "mouseSensitivity", 1d); public DoubleProperty mouseSensitivityProperty() { @@ -311,6 +325,7 @@ public class MenuSetting { mouseSizeProperty.addListener(listener); itemBarScaleProperty.addListener(listener); windowScaleProperty.addListener(listener); + cursorOffsetProperty.addListener(listener); gamepadDeadzoneProperty.addListener(listener); gamepadAimAssistZoneProperty.addListener(listener); } @@ -338,6 +353,7 @@ public class MenuSetting { obj.addProperty("mouseSize", src.getMouseSize()); obj.addProperty("itemBarScale", src.getItemBarScale()); obj.addProperty("windowScale", src.getWindowScale()); + obj.addProperty("cursorOffset", src.getCursorOffset()); obj.addProperty("gamepadDeadzone", src.getGamepadDeadzone()); obj.addProperty("gamepadAimAssistZone", src.getGamepadAimAssistZone()); return obj; @@ -368,6 +384,7 @@ public class MenuSetting { ms.setMouseSize(Optional.ofNullable(obj.get("mouseSize")).map(JsonElement::getAsInt).orElse(15)); ms.setItemBarScale(Optional.ofNullable(obj.get("itemBarScale")).map(JsonElement::getAsInt).orElse(0)); ms.setWindowScale(Optional.ofNullable(obj.get("windowScale")).map(JsonElement::getAsDouble).orElse(1d)); + ms.setCursorOffset(Optional.ofNullable(obj.get("cursorOffset")).map(JsonElement::getAsInt).orElse(0)); ms.setGamepadDeadzone(Optional.ofNullable(obj.get("gamepadDeadzone")).map(JsonElement::getAsDouble).orElse(0.2d)); ms.setGamepadAimAssistZone(Optional.ofNullable(obj.get("gamepadAimAssistZone")).map(JsonElement::getAsDouble).orElse(0.98d)); return ms; diff --git a/FCL/src/main/res/layout/menu_right.xml b/FCL/src/main/res/layout/menu_right.xml index ab73a6bf..6a3f39b9 100644 --- a/FCL/src/main/res/layout/menu_right.xml +++ b/FCL/src/main/res/layout/menu_right.xml @@ -252,6 +252,43 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/window_scale"/> + + + + + + + + + + - + + \ No newline at end of file diff --git a/FCL/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/FCL/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index c4a603d4..00000000 --- a/FCL/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/FCL/src/main/res/values-v31/colors.xml b/FCL/src/main/res/values-v31/colors.xml new file mode 100644 index 00000000..6f3023a0 --- /dev/null +++ b/FCL/src/main/res/values-v31/colors.xml @@ -0,0 +1,4 @@ + + + @android:color/system_accent1_0 + \ No newline at end of file diff --git a/FCL/src/main/res/values-zh/strings.xml b/FCL/src/main/res/values-zh/strings.xml index a7bb83e3..caf89bb8 100644 --- a/FCL/src/main/res/values-zh/strings.xml +++ b/FCL/src/main/res/values-zh/strings.xml @@ -726,6 +726,7 @@ Freedreno (OpenGL 4.6, 仅支持GPU a616-a660) 游戏设置 窗口分辨率 + 鼠标指针偏移 Java 版本 自动选择 版本隔离 diff --git a/FCL/src/main/res/values/colors.xml b/FCL/src/main/res/values/colors.xml index 39515ad4..297b5489 100644 --- a/FCL/src/main/res/values/colors.xml +++ b/FCL/src/main/res/values/colors.xml @@ -4,4 +4,5 @@ #FF000000 #FFFFFFFF #4DBCBCBC + #FFFFFF \ No newline at end of file diff --git a/FCL/src/main/res/values/strings.xml b/FCL/src/main/res/values/strings.xml index 4cd7f4fa..26ab84ce 100644 --- a/FCL/src/main/res/values/strings.xml +++ b/FCL/src/main/res/values/strings.xml @@ -763,6 +763,7 @@ Game Settings Resolution + Cursor Offset Java Version Auto JRE 8 diff --git a/FCLauncher/src/main/jniLibs/arm64-v8a/libgl4es_114.so b/FCLauncher/src/main/jniLibs/arm64-v8a/libgl4es_114.so index e9b6f0d0..53e79528 100644 Binary files a/FCLauncher/src/main/jniLibs/arm64-v8a/libgl4es_114.so and b/FCLauncher/src/main/jniLibs/arm64-v8a/libgl4es_114.so differ diff --git a/FCLauncher/src/main/jniLibs/armeabi-v7a/libgl4es_114.so b/FCLauncher/src/main/jniLibs/armeabi-v7a/libgl4es_114.so index 31d257dd..fc706fa5 100644 Binary files a/FCLauncher/src/main/jniLibs/armeabi-v7a/libgl4es_114.so and b/FCLauncher/src/main/jniLibs/armeabi-v7a/libgl4es_114.so differ diff --git a/FCLauncher/src/main/jniLibs/x86/libgl4es_114.so b/FCLauncher/src/main/jniLibs/x86/libgl4es_114.so index ed6903c8..12f910e5 100644 Binary files a/FCLauncher/src/main/jniLibs/x86/libgl4es_114.so and b/FCLauncher/src/main/jniLibs/x86/libgl4es_114.so differ diff --git a/FCLauncher/src/main/jniLibs/x86_64/libgl4es_114.so b/FCLauncher/src/main/jniLibs/x86_64/libgl4es_114.so index 56f2bb00..b21f9355 100644 Binary files a/FCLauncher/src/main/jniLibs/x86_64/libgl4es_114.so and b/FCLauncher/src/main/jniLibs/x86_64/libgl4es_114.so differ