From: fredboy Date: Thu, 9 May 2024 08:35:59 +0000 (+0700) Subject: Higher touch resolution X-Git-Tag: alpha0.8.0~2 X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=5d4bd2b1f9425a1f8160089c13832627975843f5;p=cavedroid.git Higher touch resolution --- diff --git a/android/assets/json/texture_regions.json b/android/assets/json/texture_regions.json index d071423..11459c3 100644 --- a/android/assets/json/texture_regions.json +++ b/android/assets/json/texture_regions.json @@ -41,6 +41,11 @@ "y": 26, "w": 26, "h": 26 + }, + "pause": { + "x": 104, + "w": 26, + "h": 26 } }, "allitems": { diff --git a/android/assets/json/touch_buttons.json b/android/assets/json/touch_buttons.json index 8111096..cbb9a15 100644 --- a/android/assets/json/touch_buttons.json +++ b/android/assets/json/touch_buttons.json @@ -1,16 +1,23 @@ { "alt": { - "x": -32, - "y": -32, - "w": 32, - "h": 32, + "x": -48, + "y": -48, + "w": 48, + "h": 48, "key": "L-Alt" }, "inv": { - "x": -64, - "y": -32, - "w": 32, - "h": 32, + "x": -96, + "y": -48, + "w": 48, + "h": 48, "key": "E" + }, + "pause": { + "x": -48, + "y": 0, + "w": 48, + "h": 48, + "key": "Escape" } } \ No newline at end of file diff --git a/android/assets/touch_gui.png b/android/assets/touch_gui.png index 83521da..62e4af5 100644 Binary files a/android/assets/touch_gui.png and b/android/assets/touch_gui.png differ diff --git a/core/src/ru/deadsoftware/cavedroid/CaveGame.java b/core/src/ru/deadsoftware/cavedroid/CaveGame.java index 0f9cf9e..1ba240c 100644 --- a/core/src/ru/deadsoftware/cavedroid/CaveGame.java +++ b/core/src/ru/deadsoftware/cavedroid/CaveGame.java @@ -42,7 +42,7 @@ public class CaveGame extends Game { } private void initConfig() { - int width = mTouch ? 320 : 480; + int width = 480; int height = (int) (width * ((float) Gdx.graphics.getHeight() / Gdx.graphics.getWidth())); mMainConfig.setMainComponent(mMainComponent); diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt b/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt index 4c04856..6cbc052 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/Joystick.kt @@ -65,9 +65,9 @@ class Joystick( } companion object { - const val RADIUS = 24f + const val RADIUS = 48f const val SIZE = RADIUS * 2 - const val STICK_SIZE = 16f + const val STICK_SIZE = 32f } } \ No newline at end of file diff --git a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt index b2d1244..6a8f019 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt +++ b/core/src/ru/deadsoftware/cavedroid/game/input/handler/keyboard/CloseGameWindowKeyboardInputHandler.kt @@ -19,7 +19,7 @@ class CloseGameWindowKeyboardInputHandler @Inject constructor( override fun checkConditions(action: KeyboardInputAction): Boolean { return action.actionKey is KeyboardInputActionKey.OpenInventory && - action.isKeyDown && gameWindowsManager.getCurrentWindow() != GameUiWindow.NONE + !action.isKeyDown && gameWindowsManager.getCurrentWindow() != GameUiWindow.NONE } override fun handle(action: KeyboardInputAction) {