mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 17:15:40 -04:00
fix the hotbar selector
This commit is contained in:
parent
081a618a0f
commit
f5f8fd8edd
@ -9,6 +9,8 @@ import android.view.*;
|
|||||||
import android.view.View.*;
|
import android.view.View.*;
|
||||||
import android.view.inputmethod.*;
|
import android.view.inputmethod.*;
|
||||||
import android.widget.*;
|
import android.widget.*;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.drawerlayout.widget.*;
|
import androidx.drawerlayout.widget.*;
|
||||||
import com.google.android.material.navigation.*;
|
import com.google.android.material.navigation.*;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@ -367,17 +369,16 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
x += (int)(e.getX() - e.getHistoricalX(0));
|
x += (int)(e.getX() - e.getHistoricalX(0));
|
||||||
y += (int)(e.getY() - e.getHistoricalY(0));
|
y += (int)(e.getY() - e.getHistoricalY(0));
|
||||||
}
|
}
|
||||||
if(x == 0 || !CallbackBridge.isGrabbing()) {
|
if(!CallbackBridge.isGrabbing()) {
|
||||||
x = (int) e.getX();
|
x = (int) e.getX();
|
||||||
y = (int) e.getY();
|
y = (int) e.getY();
|
||||||
}
|
}
|
||||||
int hudKeyHandled = handleGuiBar(x, y);
|
int hudKeyHandled = handleGuiBar((int)e.getX(), (int)e.getY());
|
||||||
if (!CallbackBridge.isGrabbing() && gestureDetector.onTouchEvent(e)) {
|
if (!CallbackBridge.isGrabbing() && gestureDetector.onTouchEvent(e)) {
|
||||||
if (hudKeyHandled != -1) {
|
if (hudKeyHandled != -1) {
|
||||||
sendKeyPress(hudKeyHandled);
|
sendKeyPress(hudKeyHandled);
|
||||||
} else {
|
} else {
|
||||||
CallbackBridge.sendMouseKeycode(rightOverride ? (byte) 1 : (byte) 0);
|
CallbackBridge.putMouseEventWithCoords(rightOverride ? (byte) 1 : (byte) 0,x,y);
|
||||||
CallbackBridge.sendCursorPos(x, y);
|
|
||||||
if (!rightOverride) {
|
if (!rightOverride) {
|
||||||
CallbackBridge.mouseLeft = true;
|
CallbackBridge.mouseLeft = true;
|
||||||
}
|
}
|
||||||
@ -391,8 +392,8 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
isTouchInHotbar = hudKeyHandled != -1;
|
isTouchInHotbar = hudKeyHandled != -1;
|
||||||
if (isTouchInHotbar) {
|
if (isTouchInHotbar) {
|
||||||
sendKeyPress(hudKeyHandled, 0, true);
|
sendKeyPress(hudKeyHandled, 0, true);
|
||||||
hotbarX = x;
|
hotbarX = (int)e.getX();
|
||||||
hotbarY = y;
|
hotbarY = (int)e.getY();
|
||||||
|
|
||||||
theHandler.sendEmptyMessageDelayed(BaseMainActivity.MSG_DROP_ITEM_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
theHandler.sendEmptyMessageDelayed(BaseMainActivity.MSG_DROP_ITEM_BUTTON_CHECK, LauncherPreferences.PREF_LONGPRESS_TRIGGER);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user