mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
Fix hotbar not registering 0-9 inputs
This commit is contained in:
parent
e732f7d823
commit
c2e5ddaeda
2 changed files with 13 additions and 7 deletions
|
|
@ -577,7 +577,7 @@ public class MinecraftGLView extends TextureView {
|
|||
int barX = (CallbackBridge.physicalWidth / 2) - (barWidth / 2);
|
||||
if(x < barX || x >= barX + barWidth) return -1;
|
||||
|
||||
return hotbarKeys[((x - barX) / barWidth / 9) % 9];
|
||||
return hotbarKeys[(int) net.kdt.pojavlaunch.utils.MathUtils.map(x, barX, barX + barWidth, 0, 9)];
|
||||
}
|
||||
|
||||
/** Return the size, given the UI scale size */
|
||||
|
|
|
|||
|
|
@ -2,17 +2,21 @@ package net.kdt.pojavlaunch.utils;
|
|||
import static org.lwjgl.glfw.CallbackBridge.windowHeight;
|
||||
import static org.lwjgl.glfw.CallbackBridge.windowWidth;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.*;
|
||||
|
||||
import android.os.Build;
|
||||
import android.os.FileObserver;
|
||||
import android.util.*;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import net.kdt.pojavlaunch.*;
|
||||
import net.kdt.pojavlaunch.Tools;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class MCOptionUtils
|
||||
{
|
||||
|
|
@ -103,6 +107,8 @@ public class MCOptionUtils
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
fileObserver.startWatching();
|
||||
}
|
||||
|
||||
public static void notifyListeners(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue