mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 23:25:10 +01:00
Various fixes
- Fix #309 (Missing translations) - Fix controller input always being read - Improved injection of options button (Closes #305)
This commit is contained in:
@@ -88,8 +88,10 @@ public class MidnightControlsClient extends MidnightControls {
|
|||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
public void run() { // TODO: Add a try/catch here after the alpha testing period
|
public void run() { // TODO: Add a try/catch here after the alpha testing period
|
||||||
if (lateInitDone && client.isRunning()) {
|
if (lateInitDone && client.isRunning()) {
|
||||||
input.tickCameraStick();
|
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput)) {
|
||||||
input.updateCamera();
|
input.tickCameraStick();
|
||||||
|
input.updateCamera();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, delay, period);
|
}, delay, period);
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ public class MidnightControlsConfig extends MidnightConfig {
|
|||||||
@Entry(category = VISUAL, name = "Reacharound Outline Alpha", isSlider = true, min = 0, max = 255) public static int reacharoundOutlineColorAlpha = 102;
|
@Entry(category = VISUAL, name = "Reacharound Outline Alpha", isSlider = true, min = 0, max = 255) public static int reacharoundOutlineColorAlpha = 102;
|
||||||
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.right_dead_zone", isSlider = true, min = 0.05, max = 1) public static double rightDeadZone = 0.25;
|
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.right_dead_zone", isSlider = true, min = 0.05, max = 1) public static double rightDeadZone = 0.25;
|
||||||
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.left_dead_zone", isSlider = true, min = 0.05, max = 1) public static double leftDeadZone = 0.25;
|
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.left_dead_zone", isSlider = true, min = 0.05, max = 1) public static double leftDeadZone = 0.25;
|
||||||
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.trigger_dead_zone", isSlider = true, min = 0.05, max = 1) public static double triggerDeadZone = 0.1;
|
@Entry(category = CONTROLLER, name = "Trigger Dead-Zone", isSlider = true, min = 0.05, max = 1) public static double triggerDeadZone = 0.1;
|
||||||
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.invert_right_y_axis") public static boolean invertRightYAxis = false;
|
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.invert_right_y_axis") public static boolean invertRightYAxis = false;
|
||||||
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.invert_right_x_axis") public static boolean invertRightXAxis = false;
|
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.invert_right_x_axis") public static boolean invertRightXAxis = false;
|
||||||
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.rotation_speed", isSlider = true, min = 0, max = 100, precision = 10) public static double rotationSpeed = 35.0; //used for x-axis, name kept for compatibility
|
@Entry(category = CONTROLLER, name = "midnightcontrols.menu.rotation_speed", isSlider = true, min = 0, max = 100, precision = 10) public static double rotationSpeed = 35.0; //used for x-axis, name kept for compatibility
|
||||||
|
|||||||
@@ -40,22 +40,22 @@ public abstract class GameOptionsScreenMixin extends Screen {
|
|||||||
super(title);
|
super(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "initTabNavigation", at = @At("TAIL"))
|
@Inject(method = "init", at = @At("TAIL"))
|
||||||
public void addMidnightButton(CallbackInfo ci) {
|
public void midnightcontrols$addMCButton(CallbackInfo ci) {
|
||||||
if (this.getClass().toString().equals(ControlsOptionsScreen.class.toString())) {
|
if (this.getClass().toString().equals(ControlsOptionsScreen.class.toString())) {
|
||||||
this.midnightcontrols$setupButton();
|
this.midnightcontrols$setButtonPos();
|
||||||
this.addDrawableChild(midnightcontrols$button);
|
this.addDrawableChild(midnightcontrols$button);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Inject(method = "initTabNavigation", at = @At("TAIL"))
|
||||||
public void resize(MinecraftClient client, int width, int height) {
|
public void midnightcontrols$onResize(CallbackInfo ci) {
|
||||||
super.resize(client, width, height);
|
this.midnightcontrols$setButtonPos();
|
||||||
this.midnightcontrols$setupButton();
|
|
||||||
}
|
}
|
||||||
@Unique
|
@Unique
|
||||||
public void midnightcontrols$setupButton() {
|
public void midnightcontrols$setButtonPos() {
|
||||||
assert body != null;
|
if (body != null) {
|
||||||
midnightcontrols$button.setPosition(body.getWidth() / 2 + 158, body.getY() + 4);
|
midnightcontrols$button.setPosition(body.getWidth() / 2 + 158, body.getY() + 4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,8 +130,8 @@
|
|||||||
"midnightcontrols.controls_mode.default": "Keyboard/Mouse",
|
"midnightcontrols.controls_mode.default": "Keyboard/Mouse",
|
||||||
"midnightcontrols.controls_mode.controller": "Controller",
|
"midnightcontrols.controls_mode.controller": "Controller",
|
||||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen (Beta)",
|
"midnightcontrols.controls_mode.touchscreen": "Touchscreen (Beta)",
|
||||||
"midnightcontrols.hud_side.left": "Left",
|
"midnightcontrols.hud_side.LEFT": "Left",
|
||||||
"midnightcontrols.hud_side.right": "Right",
|
"midnightcontrols.hud_side.RIGHT": "Right",
|
||||||
"midnightcontrols.menu.analog_movement": "Analog Movement",
|
"midnightcontrols.menu.analog_movement": "Analog Movement",
|
||||||
"midnightcontrols.menu.analog_movement.tooltip": "When possible, enables analog movement.",
|
"midnightcontrols.menu.analog_movement.tooltip": "When possible, enables analog movement.",
|
||||||
"midnightcontrols.menu.auto_switch_mode": "Auto Switch Mode",
|
"midnightcontrols.menu.auto_switch_mode": "Auto Switch Mode",
|
||||||
|
|||||||
Reference in New Issue
Block a user