mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 23:25:10 +01:00
API hooks for movement and screen pages
This commit is contained in:
@@ -288,7 +288,7 @@ public class MidnightInput {
|
||||
float rightX = polarUtil.polarX;
|
||||
float rightY = polarUtil.polarY;
|
||||
|
||||
boolean isRadialMenu = client.currentScreen instanceof RingScreen || (MidnightControlsCompat.isEmotecraftPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen));
|
||||
boolean isRadialMenu = client.currentScreen instanceof RingScreen || (EmotecraftCompat.isPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen));
|
||||
|
||||
if (!isRadialMenu) {
|
||||
for (int i = 0; i < GLFW_GAMEPAD_AXIS_LEFT_TRIGGER; i++) {
|
||||
@@ -505,8 +505,10 @@ public class MidnightInput {
|
||||
}
|
||||
|
||||
axisValue = (float) Math.min(axisValue / MidnightControlsConfig.getAxisMaxValue(storage.axis), 1);
|
||||
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(storage.axis, true), storage.polarity == AxisStorage.Polarity.PLUS ? axisValue : 0.f);
|
||||
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(storage.axis, false), storage.polarity == AxisStorage.Polarity.MINUS ? axisValue : 0.f);
|
||||
if (!MidnightControlsCompat.handleMovement(storage, axisValue)) {
|
||||
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(storage.axis, true), storage.polarity == AxisStorage.Polarity.PLUS ? axisValue : 0.f);
|
||||
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(storage.axis, false), storage.polarity == AxisStorage.Polarity.MINUS ? axisValue : 0.f);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleScreenScrolling(Screen screen, AxisStorage storage) {
|
||||
@@ -585,7 +587,7 @@ public class MidnightInput {
|
||||
else if (y > border) index = 6;
|
||||
}
|
||||
if (client.currentScreen instanceof RingScreen && index > -1) RingPage.selected = index;
|
||||
if (MidnightControlsCompat.isEmotecraftPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen)) EmotecraftCompat.handleEmoteSelector(index);
|
||||
if (EmotecraftCompat.isPresent() && EmotecraftCompat.isEmotecraftScreen(client.currentScreen)) EmotecraftCompat.handleEmoteSelector(index);
|
||||
}
|
||||
|
||||
public boolean handleListWidgetScrolling(List<? extends Element> children, float value) {
|
||||
|
||||
Reference in New Issue
Block a user