MidnightControls 0.1.0 (Beta)

Changes from LambdaControls:
- Support for Steam Deck and Dualsense
- Support for L4, L5, R4, R5 buttons
- Updated Libraries
- New Logo and Name
- Lots of Bugfixes
- MidnightConfig backend
This commit is contained in:
Motschen
2022-03-12 22:33:19 +01:00
parent bfaa4f5d9a
commit 5fcf4c2b1b
113 changed files with 2934 additions and 3307 deletions

View File

@@ -1,836 +0,0 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
import com.electronwill.nightconfig.core.file.FileConfig;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.LambdaControlsFeature;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.controller.Controller;
import dev.lambdaurora.lambdacontrols.client.controller.InputManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import java.util.Arrays;
import java.util.Optional;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_X;
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y;
/**
* Represents LambdaControls configuration.
*/
public class LambdaControlsConfig {
// General
private static final ControlsMode DEFAULT_CONTROLS_MODE = ControlsMode.DEFAULT;
private static final boolean DEFAULT_AUTO_SWITCH_MODE = false;
private static final boolean DEFAULT_DEBUG = false;
// HUD
private static final boolean DEFAULT_HUD_ENABLE = true;
private static final HudSide DEFAULT_HUD_SIDE = HudSide.LEFT;
// Gameplay
private static final boolean DEFAULT_ANALOG_MOVEMENT = true;
private static final boolean DEFAULT_FAST_BLOCK_INTERACTION = true;
private static final boolean DEFAULT_FLY_DRIFTING = false;
private static final boolean DEFAULT_FLY_VERTICAL_DRIFTING = true;
private static final boolean DEFAULT_HORIZONTAL_REACHAROUND = false;
private static final boolean DEFAULT_VERTICAL_REACHAROUND = false;
private static final boolean DEFAULT_REACHAROUND_OUTLINE = true;
private static final int[] DEFAULT_REACHAROUND_OUTLINE_COLOR = new int[]{255, 255, 255, 102};
// Controller
private static final ControllerType DEFAULT_CONTROLLER_TYPE = ControllerType.DEFAULT;
private static final double DEFAULT_DEAD_ZONE = 0.25;
private static final double DEFAULT_MAX_VALUE = 1;
private static final double DEFAULT_ROTATION_SPEED = 40.0;
private static final double DEFAULT_MOUSE_SPEED = 25.0;
private static final boolean DEFAULT_UNFOCUSED_INPUT = false;
private static final boolean DEFAULT_VIRTUAL_MOUSE = false;
private static final VirtualMouseSkin DEFAULT_VIRTUAL_MOUSE_SKIN = VirtualMouseSkin.DEFAULT_LIGHT;
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
protected final FileConfig config = FileConfig.builder("config/lambdacontrols.toml").concurrent().defaultResource("/config.toml").build();
private final LambdaControlsClient mod;
private ControlsMode controlsMode;
private ControllerType controllerType;
// Gameplay.
private boolean analogMovement;
private boolean shouldRenderReacharoundOutline;
private int[] reacharoundOutlineColor;
// Controller settings
private double rightDeadZone;
private double leftDeadZone;
private double[] maxAnalogValues = new double[]{DEFAULT_MAX_VALUE, DEFAULT_MAX_VALUE, DEFAULT_MAX_VALUE, DEFAULT_MAX_VALUE};
private double rotationSpeed;
private double mouseSpeed;
private boolean unfocusedInput;
private boolean virtualMouse;
private VirtualMouseSkin virtualMouseSkin;
// HUD settings.
private boolean hudEnable;
private HudSide hudSide;
public LambdaControlsConfig(@NotNull LambdaControlsClient mod) {
this.mod = mod;
}
/**
* Loads the configuration
*/
public void load() {
this.config.load();
this.checkAndFix();
this.mod.log("Configuration loaded.");
this.controlsMode = ControlsMode.byId(this.config.getOrElse("controls", DEFAULT_CONTROLS_MODE.getName())).orElse(DEFAULT_CONTROLS_MODE);
// HUD settings.
this.hudEnable = this.config.getOrElse("hud.enable", DEFAULT_HUD_ENABLE);
this.hudSide = HudSide.byId(this.config.getOrElse("hud.side", DEFAULT_HUD_SIDE.getName())).orElse(DEFAULT_HUD_SIDE);
// Gameplay
this.analogMovement = this.config.getOrElse("gameplay.analog_movement", DEFAULT_ANALOG_MOVEMENT);
LambdaControlsFeature.FAST_BLOCK_PLACING.setEnabled(this.config.getOrElse("gameplay.fast_block_placing", DEFAULT_FAST_BLOCK_INTERACTION));
LambdaControlsFeature.HORIZONTAL_REACHAROUND.setEnabled(this.config.getOrElse("gameplay.reacharound.horizontal", DEFAULT_HORIZONTAL_REACHAROUND));
LambdaControlsFeature.VERTICAL_REACHAROUND.setEnabled(this.config.getOrElse("gameplay.reacharound.vertical", DEFAULT_VERTICAL_REACHAROUND));
this.shouldRenderReacharoundOutline = this.config.getOrElse("gameplay.reacharound.outline", DEFAULT_REACHAROUND_OUTLINE);
this.reacharoundOutlineColor = this.config.getOptional("gameplay.reacharound.outline_color")
.map(hex -> parseColor((String) hex))
.orElse(DEFAULT_REACHAROUND_OUTLINE_COLOR);
// Controller settings.
this.controllerType = ControllerType.byId(this.config.getOrElse("controller.type", DEFAULT_CONTROLLER_TYPE.getName())).orElse(DEFAULT_CONTROLLER_TYPE);
this.rightDeadZone = this.config.getOrElse("controller.right_dead_zone", DEFAULT_DEAD_ZONE);
this.leftDeadZone = this.config.getOrElse("controller.left_dead_zone", DEFAULT_DEAD_ZONE);
this.rotationSpeed = this.config.getOrElse("controller.rotation_speed", DEFAULT_ROTATION_SPEED);
this.mouseSpeed = this.config.getOrElse("controller.mouse_speed", DEFAULT_MOUSE_SPEED);
this.unfocusedInput = this.config.getOrElse("controller.unfocused_input", DEFAULT_UNFOCUSED_INPUT);
this.virtualMouse = this.config.getOrElse("controller.virtual_mouse", DEFAULT_VIRTUAL_MOUSE);
this.virtualMouseSkin = VirtualMouseSkin.byId(this.config.getOrElse("controller.virtual_mouse_skin", DEFAULT_VIRTUAL_MOUSE_SKIN.getName())).orElse(DEFAULT_VIRTUAL_MOUSE_SKIN);
for (int i = 0; i < this.maxAnalogValues.length; i++) {
this.maxAnalogValues[i] = this.config.getOrElse("controller.max_value_" + i, DEFAULT_MAX_VALUE);
}
// Controller controls.
InputManager.loadButtonBindings(this);
this.mod.ring.load(this.config);
}
/**
* Saves the configuration.
*/
public void save() {
this.config.set("controller.right_dead_zone", this.rightDeadZone);
this.config.set("controller.left_dead_zone", this.leftDeadZone);
this.config.set("controller.rotation_speed", this.rotationSpeed);
this.config.set("controller.mouse_speed", this.mouseSpeed);
this.config.set("controller.unfocused_input", this.unfocusedInput);
this.config.set("controller.virtual_mouse", this.virtualMouse);
for (int i = 0; i < this.maxAnalogValues.length; i++) {
this.config.set("controller.max_value_" + i, this.maxAnalogValues[i]);
}
this.config.save();
this.mod.log("Configuration saved.");
}
public void checkAndFix() {
InputManager.streamBindings().forEach(binding -> {
var path = "controller.controls." + binding.getName();
var raw = this.config.getRaw(path);
if (raw instanceof Number) {
this.mod.warn("Invalid data at \"" + path + "\", fixing...");
this.config.set(path, String.valueOf(raw));
}
});
if (this.config.contains("gameplay.front_block_placing.enabled")) {
this.setFrontBlockPlacing(this.config.getOrElse("gameplay.front_block_placing.enabled", DEFAULT_HORIZONTAL_REACHAROUND));
this.config.remove("gameplay.front_block_placing.enabled");
}
if (this.config.contains("gameplay.front_block_placing.outline")) {
this.setRenderReacharoundOutline(this.config.getOrElse("gameplay.front_block_placing.outline", DEFAULT_REACHAROUND_OUTLINE));
this.config.remove("gameplay.front_block_placing.outline");
}
if (this.config.contains("gameplay.front_block_placing.outline_color")) {
this.config.getOptional("gameplay.front_block_placing.outline_color").ifPresent(color -> this.config.set("gameplay.reacharound.outline_color", color));
this.config.remove("gameplay.front_block_placing.outline_color");
}
this.renamed("controller.dead_zone", "controller.right_dead_zone");
this.renamed("controller.controls.tab_left", "controller.controls.tab_back");
this.renamed("controller.controls.tab_right", "controller.controls.tab_next");
}
private void renamed(String oldPath, String newPath) {
if (!this.config.contains(oldPath))
return;
var raw = this.config.getRaw(oldPath);
this.config.remove(oldPath);
this.config.set(newPath, raw);
}
/**
* Resets the configuration to default values.
*/
public void reset() {
// General
this.setControlsMode(DEFAULT_CONTROLS_MODE);
this.setAutoSwitchMode(DEFAULT_AUTO_SWITCH_MODE);
this.setDebug(DEFAULT_DEBUG);
// Gameplay
this.setAnalogMovement(DEFAULT_ANALOG_MOVEMENT);
this.setFastBlockPlacing(DEFAULT_FAST_BLOCK_INTERACTION);
this.setFlyDrifting(DEFAULT_FLY_DRIFTING);
this.setFlyVerticalDrifting(DEFAULT_FLY_VERTICAL_DRIFTING);
this.setFrontBlockPlacing(DEFAULT_HORIZONTAL_REACHAROUND);
this.setVerticalReacharound(DEFAULT_VERTICAL_REACHAROUND);
this.setRenderReacharoundOutline(DEFAULT_REACHAROUND_OUTLINE);
// Controller
this.setControllerType(DEFAULT_CONTROLLER_TYPE);
this.setRightDeadZone(DEFAULT_DEAD_ZONE);
this.setLeftDeadZone(DEFAULT_DEAD_ZONE);
this.setRotationSpeed(DEFAULT_ROTATION_SPEED);
this.setMouseSpeed(DEFAULT_MOUSE_SPEED);
this.setUnfocusedInput(DEFAULT_UNFOCUSED_INPUT);
this.setVirtualMouse(DEFAULT_VIRTUAL_MOUSE);
this.setVirtualMouseSkin(DEFAULT_VIRTUAL_MOUSE_SKIN);
Arrays.fill(this.maxAnalogValues, DEFAULT_MAX_VALUE);
// HUD
this.setHudEnabled(DEFAULT_HUD_ENABLE);
this.setHudSide(DEFAULT_HUD_SIDE);
// Collect prevents concurrent modification.
InputManager.streamBindings().collect(Collectors.toList()).forEach(binding -> this.setButtonBinding(binding, binding.getDefaultButton()));
}
/**
* Gets the controls mode from the configuration.
*
* @return the controls mode
*/
public @NotNull ControlsMode getControlsMode() {
return this.controlsMode;
}
/**
* Sets the controls mode in the configuration.
*
* @param controlsMode the controls mode
*/
public void setControlsMode(@NotNull ControlsMode controlsMode) {
this.controlsMode = controlsMode;
this.config.set("controls", controlsMode.getName());
}
/**
* Returns whether the auto switch mode is enabled or not.
*
* @return true if the auto switch mode is enabled, else false
*/
public boolean hasAutoSwitchMode() {
return this.config.getOrElse("auto_switch_mode", DEFAULT_AUTO_SWITCH_MODE);
}
/**
* Sets whether the auto switch mode is enabled or not.
*
* @param autoSwitchMode true if the auto switch mode is enabled, else false
*/
public void setAutoSwitchMode(boolean autoSwitchMode) {
this.config.set("auto_switch_mode", autoSwitchMode);
}
/**
* Returns whether the mod has debug enabled or not.
*
* @return true if debug is enabled, else false
*/
public boolean hasDebug() {
return this.config.getOrElse("debug", DEFAULT_DEBUG);
}
/**
* Sets whether the mod has debug enabled or not.
*
* @param debug true if debug is enabled, else false
*/
protected void setDebug(boolean debug) {
this.config.set("debug", debug);
}
/*
HUD settings
*/
/**
* Returns whether the HUD is enabled.
*
* @return true if the HUD is enabled, else false
*/
public boolean isHudEnabled() {
return this.hudEnable;
}
/**
* Sets whether the HUD is enabled.
*
* @param enable true if the HUD is enabled, else false
*/
public void setHudEnabled(boolean enable) {
this.hudEnable = enable;
this.config.set("hud.enable", this.hudEnable);
}
/**
* Gets the HUD side from the configuration.
*
* @return the HUD side
*/
public @NotNull HudSide getHudSide() {
return this.hudSide;
}
/**
* Sets the HUD side in the configuration.
*
* @param hudSide the HUD side
*/
public void setHudSide(@NotNull HudSide hudSide) {
this.hudSide = hudSide;
this.config.set("hud.side", hudSide.getName());
}
/*
Gameplay settings
*/
/**
* Gets whether analog movement is enabled.
*
* @return {@code true} if analog movement is enabled, else {@code false}
*/
public boolean hasAnalogMovement() {
return this.analogMovement;
}
/**
* Sets whether analog movement is enabled.
*
* @param analogMovement {@code true} if analog movement is enabled, else {@code false}
*/
public void setAnalogMovement(boolean analogMovement) {
this.config.set("gameplay.analog_movement", this.analogMovement = analogMovement);
}
/**
* Gets whether fast block placing is enabled or not.
*
* @return true if fast block placing is enabled, else false
*/
public boolean hasFastBlockPlacing() {
return LambdaControlsFeature.FAST_BLOCK_PLACING.isEnabled();
}
/**
* Sets whether fast block placing is enabled or not.
*
* @param enable true if fast block placing is enabled, else false
*/
public void setFastBlockPlacing(boolean enable) {
LambdaControlsFeature.FAST_BLOCK_PLACING.setEnabled(enable);
this.config.set("gameplay.fast_block_placing", enable);
}
/**
* Returns whether fly drifting is enabled or not.
*
* @return true if fly drifting is enabled, else false
*/
public boolean hasFlyDrifting() {
return this.config.getOrElse("gameplay.fly.drifting", DEFAULT_FLY_DRIFTING);
}
/**
* Sets whether fly drifting is enabled or not.
*
* @param flyDrifting true if fly drifting is enabled, else false
*/
public void setFlyDrifting(boolean flyDrifting) {
this.config.set("gameplay.fly.drifting", flyDrifting);
}
/**
* Returns whether vertical fly drifting is enabled or not.
*
* @return true if vertical fly drifting is enabled, else false
*/
public boolean hasFlyVerticalDrifting() {
return this.config.getOrElse("gameplay.fly.vertical_drifting", DEFAULT_FLY_VERTICAL_DRIFTING);
}
/**
* Sets whether vertical fly drifting is enabled or not.
*
* @param flyDrifting true if vertical fly drifting is enabled, else false
*/
public void setFlyVerticalDrifting(boolean flyDrifting) {
this.config.set("gameplay.fly.vertical_drifting", flyDrifting);
}
/**
* Returns whether front block placing is enabled or not.
*
* @return true if front block placing is enabled, else false
*/
public boolean hasFrontBlockPlacing() {
return LambdaControlsFeature.HORIZONTAL_REACHAROUND.isEnabled();
}
/**
* Sets whether front block placing is enabled or not.
*
* @param enable true if front block placing is enabled, else false
*/
public void setFrontBlockPlacing(boolean enable) {
LambdaControlsFeature.HORIZONTAL_REACHAROUND.setEnabled(enable);
this.config.set("gameplay.reacharound.horizontal", enable);
}
/**
* Returns whether vertical reacharound is enabled or not.
*
* @return true if vertical reacharound is enabled, else false
*/
public boolean hasVerticalReacharound() {
return LambdaControlsFeature.VERTICAL_REACHAROUND.isEnabled();
}
/**
* Sets whether vertical reacharound is enabled or not.
*
* @param enable true if vertical reacharound is enabled, else false
*/
public void setVerticalReacharound(boolean enable) {
LambdaControlsFeature.VERTICAL_REACHAROUND.setEnabled(enable);
this.config.set("gameplay.reacharound.vertical", enable);
}
/**
* Returns whether front block placing outline is enabled or not.
*
* @return true if front block placing outline is enabled, else false
*/
public boolean shouldRenderReacharoundOutline() {
return this.shouldRenderReacharoundOutline;
}
/**
* Sets whether front block placing outline is enabled or not.
*
* @param render true if front block placing outline is enabled, else false
*/
public void setRenderReacharoundOutline(boolean render) {
this.config.set("gameplay.reacharound.outline", this.shouldRenderReacharoundOutline = render);
}
/**
* Returns the front block placing outline color as an integer array.
* <p>
* The integer array has 4 elements: red, green, blue and alpha.
*
* @return the color as a RGBA integer array
*/
public int[] getReacharoundOutlineColor() {
return this.reacharoundOutlineColor;
}
/*
Controller settings
*/
/**
* Gets the used controller.
*
* @return the controller
*/
public Controller getController() {
var raw = this.config.getRaw("controller.id");
if (raw instanceof Number) {
return Controller.byId((Integer) raw);
} else if (raw instanceof String) {
return Controller.byGuid((String) raw).orElse(Controller.byId(GLFW.GLFW_JOYSTICK_1));
}
return Controller.byId(GLFW.GLFW_JOYSTICK_1);
}
/**
* Sets the used controller.
*
* @param controller the controller
*/
public void setController(Controller controller) {
this.config.set("controller.id", controller.id());
}
/**
* Gets the second controller (for Joy-Con supports).
*
* @return the second controller
*/
public Optional<Controller> getSecondController() {
var raw = this.config.getRaw("controller.id2");
if (raw instanceof Number) {
if ((int) raw == -1)
return Optional.empty();
return Optional.of(Controller.byId((Integer) raw));
} else if (raw instanceof String) {
return Optional.of(Controller.byGuid((String) raw).orElse(Controller.byId(GLFW.GLFW_JOYSTICK_1)));
}
return Optional.empty();
}
/**
* Sets the second controller.
*
* @param controller the second controller
*/
public void setSecondController(@Nullable Controller controller) {
this.config.set("controller.id2", controller == null ? -1 : controller.id());
}
/**
* Gets the controller's type.
*
* @return the controller's type
*/
public @NotNull ControllerType getControllerType() {
return this.controllerType;
}
/**
* Sets the controller's type.
*
* @param controllerType the controller's type
*/
public void setControllerType(@NotNull ControllerType controllerType) {
this.controllerType = controllerType;
this.config.set("controller.type", controllerType.getName());
}
/**
* Gets the controller's right dead zone from the configuration.
*
* @return the controller's right dead zone value
*/
public double getRightDeadZone() {
return this.rightDeadZone;
}
/**
* Sets the controller's right dead zone in the configuration.
*
* @param deadZone the controller's right dead zone value
*/
public void setRightDeadZone(double deadZone) {
this.rightDeadZone = deadZone;
}
/**
* Gets the controller's left dead zone from the configuration.
*
* @return the controller's left dead zone value
*/
public double getLeftDeadZone() {
return this.leftDeadZone;
}
/**
* Sets the controller's left dead zone in the configuration.
*
* @param deadZone the controller's left dead zone value
*/
public void setLeftDeadZone(double deadZone) {
this.leftDeadZone = deadZone;
}
/**
* Gets the controller's rotation speed.
*
* @return the rotation speed
*/
public double getRotationSpeed() {
return this.rotationSpeed;
}
/**
* Sets the controller's rotation speed.
*
* @param rotationSpeed the rotation speed
*/
public void setRotationSpeed(double rotationSpeed) {
this.rotationSpeed = rotationSpeed;
}
/**
* Gets the controller's mouse speed.
*
* @return the mouse speed
*/
public double getMouseSpeed() {
return this.mouseSpeed;
}
/**
* Sets the controller's mouse speed.
*
* @param mouseSpeed the mouse speed
*/
public void setMouseSpeed(double mouseSpeed) {
this.mouseSpeed = mouseSpeed;
}
/**
* Returns whether the right X axis is inverted or not.
*
* @return true if the right X axis is inverted, else false
*/
public boolean doesInvertRightXAxis() {
return this.config.getOrElse("controller.invert_right_x_axis", false);
}
/**
* Sets whether the right X axis is inverted or not.
*
* @param invert true if the right X axis is inverted, else false
*/
public void setInvertRightXAxis(boolean invert) {
this.config.set("controller.invert_right_x_axis", invert);
}
/**
* Returns whether the right Y axis is inverted or not.
*
* @return true if the right Y axis is inverted, else false
*/
public boolean doesInvertRightYAxis() {
return this.config.getOrElse("controller.invert_right_y_axis", false);
}
/**
* Sets whether the right Y axis is inverted or not.
*
* @param invert true if the right Y axis is inverted, else false
*/
public void setInvertRightYAxis(boolean invert) {
this.config.set("controller.invert_right_y_axis", invert);
}
/**
* Returns whether unfocused controller input is allowed or not.
*
* @return true if unfocused controller input is allowed, else false
*/
public boolean hasUnfocusedInput() {
return this.unfocusedInput;
}
/**
* Sets whether unfocused controller input is allowed or not.
*
* @param unfocusedInput true if unfocused controller input is allowed, else false
*/
public void setUnfocusedInput(boolean unfocusedInput) {
this.unfocusedInput = unfocusedInput;
}
/**
* Returns whether the mouse is virtual or not.
*
* @return true if the mouse is virtual, else false
*/
public boolean hasVirtualMouse() {
return this.virtualMouse;
}
/**
* Sets whether the mouse is virtual or not.
*
* @param virtualMouse true if the mouse is virtual, else false
*/
public void setVirtualMouse(boolean virtualMouse) {
this.virtualMouse = virtualMouse;
}
/**
* Gets the virtual mouse skin.
*
* @return the virtual mouse skin
*/
public VirtualMouseSkin getVirtualMouseSkin() {
return this.virtualMouseSkin;
}
/**
* Sets the virtual mouse skin.
*
* @param skin the virtual mouse skin
*/
public void setVirtualMouseSkin(VirtualMouseSkin skin) {
this.virtualMouseSkin = skin;
this.config.set("controller.virtual_mouse_skin", skin.getName());
}
/**
* Gets the right X axis sign.
*
* @return the right X axis sign
*/
public double getRightXAxisSign() {
return this.doesInvertRightXAxis() ? -1.0 : 1.0;
}
/**
* Gets the right Y axis sign.
*
* @return the right Y axis sign
*/
public double getRightYAxisSign() {
return this.doesInvertRightYAxis() ? -1.0 : 1.0;
}
public double getAxisMaxValue(int axis) {
if (axis >= this.maxAnalogValues.length)
return DEFAULT_MAX_VALUE;
return this.maxAnalogValues[axis];
}
public void setAxisMaxValue(int axis, double value) {
if (axis < this.maxAnalogValues.length)
this.maxAnalogValues[axis] = value;
}
/**
* Loads the button binding from configuration.
*
* @param button the button binding
*/
public void loadButtonBinding(@NotNull ButtonBinding button) {
button.setButton(button.getDefaultButton());
var code = this.config.getOrElse("controller.controls." + button.getName(), button.getButtonCode());
var matcher = BUTTON_BINDING_PATTERN.matcher(code);
try {
var buttons = new int[1];
int count = 0;
while (matcher.find()) {
count++;
if (count > buttons.length)
buttons = Arrays.copyOf(buttons, count);
String current;
if (!this.checkValidity(button, code, current = matcher.group(1)))
return;
buttons[count - 1] = Integer.parseInt(current);
}
if (count == 0) {
this.mod.warn("Malformed config value \"" + code + "\" for binding \"" + button.getName() + "\".");
this.setButtonBinding(button, new int[]{-1});
}
button.setButton(buttons);
} catch (Exception e) {
this.mod.warn("Malformed config value \"" + code + "\" for binding \"" + button.getName() + "\".");
this.config.set("controller.controls." + button.getName(), button.getButtonCode());
}
}
private boolean checkValidity(@NotNull ButtonBinding binding, @NotNull String input, String group) {
if (group == null) {
this.mod.warn("Malformed config value \"" + input + "\" for binding \"" + binding.getName() + "\".");
this.config.set("controller.controls." + binding.getName(), binding.getButtonCode());
return false;
}
return true;
}
/**
* Sets the button binding in configuration.
*
* @param binding the button binding
* @param button the button
*/
public void setButtonBinding(@NotNull ButtonBinding binding, int[] button) {
binding.setButton(button);
this.config.set("controller.controls." + binding.getName(), binding.getButtonCode());
}
public boolean isBackButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_Y, false) == ButtonBinding.axisAsButton(btn, state == 1);
}
public boolean isForwardButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_Y, true) == ButtonBinding.axisAsButton(btn, state == 1);
}
public boolean isLeftButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_X, false) == ButtonBinding.axisAsButton(btn, state == 1);
}
public boolean isRightButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_X, true) == ButtonBinding.axisAsButton(btn, state == 1);
}
/**
* Returns whether the specified axis is an axis used for movements.
*
* @param axis the axis index
* @return true if the axis is used for movements, else false
*/
public boolean isMovementAxis(int axis) {
return axis == GLFW_GAMEPAD_AXIS_LEFT_Y || axis == GLFW_GAMEPAD_AXIS_LEFT_X;
}
/**
* Parses a color from a hexadecimal color string.
*
* @param hex the hexadecimal color
* @return the color instance, null if invalid
*/
private static int[] parseColor(String hex) {
hex = hex.replace("#", "");
return switch (hex.length()) {
case 6 -> new int[]{
Integer.valueOf(hex.substring(0, 2), 16),
Integer.valueOf(hex.substring(2, 4), 16),
Integer.valueOf(hex.substring(4, 6), 16),
255
};
case 8 -> new int[]{
Integer.valueOf(hex.substring(0, 2), 16),
Integer.valueOf(hex.substring(2, 4), 16),
Integer.valueOf(hex.substring(4, 6), 16),
Integer.valueOf(hex.substring(6, 8), 16)
};
default -> null;
};
}
}

View File

@@ -1,282 +0,0 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.LiteralText;
import org.jetbrains.annotations.NotNull;
/**
* Represents the touchscreen overlay
*/
public class TouchscreenOverlay extends Screen {
public TouchscreenOverlay(@NotNull LambdaControlsClient mod) {
super(new LiteralText("Touchscreen overlay"));
}
/*public static final Identifier WIDGETS_LOCATION = new Identifier("lambdacontrols", "textures/gui/widgets.png");
private LambdaControlsClient mod;
private SpruceTexturedButtonWidget jumpButton;
private SpruceTexturedButtonWidget flyButton;
private SpruceTexturedButtonWidget flyUpButton;
private SpruceTexturedButtonWidget flyDownButton;
private int flyButtonEnableTicks = 0;
private int forwardButtonTick = 0;
private SpruceTexturedButtonWidget forwardLeftButton;
private SpruceTexturedButtonWidget forwardRightButton;
private SpruceTexturedButtonWidget startSneakButton;
private SpruceTexturedButtonWidget endSneakButton;
public TouchscreenOverlay(@NotNull LambdaControlsClient mod)
{
super(new LiteralText("Touchscreen overlay"));
this.mod = mod;
this.passEvents = true;
}
@Override
public boolean isPauseScreen()
{
return false;
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers)
{
return false;
}
private void pauseGame(boolean bl)
{
if (this.client == null)
return;
boolean bl2 = this.client.isIntegratedServerRunning() && !this.client.getServer().isRemote();
if (bl2) {
this.client.openScreen(new GameMenuScreen(!bl));
this.client.getSoundManager().pauseAll();
} else {
this.client.openScreen(new GameMenuScreen(true));
}
}
/**
* Updates the forward button ticks cooldown.
*
* @param state The button state.
*
private void updateForwardButtonsState(boolean state)
{
if (state)
this.forwardButtonTick = -1;
else
this.forwardButtonTick = 20;
}
/**
* Updates the jump buttons.
*
private void updateJumpButtons()
{
if (this.client == null)
return;
if (this.client.player.abilities.allowFlying && this.client.player.abilities.flying) {
boolean oldStateFly = this.flyButton.visible;
this.jumpButton.visible = false;
this.flyButton.visible = true;
this.flyUpButton.visible = true;
this.flyDownButton.visible = true;
if (oldStateFly != this.flyButton.visible) {
this.flyButtonEnableTicks = 5;
this.handleJump(null, false);
} else if (this.flyButtonEnableTicks > 0)
this.flyButtonEnableTicks--;
} else {
this.jumpButton.visible = true;
this.flyButton.visible = false;
this.flyUpButton.visible = false;
this.flyDownButton.visible = false;
}
}
/**
* Handles the jump button.
*
* @param btn The pressed button.
* @param state The state of the jump button.
*
private void handleJump(ButtonWidget btn, boolean state)
{
((KeyBindingAccessor) this.client.options.keyJump).lambdacontrols_handlePressState(state);
}
@Override
public void tick()
{
if (this.forwardButtonTick > 0) {
this.forwardButtonTick--;
} else if (this.forwardButtonTick == 0) {
if (this.forwardLeftButton.visible)
this.forwardLeftButton.visible = false;
if (this.forwardRightButton.visible)
this.forwardRightButton.visible = false;
}
this.updateJumpButtons();
}
@Override
protected void init()
{
super.init();
int scaledWidth = this.client.getWindow().getScaledWidth();
int scaledHeight = this.client.getWindow().getScaledHeight();
this.addButton(new TexturedButtonWidget(scaledWidth / 2 - 20, 0, 20, 20, 0, 106, 20, ButtonWidget.WIDGETS_LOCATION, 256, 256,
btn -> this.client.openScreen(new ChatScreen("")), LiteralText.EMPTY));
this.addButton(new TexturedButtonWidget(scaledWidth / 2, 0, 20, 20, 0, 0, 20, WIDGETS_LOCATION, 256, 256,
btn -> this.pauseGame(false)));
// Inventory buttons.
int inventoryButtonX = scaledWidth / 2;
int inventoryButtonY = scaledHeight - 16 - 5;
if (this.client.options.mainArm == Arm.LEFT) {
inventoryButtonX = inventoryButtonX - 91 - 24;
} else {
inventoryButtonX = inventoryButtonX + 91 + 4;
}
this.addButton(new TexturedButtonWidget(inventoryButtonX, inventoryButtonY, 20, 20, 20, 0, 20, WIDGETS_LOCATION, 256, 256,
btn -> {
if (this.client.interactionManager.hasRidingInventory()) {
this.client.player.openRidingInventory();
} else {
this.client.getTutorialManager().onInventoryOpened();
this.client.openScreen(new InventoryScreen(this.client.player));
}
}));
int jumpButtonX, swapHandsX, sneakButtonX;
int sneakButtonY = scaledHeight - 10 - 40 - 5;
if (this.mod.config.getHudSide() == HudSide.LEFT) {
jumpButtonX = scaledWidth - 20 - 20;
swapHandsX = jumpButtonX - 5 - 40;
sneakButtonX = 10 + 20 + 5;
} else {
jumpButtonX = 20;
swapHandsX = jumpButtonX + 5 + 40;
sneakButtonX = scaledWidth - 10 - 40 - 5;
}
// Swap items hand.
this.addButton(new SpruceTexturedButtonWidget(swapHandsX, sneakButtonY, 20, 20, 0, 160, 20, WIDGETS_LOCATION,
(btn, state) -> {
if (state) {
if (!this.client.player.isSpectator()) {
this.client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN));
}
}
}));
// Drop
this.addButton(new SpruceTexturedButtonWidget(swapHandsX, sneakButtonY + 5 + 20, 20, 20, 20, 160, 20, WIDGETS_LOCATION,
(btn, state) -> ((KeyBindingAccessor) this.client.options.keyDrop).lambdacontrols_handlePressState(state)));
// Jump keys
this.addButton(this.jumpButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY, 20, 20, 0, 40, 20, WIDGETS_LOCATION,
this::handleJump));
this.addButton(this.flyButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY, 20, 20, 20, 40, 20, WIDGETS_LOCATION,
(btn, state) -> {
if (this.flyButtonEnableTicks == 0) this.client.player.abilities.flying = false;
}));
this.addButton(this.flyUpButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY - 5 - 20, 20, 20, 40, 40, 20, WIDGETS_LOCATION,
this::handleJump));
this.addButton(this.flyDownButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY + 20 + 5, 20, 20, 60, 40, 20, WIDGETS_LOCATION,
(btn, state) -> ((KeyBindingAccessor) this.client.options.keySneak).lambdacontrols_handlePressState(state)));
this.updateJumpButtons();
// Movements keys
this.addButton((this.startSneakButton = new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY, 20, 20, 0, 120, 20, WIDGETS_LOCATION,
(btn, state) -> {
if (state) {
((KeyBindingAccessor) this.client.options.keySneak).lambdacontrols_handlePressState(true);
this.startSneakButton.visible = false;
this.endSneakButton.visible = true;
}
})));
this.addButton((this.endSneakButton = new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY, 20, 20, 20, 120, 20, WIDGETS_LOCATION,
(btn, state) -> {
if (state) {
((KeyBindingAccessor) this.client.options.keySneak).lambdacontrols_handlePressState(false);
this.endSneakButton.visible = false;
this.startSneakButton.visible = true;
}
})));
this.endSneakButton.visible = false;
this.addButton(this.forwardLeftButton = new SpruceTexturedButtonWidget(sneakButtonX - 20 - 5, sneakButtonY - 5 - 20, 20, 20, 80, 80, 20, WIDGETS_LOCATION,
(btn, state) -> {
((KeyBindingAccessor) this.client.options.keyForward).lambdacontrols_handlePressState(state);
((KeyBindingAccessor) this.client.options.keyLeft).lambdacontrols_handlePressState(state);
this.updateForwardButtonsState(state);
}));
this.forwardLeftButton.visible = false;
this.addButton(new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY - 5 - 20, 20, 20, 0, 80, 20, WIDGETS_LOCATION,
(btn, state) -> {
((KeyBindingAccessor) this.client.options.keyForward).lambdacontrols_handlePressState(state);
this.updateForwardButtonsState(state);
this.forwardLeftButton.visible = true;
this.forwardRightButton.visible = true;
}));
this.addButton(this.forwardRightButton = new SpruceTexturedButtonWidget(sneakButtonX + 20 + 5, sneakButtonY - 5 - 20, 20, 20, 100, 80, 20, WIDGETS_LOCATION,
(btn, state) -> {
((KeyBindingAccessor) this.client.options.keyForward).lambdacontrols_handlePressState(state);
((KeyBindingAccessor) this.client.options.keyRight).lambdacontrols_handlePressState(state);
this.updateForwardButtonsState(state);
}));
this.forwardRightButton.visible = true;
this.addButton(new SpruceTexturedButtonWidget(sneakButtonX + 20 + 5, sneakButtonY, 20, 20, 20, 80, 20, WIDGETS_LOCATION,
(btn, state) -> ((KeyBindingAccessor) this.client.options.keyRight).lambdacontrols_handlePressState(state)));
this.addButton(new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY + 20 + 5, 20, 20, 40, 80, 20, WIDGETS_LOCATION,
(btn, state) -> ((KeyBindingAccessor) this.client.options.keyBack).lambdacontrols_handlePressState(state)));
this.addButton(new SpruceTexturedButtonWidget(sneakButtonX - 20 - 5, sneakButtonY, 20, 20, 60, 80, 20, WIDGETS_LOCATION,
(btn, state) -> ((KeyBindingAccessor) this.client.options.keyLeft).lambdacontrols_handlePressState(state)));
this.buttons.forEach(button -> {
if (button instanceof SpruceTexturedButtonWidget) {
((SpruceTexturedButtonWidget) button).setSilent(true);
}
});
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button)
{
if (mouseY >= (double) (this.height - 22) && this.client != null && this.client.player != null) {
int centerX = this.width / 2;
if (mouseX >= (double) (centerX - 90) && mouseX <= (double) (centerX + 90)) {
for (int slot = 0; slot < 9; ++slot) {
int slotX = centerX - 90 + slot * 20 + 2;
if (mouseX >= (double) slotX && mouseX <= (double) (slotX + 20)) {
this.client.player.inventory.selectedSlot = slot;
return true;
}
}
}
}
return super.mouseClicked(mouseX, mouseY, button);
}
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
{
if (button == GLFW.GLFW_MOUSE_BUTTON_1 && this.client != null) {
if (deltaY > 0.01)
this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_Y, (float) Math.abs(deltaY / 5.0), 2);
else if (deltaY < 0.01)
this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_Y, (float) Math.abs(deltaY / 5.0), 1);
if (deltaX > 0.01)
this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_X, (float) Math.abs(deltaX / 5.0), 2);
else if (deltaX < 0.01)
this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_X, (float) Math.abs(deltaX / 5.0), 1);
}
return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
}*/
}

View File

@@ -1,58 +0,0 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsSettingsScreen;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.ControlsOptionsScreen;
import net.minecraft.client.gui.screen.option.GameOptionsScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.CyclingButtonWidget;
import net.minecraft.client.option.GameOptions;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
/**
* Injects the new controls settings button.
*/
@Mixin(ControlsOptionsScreen.class)
public class ControlsOptionsScreenMixin extends GameOptionsScreen {
public ControlsOptionsScreenMixin(Screen parent, GameOptions gameOptions, Text text) {
super(parent, gameOptions, text);
}
@SuppressWarnings("unchecked")
@Redirect(
method = "init",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/screen/option/ControlsOptionsScreen;addDrawableChild(Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;",
ordinal = 1
)
)
private <T extends Element & Drawable & Selectable, R extends Element & Drawable & Selectable> R onInit(ControlsOptionsScreen screen, T element) {
/*if (this.parent instanceof ControllerControlsWidget)
return this.addButton(btn);
else*/
if (element instanceof CyclingButtonWidget btn) {
return (R) this.addDrawableChild(new ButtonWidget(btn.x, btn.y, btn.getWidth(), ((ClickableWidgetAccessor) btn).getHeight(),
new TranslatableText("menu.options"),
b -> this.client.openScreen(new LambdaControlsSettingsScreen(this, true))));
} else {
return (R) this.addDrawableChild(element);
}
}
}

View File

@@ -1,67 +0,0 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.compat.LambdaControlsCompat;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsRenderer;
import dev.lambdaurora.lambdacontrols.client.util.HandledScreenAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* Represents the mixin for the class ContainerScreen.
*/
@Mixin(HandledScreen.class)
public abstract class HandledScreenMixin implements HandledScreenAccessor {
@Accessor("x")
public abstract int getX();
@Accessor("y")
public abstract int getY();
@Invoker("getSlotAt")
public abstract Slot lambdacontrols$getSlotAt(double posX, double posY);
@Invoker("isClickOutsideBounds")
public abstract boolean lambdacontrols$isClickOutsideBounds(double mouseX, double mouseY, int x, int y, int button);
@Invoker("onMouseClick")
public abstract void lambdacontrols$onMouseClick(@Nullable Slot slot, int slotId, int clickData, SlotActionType actionType);
@Inject(method = "render", at = @At("RETURN"))
public void onRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (LambdaControlsClient.get().config.getControlsMode() == ControlsMode.CONTROLLER) {
var client = MinecraftClient.getInstance();
int x = 2, y = client.getWindow().getScaledHeight() - 2 - LambdaControlsRenderer.ICON_SIZE;
x = LambdaControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_A}, "lambdacontrols.action.pickup_all", true, client) + 2;
x = LambdaControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_B}, "lambdacontrols.action.exit", true, client) + 2;
if (LambdaControlsCompat.isReiPresent()) {
x = 2;
y -= 24;
}
x = LambdaControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_X}, "lambdacontrols.action.pickup", true, client) + 2;
LambdaControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_Y}, "lambdacontrols.action.quick_move", true, client);
}
}
}

View File

@@ -1,53 +0,0 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsSettingsScreen;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.OptionsScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
/**
* Injects the new controls settings button.
*/
@Mixin(OptionsScreen.class)
public class OptionsScreenMixin extends Screen {
protected OptionsScreenMixin(Text title) {
super(title);
}
@SuppressWarnings("unchecked")
@Redirect(
method = "init",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/screen/option/OptionsScreen;addDrawableChild(Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;",
ordinal = 7
)
)
private <T extends Element & Drawable & Selectable> T lambdacontrols$onInit(OptionsScreen screen, T element) {
if (LambdaControlsClient.get().config.getControlsMode() == ControlsMode.CONTROLLER && element instanceof ButtonWidget btn) {
return (T) this.addDrawableChild(new ButtonWidget(btn.x, btn.y, btn.getWidth(), ((ClickableWidgetAccessor) btn).getHeight(),
btn.getMessage(),
b -> this.client.openScreen(new LambdaControlsSettingsScreen(this, false))));
} else {
return this.addDrawableChild(element);
}
}
}

View File

@@ -1,26 +0,0 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.util;
/**
* Represents a Minecraft keybinding with extra access.
*/
public interface KeyBindingAccessor {
boolean lambdacontrols$press();
boolean lambdacontrols$unpress();
default boolean lambdacontrols$handlePressState(boolean pressed) {
if (pressed)
return this.lambdacontrols$press();
else
return this.lambdacontrols$unpress();
}
}

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols;
package eu.midnightdust.midnightcontrols;
import org.aperlambda.lambdacommon.utils.Nameable;
import dev.lambdaurora.spruceui.util.Nameable;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
@@ -45,7 +45,7 @@ public enum ControlsMode implements Nameable {
* @since 1.1.0
*/
public String getTranslationKey() {
return "lambdacontrols.controls_mode." + this.getName();
return "midnightcontrols.controls_mode." + this.getName();
}
@Override

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols;
package eu.midnightdust.midnightcontrols;
import dev.lambdaurora.lambdacontrols.event.PlayerChangeControlsModeCallback;
import eu.midnightdust.midnightcontrols.event.PlayerChangeControlsModeCallback;
import io.netty.buffer.Unpooled;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
@@ -26,26 +26,26 @@ import java.util.Objects;
import java.util.Optional;
/**
* Represents the LambdaControls mod.
* Represents the midnightcontrols mod.
*
* @author LambdAurora
* @version 1.7.0
* @since 1.0.0
*/
public class LambdaControls implements ModInitializer {
private static LambdaControls INSTANCE;
public static final Identifier CONTROLS_MODE_CHANNEL = new Identifier(LambdaControlsConstants.CONTROLS_MODE_CHANNEL.toString());
public static final Identifier FEATURE_CHANNEL = new Identifier(LambdaControlsConstants.FEATURE_CHANNEL.toString());
public static final Identifier HELLO_CHANNEL = new Identifier(LambdaControlsConstants.HELLO_CHANNEL.toString());
public class MidnightControls implements ModInitializer {
private static MidnightControls INSTANCE;
public static final Identifier CONTROLS_MODE_CHANNEL = new Identifier(MidnightControlsConstants.CONTROLS_MODE_CHANNEL.toString());
public static final Identifier FEATURE_CHANNEL = new Identifier(MidnightControlsConstants.FEATURE_CHANNEL.toString());
public static final Identifier HELLO_CHANNEL = new Identifier(MidnightControlsConstants.HELLO_CHANNEL.toString());
public static final TranslatableText NOT_BOUND_TEXT = new TranslatableText("lambdacontrols.not_bound");
public static final TranslatableText NOT_BOUND_TEXT = new TranslatableText("midnightcontrols.not_bound");
public final Logger logger = LogManager.getLogger("LambdaControls");
public final Logger logger = LogManager.getLogger("midnightcontrols");
@Override
public void onInitialize() {
INSTANCE = this;
this.log("Initializing LambdaControls...");
this.log("Initializing midnightcontrols...");
ServerPlayNetworking.registerGlobalReceiver(HELLO_CHANNEL, (server, player, handler, buf, responseSender) -> {
String version = buf.readString(32);
@@ -53,7 +53,7 @@ public class LambdaControls implements ModInitializer {
.ifPresent(controlsMode -> server
.execute(() -> PlayerChangeControlsModeCallback.EVENT.invoker().apply(player, controlsMode)));
server.execute(() -> {
ServerPlayNetworking.send(player, FEATURE_CHANNEL, this.makeFeatureBuffer(LambdaControlsFeature.HORIZONTAL_REACHAROUND));
ServerPlayNetworking.send(player, FEATURE_CHANNEL, this.makeFeatureBuffer(MidnightControlsFeature.HORIZONTAL_REACHAROUND));
});
});
ServerPlayNetworking.registerGlobalReceiver(CONTROLS_MODE_CHANNEL,
@@ -68,7 +68,7 @@ public class LambdaControls implements ModInitializer {
* @param info the message to print
*/
public void log(String info) {
this.logger.info("[LambdaControls] " + info);
this.logger.info("[midnightcontrols] " + info);
}
/**
@@ -77,11 +77,11 @@ public class LambdaControls implements ModInitializer {
* @param warning the warning to print
*/
public void warn(String warning) {
this.logger.info("[LambdaControls] " + warning);
this.logger.info("[midnightcontrols] " + warning);
}
/**
* Returns a packet byte buffer made for the lambdacontrols:controls_mode plugin message.
* Returns a packet byte buffer made for the midnightcontrols:controls_mode plugin message.
*
* @param controlsMode the controls mode to send
* @return the packet byte buffer
@@ -92,12 +92,12 @@ public class LambdaControls implements ModInitializer {
}
/**
* Returns a packet byte buffer made for the lambdacontrols:feature plugin message.
* Returns a packet byte buffer made for the midnightcontrols:feature plugin message.
*
* @param features the features data to send
* @return the packet byte buffer
*/
public PacketByteBuf makeFeatureBuffer(LambdaControlsFeature... features) {
public PacketByteBuf makeFeatureBuffer(MidnightControlsFeature... features) {
if (features.length == 0)
throw new IllegalArgumentException("At least one feature must be provided.");
var buffer = new PacketByteBuf(Unpooled.buffer());
@@ -112,18 +112,18 @@ public class LambdaControls implements ModInitializer {
public PacketByteBuf makeHello(@NotNull ControlsMode controlsMode) {
var version = "";
Optional<ModContainer> container;
if ((container = FabricLoader.getInstance().getModContainer(LambdaControlsConstants.NAMESPACE)).isPresent()) {
if ((container = FabricLoader.getInstance().getModContainer(MidnightControlsConstants.NAMESPACE)).isPresent()) {
version = container.get().getMetadata().getVersion().getFriendlyString();
}
return new PacketByteBuf(Unpooled.buffer()).writeString(version, 32).writeString(controlsMode.getName(), 32);
}
/**
* Gets the LambdaControls instance.
* Gets the midnightcontrols instance.
*
* @return the LambdaControls instance
* @return the midnightcontrols instance
*/
public static LambdaControls get() {
public static MidnightControls get() {
return INSTANCE;
}
}

View File

@@ -1,25 +1,26 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols;
package eu.midnightdust.midnightcontrols;
import org.aperlambda.lambdacommon.Identifier;
import net.minecraft.util.Identifier;
/**
* Represents the constants used by LambdaControls.
* Represents the constants used by midnightcontrols.
*
* @author LambdAurora
* @version 1.1.0
* @since 1.1.0
*/
public class LambdaControlsConstants {
public static final String NAMESPACE = "lambdacontrols";
public class MidnightControlsConstants {
public static final String NAMESPACE = "midnightcontrols";
public static final Identifier CONTROLS_MODE_CHANNEL = new Identifier(NAMESPACE, "controls_mode");
public static final Identifier FEATURE_CHANNEL = new Identifier(NAMESPACE, "feature");
public static final Identifier HELLO_CHANNEL = new Identifier(NAMESPACE, "hello");

View File

@@ -1,15 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols;
package eu.midnightdust.midnightcontrols;
import org.aperlambda.lambdacommon.utils.Nameable;
import dev.lambdaurora.spruceui.util.Nameable;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@@ -24,11 +25,11 @@ import java.util.Optional;
* @version 1.5.0
* @since 1.1.0
*/
public class LambdaControlsFeature implements Nameable {
private static final List<LambdaControlsFeature> FEATURES = new ArrayList<>();
public static final LambdaControlsFeature FAST_BLOCK_PLACING = new LambdaControlsFeature("fast_block_placing", true, true);
public static final LambdaControlsFeature HORIZONTAL_REACHAROUND = new LambdaControlsFeature("horizontal_reacharound", true, false);
public static final LambdaControlsFeature VERTICAL_REACHAROUND = new LambdaControlsFeature("vertical_reacharound", true, false);
public class MidnightControlsFeature implements Nameable {
private static final List<MidnightControlsFeature> FEATURES = new ArrayList<>();
public static final MidnightControlsFeature FAST_BLOCK_PLACING = new MidnightControlsFeature("fast_block_placing", true, MidnightControlsConfig.fastBlockPlacing);
public static final MidnightControlsFeature HORIZONTAL_REACHAROUND = new MidnightControlsFeature("horizontal_reacharound", true, MidnightControlsConfig.horizontalReacharound);
public static final MidnightControlsFeature VERTICAL_REACHAROUND = new MidnightControlsFeature("vertical_reacharound", true, MidnightControlsConfig.verticalReacharound);
private final String key;
private final boolean defaultAllowed;
@@ -36,14 +37,14 @@ public class LambdaControlsFeature implements Nameable {
private final boolean defaultEnabled;
private boolean enabled;
public LambdaControlsFeature(@NotNull String key, boolean allowed, boolean enabled) {
public MidnightControlsFeature(@NotNull String key, boolean allowed, boolean enabled) {
Objects.requireNonNull(key, "Feature key cannot be null.");
this.key = key;
this.setAllowed(this.defaultAllowed = allowed);
this.setEnabled(this.defaultEnabled = enabled);
}
public LambdaControlsFeature(@NotNull String key) {
public MidnightControlsFeature(@NotNull String key) {
this(key, false, false);
}
@@ -121,7 +122,7 @@ public class LambdaControlsFeature implements Nameable {
return this.key;
}
public static @NotNull Optional<LambdaControlsFeature> fromName(@NotNull String key) {
public static @NotNull Optional<MidnightControlsFeature> fromName(@NotNull String key) {
Objects.requireNonNull(key, "Cannot find features with a null name.");
return FEATURES.parallelStream().filter(feature -> feature.getName().equals(key)).findFirst();
}
@@ -130,14 +131,14 @@ public class LambdaControlsFeature implements Nameable {
* Resets all features to their default values.
*/
public static void resetAll() {
FEATURES.parallelStream().forEach(LambdaControlsFeature::reset);
FEATURES.parallelStream().forEach(MidnightControlsFeature::reset);
}
/**
* Resets all features to allow state.
*/
public static void resetAllAllowed() {
FEATURES.parallelStream().forEach(LambdaControlsFeature::resetAllowed);
FEATURES.parallelStream().forEach(MidnightControlsFeature::resetAllowed);
}
static {

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
/**
* Represents a button state.

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
@@ -26,20 +26,22 @@ import java.util.Optional;
* @since 1.0.0
*/
public enum ControllerType implements Nameable {
DEFAULT(0),
DUALSHOCK(1),
SWITCH(2),
XBOX_360(3, new LiteralText("Xbox 360")),
XBOX(4),
STEAM(5),
OUYA(6);
DEFAULT(0, new LiteralText("Default")),
DUALSHOCK(1, new LiteralText("Dualshock")),
DUALSENSE(2, new LiteralText("Dualsense")),
SWITCH(3, new LiteralText("Switch")),
XBOX_360(4, new LiteralText("Xbox 360")),
XBOX(5, new LiteralText("Xbox")),
STEAM_DECK(6, new LiteralText("Steam Deck")),
STEAM_CONTROLLER(7, new LiteralText("Steam Controller")),
OUYA(8, new LiteralText("Ouya"));
private final int id;
private final Text text;
ControllerType(int id) {
this.id = id;
this.text = new TranslatableText("lambdacontrols.controller_type." + this.getName());
this.text = new TranslatableText("midnightcontrols.controller_type." + this.getName());
}
ControllerType(int id, @NotNull Text text) {

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
@@ -52,7 +52,7 @@ public enum HudSide implements Nameable {
* @return the translation key of this hude side
*/
public @NotNull String getTranslationKey() {
return "lambdacontrols.hud_side." + this.getName();
return "midnightcontrols.hud_side." + this.getName();
}
/**

View File

@@ -1,25 +1,27 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.LambdaControls;
import dev.lambdaurora.lambdacontrols.LambdaControlsConstants;
import dev.lambdaurora.lambdacontrols.LambdaControlsFeature;
import dev.lambdaurora.lambdacontrols.client.compat.LambdaControlsCompat;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.controller.Controller;
import dev.lambdaurora.lambdacontrols.client.controller.InputManager;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsHud;
import dev.lambdaurora.lambdacontrols.client.ring.KeyBindingRingAction;
import dev.lambdaurora.lambdacontrols.client.ring.LambdaRing;
import dev.lambdaurora.spruceui.event.OpenScreenCallback;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.MidnightControls;
import eu.midnightdust.midnightcontrols.MidnightControlsConstants;
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.Controller;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsHud;
import eu.midnightdust.midnightcontrols.client.gui.TouchscreenOverlay;
import eu.midnightdust.midnightcontrols.client.ring.KeyBindingRingAction;
import eu.midnightdust.midnightcontrols.client.ring.MidnightRing;
import dev.lambdaurora.spruceui.hud.HudManager;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
@@ -40,33 +42,33 @@ import org.lwjgl.glfw.GLFW;
import java.io.File;
/**
* Represents the LambdaControls client mod.
* Represents the midnightcontrols client mod.
*
* @author LambdAurora
* @version 1.7.0
* @since 1.1.0
*/
public class LambdaControlsClient extends LambdaControls implements ClientModInitializer {
private static LambdaControlsClient INSTANCE;
public static final KeyBinding BINDING_LOOK_UP = InputManager.makeKeyBinding(new Identifier(LambdaControlsConstants.NAMESPACE, "look_up"),
public class MidnightControlsClient extends MidnightControls implements ClientModInitializer {
private static MidnightControlsClient INSTANCE;
public static final KeyBinding BINDING_LOOK_UP = InputManager.makeKeyBinding(new Identifier(MidnightControlsConstants.NAMESPACE, "look_up"),
InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_8, "key.categories.movement");
public static final KeyBinding BINDING_LOOK_RIGHT = InputManager.makeKeyBinding(new Identifier(LambdaControlsConstants.NAMESPACE, "look_right"),
public static final KeyBinding BINDING_LOOK_RIGHT = InputManager.makeKeyBinding(new Identifier(MidnightControlsConstants.NAMESPACE, "look_right"),
InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_6, "key.categories.movement");
public static final KeyBinding BINDING_LOOK_DOWN = InputManager.makeKeyBinding(new Identifier(LambdaControlsConstants.NAMESPACE, "look_down"),
public static final KeyBinding BINDING_LOOK_DOWN = InputManager.makeKeyBinding(new Identifier(MidnightControlsConstants.NAMESPACE, "look_down"),
InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_2, "key.categories.movement");
public static final KeyBinding BINDING_LOOK_LEFT = InputManager.makeKeyBinding(new Identifier(LambdaControlsConstants.NAMESPACE, "look_left"),
public static final KeyBinding BINDING_LOOK_LEFT = InputManager.makeKeyBinding(new Identifier(MidnightControlsConstants.NAMESPACE, "look_left"),
InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_KP_4, "key.categories.movement");
/*public static final KeyBinding BINDING_RING = InputManager.makeKeyBinding(new Identifier(LambdaControlsConstants.NAMESPACE, "ring"),
/*public static final KeyBinding BINDING_RING = InputManager.makeKeyBinding(new Identifier(midnightcontrolsConstants.NAMESPACE, "ring"),
InputUtil.Type.MOUSE, GLFW.GLFW_MOUSE_BUTTON_5, "key.categories.misc");*/
public static final Identifier CONTROLLER_BUTTONS = new Identifier(LambdaControlsConstants.NAMESPACE, "textures/gui/controller_buttons.png");
public static final Identifier CONTROLLER_AXIS = new Identifier(LambdaControlsConstants.NAMESPACE, "textures/gui/controller_axis.png");
public static final Identifier CURSOR_TEXTURE = new Identifier(LambdaControlsConstants.NAMESPACE, "textures/gui/cursor.png");
public static final Identifier CONTROLLER_BUTTONS = new Identifier(MidnightControlsConstants.NAMESPACE, "textures/gui/controller_buttons.png");
public static final Identifier CONTROLLER_EXPANDED = new Identifier(MidnightControlsConstants.NAMESPACE, "textures/gui/controller_expanded.png");
public static final Identifier CONTROLLER_AXIS = new Identifier(MidnightControlsConstants.NAMESPACE, "textures/gui/controller_axis.png");
public static final Identifier CURSOR_TEXTURE = new Identifier(MidnightControlsConstants.NAMESPACE, "textures/gui/cursor.png");
public final static File MAPPINGS_FILE = new File("config/gamecontrollerdb.txt");
public final LambdaControlsConfig config = new LambdaControlsConfig(this);
public final LambdaInput input = new LambdaInput(this);
public final LambdaRing ring = new LambdaRing(this);
public final LambdaReacharound reacharound = new LambdaReacharound();
private LambdaControlsHud hud;
public final MidnightInput input = new MidnightInput();
public final MidnightRing ring = new MidnightRing(this);
public final MidnightReacharound reacharound = new MidnightReacharound();
private MidnightControlsHud hud;
private ControlsMode previousControlsMode;
@Override
@@ -81,37 +83,37 @@ public class LambdaControlsClient extends LambdaControls implements ClientModIni
this.ring.registerAction("keybinding", KeyBindingRingAction.FACTORY);
ClientPlayNetworking.registerGlobalReceiver(CONTROLS_MODE_CHANNEL, (client, handler, buf, responseSender) -> {
responseSender.sendPacket(CONTROLS_MODE_CHANNEL, this.makeControlsModeBuffer(this.config.getControlsMode()));
responseSender.sendPacket(CONTROLS_MODE_CHANNEL, this.makeControlsModeBuffer(MidnightControlsConfig.controlsMode));
});
ClientPlayNetworking.registerGlobalReceiver(FEATURE_CHANNEL, (client, handler, buf, responseSender) -> {
int features = buf.readVarInt();
for (int i = 0; i < features; i++) {
var name = buf.readString(64);
boolean allowed = buf.readBoolean();
LambdaControlsFeature.fromName(name).ifPresent(feature -> client.execute(() -> feature.setAllowed(allowed)));
MidnightControlsFeature.fromName(name).ifPresent(feature -> client.execute(() -> feature.setAllowed(allowed)));
}
});
ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> {
sender.sendPacket(HELLO_CHANNEL, this.makeHello(this.config.getControlsMode()));
sender.sendPacket(CONTROLS_MODE_CHANNEL, this.makeControlsModeBuffer(this.config.getControlsMode()));
sender.sendPacket(HELLO_CHANNEL, this.makeHello(MidnightControlsConfig.controlsMode));
sender.sendPacket(CONTROLS_MODE_CHANNEL, this.makeControlsModeBuffer(MidnightControlsConfig.controlsMode));
});
ClientPlayConnectionEvents.DISCONNECT.register(this::onLeave);
ClientTickEvents.START_CLIENT_TICK.register(this.reacharound::tick);
ClientTickEvents.END_CLIENT_TICK.register(this::onTick);
/*OpenScreenCallback.EVENT.register((client, screen) -> {
if (screen == null && this.config.getControlsMode() == ControlsMode.TOUCHSCREEN) {
screen = new TouchscreenOverlay(this);
screen.init(client, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
client.skipGameRender = false;
client.currentScreen = screen;
} else if (screen != null) {
OpenScreenCallback.EVENT.register((client, screen) -> {
// if (screen == null && MidnightControlsConfig.controlsMode == ControlsMode.TOUCHSCREEN) {
// screen = new TouchscreenOverlay(this);
// screen.init(client, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
// client.skipGameRender = false;
// client.currentScreen = screen;
// } else if (screen != null) {
this.input.onScreenOpen(client, client.getWindow().getWidth(), client.getWindow().getHeight());
}
});*/
//}
});
HudManager.register(this.hud = new LambdaControlsHud(this));
HudManager.register(this.hud = new MidnightControlsHud(this));
}
/**
@@ -119,23 +121,23 @@ public class LambdaControlsClient extends LambdaControls implements ClientModIni
*/
public void onMcInit(@NotNull MinecraftClient client) {
ButtonBinding.init(client.options);
this.config.load();
this.hud.setVisible(this.config.isHudEnabled());
MidnightControlsConfig.load();
this.hud.setVisible(MidnightControlsConfig.hudEnable);
Controller.updateMappings();
GLFW.glfwSetJoystickCallback((jid, event) -> {
if (event == GLFW.GLFW_CONNECTED) {
var controller = Controller.byId(jid);
client.getToastManager().add(new SystemToast(SystemToast.Type.TUTORIAL_HINT, new TranslatableText("lambdacontrols.controller.connected", jid),
client.getToastManager().add(new SystemToast(SystemToast.Type.TUTORIAL_HINT, new TranslatableText("midnightcontrols.controller.connected", jid),
new LiteralText(controller.getName())));
} else if (event == GLFW.GLFW_DISCONNECTED) {
client.getToastManager().add(new SystemToast(SystemToast.Type.TUTORIAL_HINT, new TranslatableText("lambdacontrols.controller.disconnected", jid),
client.getToastManager().add(new SystemToast(SystemToast.Type.TUTORIAL_HINT, new TranslatableText("midnightcontrols.controller.disconnected", jid),
null));
}
this.switchControlsMode();
});
LambdaControlsCompat.init(this);
MidnightControlsCompat.init(this);
}
/**
@@ -145,7 +147,7 @@ public class LambdaControlsClient extends LambdaControls implements ClientModIni
*/
public void onTick(@NotNull MinecraftClient client) {
this.input.tick(client);
if (this.config.getControlsMode() == ControlsMode.CONTROLLER && (client.isWindowFocused() || this.config.hasUnfocusedInput()))
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && (client.isWindowFocused() || MidnightControlsConfig.unfocusedInput))
this.input.tickController(client);
/*if (BINDING_RING.wasPressed()) {
@@ -161,23 +163,23 @@ public class LambdaControlsClient extends LambdaControls implements ClientModIni
* Called when leaving a server.
*/
public void onLeave(ClientPlayNetworkHandler handler, MinecraftClient client) {
LambdaControlsFeature.resetAllAllowed();
MidnightControlsFeature.resetAllAllowed();
}
/**
* Switches the controls mode if the auto switch is enabled.
*/
public void switchControlsMode() {
if (this.config.hasAutoSwitchMode()) {
if (this.config.getController().isGamepad()) {
this.previousControlsMode = this.config.getControlsMode();
this.config.setControlsMode(ControlsMode.CONTROLLER);
if (MidnightControlsConfig.autoSwitchMode) {
if (MidnightControlsConfig.getController().isGamepad()) {
this.previousControlsMode = MidnightControlsConfig.controlsMode;
MidnightControlsConfig.controlsMode = ControlsMode.CONTROLLER;
} else {
if (this.previousControlsMode == null) {
this.previousControlsMode = ControlsMode.DEFAULT;
}
this.config.setControlsMode(this.previousControlsMode);
MidnightControlsConfig.controlsMode = this.previousControlsMode;
}
}
}
@@ -188,16 +190,16 @@ public class LambdaControlsClient extends LambdaControls implements ClientModIni
* @param enabled true if the HUD is enabled, else false
*/
public void setHudEnabled(boolean enabled) {
this.config.setHudEnabled(enabled);
MidnightControlsConfig.hudEnable = enabled;
this.hud.setVisible(enabled);
}
/**
* Gets the LambdaControls client instance.
* Gets the midnightcontrols client instance.
*
* @return the LambdaControls client instance
* @return the midnightcontrols client instance
*/
public static LambdaControlsClient get() {
public static MidnightControlsClient get() {
return INSTANCE;
}
}

View File

@@ -0,0 +1,259 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package eu.midnightdust.midnightcontrols.client;
import eu.midnightdust.lib.config.MidnightConfig;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.Controller;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import java.util.*;
import java.util.regex.Pattern;
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_X;
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y;
/**
* Represents MidnightControls configuration.
*/
public class MidnightControlsConfig extends MidnightConfig {
// General
@Entry public static ControlsMode controlsMode = ControlsMode.DEFAULT;
@Entry public static boolean autoSwitchMode = false;
@Entry public static boolean debug = false;
// HUD
@Entry public static boolean hudEnable = true;
@Entry public static HudSide hudSide = HudSide.LEFT;
// Gameplay
@Entry public static boolean analogMovement = true;
@Entry public static boolean fastBlockPlacing = true;
@Entry public static boolean flyDrifting = false;
@Entry public static boolean verticalFlyDrifting = true;
@Entry public static boolean horizontalReacharound = false;
@Entry public static boolean verticalReacharound = false;
@Entry public static boolean shouldRenderReacharoundOutline = true;
@Entry public static int[] reacharoundOutlineColor = new int[]{255, 255, 255, 102};
// Controller
@Entry public static ControllerType controllerType = ControllerType.DEFAULT;
//private static final double DEFAULT_DEAD_ZONE = 0.25;
@Entry public static double rightDeadZone = 0.25;
@Entry public static double leftDeadZone = 0.25;
@Entry public static boolean invertRightYAxis = false;
@Entry public static boolean invertRightXAxis = false;
@Entry public static double DEFAULT_MAX_VALUE = 1;
@Entry public static double rotationSpeed = 40.0;
@Entry public static double mouseSpeed = 25.0;
@Entry public static boolean unfocusedInput = false;
@Entry public static boolean virtualMouse = false;
@Entry public static VirtualMouseSkin virtualMouseSkin = VirtualMouseSkin.DEFAULT_LIGHT;
// @Entry public static List<Pages> ringPages = new ArrayList<String>();
// @Entry public static double maxAnalog1 = 1;
// @Entry public static double maxAnalog2 = 1;
// @Entry public static double maxAnalog3 = 1;
// @Entry public static double maxAnalog4 = 1;
@Entry public static Object controllerID = 0;
@Entry public static Object secondControllerID = -1;
@Entry public static Map<String, String> BINDINGS = Map.of();
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
// Gameplay.
// Controller settings
@Entry public static double[] maxAnalogValues = new double[]{DEFAULT_MAX_VALUE, DEFAULT_MAX_VALUE, DEFAULT_MAX_VALUE, DEFAULT_MAX_VALUE};
/**
* Loads the configuration
*/
public static void load() {
MidnightControlsConfig.init("midnightcontrols", MidnightControlsConfig.class);
MidnightControlsClient.get().log("Configuration loaded.");
// Controller controls.
InputManager.loadButtonBindings();
//this.mod.ring.load(this.config);
}
/**
* Saves the configuration.
*/
public static void save() {
MidnightControlsConfig.write("midnightcontrols");
MidnightControlsClient.get().log("Configuration saved.");
}
/**
* Gets the used controller.
*
* @return the controller
*/
public static Controller getController() {
var raw = MidnightControlsConfig.controllerID;
if (raw instanceof Number) {
return Controller.byId(((Number) raw).intValue());
} else if (raw instanceof String) {
return Controller.byGuid((String) raw).orElse(Controller.byId(GLFW.GLFW_JOYSTICK_1));
}
return Controller.byId(GLFW.GLFW_JOYSTICK_1);
}
/**
* Sets the used controller.
*
* @param controller the controller
*/
public static void setController(Controller controller) {
MidnightControlsConfig.controllerID = controller.id();
MidnightControlsConfig.write("midnightcontrols");
}
/**
* Gets the second controller (for Joy-Con supports).
*
* @return the second controller
*/
public static Optional<Controller> getSecondController() {
var raw = MidnightControlsConfig.secondControllerID;
if (raw instanceof Number) {
if (((Number) raw).intValue() == -1)
return Optional.empty();
return Optional.of(Controller.byId((Integer) raw));
} else if (raw instanceof String) {
return Optional.of(Controller.byGuid((String) raw).orElse(Controller.byId(GLFW.GLFW_JOYSTICK_1)));
}
return Optional.empty();
}
/**
* Sets the second controller.
*
* @param controller the second controller
*/
public static void setSecondController(@Nullable Controller controller) {
MidnightControlsConfig.secondControllerID = controller == null ? -1 : controller.id();
}
/**
* Gets the right X axis sign.
*
* @return the right X axis sign
*/
public static double getRightXAxisSign() {
return MidnightControlsConfig.invertRightXAxis ? -1.0 : 1.0;
}
/**
* Gets the right Y axis sign.
*
* @return the right Y axis sign
*/
public static double getRightYAxisSign() {
return MidnightControlsConfig.invertRightYAxis ? -1.0 : 1.0;
}
public static double getAxisMaxValue(int axis) {
if (axis >= MidnightControlsConfig.maxAnalogValues.length)
return DEFAULT_MAX_VALUE;
return MidnightControlsConfig.maxAnalogValues[axis];
}
public static void setAxisMaxValue(int axis, double value) {
if (axis < MidnightControlsConfig.maxAnalogValues.length)
MidnightControlsConfig.maxAnalogValues[axis] = value;
}
/**
* Loads the button binding from configuration.
*
* @param button the button binding
*/
public static void loadButtonBinding(@NotNull ButtonBinding button) {
button.setButton(button.getDefaultButton());
var code = MidnightControlsConfig.BINDINGS.getOrDefault("controller.controls." + button.getName(), button.getButtonCode());
var matcher = BUTTON_BINDING_PATTERN.matcher(code);
try {
var buttons = new int[1];
int count = 0;
while (matcher.find()) {
count++;
if (count > buttons.length)
buttons = Arrays.copyOf(buttons, count);
String current;
if (!MidnightControlsConfig.checkValidity(button, code, current = matcher.group(1)))
return;
buttons[count - 1] = Integer.parseInt(current);
}
if (count == 0) {
MidnightControlsClient.get().warn("Malformed config value \"" + code + "\" for binding \"" + button.getName() + "\".");
MidnightControlsConfig.setButtonBinding(button, new int[]{-1});
}
button.setButton(buttons);
} catch (Exception e) {
MidnightControlsClient.get().warn("Malformed config value \"" + code + "\" for binding \"" + button.getName() + "\".");
MidnightControlsConfig.BINDINGS.put("controller.controls." + button.getName(), button.getButtonCode());
}
}
private static boolean checkValidity(@NotNull ButtonBinding binding, @NotNull String input, String group) {
if (group == null) {
MidnightControlsClient.get().warn("Malformed config value \"" + input + "\" for binding \"" + binding.getName() + "\".");
MidnightControlsConfig.BINDINGS.put("controller.controls." + binding.getName(), binding.getButtonCode());
return false;
}
return true;
}
/**
* Sets the button binding in configuration.
*
* @param binding the button binding
* @param button the button
*/
public static void setButtonBinding(@NotNull ButtonBinding binding, int[] button) {
binding.setButton(button);
MidnightControlsConfig.BINDINGS.put("controller.controls." + binding.getName(), binding.getButtonCode());
}
public static boolean isBackButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_Y, false) == ButtonBinding.axisAsButton(btn, state == 1);
}
public static boolean isForwardButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_Y, true) == ButtonBinding.axisAsButton(btn, state == 1);
}
public static boolean isLeftButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_X, false) == ButtonBinding.axisAsButton(btn, state == 1);
}
public static boolean isRightButton(int btn, boolean isBtn, int state) {
if (!isBtn && state == 0)
return false;
return ButtonBinding.axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_X, true) == ButtonBinding.axisAsButton(btn, state == 1);
}
/**
* Returns whether the specified axis is an axis used for movements.
*
* @param axis the axis index
* @return true if the axis is used for movements, else false
*/
public static boolean isMovementAxis(int axis) {
return axis == GLFW_GAMEPAD_AXIS_LEFT_Y || axis == GLFW_GAMEPAD_AXIS_LEFT_X;
}
}

View File

@@ -1,28 +1,28 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsSettingsScreen;
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsSettingsScreen;
/**
* Represents the API implementation of ModMenu for LambdaControls.
* Represents the API implementation of ModMenu for midnightcontrols.
*
* @author LambdAurora
* @version 1.7.0
* @since 1.1.0
*/
public class LambdaControlsModMenu implements ModMenuApi {
public class MidnightControlsModMenu implements ModMenuApi {
@Override
public ConfigScreenFactory<?> getModConfigScreenFactory() {
return parent -> new LambdaControlsSettingsScreen(parent, false);
return parent -> new MidnightControlsSettingsScreen(parent, false);
}
}

View File

@@ -1,26 +1,26 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import com.google.common.collect.ImmutableSet;
import dev.lambdaurora.lambdacontrols.client.compat.LambdaControlsCompat;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.controller.Controller;
import dev.lambdaurora.lambdacontrols.client.controller.InputManager;
import dev.lambdaurora.lambdacontrols.client.gui.TouchscreenOverlay;
import dev.lambdaurora.lambdacontrols.client.gui.widget.ControllerControlsWidget;
import dev.lambdaurora.lambdacontrols.client.mixin.AdvancementsScreenAccessor;
import dev.lambdaurora.lambdacontrols.client.mixin.CreativeInventoryScreenAccessor;
import dev.lambdaurora.lambdacontrols.client.mixin.EntryListWidgetAccessor;
import dev.lambdaurora.lambdacontrols.client.util.HandledScreenAccessor;
import dev.lambdaurora.lambdacontrols.client.util.MouseAccessor;
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.Controller;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import eu.midnightdust.midnightcontrols.client.gui.TouchscreenOverlay;
import eu.midnightdust.midnightcontrols.client.gui.widget.ControllerControlsWidget;
import eu.midnightdust.midnightcontrols.client.mixin.AdvancementsScreenAccessor;
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
import eu.midnightdust.midnightcontrols.client.mixin.EntryListWidgetAccessor;
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
import dev.lambdaurora.spruceui.navigation.NavigationDirection;
import dev.lambdaurora.spruceui.screen.SpruceScreen;
import dev.lambdaurora.spruceui.widget.AbstractSprucePressableButtonWidget;
@@ -58,20 +58,17 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import static dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding.axisAsButton;
import static dev.lambdaurora.lambdacontrols.client.controller.InputManager.INPUT_MANAGER;
import static org.lwjgl.glfw.GLFW.*;
/**
* Represents the LambdaControls' input handler.
* Represents the midnightcontrols' input handler.
*
* @author LambdAurora
* @version 1.7.0
* @since 1.0.0
*/
public class LambdaInput {
public class MidnightInput {
private static final Map<Integer, Integer> BUTTON_COOLDOWNS = new HashMap<>();
private final LambdaControlsConfig config;
// Cooldowns
private int actionGuiCooldown = 0;
private boolean ignoreNextARelease = false;
@@ -87,9 +84,7 @@ public class LambdaInput {
private ControllerControlsWidget controlsInput = null;
public LambdaInput(@NotNull LambdaControlsClient mod) {
this.config = mod.config;
}
public MidnightInput() {}
/**
* This method is called every Minecraft tick.
@@ -101,18 +96,18 @@ public class LambdaInput {
this.targetPitch = 0.F;
// Handles the key bindings.
if (LambdaControlsClient.BINDING_LOOK_UP.isPressed()) {
if (MidnightControlsClient.BINDING_LOOK_UP.isPressed()) {
this.handleLook(client, GLFW_GAMEPAD_AXIS_RIGHT_Y, 0.8F, 2);
} else if (LambdaControlsClient.BINDING_LOOK_DOWN.isPressed()) {
} else if (MidnightControlsClient.BINDING_LOOK_DOWN.isPressed()) {
this.handleLook(client, GLFW_GAMEPAD_AXIS_RIGHT_Y, 0.8F, 1);
}
if (LambdaControlsClient.BINDING_LOOK_LEFT.isPressed()) {
if (MidnightControlsClient.BINDING_LOOK_LEFT.isPressed()) {
this.handleLook(client, GLFW_GAMEPAD_AXIS_RIGHT_X, 0.8F, 2);
} else if (LambdaControlsClient.BINDING_LOOK_RIGHT.isPressed()) {
} else if (MidnightControlsClient.BINDING_LOOK_RIGHT.isPressed()) {
this.handleLook(client, GLFW_GAMEPAD_AXIS_RIGHT_X, 0.8F, 1);
}
INPUT_MANAGER.tick(client);
InputManager.INPUT_MANAGER.tick(client);
}
/**
@@ -129,13 +124,13 @@ public class LambdaInput {
InputManager.updateStates();
var controller = this.config.getController();
var controller = MidnightControlsConfig.getController();
if (controller.isConnected()) {
var state = controller.getState();
this.fetchButtonInput(client, state, false);
this.fetchAxeInput(client, state, false);
}
this.config.getSecondController().filter(Controller::isConnected)
MidnightControlsConfig.getSecondController().filter(Controller::isConnected)
.ifPresent(joycon -> {
GLFWGamepadState state = joycon.getState();
this.fetchButtonInput(client, state, true);
@@ -173,7 +168,7 @@ public class LambdaInput {
*/
public void onPreRenderScreen(@NotNull MinecraftClient client, @NotNull Screen screen) {
if (!isScreenInteractive(screen)) {
INPUT_MANAGER.updateMousePosition(client);
InputManager.INPUT_MANAGER.updateMousePosition(client);
}
}
@@ -212,10 +207,10 @@ public class LambdaInput {
public void onScreenOpen(@NotNull MinecraftClient client, int windowWidth, int windowHeight) {
if (client.currentScreen == null) {
this.mouseSpeedX = this.mouseSpeedY = 0.0F;
INPUT_MANAGER.resetMousePosition(windowWidth, windowHeight);
} else if (isScreenInteractive(client.currentScreen) && this.config.hasVirtualMouse()) {
((MouseAccessor) client.mouse).lambdacontrols$onCursorPos(client.getWindow().getHandle(), 0, 0);
INPUT_MANAGER.resetMouseTarget(client);
InputManager.INPUT_MANAGER.resetMousePosition(windowWidth, windowHeight);
} else if (isScreenInteractive(client.currentScreen) && MidnightControlsConfig.virtualMouse) {
((MouseAccessor) client.mouse).midnightcontrols$onCursorPos(client.getWindow().getHandle(), 0, 0);
InputManager.INPUT_MANAGER.resetMouseTarget(client);
}
this.inventoryInteractionCooldown = 5;
}
@@ -263,7 +258,7 @@ public class LambdaInput {
if (i == GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y)
value *= -1.0F;
int state = value > this.config.getRightDeadZone() ? 1 : (value < -this.config.getRightDeadZone() ? 2 : 0);
int state = value > MidnightControlsConfig.rightDeadZone ? 1 : (value < -MidnightControlsConfig.rightDeadZone ? 2 : 0);
this.handleAxe(client, axis, value, absValue, state);
}
}
@@ -318,7 +313,7 @@ public class LambdaInput {
if (button == GLFW.GLFW_GAMEPAD_BUTTON_B) {
if (client.currentScreen != null) {
if (!LambdaControlsCompat.handleMenuBack(client, client.currentScreen))
if (!MidnightControlsCompat.handleMenuBack(client, client.currentScreen))
if (!this.tryGoBack(client.currentScreen))
client.currentScreen.onClose();
return;
@@ -344,7 +339,6 @@ public class LambdaInput {
}
}
}
/**
* Handles inventory interaction.
*
@@ -372,13 +366,13 @@ public class LambdaInput {
var screen = (HandledScreen) client.currentScreen;
var accessor = (HandledScreenAccessor) screen;
Slot slot = ((HandledScreenAccessor) client.currentScreen).lambdacontrols$getSlotAt(x, y);
Slot slot = ((HandledScreenAccessor) client.currentScreen).midnightcontrols$getSlotAt(x, y);
int slotId;
if (slot == null) {
if (client.player.currentScreenHandler.getCursorStack().isEmpty())
return false;
slotId = accessor.lambdacontrols$isClickOutsideBounds(x, y, accessor.getX(), accessor.getY(), GLFW_MOUSE_BUTTON_1) ? -999 : -1;
slotId = accessor.midnightcontrols$isClickOutsideBounds(x, y, accessor.getX(), accessor.getY(), GLFW_MOUSE_BUTTON_1) ? -999 : -1;
} else {
slotId = slot.id;
}
@@ -388,9 +382,9 @@ public class LambdaInput {
switch (button) {
case GLFW_GAMEPAD_BUTTON_A:
if (screen instanceof CreativeInventoryScreen)
if (((CreativeInventoryScreenAccessor) screen).lambdacontrols$isCreativeInventorySlot(slot))
if (((CreativeInventoryScreenAccessor) screen).midnightcontrols$isCreativeInventorySlot(slot))
actionType = SlotActionType.CLONE;
if (slot != null && LambdaControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot)))
if (slot != null && MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot)))
actionType = SlotActionType.CLONE;
break;
case GLFW.GLFW_GAMEPAD_BUTTON_X:
@@ -403,7 +397,7 @@ public class LambdaInput {
return false;
}
accessor.lambdacontrols$onMouseClick(slot, slotId, clickData, actionType);
accessor.midnightcontrols$onMouseClick(slot, slotId, clickData, actionType);
return true;
}
@@ -428,8 +422,8 @@ public class LambdaInput {
}
private double getDeadZoneValue(int axis) {
return (axis == GLFW_GAMEPAD_AXIS_LEFT_X || axis == GLFW_GAMEPAD_AXIS_LEFT_Y) ? this.config.getLeftDeadZone()
: this.config.getRightDeadZone();
return (axis == GLFW_GAMEPAD_AXIS_LEFT_X || axis == GLFW_GAMEPAD_AXIS_LEFT_Y) ? MidnightControlsConfig.leftDeadZone
: MidnightControlsConfig.rightDeadZone;
}
private void handleAxe(@NotNull MinecraftClient client, int axis, float value, float absValue, int state) {
@@ -444,28 +438,28 @@ public class LambdaInput {
{
boolean currentPlusState = asButtonState == 1;
boolean currentMinusState = asButtonState == 2;
var previousPlusState = InputManager.STATES.getOrDefault(axisAsButton(axis, true), ButtonState.NONE);
var previousMinusState = InputManager.STATES.getOrDefault(axisAsButton(axis, false), ButtonState.NONE);
var previousPlusState = InputManager.STATES.getOrDefault(ButtonBinding.axisAsButton(axis, true), ButtonState.NONE);
var previousMinusState = InputManager.STATES.getOrDefault(ButtonBinding.axisAsButton(axis, false), ButtonState.NONE);
if (currentPlusState != previousPlusState.isPressed()) {
InputManager.STATES.put(axisAsButton(axis, true), currentPlusState ? ButtonState.PRESS : ButtonState.RELEASE);
InputManager.STATES.put(ButtonBinding.axisAsButton(axis, true), currentPlusState ? ButtonState.PRESS : ButtonState.RELEASE);
if (currentPlusState)
BUTTON_COOLDOWNS.put(axisAsButton(axis, true), 5);
BUTTON_COOLDOWNS.put(ButtonBinding.axisAsButton(axis, true), 5);
} else if (currentPlusState) {
InputManager.STATES.put(axisAsButton(axis, true), ButtonState.REPEAT);
if (BUTTON_COOLDOWNS.getOrDefault(axisAsButton(axis, true), 0) == 0) {
BUTTON_COOLDOWNS.put(axisAsButton(axis, true), 5);
InputManager.STATES.put(ButtonBinding.axisAsButton(axis, true), ButtonState.REPEAT);
if (BUTTON_COOLDOWNS.getOrDefault(ButtonBinding.axisAsButton(axis, true), 0) == 0) {
BUTTON_COOLDOWNS.put(ButtonBinding.axisAsButton(axis, true), 5);
}
}
if (currentMinusState != previousMinusState.isPressed()) {
InputManager.STATES.put(axisAsButton(axis, false), currentMinusState ? ButtonState.PRESS : ButtonState.RELEASE);
InputManager.STATES.put(ButtonBinding.axisAsButton(axis, false), currentMinusState ? ButtonState.PRESS : ButtonState.RELEASE);
if (currentMinusState)
BUTTON_COOLDOWNS.put(axisAsButton(axis, false), 5);
BUTTON_COOLDOWNS.put(ButtonBinding.axisAsButton(axis, false), 5);
} else if (currentMinusState) {
InputManager.STATES.put(axisAsButton(axis, false), ButtonState.REPEAT);
if (BUTTON_COOLDOWNS.getOrDefault(axisAsButton(axis, false), 0) == 0) {
BUTTON_COOLDOWNS.put(axisAsButton(axis, false), 5);
InputManager.STATES.put(ButtonBinding.axisAsButton(axis, false), ButtonState.REPEAT);
if (BUTTON_COOLDOWNS.getOrDefault(ButtonBinding.axisAsButton(axis, false), 0) == 0) {
BUTTON_COOLDOWNS.put(ButtonBinding.axisAsButton(axis, false), 5);
}
}
@@ -473,23 +467,23 @@ public class LambdaInput {
float axisValue = absValue < deadZone ? 0.f : (float) (absValue - deadZone);
axisValue /= (1.0 - deadZone);
axisValue = (float) Math.min(axisValue / this.config.getAxisMaxValue(axis), 1);
axisValue = (float) Math.min(axisValue / MidnightControlsConfig.getAxisMaxValue(axis), 1);
if (currentPlusState)
InputManager.BUTTON_VALUES.put(axisAsButton(axis, true), axisValue);
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(axis, true), axisValue);
else
InputManager.BUTTON_VALUES.put(axisAsButton(axis, true), 0.f);
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(axis, true), 0.f);
if (currentMinusState)
InputManager.BUTTON_VALUES.put(axisAsButton(axis, false), axisValue);
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(axis, false), axisValue);
else
InputManager.BUTTON_VALUES.put(axisAsButton(axis, false), 0.f);
InputManager.BUTTON_VALUES.put(ButtonBinding.axisAsButton(axis, false), 0.f);
}
double deadZone = this.getDeadZoneValue(axis);
if (this.controlsInput != null && this.controlsInput.focusedBinding != null) {
if (asButtonState != 0 && !this.controlsInput.currentButtons.contains(axisAsButton(axis, asButtonState == 1))) {
if (asButtonState != 0 && !this.controlsInput.currentButtons.contains(ButtonBinding.axisAsButton(axis, asButtonState == 1))) {
this.controlsInput.currentButtons.add(axisAsButton(axis, asButtonState == 1));
this.controlsInput.currentButtons.add(ButtonBinding.axisAsButton(axis, asButtonState == 1));
int[] buttons = new int[this.controlsInput.currentButtons.size()];
for (int i = 0; i < this.controlsInput.currentButtons.size(); i++)
@@ -503,7 +497,7 @@ public class LambdaInput {
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y) {
var accessor = (CreativeInventoryScreenAccessor) creativeInventoryScreen;
// @TODO allow rebinding to left stick
if (accessor.lambdacontrols$hasScrollbar() && absValue >= deadZone) {
if (accessor.midnightcontrols$hasScrollbar() && absValue >= deadZone) {
creativeInventoryScreen.mouseScrolled(0.0, 0.0, -value);
}
return;
@@ -521,21 +515,21 @@ public class LambdaInput {
absValue -= deadZone;
absValue /= (1.0 - deadZone);
absValue = (float) MathHelper.clamp(absValue / this.config.getAxisMaxValue(axis), 0.f, 1.f);
absValue = (float) MathHelper.clamp(absValue / MidnightControlsConfig.getAxisMaxValue(axis), 0.f, 1.f);
if (client.currentScreen == null) {
// Handles the look direction.
this.handleLook(client, axis, absValue, state);
} else {
boolean allowMouseControl = true;
if (this.actionGuiCooldown == 0 && this.config.isMovementAxis(axis) && isScreenInteractive(client.currentScreen)) {
if (this.config.isForwardButton(axis, false, asButtonState)) {
if (this.actionGuiCooldown == 0 && MidnightControlsConfig.isMovementAxis(axis) && isScreenInteractive(client.currentScreen)) {
if (MidnightControlsConfig.isForwardButton(axis, false, asButtonState)) {
allowMouseControl = this.changeFocus(client.currentScreen, NavigationDirection.UP);
} else if (this.config.isBackButton(axis, false, asButtonState)) {
} else if (MidnightControlsConfig.isBackButton(axis, false, asButtonState)) {
allowMouseControl = this.changeFocus(client.currentScreen, NavigationDirection.DOWN);
} else if (this.config.isLeftButton(axis, false, asButtonState)) {
} else if (MidnightControlsConfig.isLeftButton(axis, false, asButtonState)) {
allowMouseControl = this.handleLeftRight(client.currentScreen, false);
} else if (this.config.isRightButton(axis, false, asButtonState)) {
} else if (MidnightControlsConfig.isRightButton(axis, false, asButtonState)) {
allowMouseControl = this.handleLeftRight(client.currentScreen, true);
}
}
@@ -543,13 +537,13 @@ public class LambdaInput {
float movementX = 0.f;
float movementY = 0.f;
if (this.config.isBackButton(axis, false, (value > 0 ? 1 : 2))) {
if (MidnightControlsConfig.isBackButton(axis, false, (value > 0 ? 1 : 2))) {
movementY = absValue;
} else if (this.config.isForwardButton(axis, false, (value > 0 ? 1 : 2))) {
} else if (MidnightControlsConfig.isForwardButton(axis, false, (value > 0 ? 1 : 2))) {
movementY = -absValue;
} else if (this.config.isLeftButton(axis, false, (value > 0 ? 1 : 2))) {
} else if (MidnightControlsConfig.isLeftButton(axis, false, (value > 0 ? 1 : 2))) {
movementX = -absValue;
} else if (this.config.isRightButton(axis, false, (value > 0 ? 1 : 2))) {
} else if (MidnightControlsConfig.isRightButton(axis, false, (value > 0 ? 1 : 2))) {
movementX = absValue;
}
@@ -561,7 +555,7 @@ public class LambdaInput {
It prevents the cursor to jump to the old target mouse position if the user moves the cursor with the mouse.
*/
if (Math.abs(prevXAxis) < deadZone && Math.abs(prevYAxis) < deadZone) {
INPUT_MANAGER.resetMouseTarget(client);
InputManager.INPUT_MANAGER.resetMouseTarget(client);
}
this.mouseSpeedX = movementX;
@@ -573,8 +567,8 @@ public class LambdaInput {
if (Math.abs(this.mouseSpeedX) >= .05f || Math.abs(this.mouseSpeedY) >= .05f) {
InputManager.queueMoveMousePosition(
this.mouseSpeedX * this.config.getMouseSpeed(),
this.mouseSpeedY * this.config.getMouseSpeed()
this.mouseSpeedX * MidnightControlsConfig.mouseSpeed,
this.mouseSpeedY * MidnightControlsConfig.mouseSpeed
);
}
@@ -649,7 +643,7 @@ public class LambdaInput {
this.actionGuiCooldown = 2; // Prevent to press too quickly the focused element, so we have to skip 5 ticks.
return false;
} else if (element instanceof AlwaysSelectedEntryListWidget) {
((EntryListWidgetAccessor) element).lambdacontrols$moveSelection(right ? EntryListWidget.MoveDirection.UP : EntryListWidget.MoveDirection.DOWN);
((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.UP : EntryListWidget.MoveDirection.DOWN);
return false;
} else if (element instanceof ParentElement entryList) {
var focused = entryList.getFocused();
@@ -674,16 +668,16 @@ public class LambdaInput {
double powValue = Math.pow(value, 2.0);
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y) {
if (state == 2) {
this.targetPitch = -this.config.getRightYAxisSign() * (this.config.getRotationSpeed() * powValue) * 0.11D;
this.targetPitch = -MidnightControlsConfig.getRightYAxisSign() * (MidnightControlsConfig.rotationSpeed * powValue) * 0.11D;
} else if (state == 1) {
this.targetPitch = this.config.getRightYAxisSign() * (this.config.getRotationSpeed() * powValue) * 0.11D;
this.targetPitch = MidnightControlsConfig.getRightYAxisSign() * (MidnightControlsConfig.rotationSpeed * powValue) * 0.11D;
}
}
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_X) {
if (state == 2) {
this.targetYaw = -this.config.getRightXAxisSign() * (this.config.getRotationSpeed() * powValue) * 0.11D;
this.targetYaw = -MidnightControlsConfig.getRightXAxisSign() * (MidnightControlsConfig.rotationSpeed * powValue) * 0.11D;
} else if (state == 1) {
this.targetYaw = this.config.getRightXAxisSign() * (this.config.getRotationSpeed() * powValue) * 0.11D;
this.targetYaw = MidnightControlsConfig.getRightXAxisSign() * (MidnightControlsConfig.rotationSpeed * powValue) * 0.11D;
}
}
}
@@ -711,7 +705,7 @@ public class LambdaInput {
public static boolean isScreenInteractive(@NotNull Screen screen) {
return !(screen instanceof AdvancementsScreen || screen instanceof HandledScreen || screen instanceof PackScreen
|| (screen instanceof SpruceScreen && ((SpruceScreen) screen).requiresCursor())
|| LambdaControlsCompat.requireMouseOnScreen(screen));
|| MidnightControlsCompat.requireMouseOnScreen(screen));
}
// Inspired from https://github.com/MrCrayfish/Controllable/blob/1.14.X/src/main/java/com/mrcrayfish/controllable/client/ControllerInput.java#L686.

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import dev.lambdaurora.lambdacontrols.LambdaControlsFeature;
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FluidBlock;
@@ -28,12 +28,12 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents the reach-around API of LambdaControls.
* Represents the reach-around API of midnightcontrols.
*
* @version 1.7.0
* @since 1.3.2
*/
public class LambdaReacharound {
public class MidnightReacharound {
private BlockHitResult lastReacharoundResult = null;
private boolean lastReacharoundVertical = false;
private boolean onSlab = false;
@@ -70,7 +70,7 @@ public class LambdaReacharound {
* @return {@code true} if reacharound is available, else {@code false}
*/
public boolean isReacharoundAvailable() {
return LambdaControlsFeature.HORIZONTAL_REACHAROUND.isAvailable() || LambdaControlsFeature.VERTICAL_REACHAROUND.isAvailable();
return MidnightControlsFeature.HORIZONTAL_REACHAROUND.isAvailable() || MidnightControlsFeature.VERTICAL_REACHAROUND.isAvailable();
}
private float getPlayerRange(@NotNull MinecraftClient client) {
@@ -84,7 +84,7 @@ public class LambdaReacharound {
* @return a block hit result if vertical reach-around is possible, else {@code null}
*/
public @Nullable BlockHitResult tryVerticalReachAround(@NotNull MinecraftClient client) {
if (!LambdaControlsFeature.VERTICAL_REACHAROUND.isAvailable())
if (!MidnightControlsFeature.VERTICAL_REACHAROUND.isAvailable())
return null;
if (client.player == null || client.world == null || client.crosshairTarget == null || client.crosshairTarget.getType() != HitResult.Type.MISS
|| !client.player.isOnGround() || client.player.getPitch(0.f) < 80.0F
@@ -116,7 +116,7 @@ public class LambdaReacharound {
* @return a block hit result if horizontal reach-around is possible
*/
public @Nullable BlockHitResult tryHorizontalReachAround(@NotNull MinecraftClient client) {
if (!LambdaControlsFeature.HORIZONTAL_REACHAROUND.isAvailable())
if (!MidnightControlsFeature.HORIZONTAL_REACHAROUND.isAvailable())
return null;
if (client.player != null && client.crosshairTarget != null && client.crosshairTarget.getType() == HitResult.Type.MISS

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client;
package eu.midnightdust.midnightcontrols.client;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
@@ -55,7 +55,7 @@ public enum VirtualMouseSkin implements Nameable {
* @return the virtual mouse skin's translation key
*/
public @NotNull String getTranslationKey() {
return "lambdacontrols.virtual_mouse.skin." + this.getName();
return "midnightcontrols.virtual_mouse.skin." + this.getName();
}
/**

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat;
package eu.midnightdust.midnightcontrols.client.compat;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
@@ -31,7 +31,7 @@ public interface CompatHandler {
*
* @param mod this mod instance
*/
void handle(@NotNull LambdaControlsClient mod);
void handle(@NotNull MidnightControlsClient mod);
/**
* Returns whether the mouse is required on the specified screen.

View File

@@ -0,0 +1,51 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package eu.midnightdust.midnightcontrols.client.compat;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import io.github.kosmx.emotes.arch.gui.screen.ingame.FastChosseScreen;
import io.github.kosmx.emotes.main.network.ClientEmotePlay;
import net.minecraft.client.gui.screen.Screen;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.glfw.GLFW;
/**
* Represents a compatibility handler for Emotecraft.
*
* @author Motschen
* @version 1.4.3
* @since 1.0.0
*/
public class EmotecraftCompat implements CompatHandler {
@Override
public void handle(@NotNull MidnightControlsClient mod) {
new ButtonBinding.Builder("key.emotecraft.fastchoose")
.buttons(16)
.onlyInGame()
.cooldown(true)
.category(ButtonBinding.MISC_CATEGORY)
.action((client, button, value, action) -> {
client.setScreen(new FastChosseScreen(null));
return true;
})
.register();
new ButtonBinding.Builder("key.emotecraft.stop")
.buttons(17)
.onlyInGame()
.cooldown(true)
.category(ButtonBinding.MISC_CATEGORY)
.action((client, button, value, action) -> {
ClientEmotePlay.clientStopLocalEmote();
return true;
})
.register();
}
}

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat;
package eu.midnightdust.midnightcontrols.client.compat;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import net.minecraft.client.gui.screen.Screen;
import org.aperlambda.lambdacommon.utils.LambdaReflection;
import org.jetbrains.annotations.NotNull;
@@ -30,7 +30,7 @@ public class HQMCompat implements CompatHandler {
private Optional<Class<?>> guiBaseClass;
@Override
public void handle(@NotNull LambdaControlsClient mod) {
public void handle(@NotNull MidnightControlsClient mod) {
this.guiBaseClass = LambdaReflection.getClass(GUI_BASE_CLASS_PATH);
}

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat;
package eu.midnightdust.midnightcontrols.client.compat;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.InputManager;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
@@ -30,7 +30,7 @@ import java.util.stream.Stream;
* @version 1.5.0
* @since 1.1.0
*/
public class LambdaControlsCompat {
public class MidnightControlsCompat {
private static final List<CompatHandler> HANDLERS = new ArrayList<>();
/**
@@ -38,7 +38,7 @@ public class LambdaControlsCompat {
*
* @param mod the mod instance
*/
public static void init(@NotNull LambdaControlsClient mod) {
public static void init(@NotNull MidnightControlsClient mod) {
if (FabricLoader.getInstance().isModLoaded("okzoomer")) {
mod.log("Adding okzoomer compatibility...");
HANDLERS.add(new OkZoomerCompat());
@@ -51,8 +51,12 @@ public class LambdaControlsCompat {
mod.log("Adding HQM compatibility...");
HANDLERS.add(new HQMCompat());
}
if (FabricLoader.getInstance().isModLoaded("emotecraft")) {
mod.log("Adding Emotecraft compatibility...");
HANDLERS.add(new EmotecraftCompat());
}
HANDLERS.forEach(handler -> handler.handle(mod));
InputManager.loadButtonBindings(mod.config);
InputManager.loadButtonBindings();
}
/**

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat;
package eu.midnightdust.midnightcontrols.client.compat;
import org.jetbrains.annotations.NotNull;
import org.objectweb.asm.tree.ClassNode;
@@ -25,18 +25,18 @@ import java.util.Set;
* @version 1.5.0
* @since 1.2.0
*/
public class LambdaControlsMixinPlugin implements IMixinConfigPlugin {
public class MidnightControlsMixinPlugin implements IMixinConfigPlugin {
private final HashMap<String, Boolean> conditionalMixins = new HashMap<>();
public LambdaControlsMixinPlugin() {
this.putConditionalMixin("EntryListWidgetAccessor", LambdaControlsCompat.isReiPresent());
this.putConditionalMixin("EntryWidgetAccessor", LambdaControlsCompat.isReiPresent());
this.putConditionalMixin("RecipeViewingScreenAccessor", LambdaControlsCompat.isReiPresent());
this.putConditionalMixin("VillagerRecipeViewingScreenAccessor", LambdaControlsCompat.isReiPresent());
public MidnightControlsMixinPlugin() {
this.putConditionalMixin("EntryListWidgetAccessor", MidnightControlsCompat.isReiPresent());
this.putConditionalMixin("EntryWidgetAccessor", MidnightControlsCompat.isReiPresent());
this.putConditionalMixin("RecipeViewingScreenAccessor", MidnightControlsCompat.isReiPresent());
this.putConditionalMixin("VillagerRecipeViewingScreenAccessor", MidnightControlsCompat.isReiPresent());
}
private void putConditionalMixin(@NotNull String path, boolean condition) {
this.conditionalMixins.put("me.lambdaurora.lambdacontrols.client.compat.mixin." + path, condition);
this.conditionalMixins.put("me.lambdaurora.midnightcontrols.client.compat.mixin." + path, condition);
}
@Override

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat;
package eu.midnightdust.midnightcontrols.client.compat;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import io.github.ennuil.okzoomer.keybinds.ZoomKeybinds;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.glfw.GLFW;
@@ -24,7 +24,7 @@ import org.lwjgl.glfw.GLFW;
*/
public class OkZoomerCompat implements CompatHandler {
@Override
public void handle(@NotNull LambdaControlsClient mod) {
public void handle(@NotNull MidnightControlsClient mod) {
new ButtonBinding.Builder("zoom")
.buttons(GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP, GLFW.GLFW_GAMEPAD_BUTTON_X)
.onlyInGame()

View File

@@ -1,19 +1,19 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat;
package eu.midnightdust.midnightcontrols.client.compat;
import dev.lambdaurora.lambdacontrols.client.ButtonState;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.controller.InputHandlers;
import dev.lambdaurora.lambdacontrols.client.controller.PressAction;
import eu.midnightdust.midnightcontrols.client.ButtonState;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.InputHandlers;
import eu.midnightdust.midnightcontrols.client.controller.PressAction;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.util.Identifier;
@@ -33,7 +33,7 @@ public class ReiCompat implements CompatHandler {
//private static EntryListWidget ENTRY_LIST_WIDGET;
@Override
public void handle(@NotNull LambdaControlsClient mod) {
public void handle(@NotNull MidnightControlsClient mod) {
ButtonBinding.builder(new Identifier("rei", "category_back"))
.buttons(GLFW_GAMEPAD_BUTTON_LEFT_BUMPER)
.filter((client, binding) -> isViewingScreen(client.currentScreen))
@@ -188,12 +188,12 @@ public class ReiCompat implements CompatHandler {
private static @Nullable EntryStack getCurrentStack(@NotNull Element element, double mouseX, double mouseY) {
if (element instanceof EntryWidget entry) {
if (entry.containsMouse(mouseX, mouseY))
return ((EntryWidgetAccessor) entry).lambdacontrols_getCurrentEntry();
return ((EntryWidgetAccessor) entry).midnightcontrols_getCurrentEntry();
} else if (element instanceof EntryListWidget) {
var entries = ((EntryListWidgetAccessor) element).getEntries();
for (EntryListEntryWidget entry : entries) {
if (entry.containsMouse(mouseX, mouseY)) {
return ((EntryWidgetAccessor) entry).lambdacontrols_getCurrentEntry();
return ((EntryWidgetAccessor) entry).midnightcontrols_getCurrentEntry();
}
}
} else if (!(element instanceof ButtonWidget) && element instanceof WidgetWithBounds widgetWithBounds) {
@@ -276,7 +276,7 @@ public class ReiCompat implements CompatHandler {
int currentTab = screen.getSelectedCategoryIndex();
screen.setSelectedCategoryIndex(getNextIndex(currentTab, categories.size(), next));
screen.setSelectedRecipeIndex(0);
screen.lambdacontrols_init();
screen.midnightcontrols_init();
return true;
}*/
return false;
@@ -315,7 +315,7 @@ public class ReiCompat implements CompatHandler {
}
screen.setSelectedRecipeIndex(nextRecipe);
screen.lambdacontrols_init();
screen.midnightcontrols_init();
return true;
}*/

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat.mixin;
package eu.midnightdust.midnightcontrols.client.compat.mixin;
/**
* Represents an accessor to REI's EntryListWidget.

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat.mixin;
package eu.midnightdust.midnightcontrols.client.compat.mixin;
/**
* Represents an accessor to REI's EntryWidget.
@@ -19,5 +19,5 @@ package dev.lambdaurora.lambdacontrols.client.compat.mixin;
//@Mixin(value = EntryWidget.class, remap = false)
public interface EntryWidgetAccessor {
/*@Invoker("getCurrentEntry")
EntryStack lambdacontrols_getCurrentEntry();*/
EntryStack midnightcontrols_getCurrentEntry();*/
}

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat.mixin;
package eu.midnightdust.midnightcontrols.client.compat.mixin;
/**
* Represents an accessor to REI's RecipeViewingScreen.

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.compat.mixin;
package eu.midnightdust.midnightcontrols.client.compat.mixin;
/**
* Represents an accessor to REI's VillagerRecipeViewingScreen.
@@ -40,5 +40,5 @@ public interface VillagerRecipeViewingScreenAccessor {
ScrollingContainer getScrolling();
@Invoker("init")
void lambdacontrols_init();*/
void midnightcontrols_init();*/
}

View File

@@ -1,22 +1,21 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import dev.lambdaurora.lambdacontrols.client.ButtonState;
import eu.midnightdust.midnightcontrols.client.ButtonState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.GameOptions;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.aperlambda.lambdacommon.Identifier;
import org.aperlambda.lambdacommon.utils.Nameable;
import net.minecraft.util.Identifier;
import org.aperlambda.lambdacommon.utils.function.PairPredicate;
import org.aperlambda.lambdacommon.utils.function.Predicates;
import org.jetbrains.annotations.NotNull;
@@ -34,7 +33,7 @@ import static org.lwjgl.glfw.GLFW.*;
* @version 1.7.0
* @since 1.0.0
*/
public class ButtonBinding implements Nameable {
public class ButtonBinding {
public static final ButtonCategory MOVEMENT_CATEGORY;
public static final ButtonCategory GAMEPLAY_CATEGORY;
public static final ButtonCategory INVENTORY_CATEGORY;
@@ -230,7 +229,6 @@ public class ButtonBinding implements Nameable {
}
}
@Override
public @NotNull String getName() {
return this.key;
}
@@ -241,7 +239,7 @@ public class ButtonBinding implements Nameable {
* @return the translation key
*/
public @NotNull String getTranslationKey() {
return "lambdacontrols.action." + this.getName();
return "midnightcontrols.action." + this.getName();
}
public @NotNull Text getText() {
@@ -326,32 +324,36 @@ public class ButtonBinding implements Nameable {
public static @NotNull Text getLocalizedButtonName(int button) {
return switch (button % 500) {
case -1 -> new TranslatableText("key.keyboard.unknown");
case GLFW_GAMEPAD_BUTTON_A -> new TranslatableText("lambdacontrols.button.a");
case GLFW_GAMEPAD_BUTTON_B -> new TranslatableText("lambdacontrols.button.b");
case GLFW_GAMEPAD_BUTTON_X -> new TranslatableText("lambdacontrols.button.x");
case GLFW_GAMEPAD_BUTTON_Y -> new TranslatableText("lambdacontrols.button.y");
case GLFW_GAMEPAD_BUTTON_LEFT_BUMPER -> new TranslatableText("lambdacontrols.button.left_bumper");
case GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER -> new TranslatableText("lambdacontrols.button.right_bumper");
case GLFW_GAMEPAD_BUTTON_BACK -> new TranslatableText("lambdacontrols.button.back");
case GLFW_GAMEPAD_BUTTON_START -> new TranslatableText("lambdacontrols.button.start");
case GLFW_GAMEPAD_BUTTON_GUIDE -> new TranslatableText("lambdacontrols.button.guide");
case GLFW_GAMEPAD_BUTTON_LEFT_THUMB -> new TranslatableText("lambdacontrols.button.left_thumb");
case GLFW_GAMEPAD_BUTTON_RIGHT_THUMB -> new TranslatableText("lambdacontrols.button.right_thumb");
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> new TranslatableText("lambdacontrols.button.dpad_up");
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> new TranslatableText("lambdacontrols.button.dpad_right");
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> new TranslatableText("lambdacontrols.button.dpad_down");
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> new TranslatableText("lambdacontrols.button.dpad_left");
case 100 -> new TranslatableText("lambdacontrols.axis.left_x+");
case 101 -> new TranslatableText("lambdacontrols.axis.left_y+");
case 102 -> new TranslatableText("lambdacontrols.axis.right_x+");
case 103 -> new TranslatableText("lambdacontrols.axis.right_y+");
case 104 -> new TranslatableText("lambdacontrols.axis.left_trigger");
case 105 -> new TranslatableText("lambdacontrols.axis.right_trigger");
case 200 -> new TranslatableText("lambdacontrols.axis.left_x-");
case 201 -> new TranslatableText("lambdacontrols.axis.left_y-");
case 202 -> new TranslatableText("lambdacontrols.axis.right_x-");
case 203 -> new TranslatableText("lambdacontrols.axis.right_y-");
default -> new TranslatableText("lambdacontrols.button.unknown", button);
case GLFW_GAMEPAD_BUTTON_A -> new TranslatableText("midnightcontrols.button.a");
case GLFW_GAMEPAD_BUTTON_B -> new TranslatableText("midnightcontrols.button.b");
case GLFW_GAMEPAD_BUTTON_X -> new TranslatableText("midnightcontrols.button.x");
case GLFW_GAMEPAD_BUTTON_Y -> new TranslatableText("midnightcontrols.button.y");
case GLFW_GAMEPAD_BUTTON_LEFT_BUMPER -> new TranslatableText("midnightcontrols.button.left_bumper");
case GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER -> new TranslatableText("midnightcontrols.button.right_bumper");
case GLFW_GAMEPAD_BUTTON_BACK -> new TranslatableText("midnightcontrols.button.back");
case GLFW_GAMEPAD_BUTTON_START -> new TranslatableText("midnightcontrols.button.start");
case GLFW_GAMEPAD_BUTTON_GUIDE -> new TranslatableText("midnightcontrols.button.guide");
case GLFW_GAMEPAD_BUTTON_LEFT_THUMB -> new TranslatableText("midnightcontrols.button.left_thumb");
case GLFW_GAMEPAD_BUTTON_RIGHT_THUMB -> new TranslatableText("midnightcontrols.button.right_thumb");
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> new TranslatableText("midnightcontrols.button.dpad_up");
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> new TranslatableText("midnightcontrols.button.dpad_right");
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> new TranslatableText("midnightcontrols.button.dpad_down");
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> new TranslatableText("midnightcontrols.button.dpad_left");
case 100 -> new TranslatableText("midnightcontrols.axis.left_x+");
case 101 -> new TranslatableText("midnightcontrols.axis.left_y+");
case 102 -> new TranslatableText("midnightcontrols.axis.right_x+");
case 103 -> new TranslatableText("midnightcontrols.axis.right_y+");
case 104 -> new TranslatableText("midnightcontrols.axis.left_trigger");
case 105 -> new TranslatableText("midnightcontrols.axis.right_trigger");
case 200 -> new TranslatableText("midnightcontrols.axis.left_x-");
case 201 -> new TranslatableText("midnightcontrols.axis.left_y-");
case 202 -> new TranslatableText("midnightcontrols.axis.right_x-");
case 203 -> new TranslatableText("midnightcontrols.axis.right_y-");
case 15 -> new TranslatableText("midnightcontrols.button.l4");
case 16 -> new TranslatableText("midnightcontrols.button.l5");
case 17 -> new TranslatableText("midnightcontrols.button.r4");
case 18 -> new TranslatableText("midnightcontrols.button.r5");
default -> new TranslatableText("midnightcontrols.button.unknown", button);
};
}
@@ -385,17 +387,6 @@ public class ButtonBinding implements Nameable {
));
}
/**
* Returns a builder instance.
*
* @param identifier the identifier of the button binding
* @return the builder instanc
* @since 1.5.0
*/
public static Builder builder(@NotNull Identifier identifier) {
return new Builder(identifier);
}
/**
* Returns a builder instance.
*
@@ -403,7 +394,7 @@ public class ButtonBinding implements Nameable {
* @return the builder instance
* @since 1.5.0
*/
public static Builder builder(@NotNull net.minecraft.util.Identifier identifier) {
public static Builder builder(@NotNull Identifier identifier) {
return new Builder(identifier);
}
@@ -435,11 +426,7 @@ public class ButtonBinding implements Nameable {
}
public Builder(@NotNull Identifier identifier) {
this(identifier.getNamespace() + "." + identifier.getName());
}
public Builder(@NotNull net.minecraft.util.Identifier identifier) {
this(new Identifier(identifier.toString()));
this(identifier.getNamespace() + "." + identifier.getNamespace());
}
/**

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import net.minecraft.client.resource.language.I18n;
import org.aperlambda.lambdacommon.Identifier;

View File

@@ -1,16 +1,17 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import dev.lambdaurora.lambdacontrols.LambdaControls;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.MidnightControls;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.toast.SystemToast;
import net.minecraft.text.LiteralText;
@@ -96,7 +97,7 @@ public record Controller(int id) implements Nameable {
public static Controller byId(int id) {
if (id > GLFW.GLFW_JOYSTICK_LAST) {
LambdaControlsClient.get().log("Controller '" + id + "' doesn't exist.");
MidnightControlsClient.get().log("Controller '" + id + "' doesn't exist.");
id = GLFW.GLFW_JOYSTICK_LAST;
}
Controller controller;
@@ -144,10 +145,10 @@ public record Controller(int id) implements Nameable {
*/
public static void updateMappings() {
try {
if (!LambdaControlsClient.MAPPINGS_FILE.exists())
if (!MidnightControlsClient.MAPPINGS_FILE.exists())
return;
LambdaControlsClient.get().log("Updating controller mappings...");
var buffer = ioResourceToBuffer(LambdaControlsClient.MAPPINGS_FILE.getPath(), 1024);
MidnightControlsClient.get().log("Updating controller mappings...");
var buffer = ioResourceToBuffer(MidnightControlsClient.MAPPINGS_FILE.getPath(), 1024);
GLFW.glfwUpdateGamepadMappings(buffer);
} catch (IOException e) {
e.printStackTrace();
@@ -162,21 +163,21 @@ public record Controller(int id) implements Nameable {
var client = MinecraftClient.getInstance();
if (client != null) {
client.getToastManager().add(SystemToast.create(client, SystemToast.Type.TUTORIAL_HINT,
new TranslatableText("lambdacontrols.controller.mappings.error"), new LiteralText(string)));
new TranslatableText("midnightcontrols.controller.mappings.error"), new LiteralText(string)));
}
}
} catch (Throwable e) {
/* Ignored :concern: */
}
if (LambdaControlsClient.get().config.hasDebug()) {
if (MidnightControlsConfig.debug) {
for (int i = GLFW.GLFW_JOYSTICK_1; i <= GLFW.GLFW_JOYSTICK_16; i++) {
var controller = byId(i);
if (!controller.isConnected())
continue;
LambdaControls.get().log(String.format("Controller #%d name: \"%s\"\n GUID: %s\n Gamepad: %s",
MidnightControls.get().log(String.format("Controller #%d name: \"%s\"\n GUID: %s\n Gamepad: %s",
controller.id,
controller.getName(),
controller.getGuid(),

View File

@@ -1,21 +1,22 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import dev.lambdaurora.lambdacontrols.client.ButtonState;
import dev.lambdaurora.lambdacontrols.client.LambdaInput;
import dev.lambdaurora.lambdacontrols.client.mixin.AdvancementsScreenAccessor;
import dev.lambdaurora.lambdacontrols.client.mixin.CreativeInventoryScreenAccessor;
import dev.lambdaurora.lambdacontrols.client.mixin.RecipeBookWidgetAccessor;
import dev.lambdaurora.lambdacontrols.client.util.HandledScreenAccessor;
import eu.midnightdust.midnightcontrols.client.ButtonState;
import eu.midnightdust.midnightcontrols.client.MidnightInput;
import eu.midnightdust.midnightcontrols.client.mixin.AdvancementsScreenAccessor;
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
import eu.midnightdust.midnightcontrols.client.mixin.RecipeBookWidgetAccessor;
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.Framebuffer;
import net.minecraft.client.gui.screen.advancement.AdvancementsScreen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
@@ -60,7 +61,7 @@ public class InputHandlers {
nextTab = ItemGroup.GROUPS.length - 1;
else if (nextTab >= ItemGroup.GROUPS.length)
nextTab = 0;
inventory.lambdacontrols$setSelectedTab(ItemGroup.GROUPS[nextTab]);
inventory.midnightcontrols$setSelectedTab(ItemGroup.GROUPS[nextTab]);
return true;
} else if (client.currentScreen instanceof InventoryScreen inventoryScreen) {
var recipeBook = (RecipeBookWidgetAccessor) inventoryScreen.getRecipeBookWidget();
@@ -76,7 +77,7 @@ public class InputHandlers {
currentTab.setToggled(false);
recipeBook.setCurrentTab(currentTab = tabs.get(nextTab));
currentTab.setToggled(true);
recipeBook.lambdacontrols$refreshResults(true);
recipeBook.midnightcontrols$refreshResults(true);
return true;
} else if (client.currentScreen instanceof AdvancementsScreenAccessor screen) {
var tabs = screen.getTabs().values().stream().distinct().collect(Collectors.toList());
@@ -123,7 +124,7 @@ public class InputHandlers {
*/
public static boolean handleScreenshot(@NotNull MinecraftClient client, @NotNull ButtonBinding binding, float value, @NotNull ButtonState action) {
if (action == ButtonState.RELEASE)
ScreenshotRecorder.saveScreenshot(client.runDirectory, client.getWindow().getFramebufferWidth(), client.getWindow().getFramebufferHeight(), client.getFramebuffer(),
ScreenshotRecorder.saveScreenshot(client.runDirectory, client.getFramebuffer(),
text -> client.execute(() -> client.inGameHud.getChatHud().addMessage(text)));
return true;
}
@@ -152,7 +153,7 @@ public class InputHandlers {
double mouseY = client.mouse.getY() * (double) client.getWindow().getScaledHeight() / (double) client.getWindow().getHeight();
// Finds the hovered slot.
var mouseSlot = accessor.lambdacontrols$getSlotAt(mouseX, mouseY);
var mouseSlot = accessor.midnightcontrols$getSlotAt(mouseX, mouseY);
// Finds the closest slot in the GUI within 14 pixels.
Optional<Slot> closestSlot = inventory.getScreenHandler().slots.parallelStream()
@@ -239,7 +240,7 @@ public class InputHandlers {
public static boolean inNonInteractiveScreens(@NotNull MinecraftClient client, @NotNull ButtonBinding binding) {
if (client.currentScreen == null)
return false;
return !LambdaInput.isScreenInteractive(client.currentScreen);
return !MidnightInput.isScreenInteractive(client.currentScreen);
}
/**

View File

@@ -1,19 +1,18 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.client.ButtonState;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsConfig;
import dev.lambdaurora.lambdacontrols.client.util.MouseAccessor;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.client.ButtonState;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
import it.unimi.dsi.fastutil.ints.*;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import net.minecraft.client.MinecraftClient;
@@ -52,7 +51,7 @@ public class InputManager {
}
public void tick(@NotNull MinecraftClient client) {
if (LambdaControlsClient.get().config.getControlsMode() == ControlsMode.CONTROLLER) {
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER) {
this.controllerTick(client);
}
}
@@ -72,9 +71,9 @@ public class InputManager {
if (this.prevTargetMouseX != this.targetMouseX || this.prevTargetMouseY != this.targetMouseY) {
double mouseX = this.prevTargetMouseX + (this.targetMouseX - this.prevTargetMouseX) * client.getTickDelta() + 0.5;
double mouseY = this.prevTargetMouseY + (this.targetMouseY - this.prevTargetMouseY) * client.getTickDelta() + 0.5;
if (!LambdaControlsClient.get().config.hasVirtualMouse())
if (!MidnightControlsConfig.virtualMouse)
GLFW.glfwSetCursorPos(client.getWindow().getHandle(), mouseX, mouseY);
((MouseAccessor) client.mouse).lambdacontrols$onCursorPos(client.getWindow().getHandle(), mouseX, mouseY);
((MouseAccessor) client.mouse).midnightcontrols$onCursorPos(client.getWindow().getHandle(), mouseX, mouseY);
}
}
@@ -161,8 +160,7 @@ public class InputManager {
public static void sortBindings() {
synchronized (BINDINGS) {
var sorted = BINDINGS.stream()
.sorted(Collections.reverseOrder(Comparator.comparingInt(binding -> binding.getButton().length)))
.collect(Collectors.toList());
.sorted(Collections.reverseOrder(Comparator.comparingInt(binding -> binding.getButton().length))).toList();
BINDINGS.clear();
BINDINGS.addAll(sorted);
}
@@ -195,12 +193,10 @@ public class InputManager {
/**
* Loads the button bindings from configuration.
*
* @param config the configuration instance
*/
public static void loadButtonBindings(@NotNull LambdaControlsConfig config) {
public static void loadButtonBindings() {
var queue = new ArrayList<>(BINDINGS);
queue.forEach(config::loadButtonBinding);
queue.forEach(MidnightControlsConfig::loadButtonBinding);
}
/**
@@ -314,7 +310,7 @@ public class InputManager {
var states = new Object2ObjectOpenHashMap<ButtonBinding, ButtonStateValue>();
for (var binding : BINDINGS) {
var state = binding.isAvailable(client) ? getBindingState(binding) : ButtonState.NONE;
if (skipButtons.stream().anyMatch(btn -> containsButton(binding.getButton(), btn))) {
if (skipButtons.intStream().anyMatch(btn -> containsButton(binding.getButton(), btn))) {
if (binding.pressed)
state = ButtonState.RELEASE;
else

View File

@@ -1,16 +1,17 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import dev.lambdaurora.lambdacontrols.client.ButtonState;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.client.ButtonState;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerEntity;
import org.jetbrains.annotations.NotNull;
@@ -68,7 +69,7 @@ public final class MovementHandler implements PressAction {
this.shouldOverrideMovement = direction != 0;
if (LambdaControlsClient.get().config.hasAnalogMovement()) {
if (MidnightControlsConfig.analogMovement) {
value = (float) Math.pow(value, 2);
} else value = 1.f;

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.controller;
package eu.midnightdust.midnightcontrols.client.controller;
import dev.lambdaurora.lambdacontrols.client.ButtonState;
import dev.lambdaurora.lambdacontrols.client.util.KeyBindingAccessor;
import eu.midnightdust.midnightcontrols.client.ButtonState;
import eu.midnightdust.midnightcontrols.client.util.KeyBindingAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.StickyKeyBinding;
import org.jetbrains.annotations.NotNull;
@@ -31,7 +31,7 @@ public interface PressAction {
if (binding instanceof StickyKeyBinding)
binding.setPressed(button.pressed);
else
((KeyBindingAccessor) binding).lambdacontrols$handlePressState(button.isButtonDown());
((KeyBindingAccessor) binding).midnightcontrols$handlePressState(button.isButtonDown());
});
return true;
};

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
package eu.midnightdust.midnightcontrols.client.gui;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.Controller;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.controller.Controller;
import dev.lambdaurora.spruceui.Position;
import dev.lambdaurora.spruceui.option.SpruceOption;
import dev.lambdaurora.spruceui.widget.container.SpruceContainerWidget;
@@ -37,7 +37,7 @@ public class MappingsStringInputWidget extends SpruceContainerWidget {
protected MappingsStringInputWidget(Position position, int width, int height) {
super(position, width, height);
//super(new TranslatableText("lambdacontrols.menu.title.mappings.string"));
//super(new TranslatableText("midnightcontrols.menu.title.mappings.string"));
this.reloadMappingsOption = ReloadControllerMappingsOption.newOption(btn -> {
this.writeMappings();
@@ -59,13 +59,13 @@ public class MappingsStringInputWidget extends SpruceContainerWidget {
if (this.textArea != null) {
this.mappings = this.textArea.getText();
try {
var fw = new FileWriter(LambdaControlsClient.MAPPINGS_FILE, false);
var fw = new FileWriter(MidnightControlsClient.MAPPINGS_FILE, false);
fw.write(this.mappings);
fw.close();
} catch (IOException e) {
if (this.client != null)
this.client.getToastManager().add(SystemToast.create(this.client, SystemToast.Type.TUTORIAL_HINT,
new TranslatableText("lambdacontrols.controller.mappings.error.write"), LiteralText.EMPTY));
new TranslatableText("midnightcontrols.controller.mappings.error.write"), LiteralText.EMPTY));
e.printStackTrace();
}
}
@@ -80,9 +80,9 @@ public class MappingsStringInputWidget extends SpruceContainerWidget {
if (this.mappings != null)
mappings = this.mappings;
else if (LambdaControlsClient.MAPPINGS_FILE.exists()) {
else if (MidnightControlsClient.MAPPINGS_FILE.exists()) {
try {
mappings = String.join("\n", Files.readAllLines(LambdaControlsClient.MAPPINGS_FILE.toPath()));
mappings = String.join("\n", Files.readAllLines(MidnightControlsClient.MAPPINGS_FILE.toPath()));
this.mappings = mappings;
} catch (IOException e) {
/* Ignored */

View File

@@ -1,20 +1,21 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
package eu.midnightdust.midnightcontrols.client.gui;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.LambdaControlsConstants;
import dev.lambdaurora.lambdacontrols.client.HudSide;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.compat.LambdaControlsCompat;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.MidnightControlsConstants;
import eu.midnightdust.midnightcontrols.client.HudSide;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import dev.lambdaurora.spruceui.hud.Hud;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.resource.language.I18n;
@@ -28,14 +29,14 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Represents the LambdaControls HUD.
* Represents the midnightcontrols HUD.
*
* @author LambdAurora
* @version 1.7.0
* @since 1.0.0
*/
public class LambdaControlsHud extends Hud {
private final LambdaControlsClient mod;
public class MidnightControlsHud extends Hud {
private final MidnightControlsClient mod;
private MinecraftClient client;
private int attackWidth = 0;
private int attackButtonWidth = 0;
@@ -52,8 +53,8 @@ public class LambdaControlsHud extends Hud {
private String placeAction = "";
private int ticksDisplayedCrosshair = 0;
public LambdaControlsHud(@NotNull LambdaControlsClient mod) {
super(new Identifier(LambdaControlsConstants.NAMESPACE, "hud/button_indicator"));
public MidnightControlsHud(@NotNull MidnightControlsClient mod) {
super(new Identifier(MidnightControlsConstants.NAMESPACE, "hud/button_indicator"));
this.mod = mod;
}
@@ -62,26 +63,26 @@ public class LambdaControlsHud extends Hud {
super.init(client, screenWidth, screenHeight);
this.client = client;
this.inventoryWidth = this.width(ButtonBinding.INVENTORY);
this.inventoryButtonWidth = LambdaControlsRenderer.getBindingIconWidth(ButtonBinding.INVENTORY);
this.inventoryButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.INVENTORY);
this.swapHandsWidth = this.width(ButtonBinding.SWAP_HANDS);
this.swapHandsButtonWidth = LambdaControlsRenderer.getBindingIconWidth(ButtonBinding.SWAP_HANDS);
this.swapHandsButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.SWAP_HANDS);
this.dropItemWidth = this.width(ButtonBinding.DROP_ITEM);
this.dropItemButtonWidth = LambdaControlsRenderer.getBindingIconWidth(ButtonBinding.DROP_ITEM);
this.attackButtonWidth = LambdaControlsRenderer.getBindingIconWidth(ButtonBinding.ATTACK);
this.useButtonWidth = LambdaControlsRenderer.getBindingIconWidth(ButtonBinding.USE);
this.dropItemButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.DROP_ITEM);
this.attackButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.ATTACK);
this.useButtonWidth = MidnightControlsRenderer.getBindingIconWidth(ButtonBinding.USE);
}
/**
* Renders the LambdaControls' HUD.
* Renders the midnightcontrols' HUD.
*/
@Override
public void render(MatrixStack matrices, float tickDelta) {
if (this.mod.config.getControlsMode() == ControlsMode.CONTROLLER && this.client.currentScreen == null) {
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && this.client.currentScreen == null) {
int y = bottom(2);
this.renderFirstIcons(matrices, this.mod.config.getHudSide() == HudSide.LEFT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderSecondIcons(matrices, this.mod.config.getHudSide() == HudSide.RIGHT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderFirstSection(matrices, this.mod.config.getHudSide() == HudSide.LEFT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderSecondSection(matrices, this.mod.config.getHudSide() == HudSide.RIGHT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderFirstIcons(matrices, MidnightControlsConfig.hudSide == HudSide.LEFT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderSecondIcons(matrices, MidnightControlsConfig.hudSide == HudSide.RIGHT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderFirstSection(matrices, MidnightControlsConfig.hudSide == HudSide.LEFT ? 2 : client.getWindow().getScaledWidth() - 2, y);
this.renderSecondSection(matrices, MidnightControlsConfig.hudSide == HudSide.RIGHT ? 2 : client.getWindow().getScaledWidth() - 2, y);
}
if (this.mod.reacharound.isLastReacharoundVertical()) {
@@ -100,14 +101,14 @@ public class LambdaControlsHud extends Hud {
public void renderFirstIcons(MatrixStack matrices, int x, int y) {
int offset = 2 + this.inventoryWidth + this.inventoryButtonWidth + 4;
int currentX = this.mod.config.getHudSide() == HudSide.LEFT ? x : x - this.inventoryButtonWidth;
int currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x : x - this.inventoryButtonWidth;
this.drawButton(matrices, currentX, y, ButtonBinding.INVENTORY, true);
this.drawButton(matrices, currentX += (this.mod.config.getHudSide() == HudSide.LEFT ? offset : -offset), y, ButtonBinding.SWAP_HANDS, true);
this.drawButton(matrices, currentX += (MidnightControlsConfig.hudSide == HudSide.LEFT ? offset : -offset), y, ButtonBinding.SWAP_HANDS, true);
offset = 2 + this.swapHandsWidth + this.dropItemButtonWidth + 4;
if (this.client.options.showSubtitles && this.mod.config.getHudSide() == HudSide.RIGHT) {
if (this.client.options.showSubtitles && MidnightControlsConfig.hudSide == HudSide.RIGHT) {
currentX += -offset;
} else {
currentX = this.mod.config.getHudSide() == HudSide.LEFT ? x : x - this.dropItemButtonWidth;
currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x : x - this.dropItemButtonWidth;
y -= 24;
}
this.drawButton(matrices, currentX, y, ButtonBinding.DROP_ITEM, !this.client.player.getMainHandStack().isEmpty());
@@ -117,11 +118,11 @@ public class LambdaControlsHud extends Hud {
int offset;
int currentX = x;
if (!this.placeAction.isEmpty()) {
if (this.mod.config.getHudSide() == HudSide.LEFT)
if (MidnightControlsConfig.hudSide == HudSide.LEFT)
currentX -= this.useButtonWidth;
this.drawButton(matrices, currentX, y, ButtonBinding.USE, true);
offset = 2 + this.useWidth + 4;
if (this.client.options.showSubtitles && this.mod.config.getHudSide() == HudSide.LEFT) {
if (this.client.options.showSubtitles && MidnightControlsConfig.hudSide == HudSide.LEFT) {
currentX -= offset;
} else {
currentX = x;
@@ -129,23 +130,23 @@ public class LambdaControlsHud extends Hud {
}
}
if (this.mod.config.getHudSide() == HudSide.LEFT)
if (MidnightControlsConfig.hudSide == HudSide.LEFT)
currentX -= this.attackButtonWidth;
this.drawButton(matrices, currentX, y, ButtonBinding.ATTACK, this.attackWidth != 0);
}
public void renderFirstSection(MatrixStack matrices, int x, int y) {
int currentX = this.mod.config.getHudSide() == HudSide.LEFT ? x + this.inventoryButtonWidth + 2 : x - this.inventoryButtonWidth - 2 - this.inventoryWidth;
int currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x + this.inventoryButtonWidth + 2 : x - this.inventoryButtonWidth - 2 - this.inventoryWidth;
this.drawTip(matrices, currentX, y, ButtonBinding.INVENTORY, true);
currentX += this.mod.config.getHudSide() == HudSide.LEFT ? this.inventoryWidth + 4 + this.swapHandsButtonWidth + 2
currentX += MidnightControlsConfig.hudSide == HudSide.LEFT ? this.inventoryWidth + 4 + this.swapHandsButtonWidth + 2
: -this.swapHandsWidth - 2 - this.swapHandsButtonWidth - 4;
this.drawTip(matrices, currentX, y, ButtonBinding.SWAP_HANDS, true);
if (this.client.options.showSubtitles && this.mod.config.getHudSide() == HudSide.RIGHT) {
if (this.client.options.showSubtitles && MidnightControlsConfig.hudSide == HudSide.RIGHT) {
currentX += -this.dropItemWidth - 2 - this.dropItemButtonWidth - 4;
} else {
y -= 24;
currentX = this.mod.config.getHudSide() == HudSide.LEFT ? x + this.dropItemButtonWidth + 2 : x - this.dropItemButtonWidth - 2 - this.dropItemWidth;
currentX = MidnightControlsConfig.hudSide == HudSide.LEFT ? x + this.dropItemButtonWidth + 2 : x - this.dropItemButtonWidth - 2 - this.dropItemWidth;
}
this.drawTip(matrices, currentX, y, ButtonBinding.DROP_ITEM, !this.client.player.getMainHandStack().isEmpty());
}
@@ -154,11 +155,11 @@ public class LambdaControlsHud extends Hud {
int currentX = x;
if (!this.placeAction.isEmpty()) {
currentX += this.mod.config.getHudSide() == HudSide.RIGHT ? this.useButtonWidth + 2 : -this.useButtonWidth - 2 - this.useWidth;
currentX += MidnightControlsConfig.hudSide == HudSide.RIGHT ? this.useButtonWidth + 2 : -this.useButtonWidth - 2 - this.useWidth;
this.drawTip(matrices, currentX, y, this.placeAction, true);
if (this.client.options.showSubtitles && this.mod.config.getHudSide() == HudSide.LEFT) {
if (this.client.options.showSubtitles && MidnightControlsConfig.hudSide == HudSide.LEFT) {
currentX -= 4;
} else {
currentX = x;
@@ -166,7 +167,7 @@ public class LambdaControlsHud extends Hud {
}
}
currentX += this.mod.config.getHudSide() == HudSide.RIGHT ? this.attackButtonWidth + 2 : -this.attackButtonWidth - 2 - this.attackWidth;
currentX += MidnightControlsConfig.hudSide == HudSide.RIGHT ? this.attackButtonWidth + 2 : -this.attackButtonWidth - 2 - this.attackWidth;
this.drawTip(matrices, currentX, y, this.attackAction, this.attackWidth != 0);
}
@@ -174,7 +175,7 @@ public class LambdaControlsHud extends Hud {
@Override
public void tick() {
super.tick();
if (this.mod.config.getControlsMode() == ControlsMode.CONTROLLER) {
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER) {
if (this.client.crosshairTarget == null)
return;
@@ -191,7 +192,7 @@ public class LambdaControlsHud extends Hud {
else
this.placeHitResult = null;
this.attackAction = this.client.crosshairTarget.getType() == HitResult.Type.BLOCK ? "lambdacontrols.action.hit" : ButtonBinding.ATTACK.getTranslationKey();
this.attackAction = this.client.crosshairTarget.getType() == HitResult.Type.BLOCK ? "midnightcontrols.action.hit" : ButtonBinding.ATTACK.getTranslationKey();
this.attackWidth = this.width(attackAction);
}
@@ -202,7 +203,7 @@ public class LambdaControlsHud extends Hud {
this.ticksDisplayedCrosshair = 0;
}
var customAttackAction = LambdaControlsCompat.getAttackActionAt(this.client, this.placeHitResult);
var customAttackAction = MidnightControlsCompat.getAttackActionAt(this.client, this.placeHitResult);
if (customAttackAction != null) {
this.attackAction = customAttackAction;
this.attackWidth = this.width(customAttackAction);
@@ -218,13 +219,13 @@ public class LambdaControlsHud extends Hud {
placeAction = "";
} else {
if (this.placeHitResult != null && stack.getItem() instanceof BlockItem) {
placeAction = "lambdacontrols.action.place";
placeAction = "midnightcontrols.action.place";
} else {
placeAction = ButtonBinding.USE.getTranslationKey();
}
}
var customUseAction = LambdaControlsCompat.getUseActionAt(this.client, this.placeHitResult);
var customUseAction = MidnightControlsCompat.getUseActionAt(this.client, this.placeHitResult);
if (customUseAction != null)
placeAction = customUseAction;
@@ -244,7 +245,7 @@ public class LambdaControlsHud extends Hud {
}
private int bottom(int y) {
return this.client.getWindow().getScaledHeight() - y - LambdaControlsRenderer.ICON_SIZE;
return this.client.getWindow().getScaledHeight() - y - MidnightControlsRenderer.ICON_SIZE;
}
private int width(@NotNull ButtonBinding binding) {
@@ -259,7 +260,7 @@ public class LambdaControlsHud extends Hud {
private void drawButton(MatrixStack matrices, int x, int y, @NotNull ButtonBinding button, boolean display) {
if (display)
LambdaControlsRenderer.drawButton(matrices, x, y, button, this.client);
MidnightControlsRenderer.drawButton(matrices, x, y, button, this.client);
}
private void drawTip(MatrixStack matrices, int x, int y, @NotNull ButtonBinding button, boolean display) {
@@ -270,7 +271,7 @@ public class LambdaControlsHud extends Hud {
if (!display)
return;
var translatedAction = I18n.translate(action);
int textY = (LambdaControlsRenderer.ICON_SIZE / 2 - this.client.textRenderer.fontHeight / 2) + 1;
int textY = (MidnightControlsRenderer.ICON_SIZE / 2 - this.client.textRenderer.fontHeight / 2) + 1;
this.client.textRenderer.draw(matrices, translatedAction, (float) x, (float) (y + textY), 14737632);
}
}

View File

@@ -1,20 +1,21 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
package eu.midnightdust.midnightcontrols.client.gui;
import com.mojang.blaze3d.systems.RenderSystem;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.LambdaInput;
import dev.lambdaurora.lambdacontrols.client.compat.LambdaControlsCompat;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.util.HandledScreenAccessor;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.MidnightInput;
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawableHelper;
@@ -25,13 +26,13 @@ import org.jetbrains.annotations.NotNull;
import org.lwjgl.glfw.GLFW;
/**
* Represents the LambdaControls renderer.
* Represents the midnightcontrols renderer.
*
* @author LambdAurora
* @version 1.7.0
* @since 1.2.0
*/
public class LambdaControlsRenderer {
public class MidnightControlsRenderer {
public static final int ICON_SIZE = 20;
private static final int BUTTON_SIZE = 15;
private static final int AXIS_SIZE = 18;
@@ -96,7 +97,6 @@ public class LambdaControlsRenderer {
return new ButtonSize(length, height);
}
@SuppressWarnings("deprecated")
public static int drawButton(MatrixStack matrices, int x, int y, int button, @NotNull MinecraftClient client) {
boolean second = false;
if (button == -1)
@@ -106,10 +106,14 @@ public class LambdaControlsRenderer {
second = true;
}
int controllerType = LambdaControlsClient.get().config.getControllerType().getId();
int controllerType = MidnightControlsConfig.controllerType.getId();
boolean axis = false;
int buttonOffset = button * 15;
switch (button) {
case 15 -> buttonOffset = 0;
case 16 -> buttonOffset = 18;
case 17 -> buttonOffset = 36;
case 18 -> buttonOffset = 54;
case GLFW.GLFW_GAMEPAD_BUTTON_LEFT_BUMPER -> buttonOffset = 7 * 15;
case GLFW.GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER -> buttonOffset = 8 * 15;
case GLFW.GLFW_GAMEPAD_BUTTON_BACK -> buttonOffset = 4 * 15;
@@ -153,14 +157,14 @@ public class LambdaControlsRenderer {
case GLFW.GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER + 100, GLFW.GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER + 200 -> buttonOffset = 10 * 15;
}
RenderSystem.setShaderTexture(0, axis ? LambdaControlsClient.CONTROLLER_AXIS : LambdaControlsClient.CONTROLLER_BUTTONS);
RenderSystem.setShaderTexture(0, axis ? MidnightControlsClient.CONTROLLER_AXIS : button >= 15 && button <= 19 ? MidnightControlsClient.CONTROLLER_EXPANDED :MidnightControlsClient.CONTROLLER_BUTTONS);
RenderSystem.disableDepthTest();
int assetSize = axis ? AXIS_SIZE : BUTTON_SIZE;
int assetSize = axis || (button >= 15 && button <= 18) ? AXIS_SIZE : BUTTON_SIZE;
RenderSystem.setShaderColor(1.f, second ? 0.f : 1.f, 1.f, 1.f);
DrawableHelper.drawTexture(matrices, x + (ICON_SIZE / 2 - assetSize / 2), y + (ICON_SIZE / 2 - assetSize / 2),
(float) buttonOffset, (float) (controllerType * (axis ? AXIS_SIZE : BUTTON_SIZE)),
(float) buttonOffset, (float) (controllerType * assetSize),
assetSize, assetSize,
256, 256);
RenderSystem.enableDepthTest();
@@ -177,7 +181,7 @@ public class LambdaControlsRenderer {
int buttonWidth = drawButton(matrices, x, y, button, client).length();
var translatedAction = I18n.translate(action);
int textY = (LambdaControlsRenderer.ICON_SIZE / 2 - client.textRenderer.fontHeight / 2) + 1;
int textY = (MidnightControlsRenderer.ICON_SIZE / 2 - client.textRenderer.fontHeight / 2) + 1;
return client.textRenderer.drawWithShadow(matrices, translatedAction, (float) (x + buttonWidth + 2), (float) (y + textY), 14737632);
}
@@ -190,8 +194,8 @@ public class LambdaControlsRenderer {
}
public static void renderVirtualCursor(@NotNull MatrixStack matrices, @NotNull MinecraftClient client) {
if (!LambdaControlsClient.get().config.hasVirtualMouse() || (client.currentScreen == null
|| LambdaInput.isScreenInteractive(client.currentScreen)))
if (!MidnightControlsConfig.virtualMouse || (client.currentScreen == null
|| MidnightInput.isScreenInteractive(client.currentScreen)))
return;
int mouseX = (int) (client.mouse.getX() * (double) client.getWindow().getScaledWidth() / (double) client.getWindow().getWidth());
@@ -203,7 +207,7 @@ public class LambdaControlsRenderer {
int guiLeft = inventoryScreen.getX();
int guiTop = inventoryScreen.getY();
Slot slot = inventoryScreen.lambdacontrols$getSlotAt(mouseX, mouseY);
Slot slot = inventoryScreen.midnightcontrols$getSlotAt(mouseX, mouseY);
if (slot != null) {
mouseX = guiLeft + slot.x;
@@ -213,7 +217,7 @@ public class LambdaControlsRenderer {
}
if (!hoverSlot) {
var slot = LambdaControlsCompat.getSlotAt(client.currentScreen, mouseX, mouseY);
var slot = MidnightControlsCompat.getSlotAt(client.currentScreen, mouseX, mouseY);
if (slot != null) {
mouseX = slot.x();
@@ -243,9 +247,9 @@ public class LambdaControlsRenderer {
RenderSystem.disableDepthTest();
RenderSystem.setShaderColor(1.f, 1.f, 1.f, 1.f);
RenderSystem.setShaderTexture(0, LambdaControlsClient.CURSOR_TEXTURE);
RenderSystem.setShaderTexture(0, MidnightControlsClient.CURSOR_TEXTURE);
DrawableHelper.drawTexture(matrices, x, y,
hoverSlot ? 16.f : 0.f, LambdaControlsClient.get().config.getVirtualMouseSkin().ordinal() * 16.f,
hoverSlot ? 16.f : 0.f, MidnightControlsConfig.virtualMouseSkin.ordinal() * 16.f,
16, 16, 32, 64);
RenderSystem.enableDepthTest();
}

View File

@@ -1,19 +1,19 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
package eu.midnightdust.midnightcontrols.client.gui;
import dev.lambdaurora.lambdacontrols.LambdaControls;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsConfig;
import dev.lambdaurora.lambdacontrols.client.controller.Controller;
import dev.lambdaurora.lambdacontrols.client.gui.widget.ControllerControlsWidget;
import eu.midnightdust.midnightcontrols.MidnightControls;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.controller.Controller;
import eu.midnightdust.midnightcontrols.client.gui.widget.ControllerControlsWidget;
import dev.lambdaurora.spruceui.Position;
import dev.lambdaurora.spruceui.SpruceTexts;
import dev.lambdaurora.spruceui.option.*;
@@ -38,13 +38,12 @@ import net.minecraft.util.Util;
import org.lwjgl.glfw.GLFW;
/**
* Represents the LambdaControls settings screen.
* Represents the midnightcontrols settings screen.
*/
public class LambdaControlsSettingsScreen extends SpruceScreen {
public class MidnightControlsSettingsScreen extends SpruceScreen {
private static final Text SDL2_GAMEPAD_TOOL = new LiteralText("SDL2 Gamepad Tool").formatted(Formatting.GREEN);
public static final String GAMEPAD_TOOL_URL = "https://generalarcade.com/gamepadtool/";
final LambdaControlsClient mod = LambdaControlsClient.get();
private final LambdaControlsConfig config = this.mod.config;
final MidnightControlsClient mod = MidnightControlsClient.get();
private final Screen parent;
// General options
private final SpruceOption inputModeOption;
@@ -68,17 +67,17 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
private final SpruceOption hudSideOption;
// Controller options
private final SpruceOption controllerOption =
new SpruceCyclingOption("lambdacontrols.menu.controller",
new SpruceCyclingOption("midnightcontrols.menu.controller",
amount -> {
int id = this.config.getController().id();
int id = MidnightControlsConfig.getController().id();
id += amount;
if (id > GLFW.GLFW_JOYSTICK_LAST)
id = GLFW.GLFW_JOYSTICK_1;
id = searchNextAvailableController(id, false);
this.config.setController(Controller.byId(id));
MidnightControlsConfig.setController(Controller.byId(id));
},
option -> {
var controller = this.config.getController();
var controller = MidnightControlsConfig.getController();
var controllerName = controller.getName();
if (!controller.isConnected())
return option.getDisplayText(new LiteralText(controllerName).formatted(Formatting.RED));
@@ -87,16 +86,16 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
else
return option.getDisplayText(new LiteralText(controllerName));
}, null);
private final SpruceOption secondControllerOption = new SpruceCyclingOption("lambdacontrols.menu.controller2",
private final SpruceOption secondControllerOption = new SpruceCyclingOption("midnightcontrols.menu.controller2",
amount -> {
int id = this.config.getSecondController().map(Controller::id).orElse(-1);
int id = MidnightControlsConfig.getSecondController().map(Controller::id).orElse(-1);
id += amount;
if (id > GLFW.GLFW_JOYSTICK_LAST)
id = -1;
id = searchNextAvailableController(id, true);
this.config.setSecondController(id == -1 ? null : Controller.byId(id));
MidnightControlsConfig.setSecondController(id == -1 ? null : Controller.byId(id));
},
option -> this.config.getSecondController().map(controller -> {
option -> MidnightControlsConfig.getSecondController().map(controller -> {
var controllerName = controller.getName();
if (!controller.isConnected())
return option.getDisplayText(new LiteralText(controllerName).formatted(Formatting.RED));
@@ -105,23 +104,23 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
else
return option.getDisplayText(new LiteralText(controllerName));
}).orElse(option.getDisplayText(SpruceTexts.OPTIONS_OFF.shallowCopy().formatted(Formatting.RED))),
new TranslatableText("lambdacontrols.tooltip.controller2"));
new TranslatableText("midnightcontrols.tooltip.controller2"));
private final SpruceOption unfocusedInputOption;
private final SpruceOption invertsRightXAxis;
private final SpruceOption invertsRightYAxis;
private final SpruceOption rightDeadZoneOption;
private final SpruceOption leftDeadZoneOption;
private final SpruceOption[] maxAnalogValueOptions = new SpruceOption[]{
maxAnalogValueOption(this.config, "lambdacontrols.menu.max_left_x_value", GLFW.GLFW_GAMEPAD_AXIS_LEFT_X),
maxAnalogValueOption(this.config, "lambdacontrols.menu.max_left_y_value", GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y),
maxAnalogValueOption(this.config, "lambdacontrols.menu.max_right_x_value", GLFW.GLFW_GAMEPAD_AXIS_RIGHT_X),
maxAnalogValueOption(this.config, "lambdacontrols.menu.max_right_y_value", GLFW.GLFW_GAMEPAD_AXIS_RIGHT_Y)
maxAnalogValueOption("midnightcontrols.menu.max_left_x_value", GLFW.GLFW_GAMEPAD_AXIS_LEFT_X),
maxAnalogValueOption("midnightcontrols.menu.max_left_y_value", GLFW.GLFW_GAMEPAD_AXIS_LEFT_Y),
maxAnalogValueOption("midnightcontrols.menu.max_right_x_value", GLFW.GLFW_GAMEPAD_AXIS_RIGHT_X),
maxAnalogValueOption("midnightcontrols.menu.max_right_y_value", GLFW.GLFW_GAMEPAD_AXIS_RIGHT_Y)
};
private static SpruceOption maxAnalogValueOption(LambdaControlsConfig config, String key, int axis) {
private static SpruceOption maxAnalogValueOption(String key, int axis) {
return new SpruceDoubleOption(key, .25f, 1.f, 0.05f,
() -> config.getAxisMaxValue(axis),
newValue -> config.setAxisMaxValue(axis, newValue),
() -> MidnightControlsConfig.getAxisMaxValue(axis),
newValue -> MidnightControlsConfig.setAxisMaxValue(axis, newValue),
option -> option.getDisplayText(new LiteralText(String.format("%.2f", option.get()))),
new TranslatableText(key.replace("menu", "tooltip"))
);
@@ -145,125 +144,102 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
return connected ? newId : searchNextAvailableController(newId, allowNone);
}
public LambdaControlsSettingsScreen(Screen parent, boolean hideControls) {
super(new TranslatableText("lambdacontrols.title.settings"));
public MidnightControlsSettingsScreen(Screen parent, boolean hideControls) {
super(new TranslatableText("midnightcontrols.title.settings"));
this.parent = parent;
// General options
this.inputModeOption = new SpruceCyclingOption("lambdacontrols.menu.controls_mode",
this.inputModeOption = new SpruceCyclingOption("midnightcontrols.menu.controls_mode",
amount -> {
var next = this.config.getControlsMode().next();
this.config.setControlsMode(next);
this.config.save();
var next = MidnightControlsConfig.controlsMode.next();
MidnightControlsConfig.controlsMode = next;
MidnightControlsConfig.save();
if (this.client.player != null) {
ClientPlayNetworking.getSender().sendPacket(LambdaControls.CONTROLS_MODE_CHANNEL, this.mod.makeControlsModeBuffer(next));
ClientPlayNetworking.getSender().sendPacket(MidnightControls.CONTROLS_MODE_CHANNEL, this.mod.makeControlsModeBuffer(next));
}
}, option -> option.getDisplayText(new TranslatableText(this.config.getControlsMode().getTranslationKey())),
new TranslatableText("lambdacontrols.tooltip.controls_mode"));
this.autoSwitchModeOption = new SpruceToggleBooleanOption("lambdacontrols.menu.auto_switch_mode", this.config::hasAutoSwitchMode,
this.config::setAutoSwitchMode, new TranslatableText("lambdacontrols.tooltip.auto_switch_mode"));
this.rotationSpeedOption = new SpruceDoubleOption("lambdacontrols.menu.rotation_speed", 0.0, 100.0, .5f,
this.config::getRotationSpeed,
newValue -> {
synchronized (this.config) {
this.config.setRotationSpeed(newValue);
}
}, option -> option.getDisplayText(new LiteralText(String.valueOf(option.get()))),
new TranslatableText("lambdacontrols.tooltip.rotation_speed"));
this.mouseSpeedOption = new SpruceDoubleOption("lambdacontrols.menu.mouse_speed", 0.0, 150.0, .5f,
this.config::getMouseSpeed,
newValue -> {
synchronized (this.config) {
this.config.setMouseSpeed(newValue);
}
}, option -> option.getDisplayText(new LiteralText(String.valueOf(option.get()))),
new TranslatableText("lambdacontrols.tooltip.mouse_speed"));
}, option -> option.getDisplayText(new TranslatableText(MidnightControlsConfig.controlsMode.getTranslationKey())),
new TranslatableText("midnightcontrols.tooltip.controls_mode"));
this.autoSwitchModeOption = new SpruceToggleBooleanOption("midnightcontrols.menu.auto_switch_mode", () -> MidnightControlsConfig.autoSwitchMode,
value -> MidnightControlsConfig.autoSwitchMode = value, new TranslatableText("midnightcontrols.tooltip.auto_switch_mode"));
this.rotationSpeedOption = new SpruceDoubleOption("midnightcontrols.menu.rotation_speed", 0.0, 100.0, .5f,
() -> MidnightControlsConfig.rotationSpeed,
value -> MidnightControlsConfig.rotationSpeed = value, option -> option.getDisplayText(new LiteralText(String.valueOf(option.get()))),
new TranslatableText("midnightcontrols.tooltip.rotation_speed"));
this.mouseSpeedOption = new SpruceDoubleOption("midnightcontrols.menu.mouse_speed", 0.0, 150.0, .5f,
() -> MidnightControlsConfig.mouseSpeed,
value -> MidnightControlsConfig.mouseSpeed = value, option -> option.getDisplayText(new LiteralText(String.valueOf(option.get()))),
new TranslatableText("midnightcontrols.tooltip.mouse_speed"));
this.resetOption = SpruceSimpleActionOption.reset(btn -> {
this.config.reset();
// TODO
MidnightControlsConfig.init("midnightcontrols", MidnightControlsConfig.class);
var client = MinecraftClient.getInstance();
this.init(client, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
});
// Gameplay options
this.analogMovementOption = new SpruceToggleBooleanOption("lambdacontrols.menu.analog_movement",
this.config::hasAnalogMovement, this.config::setAnalogMovement,
new TranslatableText("lambdacontrols.tooltip.analog_movement"));
this.analogMovementOption = new SpruceToggleBooleanOption("midnightcontrols.menu.analog_movement",
() -> MidnightControlsConfig.analogMovement, value -> MidnightControlsConfig.analogMovement = value,
new TranslatableText("midnightcontrols.tooltip.analog_movement"));
this.autoJumpOption = new SpruceToggleBooleanOption("options.autoJump",
() -> this.client.options.autoJump,
newValue -> this.client.options.autoJump = newValue,
null);
this.fastBlockPlacingOption = new SpruceToggleBooleanOption("lambdacontrols.menu.fast_block_placing", this.config::hasFastBlockPlacing,
this.config::setFastBlockPlacing, new TranslatableText("lambdacontrols.tooltip.fast_block_placing"));
this.frontBlockPlacingOption = new SpruceToggleBooleanOption("lambdacontrols.menu.reacharound.horizontal", this.config::hasFrontBlockPlacing,
this.config::setFrontBlockPlacing, new TranslatableText("lambdacontrols.tooltip.reacharound.horizontal"));
this.verticalReacharoundOption = new SpruceToggleBooleanOption("lambdacontrols.menu.reacharound.vertical", this.config::hasVerticalReacharound,
this.config::setVerticalReacharound, new TranslatableText("lambdacontrols.tooltip.reacharound.vertical"));
this.flyDriftingOption = new SpruceToggleBooleanOption("lambdacontrols.menu.fly_drifting", this.config::hasFlyDrifting,
this.config::setFlyDrifting, new TranslatableText("lambdacontrols.tooltip.fly_drifting"));
this.flyVerticalDriftingOption = new SpruceToggleBooleanOption("lambdacontrols.menu.fly_drifting_vertical", this.config::hasFlyVerticalDrifting,
this.config::setFlyVerticalDrifting, new TranslatableText("lambdacontrols.tooltip.fly_drifting_vertical"));
this.fastBlockPlacingOption = new SpruceToggleBooleanOption("midnightcontrols.menu.fast_block_placing", () -> MidnightControlsConfig.fastBlockPlacing,
value -> MidnightControlsConfig.fastBlockPlacing = value, new TranslatableText("midnightcontrols.tooltip.fast_block_placing"));
this.frontBlockPlacingOption = new SpruceToggleBooleanOption("midnightcontrols.menu.reacharound.horizontal", () -> MidnightControlsConfig.horizontalReacharound,
value -> MidnightControlsConfig.horizontalReacharound = value, new TranslatableText("midnightcontrols.tooltip.reacharound.horizontal"));
this.verticalReacharoundOption = new SpruceToggleBooleanOption("midnightcontrols.menu.reacharound.vertical", () -> MidnightControlsConfig.verticalReacharound,
value -> MidnightControlsConfig.verticalReacharound = value, new TranslatableText("midnightcontrols.tooltip.reacharound.vertical"));
this.flyDriftingOption = new SpruceToggleBooleanOption("midnightcontrols.menu.fly_drifting", () -> MidnightControlsConfig.flyDrifting,
value -> MidnightControlsConfig.flyDrifting = value, new TranslatableText("midnightcontrols.tooltip.fly_drifting"));
this.flyVerticalDriftingOption = new SpruceToggleBooleanOption("midnightcontrols.menu.fly_drifting_vertical", () -> MidnightControlsConfig.verticalFlyDrifting,
value -> MidnightControlsConfig.verticalFlyDrifting = value, new TranslatableText("midnightcontrols.tooltip.fly_drifting_vertical"));
// Appearance options
this.controllerTypeOption = new SpruceCyclingOption("lambdacontrols.menu.controller_type",
amount -> this.config.setControllerType(this.config.getControllerType().next()),
option -> option.getDisplayText(this.config.getControllerType().getTranslatedText()),
new TranslatableText("lambdacontrols.tooltip.controller_type"));
this.virtualMouseSkinOption = new SpruceCyclingOption("lambdacontrols.menu.virtual_mouse.skin",
amount -> this.config.setVirtualMouseSkin(this.config.getVirtualMouseSkin().next()),
option -> option.getDisplayText(this.config.getVirtualMouseSkin().getTranslatedText()),
this.controllerTypeOption = new SpruceCyclingOption("midnightcontrols.menu.controller_type",
amount -> MidnightControlsConfig.controllerType = MidnightControlsConfig.controllerType.next(),
option -> option.getDisplayText(MidnightControlsConfig.controllerType.getTranslatedText()),
new TranslatableText("midnightcontrols.tooltip.controller_type"));
this.virtualMouseSkinOption = new SpruceCyclingOption("midnightcontrols.menu.virtual_mouse.skin",
amount -> MidnightControlsConfig.virtualMouseSkin = MidnightControlsConfig.virtualMouseSkin.next(),
option -> option.getDisplayText(MidnightControlsConfig.virtualMouseSkin.getTranslatedText()),
null);
this.hudEnableOption = new SpruceToggleBooleanOption("lambdacontrols.menu.hud_enable", this.config::isHudEnabled,
this.mod::setHudEnabled, new TranslatableText("lambdacontrols.tooltip.hud_enable"));
this.hudSideOption = new SpruceCyclingOption("lambdacontrols.menu.hud_side",
amount -> this.config.setHudSide(this.config.getHudSide().next()),
option -> option.getDisplayText(this.config.getHudSide().getTranslatedText()),
new TranslatableText("lambdacontrols.tooltip.hud_side"));
this.hudEnableOption = new SpruceToggleBooleanOption("midnightcontrols.menu.hud_enable", () -> MidnightControlsConfig.hudEnable,
this.mod::setHudEnabled, new TranslatableText("midnightcontrols.tooltip.hud_enable"));
this.hudSideOption = new SpruceCyclingOption("midnightcontrols.menu.hud_side",
amount -> MidnightControlsConfig.hudSide = MidnightControlsConfig.hudSide.next(),
option -> option.getDisplayText(MidnightControlsConfig.hudSide.getTranslatedText()),
new TranslatableText("midnightcontrols.tooltip.hud_side"));
// Controller options
this.rightDeadZoneOption = new SpruceDoubleOption("lambdacontrols.menu.right_dead_zone", 0.05, 1.0, .05f,
this.config::getRightDeadZone,
newValue -> {
synchronized (this.config) {
this.config.setRightDeadZone(newValue);
}
}, option -> {
this.rightDeadZoneOption = new SpruceDoubleOption("midnightcontrols.menu.right_dead_zone", 0.05, 1.0, .05f,
() -> MidnightControlsConfig.rightDeadZone,
value -> MidnightControlsConfig.rightDeadZone = value, option -> {
var value = String.valueOf(option.get());
return option.getDisplayText(new LiteralText(value.substring(0, Math.min(value.length(), 5))));
}, new TranslatableText("lambdacontrols.tooltip.right_dead_zone"));
this.leftDeadZoneOption = new SpruceDoubleOption("lambdacontrols.menu.left_dead_zone", 0.05, 1.0, .05f,
this.config::getLeftDeadZone,
newValue -> {
synchronized (this.config) {
this.config.setLeftDeadZone(newValue);
}
}, option -> {
}, new TranslatableText("midnightcontrols.tooltip.right_dead_zone"));
this.leftDeadZoneOption = new SpruceDoubleOption("midnightcontrols.menu.left_dead_zone", 0.05, 1.0, .05f,
() -> MidnightControlsConfig.leftDeadZone,
value -> MidnightControlsConfig.leftDeadZone = value, option -> {
var value = String.valueOf(option.get());
return option.getDisplayText(new LiteralText(value.substring(0, Math.min(value.length(), 5))));
}, new TranslatableText("lambdacontrols.tooltip.left_dead_zone"));
this.invertsRightXAxis = new SpruceToggleBooleanOption("lambdacontrols.menu.invert_right_x_axis", this.config::doesInvertRightXAxis,
newValue -> {
synchronized (this.config) {
this.config.setInvertRightXAxis(newValue);
}
}, null);
this.invertsRightYAxis = new SpruceToggleBooleanOption("lambdacontrols.menu.invert_right_y_axis", this.config::doesInvertRightYAxis,
newValue -> {
synchronized (this.config) {
this.config.setInvertRightYAxis(newValue);
}
}, null);
this.unfocusedInputOption = new SpruceToggleBooleanOption("lambdacontrols.menu.unfocused_input", this.config::hasUnfocusedInput,
this.config::setUnfocusedInput, new TranslatableText("lambdacontrols.tooltip.unfocused_input"));
this.virtualMouseOption = new SpruceToggleBooleanOption("lambdacontrols.menu.virtual_mouse", this.config::hasVirtualMouse,
this.config::setVirtualMouse, new TranslatableText("lambdacontrols.tooltip.virtual_mouse"));
}, new TranslatableText("midnightcontrols.tooltip.left_dead_zone"));
this.invertsRightXAxis = new SpruceToggleBooleanOption("midnightcontrols.menu.invert_right_x_axis", () -> MidnightControlsConfig.invertRightXAxis,
value -> MidnightControlsConfig.invertRightXAxis = value, null);
this.invertsRightYAxis = new SpruceToggleBooleanOption("midnightcontrols.menu.invert_right_y_axis", () -> MidnightControlsConfig.invertRightYAxis,
value -> MidnightControlsConfig.invertRightYAxis = value, null);
this.unfocusedInputOption = new SpruceToggleBooleanOption("midnightcontrols.menu.unfocused_input", () -> MidnightControlsConfig.unfocusedInput,
value -> MidnightControlsConfig.unfocusedInput = value, new TranslatableText("midnightcontrols.tooltip.unfocused_input"));
this.virtualMouseOption = new SpruceToggleBooleanOption("midnightcontrols.menu.virtual_mouse", () -> MidnightControlsConfig.virtualMouse,
value -> MidnightControlsConfig.virtualMouse = value, new TranslatableText("midnightcontrols.tooltip.virtual_mouse"));
}
@Override
public void removed() {
this.config.save();
MidnightControlsConfig.save();
super.removed();
}
@Override
public void onClose() {
this.config.save();
MidnightControlsConfig.save();
super.onClose();
}
@@ -279,7 +255,7 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
this.addDrawableChild(this.resetOption.createWidget(Position.of(this.width / 2 - 155, this.height - 29), 150));
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 160, this.height - 29, 150, 20, SpruceTexts.GUI_DONE,
btn -> this.client.openScreen(this.parent)));
btn -> this.client.setScreen(this.parent)));
}
public void buildTabs() {
@@ -288,22 +264,22 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
Math.max(116, this.width / 8), 0);
this.addDrawableChild(tabs);
tabs.addSeparatorEntry(new TranslatableText("lambdacontrols.menu.separator.general"));
tabs.addTabEntry(new TranslatableText("lambdacontrols.menu.title.general"), null,
tabs.addSeparatorEntry(new TranslatableText("midnightcontrols.menu.separator.general"));
tabs.addTabEntry(new TranslatableText("midnightcontrols.menu.title.general"), null,
this::buildGeneralTab);
tabs.addTabEntry(new TranslatableText("lambdacontrols.menu.title.gameplay"), null,
tabs.addTabEntry(new TranslatableText("midnightcontrols.menu.title.gameplay"), null,
this::buildGameplayTab);
tabs.addTabEntry(new TranslatableText("lambdacontrols.menu.title.visual"), null,
tabs.addTabEntry(new TranslatableText("midnightcontrols.menu.title.visual"), null,
this::buildVisualTab);
tabs.addSeparatorEntry(new TranslatableText("options.controls"));
tabs.addTabEntry(new TranslatableText("lambdacontrols.menu.title.controller_controls"), null,
tabs.addTabEntry(new TranslatableText("midnightcontrols.menu.title.controller_controls"), null,
this::buildControllerControlsTab);
tabs.addSeparatorEntry(new TranslatableText("lambdacontrols.menu.separator.controller"));
tabs.addTabEntry(new TranslatableText("lambdacontrols.menu.title.controller"), null,
tabs.addSeparatorEntry(new TranslatableText("midnightcontrols.menu.separator.controller"));
tabs.addTabEntry(new TranslatableText("midnightcontrols.menu.title.controller"), null,
this::buildControllerTab);
tabs.addTabEntry(new TranslatableText("lambdacontrols.menu.title.mappings.string"), null,
tabs.addTabEntry(new TranslatableText("midnightcontrols.menu.title.mappings.string"), null,
this::buildMappingsStringEditorTab);
}
@@ -333,7 +309,7 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
var list = new SpruceOptionListWidget(Position.origin(), width, height);
list.addSingleOptionEntry(this.controllerTypeOption);
list.addSingleOptionEntry(this.virtualMouseSkinOption);
list.addSingleOptionEntry(new SpruceSeparatorOption("lambdacontrols.menu.title.hud", true, null));
list.addSingleOptionEntry(new SpruceSeparatorOption("midnightcontrols.menu.title.hud", true, null));
list.addSingleOptionEntry(this.hudEnableOption);
list.addSingleOptionEntry(this.hudSideOption);
return list;
@@ -347,7 +323,7 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
var root = new SpruceContainerWidget(Position.origin(), width, height);
var aboutMappings1 = new SpruceLabelWidget(Position.of(0, 2),
new TranslatableText("lambdacontrols.controller.mappings.1", SDL2_GAMEPAD_TOOL),
new TranslatableText("midnightcontrols.controller.mappings.1", SDL2_GAMEPAD_TOOL),
width, true);
var gamepadToolUrlLabel = new SpruceLabelWidget(Position.of(0, aboutMappings1.getHeight() + 4),
@@ -357,7 +333,7 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
var aboutMappings3 = new SpruceLabelWidget(Position.of(0,
aboutMappings1.getHeight() + gamepadToolUrlLabel.getHeight() + 6),
new TranslatableText("lambdacontrols.controller.mappings.3", Formatting.GREEN.toString(), Formatting.RESET.toString()),
new TranslatableText("midnightcontrols.controller.mappings.3", Formatting.GREEN.toString(), Formatting.RESET.toString()),
width, true);
int listHeight = height - 8 - aboutMappings1.getHeight() - aboutMappings3.getHeight() - gamepadToolUrlLabel.getHeight();
@@ -390,6 +366,6 @@ public class LambdaControlsSettingsScreen extends SpruceScreen {
@Override
public void renderTitle(MatrixStack matrices, int mouseX, int mouseY, float delta) {
drawCenteredText(matrices, this.textRenderer, I18n.translate("lambdacontrols.menu.title"), this.width / 2, 8, 16777215);
drawCenteredText(matrices, this.textRenderer, I18n.translate("midnightcontrols.menu.title"), this.width / 2, 8, 16777215);
}
}

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
package eu.midnightdust.midnightcontrols.client.gui;
import dev.lambdaurora.lambdacontrols.client.controller.Controller;
import eu.midnightdust.midnightcontrols.client.controller.Controller;
import dev.lambdaurora.spruceui.option.SpruceSimpleActionOption;
import dev.lambdaurora.spruceui.widget.SpruceButtonWidget;
import net.minecraft.client.MinecraftClient;
@@ -24,7 +24,7 @@ import java.util.function.Consumer;
* Represents the option to reload the controller mappings.
*/
public class ReloadControllerMappingsOption {
private static final String KEY = "lambdacontrols.menu.reload_controller_mappings";
private static final String KEY = "midnightcontrols.menu.reload_controller_mappings";
public static SpruceSimpleActionOption newOption(@Nullable Consumer<SpruceButtonWidget> before) {
return SpruceSimpleActionOption.of(KEY, btn -> {
@@ -32,10 +32,10 @@ public class ReloadControllerMappingsOption {
if (before != null)
before.accept(btn);
Controller.updateMappings();
if (client.currentScreen instanceof LambdaControlsSettingsScreen)
if (client.currentScreen instanceof MidnightControlsSettingsScreen)
client.currentScreen.init(client, client.getWindow().getScaledWidth(), client.getWindow().getScaledHeight());
client.getToastManager().add(SystemToast.create(client, SystemToast.Type.TUTORIAL_HINT,
new TranslatableText("lambdacontrols.controller.mappings.updated"), LiteralText.EMPTY));
}, new TranslatableText("lambdacontrols.tooltip.reload_controller_mappings"));
new TranslatableText("midnightcontrols.controller.mappings.updated"), LiteralText.EMPTY));
}, new TranslatableText("midnightcontrols.tooltip.reload_controller_mappings"));
}
}

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui;
package eu.midnightdust.midnightcontrols.client.gui;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.ring.RingPage;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.ring.RingPage;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.TranslatableText;
@@ -23,15 +23,15 @@ import net.minecraft.text.TranslatableText;
* @since 1.4.3
*/
public class RingScreen extends Screen {
protected final LambdaControlsClient mod;
protected final MidnightControlsClient mod;
public RingScreen() {
super(new TranslatableText("lambdacontrols.menu.title.ring"));
this.mod = LambdaControlsClient.get();
super(new TranslatableText("midnightcontrols.menu.title.ring"));
this.mod = MidnightControlsClient.get();
}
@Override
public boolean isPauseScreen() {
public boolean shouldPause() {
return false;
}
@@ -46,7 +46,7 @@ public class RingScreen extends Screen {
@Override
public boolean mouseReleased(double mouseX, double mouseY, int button) {
/*if (LambdaControlsClient.BINDING_RING.matchesMouse(button)) {
/*if (midnightcontrolsClient.BINDING_RING.matchesMouse(button)) {
this.onClose();
return true;
}*/

View File

@@ -0,0 +1,301 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package eu.midnightdust.midnightcontrols.client.gui;
import dev.lambdaurora.spruceui.widget.SpruceTexturedButtonWidget;
import eu.midnightdust.midnightcontrols.client.HudSide;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.util.KeyBindingAccessor;
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TexturedButtonWidget;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
import net.minecraft.text.LiteralText;
import net.minecraft.util.Arm;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import org.jetbrains.annotations.NotNull;
import org.lwjgl.glfw.GLFW;
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_RIGHT_X;
import static org.lwjgl.glfw.GLFW.GLFW_GAMEPAD_AXIS_RIGHT_Y;
/**
* Represents the touchscreen overlay
*/
public class TouchscreenOverlay extends Screen {
public static final Identifier WIDGETS_LOCATION = new Identifier("midnightcontrols", "textures/gui/widgets.png");
private MidnightControlsClient mod;
private SpruceTexturedButtonWidget jumpButton;
private SpruceTexturedButtonWidget flyButton;
private SpruceTexturedButtonWidget flyUpButton;
private SpruceTexturedButtonWidget flyDownButton;
private int flyButtonEnableTicks = 0;
private int forwardButtonTick = 0;
private SpruceTexturedButtonWidget forwardLeftButton;
private SpruceTexturedButtonWidget forwardRightButton;
private SpruceTexturedButtonWidget startSneakButton;
private SpruceTexturedButtonWidget endSneakButton;
public TouchscreenOverlay(@NotNull MidnightControlsClient mod)
{
super(new LiteralText("Touchscreen overlay"));
this.mod = mod;
this.passEvents = true;
}
// @Override
// public boolean shouldPause()
// {
// return false;
// }
//
// @Override
// public boolean keyPressed(int keyCode, int scanCode, int modifiers)
// {
// super.keyPressed(keyCode,scanCode,modifiers);
// //return false;
// return true;
// }
//
// private void pauseGame(boolean bl)
// {
// if (this.client == null)
// return;
// boolean bl2 = this.client.isIntegratedServerRunning() && !this.client.getServer().isRemote();
// if (bl2) {
// this.client.setScreen(new GameMenuScreen(!bl));
// this.client.getSoundManager().pauseAll();
// } else {
// this.client.setScreen(new GameMenuScreen(true));
// }
// }
//
// /**
// * Updates the forward button ticks cooldown.
// *
// * @param state The button state.
// *
// */
// private void updateForwardButtonsState(boolean state)
// {
// if (state)
// this.forwardButtonTick = -1;
// else
// this.forwardButtonTick = 20;
// }
//
// /**
// * Updates the jump buttons.
// */
// private void updateJumpButtons()
// {
// if (this.client == null)
// return;
// if (!this.client.interactionManager.isFlyingLocked()) {
// boolean oldStateFly = this.flyButton.visible;
// this.jumpButton.visible = false;
// this.flyButton.visible = true;
// this.flyUpButton.visible = true;
// this.flyDownButton.visible = true;
// if (oldStateFly != this.flyButton.visible) {
// this.flyButtonEnableTicks = 5;
// this.handleJump(null, false);
// } else if (this.flyButtonEnableTicks > 0)
// this.flyButtonEnableTicks--;
// } else {
// this.jumpButton.visible = true;
// this.flyButton.visible = false;
// this.flyUpButton.visible = false;
// this.flyDownButton.visible = false;
// }
// }
//
// /**
// * Handles the jump button.
// *
// * @param btn The pressed button.
// * @param state The state of the jump button.
// */
// private void handleJump(ButtonWidget btn, boolean state)
// {
// ((KeyBindingAccessor) this.client.options.keyJump).midnightcontrols$handlePressState(state);
// }
//
// @Override
// public void tick()
// {
// if (this.forwardButtonTick > 0) {
// this.forwardButtonTick--;
// } else if (this.forwardButtonTick == 0) {
// if (this.forwardLeftButton.visible)
// this.forwardLeftButton.visible = false;
// if (this.forwardRightButton.visible)
// this.forwardRightButton.visible = false;
// }
// this.updateJumpButtons();
// }
//
// @Override
// protected void init()
// {
// super.init();
// int scaledWidth = this.client.getWindow().getScaledWidth();
// int scaledHeight = this.client.getWindow().getScaledHeight();
// this.addDrawableChild(new TexturedButtonWidget(scaledWidth / 2 - 20, 0, 20, 20, 0, 106, 20, ButtonWidget.WIDGETS_LOCATION, 256, 256,
// btn -> this.client.setScreen(new ChatScreen("")), LiteralText.EMPTY));
// this.addDrawableChild(new TexturedButtonWidget(scaledWidth / 2, 0, 20, 20, 0, 0, 20, WIDGETS_LOCATION, 256, 256,
// btn -> this.pauseGame(false)));
// // Inventory buttons.
// int inventoryButtonX = scaledWidth / 2;
// int inventoryButtonY = scaledHeight - 16 - 5;
// if (this.client.options.mainArm == Arm.LEFT) {
// inventoryButtonX = inventoryButtonX - 91 - 24;
// } else {
// inventoryButtonX = inventoryButtonX + 91 + 4;
// }
// this.addDrawableChild(new TexturedButtonWidget(inventoryButtonX, inventoryButtonY, 20, 20, 20, 0, 20, WIDGETS_LOCATION, 256, 256,
// btn -> {
// if (this.client.interactionManager.hasRidingInventory()) {
// this.client.player.openRidingInventory();
// } else {
// this.client.getTutorialManager().onInventoryOpened();
// this.client.openScreen(new InventoryScreen(this.client.player));
// }
// }));
// int jumpButtonX, swapHandsX, sneakButtonX;
// int sneakButtonY = scaledHeight - 10 - 40 - 5;
// if (MidnightControlsConfig.hudSide == HudSide.LEFT) {
// jumpButtonX = scaledWidth - 20 - 20;
// swapHandsX = jumpButtonX - 5 - 40;
// sneakButtonX = 10 + 20 + 5;
// } else {
// jumpButtonX = 20;
// swapHandsX = jumpButtonX + 5 + 40;
// sneakButtonX = scaledWidth - 10 - 40 - 5;
// }
// // Swap items hand.
// this.addDrawableChild(new SpruceTexturedButtonWidget(swapHandsX, sneakButtonY, 20, 20, 0, 160, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// if (state) {
// if (!this.client.player.isSpectator()) {
// this.client.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN));
// }
// }
// }));
// // Drop
// this.addDrawableChild(new SpruceTexturedButtonWidget(swapHandsX, sneakButtonY + 5 + 20, 20, 20, 20, 160, 20, WIDGETS_LOCATION,
// (btn, state) -> ((KeyBindingAccessor) this.client.options.keyDrop).midnightcontrols$handlePressState(state)));
// // Jump keys
// this.addDrawableChild(this.jumpButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY, 20, 20, 0, 40, 20, WIDGETS_LOCATION,
// this::handleJump));
// this.addDrawableChild(this.flyButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY, 20, 20, 20, 40, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// if (this.flyButtonEnableTicks == 0) this.client..abilities.flying = false;
// }));
// this.addDrawableChild(this.flyUpButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY - 5 - 20, 20, 20, 40, 40, 20, WIDGETS_LOCATION,
// this::handleJump));
// this.addDrawableChild(this.flyDownButton = new SpruceTexturedButtonWidget(jumpButtonX, sneakButtonY + 20 + 5, 20, 20, 60, 40, 20, WIDGETS_LOCATION,
// (btn, state) -> ((KeyBindingAccessor) this.client.options.keySneak).midnightcontrols$handlePressState(state)));
// this.updateJumpButtons();
// // Movements keys
// this.addDrawableChild((this.startSneakButton = new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY, 20, 20, 0, 120, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// if (state) {
// ((KeyBindingAccessor) this.client.options.keySneak).midnightcontrols$handlePressState(true);
// this.startSneakButton.setVisible(false);
// this.endSneakButton.setVisible(true);
// }
// })));
// this.addDrawableChild((this.endSneakButton = new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY, 20, 20, 20, 120, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// if (state) {
// ((KeyBindingAccessor) this.client.options.keySneak).midnightcontrols$handlePressState(false);
// this.endSneakButton.setVisible(false);
// this.startSneakButton.setVisible(true);
// }
// })));
// this.endSneakButton.setVisible(false);
// this.addDrawableChild(this.forwardLeftButton = new SpruceTexturedButtonWidget(sneakButtonX - 20 - 5, sneakButtonY - 5 - 20, 20, 20, 80, 80, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// ((KeyBindingAccessor) this.client.options.keyForward).midnightcontrols$handlePressState(state);
// ((KeyBindingAccessor) this.client.options.keyLeft).midnightcontrols$handlePressState(state);
// this.updateForwardButtonsState(state);
// }));
// this.forwardLeftButton.setVisible(false);
// this.addDrawableChild(new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY - 5 - 20, 20, 20, 0, 80, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// ((KeyBindingAccessor) this.client.options.keyForward).midnightcontrols$handlePressState(state);
// this.updateForwardButtonsState(state);
// this.forwardLeftButton.setVisible(true);
// this.forwardRightButton.setVisible(true);
// }));
// this.addDrawableChild(this.forwardRightButton = new SpruceTexturedButtonWidget(sneakButtonX + 20 + 5, sneakButtonY - 5 - 20, 20, 20, 100, 80, 20, WIDGETS_LOCATION,
// (btn, state) -> {
// ((KeyBindingAccessor) this.client.options.keyForward).midnightcontrols$handlePressState(state);
// ((KeyBindingAccessor) this.client.options.keyRight).midnightcontrols$handlePressState(state);
// this.updateForwardButtonsState(state);
// }));
// this.forwardRightButton.setVisible(true);
// this.addDrawableChild(new SpruceTexturedButtonWidget(sneakButtonX + 20 + 5, sneakButtonY, 20, 20, 20, 80, 20, WIDGETS_LOCATION,
// (btn, state) -> ((KeyBindingAccessor) this.client.options.keyRight).midnightcontrols$handlePressState(state)));
// this.addDrawableChild(new SpruceTexturedButtonWidget(sneakButtonX, sneakButtonY + 20 + 5, 20, 20, 40, 80, 20, WIDGETS_LOCATION,
// (btn, state) -> ((KeyBindingAccessor) this.client.options.keyBack).midnightcontrols$handlePressState(state)));
// this.addDrawableChild(new SpruceTexturedButtonWidget(sneakButtonX - 20 - 5, sneakButtonY, 20, 20, 60, 80, 20, WIDGETS_LOCATION,
// (btn, state) -> ((KeyBindingAccessor) this.client.options.keyLeft).midnightcontrols$handlePressState(state)));
//
// this.children().forEach(button -> {
// if (button instanceof SpruceTexturedButtonWidget) {
// ((SpruceTexturedButtonWidget) button).setSilent(true);
// }
// });
// }
//
// @Override
// public boolean mouseClicked(double mouseX, double mouseY, int button)
// {
// if (mouseY >= (double) (this.height - 22) && this.client != null && this.client.player != null) {
// int centerX = this.width / 2;
// if (mouseX >= (double) (centerX - 90) && mouseX <= (double) (centerX + 90)) {
// for (int slot = 0; slot < 9; ++slot) {
// int slotX = centerX - 90 + slot * 20 + 2;
// if (mouseX >= (double) slotX && mouseX <= (double) (slotX + 20)) {
// this.client.player.getInventory().selectedSlot = slot;
// return true;
// }
// }
// }
// }
// return super.mouseClicked(mouseX, mouseY, button);
// }
//
// @Override
// public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
// {
// if (button == GLFW.GLFW_MOUSE_BUTTON_1 && this.client != null) {
// if (deltaY > 0.01)
// this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_Y, (float) Math.abs(deltaY / 5.0), 2);
// else if (deltaY < 0.01)
// this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_Y, (float) Math.abs(deltaY / 5.0), 1);
//
// if (deltaX > 0.01)
// this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_X, (float) Math.abs(deltaX / 5.0), 2);
// else if (deltaX < 0.01)
// this.mod.input.handleLook(this.client, GLFW_GAMEPAD_AXIS_RIGHT_X, (float) Math.abs(deltaX / 5.0), 1);
// }
// return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
// }
}

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui.widget;
package eu.midnightdust.midnightcontrols.client.gui.widget;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsRenderer;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsRenderer;
import dev.lambdaurora.spruceui.Position;
import dev.lambdaurora.spruceui.SpruceTexts;
import dev.lambdaurora.spruceui.widget.AbstractSpruceIconButtonWidget;
@@ -51,7 +51,7 @@ public class ControllerButtonWidget extends AbstractSpruceIconButtonWidget {
if (this.binding.getButton().length > 1) {
x += (this.width / 2 - this.iconWidth / 2) - 4;
}
var size = LambdaControlsRenderer.drawButton(matrices, x, this.getY(), this.binding, MinecraftClient.getInstance());
var size = MidnightControlsRenderer.drawButton(matrices, x, this.getY(), this.binding, MinecraftClient.getInstance());
this.iconWidth = size.length();
return size.height();
}

View File

@@ -1,17 +1,18 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui.widget;
package eu.midnightdust.midnightcontrols.client.gui.widget;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.controller.InputManager;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import dev.lambdaurora.spruceui.Position;
import dev.lambdaurora.spruceui.SpruceTexts;
import dev.lambdaurora.spruceui.widget.SpruceButtonWidget;
@@ -29,7 +30,7 @@ import java.util.stream.Collectors;
* Represents the controls screen.
*/
public class ControllerControlsWidget extends SpruceContainerWidget {
final LambdaControlsClient mod;
final MidnightControlsClient mod;
private ControlsListWidget bindingsListWidget;
private SpruceButtonWidget resetButton;
public ButtonBinding focusedBinding;
@@ -38,25 +39,25 @@ public class ControllerControlsWidget extends SpruceContainerWidget {
public ControllerControlsWidget(Position position, int width, int height) {
super(position, width, height);
this.mod = LambdaControlsClient.get();
this.mod = MidnightControlsClient.get();
this.init();
}
protected void init() {
this.addChild(new SpruceButtonWidget(Position.of(this, this.width / 2 - 155, 18), 310, 20,
new TranslatableText("lambdacontrols.menu.keyboard_controls"),
btn -> this.client.openScreen(new ControlsOptionsScreen(null, this.client.options))));
new TranslatableText("midnightcontrols.menu.keyboard_controls"),
btn -> this.client.setScreen(new ControlsOptionsScreen(null, this.client.options))));
this.bindingsListWidget = new ControlsListWidget(Position.of(this, 0, 43), this.width, this.height - 43 - 35, this);
this.addChild(this.bindingsListWidget);
this.addChild(this.resetButton = new SpruceButtonWidget(Position.of(this, this.width / 2 - 155, this.height - 29), 150, 20,
SpruceTexts.CONTROLS_RESET_ALL,
btn -> InputManager.streamBindings().collect(Collectors.toSet()).forEach(binding -> this.mod.config.setButtonBinding(binding, binding.getDefaultButton()))));
btn -> InputManager.streamBindings().collect(Collectors.toSet()).forEach(binding -> MidnightControlsConfig.setButtonBinding(binding, binding.getDefaultButton()))));
}
@Override
public void renderWidget(MatrixStack matrices, int mouseX, int mouseY, float delta) {
drawCenteredText(matrices, this.client.textRenderer, new TranslatableText("lambdacontrols.menu.title.controller_controls"),
drawCenteredText(matrices, this.client.textRenderer, new TranslatableText("midnightcontrols.menu.title.controller_controls"),
this.getX() + this.width / 2, this.getY() + 4, 16777215);
this.resetButton.setActive(InputManager.streamBindings().anyMatch(Predicates.not(ButtonBinding::isDefault)));
super.renderWidget(matrices, mouseX, mouseY, delta);
@@ -64,7 +65,7 @@ public class ControllerControlsWidget extends SpruceContainerWidget {
public void finishBindingEdit(int... buttons) {
if (this.focusedBinding == null) return;
this.mod.config.setButtonBinding(this.focusedBinding, buttons);
MidnightControlsConfig.setButtonBinding(this.focusedBinding, buttons);
this.focusedBinding = null;
}
}

View File

@@ -1,18 +1,19 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.gui.widget;
package eu.midnightdust.midnightcontrols.client.gui.widget;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonBinding;
import dev.lambdaurora.lambdacontrols.client.controller.ButtonCategory;
import dev.lambdaurora.lambdacontrols.client.controller.InputManager;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
import eu.midnightdust.midnightcontrols.client.controller.ButtonCategory;
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
import dev.lambdaurora.spruceui.Position;
import dev.lambdaurora.spruceui.SpruceTexts;
import dev.lambdaurora.spruceui.navigation.NavigationDirection;
@@ -89,7 +90,7 @@ public class ControlsListWidget extends SpruceEntryListWidget<ControlsListWidget
this.bindingName = I18n.translate(this.binding.getTranslationKey());
this.editButton = new ControllerButtonWidget(Position.of(this, parent.getWidth() / 2 - 8, 0), 110, this.binding, btn -> {
gui.focusedBinding = binding;
LambdaControlsClient.get().input.beginControlsInput(gui);
MidnightControlsClient.get().input.beginControlsInput(gui);
}) {
protected Text getNarrationMessage() {
return binding.isNotBound() ? new TranslatableText("narrator.controls.unbound", bindingName)
@@ -100,7 +101,7 @@ public class ControlsListWidget extends SpruceEntryListWidget<ControlsListWidget
this.resetButton = new SpruceButtonWidget(Position.of(this,
this.editButton.getPosition().getRelativeX() + this.editButton.getWidth() + 2, 0),
44, 20, new TranslatableText("controls.reset"),
btn -> LambdaControlsClient.get().config.setButtonBinding(binding, binding.getDefaultButton())) {
btn -> MidnightControlsConfig.setButtonBinding(binding, binding.getDefaultButton())) {
protected Text getNarrationMessage() {
return new TranslatableText("narrator.controls.reset", bindingName);
}
@@ -110,12 +111,12 @@ public class ControlsListWidget extends SpruceEntryListWidget<ControlsListWidget
this.editButton.getPosition().getRelativeX() + this.editButton.getWidth() + 2, 0),
this.resetButton.getWidth(), this.resetButton.getHeight(), SpruceTexts.GUI_UNBIND,
btn -> {
LambdaControlsClient.get().config.setButtonBinding(binding, UNBOUND);
MidnightControlsConfig.setButtonBinding(binding, UNBOUND);
gui.focusedBinding = null;
LambdaControlsClient.get().input.beginControlsInput(null);
MidnightControlsClient.get().input.beginControlsInput(null);
}) {
protected Text getNarrationMessage() {
return new TranslatableText("lambdacontrols.narrator.unbound", bindingName);
return new TranslatableText("midnightcontrols.narrator.unbound", bindingName);
}
};
this.children.add(this.unbindButton);

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.advancement.Advancement;
import net.minecraft.client.gui.screen.advancement.AdvancementTab;

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.client.gui.widget.ClickableWidget;
import org.spongepowered.asm.mixin.Mixin;

View File

@@ -1,17 +1,18 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import com.mojang.authlib.GameProfile;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.controller.MovementHandler;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.controller.MovementHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.input.Input;
import net.minecraft.client.network.AbstractClientPlayerEntity;
@@ -31,7 +32,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
*/
@Mixin(ClientPlayerEntity.class)
public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity {
private boolean lambdacontrols$driftingPrevented = false;
private boolean midnightcontrols$driftingPrevented = false;
@Shadow
protected abstract boolean hasMovementInput();
@@ -52,17 +53,17 @@ public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity
@Inject(method = "move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;move(Lnet/minecraft/entity/MovementType;Lnet/minecraft/util/math/Vec3d;)V"))
public void onMove(MovementType type, Vec3d movement, CallbackInfo ci) {
var mod = LambdaControlsClient.get();
var mod = MidnightControlsClient.get();
if (type == MovementType.SELF) {
if (this.getAbilities().flying && (!mod.config.hasFlyDrifting() || !mod.config.hasFlyVerticalDrifting())) {
if (this.getAbilities().flying && (!MidnightControlsConfig.flyDrifting || !MidnightControlsConfig.verticalFlyDrifting)) {
if (!this.hasMovementInput()) {
if (!this.lambdacontrols$driftingPrevented) {
if (!mod.config.hasFlyDrifting())
if (!this.midnightcontrols$driftingPrevented) {
if (!MidnightControlsConfig.flyDrifting)
this.setVelocity(this.getVelocity().multiply(0, 1.0, 0));
}
this.lambdacontrols$driftingPrevented = true;
this.midnightcontrols$driftingPrevented = true;
} else
this.lambdacontrols$driftingPrevented = false;
this.midnightcontrols$driftingPrevented = false;
}
}
}
@@ -75,7 +76,7 @@ public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity
@Inject(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;isCamera()Z"))
public void onTickMovement(CallbackInfo ci) {
if (this.getAbilities().flying && this.isCamera()) {
if (LambdaControlsClient.get().config.hasFlyVerticalDrifting())
if (MidnightControlsConfig.verticalFlyDrifting)
return;
int moving = 0;
if (this.input.sneaking) {

View File

@@ -0,0 +1,42 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package eu.midnightdust.midnightcontrols.client.mixin;
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsSettingsScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.option.ControlsOptionsScreen;
import net.minecraft.client.gui.screen.option.GameOptionsScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.option.GameOptions;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* Injects the new controls settings button.
*/
@Mixin(ControlsOptionsScreen.class)
public class ControlsOptionsScreenMixin extends GameOptionsScreen {
public ControlsOptionsScreenMixin(Screen parent, GameOptions gameOptions, Text text) {
super(parent, gameOptions, text);
}
@Inject(method = "init", at = @At(value = "INVOKE", ordinal = 4, shift = At.Shift.AFTER, target = "Lnet/minecraft/client/gui/screen/option/ControlsOptionsScreen;addDrawableChild(Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;"))
private void addControllerButton(CallbackInfo ci) {
int i = this.width / 2 - 155;
int j = i + 160;
int k = this.height / 6 - 12 + 48;;
this.addDrawableChild(new ButtonWidget(j, k, 150, 20, new TranslatableText("midnightcontrols.menu.title.controller").append("..."), (button) -> {
this.client.setScreen(new MidnightControlsSettingsScreen(this, false));
}));
}
}

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.item.ItemGroup;
@@ -37,7 +37,7 @@ public interface CreativeInventoryScreenAccessor {
* @param group the tab's item group
*/
@Invoker("setSelectedTab")
void lambdacontrols$setSelectedTab(@NotNull ItemGroup group);
void midnightcontrols$setSelectedTab(@NotNull ItemGroup group);
/**
* Returns whether the slot belongs to the creative inventory or not.
@@ -46,7 +46,7 @@ public interface CreativeInventoryScreenAccessor {
* @return true if the slot is from the creative inventory, else false
*/
@Invoker("isCreativeInventorySlot")
boolean lambdacontrols$isCreativeInventorySlot(@Nullable Slot slot);
boolean midnightcontrols$isCreativeInventorySlot(@Nullable Slot slot);
/**
* Returns whether the current tab has a scrollbar or not.
@@ -54,5 +54,5 @@ public interface CreativeInventoryScreenAccessor {
* @return true if the current tab has a scrollbar, else false
*/
@Invoker("hasScrollbar")
boolean lambdacontrols$hasScrollbar();
boolean midnightcontrols$hasScrollbar();
}

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.client.gui.widget.EntryListWidget;
import org.spongepowered.asm.mixin.Mixin;
@@ -16,5 +16,5 @@ import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(EntryListWidget.class)
public interface EntryListWidgetAccessor {
@Invoker("moveSelection")
void lambdacontrols$moveSelection(EntryListWidget.MoveDirection direction);
void midnightcontrols$moveSelection(EntryListWidget.MoveDirection direction);
}

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.client.option.GameOptions;
import org.spongepowered.asm.mixin.Mixin;

View File

@@ -1,16 +1,17 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.GameRenderer;
import org.spongepowered.asm.mixin.Final;
@@ -28,7 +29,7 @@ public class GameRendererMixin {
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Mouse;getX()D"))
private void onRender(float tickDelta, long startTime, boolean fullRender, CallbackInfo ci) {
if (this.client.currentScreen != null && LambdaControlsClient.get().config.getControlsMode() == ControlsMode.CONTROLLER)
LambdaControlsClient.get().input.onPreRenderScreen(this.client, this.client.currentScreen);
if (this.client.currentScreen != null && MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER)
MidnightControlsClient.get().input.onPreRenderScreen(this.client, this.client.currentScreen);
}
}

View File

@@ -0,0 +1,70 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package eu.midnightdust.midnightcontrols.client.mixin;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.MidnightInput;
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsRenderer;
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
import org.spongepowered.asm.mixin.gen.Invoker;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/**
* Represents the mixin for the class ContainerScreen.
*/
@Mixin(HandledScreen.class)
public abstract class HandledScreenMixin implements HandledScreenAccessor {
@Accessor("x")
public abstract int getX();
@Accessor("y")
public abstract int getY();
@Invoker("getSlotAt")
public abstract Slot midnightcontrols$getSlotAt(double posX, double posY);
@Invoker("isClickOutsideBounds")
public abstract boolean midnightcontrols$isClickOutsideBounds(double mouseX, double mouseY, int x, int y, int button);
@Invoker("onMouseClick")
public abstract void midnightcontrols$onMouseClick(@Nullable Slot slot, int slotId, int clickData, SlotActionType actionType);
@Inject(method = "render", at = @At("RETURN"))
public void onRender(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER) {
var client = MinecraftClient.getInstance();
int x = 2, y = client.getWindow().getScaledHeight() - 2 - MidnightControlsRenderer.ICON_SIZE;
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_A}, "midnightcontrols.action.pickup_all", true, client) + 2;
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_B}, "midnightcontrols.action.exit", true, client) + 2;
if (MidnightControlsCompat.isReiPresent()) {
x = 2;
y -= 24;
}
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_X}, "midnightcontrols.action.pickup", true, client) + 2;
MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_Y}, "midnightcontrols.action.quick_move", true, client);
}
}
}

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.client.util.KeyBindingAccessor;
import eu.midnightdust.midnightcontrols.client.util.KeyBindingAccessor;
import net.minecraft.client.option.KeyBinding;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -23,7 +23,7 @@ public class KeyBindingMixin implements KeyBindingAccessor {
private boolean pressed;
@Override
public boolean lambdacontrols$press() {
public boolean midnightcontrols$press() {
boolean oldPressed = this.pressed;
if (!this.pressed)
this.pressed = true;
@@ -32,7 +32,7 @@ public class KeyBindingMixin implements KeyBindingAccessor {
}
@Override
public boolean lambdacontrols$unpress() {
public boolean midnightcontrols$unpress() {
if (this.pressed) {
this.pressed = false;
return true;

View File

@@ -1,18 +1,21 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.LambdaControlsFeature;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.gui.LambdaControlsRenderer;
import eu.midnightdust.midnightcontrols.MidnightControls;
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightInput;
import eu.midnightdust.midnightcontrols.client.gui.MidnightControlsRenderer;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.ClientPlayerInteractionManager;
import net.minecraft.client.render.GameRenderer;
@@ -28,6 +31,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import org.jetbrains.annotations.Nullable;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -61,13 +65,13 @@ public abstract class MinecraftClientMixin {
@Shadow
private int itemUseCooldown;
private BlockPos lambdacontrols$lastTargetPos;
private Vec3d lambdacontrols$lastPos;
private Direction lambdacontrols$lastTargetSide;
private BlockPos midnightcontrols$lastTargetPos;
private Vec3d midnightcontrols$lastPos;
private Direction midnightcontrols$lastTargetSide;
@Inject(method = "<init>", at = @At("RETURN"))
private void onInit(CallbackInfo ci) {
LambdaControlsClient.get().onMcInit((MinecraftClient) (Object) this);
MidnightControlsClient.get().onMcInit((MinecraftClient) (Object) this);
}
@Inject(method = "tick", at = @At("HEAD"))
@@ -75,10 +79,10 @@ public abstract class MinecraftClientMixin {
if (this.player == null)
return;
if (!LambdaControlsFeature.FAST_BLOCK_PLACING.isAvailable())
if (!MidnightControlsFeature.FAST_BLOCK_PLACING.isAvailable())
return;
if (this.lambdacontrols$lastPos == null)
this.lambdacontrols$lastPos = this.player.getPos();
if (this.midnightcontrols$lastPos == null)
this.midnightcontrols$lastPos = this.player.getPos();
int cooldown = this.itemUseCooldown;
BlockHitResult hitResult;
@@ -87,42 +91,42 @@ public abstract class MinecraftClientMixin {
var targetPos = hitResult.getBlockPos();
var side = hitResult.getSide();
boolean sidewaysBlockPlacing = this.lambdacontrols$lastTargetPos == null || !targetPos.equals(this.lambdacontrols$lastTargetPos.offset(this.lambdacontrols$lastTargetSide));
boolean backwardsBlockPlacing = this.player.input.movementForward < 0.0f && (this.lambdacontrols$lastTargetPos == null || targetPos.equals(this.lambdacontrols$lastTargetPos.offset(this.lambdacontrols$lastTargetSide)));
boolean sidewaysBlockPlacing = this.midnightcontrols$lastTargetPos == null || !targetPos.equals(this.midnightcontrols$lastTargetPos.offset(this.midnightcontrols$lastTargetSide));
boolean backwardsBlockPlacing = this.player.input.movementForward < 0.0f && (this.midnightcontrols$lastTargetPos == null || targetPos.equals(this.midnightcontrols$lastTargetPos.offset(this.midnightcontrols$lastTargetSide)));
if (cooldown > 1
&& !targetPos.equals(this.lambdacontrols$lastTargetPos)
&& !targetPos.equals(this.midnightcontrols$lastTargetPos)
&& (sidewaysBlockPlacing || backwardsBlockPlacing)) {
this.itemUseCooldown = 1;
}
this.lambdacontrols$lastTargetPos = targetPos.toImmutable();
this.lambdacontrols$lastTargetSide = side;
this.midnightcontrols$lastTargetPos = targetPos.toImmutable();
this.midnightcontrols$lastTargetSide = side;
}
// Removed front placing sprinting as way too cheaty.
/*else if (this.player.isSprinting()) {
hitResult = LambdaControlsClient.get().reacharound.getLastReacharoundResult();
hitResult = midnightcontrolsClient.get().reacharound.getLastReacharoundResult();
if (hitResult != null) {
if (cooldown > 0)
this.itemUseCooldown = 0;
}
}*/
this.lambdacontrols$lastPos = this.player.getPos();
this.midnightcontrols$lastPos = this.player.getPos();
}
@Inject(method = "render", at = @At("HEAD"))
private void onRender(boolean fullRender, CallbackInfo ci) {
LambdaControlsClient.get().onRender((MinecraftClient) (Object) (this));
MidnightControlsClient.get().onRender((MinecraftClient) (Object) (this));
}
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;render(FJZ)V", shift = At.Shift.AFTER))
private void renderVirtualCursor(boolean fullRender, CallbackInfo ci) {
LambdaControlsRenderer.renderVirtualCursor(new MatrixStack(), (MinecraftClient) (Object) this);
MidnightControlsRenderer.renderVirtualCursor(new MatrixStack(), (MinecraftClient) (Object) this);
}
@Inject(method = "doItemUse()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/hit/HitResult;getType()Lnet/minecraft/util/hit/HitResult$Type;"), locals = LocalCapture.CAPTURE_FAILEXCEPTION, cancellable = true)
private void onItemUse(CallbackInfo ci, Hand[] hands, int handCount, int handIndex, Hand hand, ItemStack stackInHand) {
var mod = LambdaControlsClient.get();
var mod = MidnightControlsClient.get();
if (!stackInHand.isEmpty() && this.player.getPitch(0.f) > 35.0F && mod.reacharound.isReacharoundAvailable()) {
if (this.crosshairTarget != null && this.crosshairTarget.getType() == HitResult.Type.MISS && this.player.isOnGround()) {
if (!stackInHand.isEmpty() && stackInHand.getItem() instanceof BlockItem) {

View File

@@ -1,18 +1,18 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsConfig;
import dev.lambdaurora.lambdacontrols.client.util.MouseAccessor;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.Mouse;
import net.minecraft.client.gui.screen.Screen;
@@ -36,13 +36,13 @@ public abstract class MouseMixin implements MouseAccessor {
private MinecraftClient client;
@Invoker("onCursorPos")
public abstract void lambdacontrols$onCursorPos(long window, double x, double y);
public abstract void midnightcontrols$onCursorPos(long window, double x, double y);
@Inject(method = "method_1605", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/client/gui/screen/Screen;mouseReleased(DDI)Z"))
private static void onMouseBackButton(boolean[] result, Screen screen, double mouseX, double mouseY, int button, CallbackInfo ci) {
if (!result[0] && button == GLFW.GLFW_MOUSE_BUTTON_4 && screen != null) {
if (LambdaControlsClient.get().input.tryGoBack(screen)) {
result[0] = true;
@Inject(method = "onMouseButton", at = @At(value = "TAIL"))
private void onMouseBackButton(long window, int button, int action, int mods, CallbackInfo ci) {
if (action == 1 && button == GLFW.GLFW_MOUSE_BUTTON_4 && MinecraftClient.getInstance().currentScreen != null) {
if (MidnightControlsClient.get().input.tryGoBack(MinecraftClient.getInstance().currentScreen)) {
action = 0;
}
}
}
@@ -50,8 +50,7 @@ public abstract class MouseMixin implements MouseAccessor {
@Inject(method = "isCursorLocked", at = @At("HEAD"), cancellable = true)
private void isCursorLocked(CallbackInfoReturnable<Boolean> ci) {
if (this.client.currentScreen == null) {
var config = LambdaControlsClient.get().config;
if (config.getControlsMode() == ControlsMode.CONTROLLER && config.hasVirtualMouse()) {
if (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && MidnightControlsConfig.virtualMouse) {
ci.setReturnValue(true);
ci.cancel();
}
@@ -60,9 +59,8 @@ public abstract class MouseMixin implements MouseAccessor {
@Inject(method = "lockCursor", at = @At("HEAD"), cancellable = true)
private void onCursorLocked(CallbackInfo ci) {
LambdaControlsConfig config = LambdaControlsClient.get().config;
if (/*config.getControlsMode() == ControlsMode.TOUCHSCREEN
||*/ (config.getControlsMode() == ControlsMode.CONTROLLER && config.hasVirtualMouse()))
||*/ (MidnightControlsConfig.controlsMode == ControlsMode.CONTROLLER && MidnightControlsConfig.virtualMouse))
ci.cancel();
}
}

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
import net.minecraft.client.gui.screen.recipebook.RecipeGroupButtonWidget;
@@ -29,5 +29,5 @@ public interface RecipeBookWidgetAccessor {
void setCurrentTab(RecipeGroupButtonWidget currentTab);
@Invoker("refreshResults")
void lambdacontrols$refreshResults(boolean resetCurrentPage);
void midnightcontrols$refreshResults(boolean resetCurrentPage);
}

View File

@@ -1,15 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.mixin;
package eu.midnightdust.midnightcontrols.client.mixin;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import net.minecraft.block.ShapeContext;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.*;
@@ -62,9 +63,9 @@ public abstract class WorldRendererMixin {
)
private void onOutlineRender(MatrixStack matrices, float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer,
LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, CallbackInfo ci) {
if (this.client.crosshairTarget == null || this.client.crosshairTarget.getType() != HitResult.Type.MISS || !LambdaControlsClient.get().config.shouldRenderReacharoundOutline())
if (this.client.crosshairTarget == null || this.client.crosshairTarget.getType() != HitResult.Type.MISS || !MidnightControlsConfig.shouldRenderReacharoundOutline)
return;
var result = LambdaControlsClient.get().reacharound.getLastReacharoundResult();
var result = MidnightControlsClient.get().reacharound.getLastReacharoundResult();
if (result == null)
return;
var blockPos = result.getBlockPos();
@@ -73,7 +74,7 @@ public abstract class WorldRendererMixin {
if (stack == null || !(stack.getItem() instanceof BlockItem))
return;
var mod = LambdaControlsClient.get();
var mod = MidnightControlsClient.get();
var block = ((BlockItem) stack.getItem()).getBlock();
result = mod.reacharound.withSideForReacharound(result, block);
@@ -85,7 +86,7 @@ public abstract class WorldRendererMixin {
var pos = camera.getPos();
var outlineShape = placementState.getOutlineShape(this.client.world, blockPos, ShapeContext.of(camera.getFocusedEntity()));
int[] color = mod.config.getReacharoundOutlineColor();
int[] color = MidnightControlsConfig.reacharoundOutlineColor;
var vertexConsumer = this.bufferBuilders.getEntityVertexConsumers().getBuffer(RenderLayer.getLines());
drawShapeOutline(matrices, vertexConsumer, outlineShape,

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.ring;
package eu.midnightdust.midnightcontrols.client.ring;
import com.electronwill.nightconfig.core.Config;
import net.minecraft.client.font.TextRenderer;

View File

@@ -1,16 +1,16 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.ring;
package eu.midnightdust.midnightcontrols.client.ring;
import com.electronwill.nightconfig.core.Config;
import dev.lambdaurora.lambdacontrols.client.util.KeyBindingAccessor;
import eu.midnightdust.midnightcontrols.client.util.KeyBindingAccessor;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.KeyBinding;
@@ -39,9 +39,9 @@ public class KeyBindingRingAction extends RingAction {
public void onAction(@NotNull RingButtonMode mode) {
KeyBindingAccessor accessor = (KeyBindingAccessor) this.binding;
switch (mode) {
case PRESS, HOLD -> accessor.lambdacontrols$handlePressState(this.activated);
case PRESS, HOLD -> accessor.midnightcontrols$handlePressState(this.activated);
case TOGGLE -> {
accessor.lambdacontrols$handlePressState(!this.binding.isPressed());
accessor.midnightcontrols$handlePressState(!this.binding.isPressed());
this.activated = !this.binding.isPressed();
}
}

View File

@@ -1,16 +1,17 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.ring;
package eu.midnightdust.midnightcontrols.client.ring;
import com.electronwill.nightconfig.core.Config;
import dev.lambdaurora.lambdacontrols.client.LambdaControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import org.jetbrains.annotations.NotNull;
@@ -26,15 +27,15 @@ import java.util.Map;
* @version 1.7.0
* @since 1.4.0
*/
public final class LambdaRing {
public final class MidnightRing {
public static final int ELEMENT_SIZE = 50;
private final Map<String, RingAction.Factory> actionFactories = new Object2ObjectOpenHashMap<>();
private final List<RingPage> pages = new ArrayList<>(Collections.singletonList(RingPage.DEFAULT));
private final LambdaControlsClient mod;
private final MidnightControlsClient mod;
private int currentPage = 0;
public LambdaRing(@NotNull LambdaControlsClient mod) {
public MidnightRing(@NotNull MidnightControlsClient mod) {
this.mod = mod;
}
@@ -48,20 +49,18 @@ public final class LambdaRing {
/**
* Loads the ring from configuration.
*
* @param config the configuration
*/
public void load(@NotNull Config config) {
List<Config> configPages = config.get("ring.pages");
if (configPages != null) {
this.pages.clear();
for (var configPage : configPages) {
RingPage.parseRingPage(configPage).ifPresent(this.pages::add);
}
}
if (this.pages.isEmpty()) {
this.pages.add(RingPage.DEFAULT);
}
public void load() {
// List<Config> configPages = MidnightControlsConfig.ringPages;
// if (configPages != null) {
// this.pages.clear();
// for (var configPage : configPages) {
// RingPage.parseRingPage(configPage).ifPresent(this.pages::add);
// }
// }
// if (this.pages.isEmpty()) {
// this.pages.add(RingPage.DEFAULT);
// }
}
public @NotNull RingPage getCurrentPage() {

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.ring;
package eu.midnightdust.midnightcontrols.client.ring;
import com.electronwill.nightconfig.core.Config;
import net.minecraft.client.font.TextRenderer;
@@ -64,7 +64,7 @@ public abstract class RingAction extends DrawableHelper implements Nameable {
public abstract void onAction(@NotNull RingButtonMode mode);
public void render(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int x, int y, boolean hovered) {
fill(matrices, x, y, x + LambdaRing.ELEMENT_SIZE, y + LambdaRing.ELEMENT_SIZE, hovered ? 0xbb777777 : 0xbb000000);
fill(matrices, x, y, x + MidnightRing.ELEMENT_SIZE, y + MidnightRing.ELEMENT_SIZE, hovered ? 0xbb777777 : 0xbb000000);
drawIcon(matrices, textRenderer, x, y, hovered);
}

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.ring;
package eu.midnightdust.midnightcontrols.client.ring;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
@@ -52,7 +52,7 @@ public enum RingButtonMode implements Nameable {
* @return the translation key of this ring button mode
*/
public @NotNull String getTranslationKey() {
return "lambdacontrols.ring.button_mode." + this.getName();
return "midnightcontrols.ring.button_mode." + this.getName();
}
/**

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.ring;
package eu.midnightdust.midnightcontrols.client.ring;
import com.electronwill.nightconfig.core.Config;
import net.minecraft.client.font.TextRenderer;
@@ -52,7 +52,7 @@ public class RingPage extends DrawableHelper {
int centerX = width / 2;
int centerY = height / 2;
int offset = LambdaRing.ELEMENT_SIZE + (LambdaRing.ELEMENT_SIZE / 2) + 5;
int offset = MidnightRing.ELEMENT_SIZE + (MidnightRing.ELEMENT_SIZE / 2) + 5;
int y = centerY - offset;
int x = centerX - offset;
@@ -81,7 +81,7 @@ public class RingPage extends DrawableHelper {
}
private static boolean isHovered(int x, int y, int mouseX, int mouseY) {
return mouseX >= x && mouseY >= y && mouseX <= x + LambdaRing.ELEMENT_SIZE && mouseY <= y + LambdaRing.ELEMENT_SIZE;
return mouseX >= x && mouseY >= y && mouseX <= x + MidnightRing.ELEMENT_SIZE && mouseY <= y + MidnightRing.ELEMENT_SIZE;
}
/**

View File

@@ -1,13 +1,13 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.util;
package eu.midnightdust.midnightcontrols.client.util;
import net.minecraft.screen.slot.Slot;
import net.minecraft.screen.slot.SlotActionType;
@@ -38,9 +38,9 @@ public interface HandledScreenAccessor {
* @param posY the Y position to check
* @return the slot at the specified position
*/
Slot lambdacontrols$getSlotAt(double posX, double posY);
Slot midnightcontrols$getSlotAt(double posX, double posY);
boolean lambdacontrols$isClickOutsideBounds(double mouseX, double mouseY, int x, int y, int button);
boolean midnightcontrols$isClickOutsideBounds(double mouseX, double mouseY, int x, int y, int button);
/**
* Handles a mouse click on the specified slot.
@@ -50,5 +50,5 @@ public interface HandledScreenAccessor {
* @param clickData the click data
* @param actionType the action type
*/
void lambdacontrols$onMouseClick(@Nullable Slot slot, int slotId, int clickData, SlotActionType actionType);
void midnightcontrols$onMouseClick(@Nullable Slot slot, int slotId, int clickData, SlotActionType actionType);
}

View File

@@ -0,0 +1,26 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package eu.midnightdust.midnightcontrols.client.util;
/**
* Represents a Minecraft keybinding with extra access.
*/
public interface KeyBindingAccessor {
boolean midnightcontrols$press();
boolean midnightcontrols$unpress();
default boolean midnightcontrols$handlePressState(boolean pressed) {
if (pressed)
return this.midnightcontrols$press();
else
return this.midnightcontrols$unpress();
}
}

View File

@@ -1,17 +1,17 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.client.util;
package eu.midnightdust.midnightcontrols.client.util;
/**
* Represents mouse's extra access.
*/
public interface MouseAccessor {
void lambdacontrols$onCursorPos(long window, double x, double y);
void midnightcontrols$onCursorPos(long window, double x, double y);
}

View File

@@ -1,15 +1,15 @@
/*
* Copyright © 2021 LambdAurora <aurora42lambda@gmail.com>
*
* This file is part of LambdaControls.
* This file is part of midnightcontrols.
*
* Licensed under the MIT license. For more information,
* see the LICENSE file.
*/
package dev.lambdaurora.lambdacontrols.event;
package eu.midnightdust.midnightcontrols.event;
import dev.lambdaurora.lambdacontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.ControlsMode;
import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.entity.player.PlayerEntity;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

@@ -1,150 +0,0 @@
{
"key.lambdacontrols.look_down": "Look down",
"key.lambdacontrols.look_left": "Look left",
"key.lambdacontrols.look_right": "Look right",
"key.lambdacontrols.look_up": "Look up",
"key.lambdacontrols.ring": "Show controls ring",
"lambdacontrols.action.attack": "Attack",
"lambdacontrols.action.back": "Back",
"lambdacontrols.action.chat": "Open Chat",
"lambdacontrols.action.drop_item": "Drop Item",
"lambdacontrols.action.exit": "Exit",
"lambdacontrols.action.forward": "Forward",
"lambdacontrols.action.hit": "Hit",
"lambdacontrols.action.hotbar_left": "Hotbar left",
"lambdacontrols.action.hotbar_right": "Hotbar right",
"lambdacontrols.action.inventory": "Inventory",
"lambdacontrols.action.jump": "Jump",
"lambdacontrols.action.left": "Left",
"lambdacontrols.action.pause_game": "Pause Game",
"lambdacontrols.action.pick_block": "Pick Block",
"lambdacontrols.action.pickup": "Pickup",
"lambdacontrols.action.pickup_all": "Pickup all",
"lambdacontrols.action.place": "Place",
"lambdacontrols.action.player_list": "Player List",
"lambdacontrols.action.quick_move": "Quick move",
"lambdacontrols.action.right": "Right",
"lambdacontrols.action.screenshot": "Take Screenshot",
"lambdacontrols.action.sneak": "Sneak",
"lambdacontrols.action.sprint": "Sprint",
"lambdacontrols.action.swap_hands": "Swap Hands",
"lambdacontrols.action.toggle_perspective": "Toggle Perspective",
"lambdacontrols.action.toggle_smooth_camera": "Toggle Cinematic Camera",
"lambdacontrols.action.use": "Use",
"lambdacontrols.action.zoom": "Zoom",
"lambdacontrols.action.zoom_in": "Increase Zoom",
"lambdacontrols.action.zoom_out": "Decrease Zoom",
"lambdacontrols.action.zoom_reset": "Reset Zoom",
"lambdacontrols.button.a": "A",
"lambdacontrols.button.b": "B",
"lambdacontrols.button.x": "X",
"lambdacontrols.button.y": "Y",
"lambdacontrols.button.left_bumper": "Left bumper",
"lambdacontrols.button.right_bumper": "Right bumper",
"lambdacontrols.button.back": "Back",
"lambdacontrols.button.start": "Start",
"lambdacontrols.button.guide": "Guide",
"lambdacontrols.button.left_thumb": "Left thumb",
"lambdacontrols.button.right_thumb": "Right thumb",
"lambdacontrols.button.dpad_up": "DPAD up",
"lambdacontrols.button.dpad_right": "DPAD right",
"lambdacontrols.button.dpad_down": "DPAD down",
"lambdacontrols.button.dpad_left": "DPAD left",
"lambdacontrols.axis.left_x+": "Left X+",
"lambdacontrols.axis.left_y+": "Left Y+",
"lambdacontrols.axis.right_x+": "Right X+",
"lambdacontrols.axis.right_y+": "Right Y+",
"lambdacontrols.axis.left_trigger": "Left trigger",
"lambdacontrols.axis.right_trigger": "Right trigger",
"lambdacontrols.axis.left_x-": "Left X-",
"lambdacontrols.axis.left_y-": "Left Y-",
"lambdacontrols.axis.right_x-": "Right X-",
"lambdacontrols.axis.right_y-": "Right Y-",
"lambdacontrols.button.unknown": "Unknown (%d)",
"lambdacontrols.controller.connected": "Controller %d connected.",
"lambdacontrols.controller.disconnected": "Controller %d disconnected.",
"lambdacontrols.controller.mappings.1": "To configure the controller mappings, please use %s",
"lambdacontrols.controller.mappings.3": "and paste the mapping in the mappings file editor.",
"lambdacontrols.controller.mappings.error": "Error while loading mappings.",
"lambdacontrols.controller.mappings.error.write": "Error while writing mappings to file.",
"lambdacontrols.controller.mappings.updated": "Updated mappings!",
"lambdacontrols.controller_type.default": "default",
"lambdacontrols.controller_type.dualshock": "DualShock",
"lambdacontrols.controller_type.switch": "Switch",
"lambdacontrols.controller_type.xbox": "Xbox",
"lambdacontrols.controller_type.steam": "Steam",
"lambdacontrols.controller_type.ouya": "OUYA",
"lambdacontrols.controls_mode.default": "Keyboard/Mouse",
"lambdacontrols.controls_mode.controller": "Controller",
"lambdacontrols.controls_mode.touchscreen": "Touchscreen",
"lambdacontrols.hud_side.left": "left",
"lambdacontrols.hud_side.right": "right",
"lambdacontrols.menu.analog_movement": "Analog Movement",
"lambdacontrols.menu.auto_switch_mode": "Auto Switch Mode",
"lambdacontrols.menu.controller": "Controller",
"lambdacontrols.menu.controller2": "Second Controller",
"lambdacontrols.menu.controller_type": "Controller Type",
"lambdacontrols.menu.controls_mode": "Mode",
"lambdacontrols.menu.fast_block_placing": "Fast Block Placing",
"lambdacontrols.menu.fly_drifting": "Fly Drifting",
"lambdacontrols.menu.fly_drifting_vertical": "Vertical Fly Drifting",
"lambdacontrols.menu.hud_enable": "Enable HUD",
"lambdacontrols.menu.hud_side": "HUD Side",
"lambdacontrols.menu.invert_right_x_axis": "Invert Right X",
"lambdacontrols.menu.invert_right_y_axis": "Invert Right Y",
"lambdacontrols.menu.keyboard_controls": "Keyboard Controls...",
"lambdacontrols.menu.left_dead_zone": "Left Dead Zone",
"lambdacontrols.menu.mappings.open_input_str": "Open Mappings File Editor",
"lambdacontrols.menu.max_left_x_value": "Left X Axis Max Value",
"lambdacontrols.menu.max_left_y_value": "Left Y Axis Max Value",
"lambdacontrols.menu.max_right_x_value": "Right X Axis Max Value",
"lambdacontrols.menu.max_right_y_value": "Right Y Axis Max Value",
"lambdacontrols.menu.mouse_speed": "Mouse Speed",
"lambdacontrols.menu.reacharound.horizontal": "Front Block Placing",
"lambdacontrols.menu.reacharound.vertical": "Vertical Reacharound",
"lambdacontrols.menu.reload_controller_mappings": "Reload Controller Mappings",
"lambdacontrols.menu.right_dead_zone": "Right Dead Zone",
"lambdacontrols.menu.rotation_speed": "Rotation Speed",
"lambdacontrols.menu.separator.controller": "Controller",
"lambdacontrols.menu.separator.general": "General",
"lambdacontrols.menu.title": "LambdaControls - Settings",
"lambdacontrols.menu.title.controller": "Controller Options",
"lambdacontrols.menu.title.controller_controls": "Controller Controls",
"lambdacontrols.menu.title.gameplay": "Gameplay Options",
"lambdacontrols.menu.title.general": "General Options",
"lambdacontrols.menu.title.hud": "HUD Options",
"lambdacontrols.menu.title.mappings.string": "Mappings File Editor",
"lambdacontrols.menu.title.visual": "Appearance Options",
"lambdacontrols.menu.unfocused_input": "Unfocused Input",
"lambdacontrols.menu.virtual_mouse": "Virtual Mouse",
"lambdacontrols.menu.virtual_mouse.skin": "Virtual Mouse Skin",
"lambdacontrols.narrator.unbound": "Unbound %s",
"lambdacontrols.not_bound": "Not bound",
"lambdacontrols.tooltip.analog_movement": "Enables analog movement when possible.",
"lambdacontrols.tooltip.auto_switch_mode": "If the controls mode should be switched to Controller automatically if one is connected.",
"lambdacontrols.tooltip.controller2": "Second controller to use, which allows Joy-Cons support for example.",
"lambdacontrols.tooltip.controller_type": "The controller type to display the correct buttons.",
"lambdacontrols.tooltip.controls_mode": "The controls mode.",
"lambdacontrols.tooltip.fast_block_placing": "While flying in creative mode, enables fast block placing depending on your speed. §cOn some servers this might be considered as cheating.",
"lambdacontrols.tooltip.fly_drifting": "While flying, enables Vanilla drifting/inertia.",
"lambdacontrols.tooltip.fly_drifting_vertical": "While flying, enables Vanilla vertical drifting/intertia.",
"lambdacontrols.tooltip.hud_enable": "Toggles the on-screen controller button indicator.",
"lambdacontrols.tooltip.hud_side": "The position of the HUD.",
"lambdacontrols.tooltip.left_dead_zone": "The dead zone for the controller's left analogue stick.",
"lambdacontrols.tooltip.max_left_x_value": "Changes what the mod considers the highest value for the left X axis. Useful if your axis does not use the full range and seems slow.",
"lambdacontrols.tooltip.max_left_y_value": "Changes what the mod considers the highest value for the left Y axis. Useful if your axis does not use the full range and seems slow.",
"lambdacontrols.tooltip.max_right_x_value": "Changes what the mod considers the highest value for the right X axis. Useful if your axis does not use the full range and seems slow.",
"lambdacontrols.tooltip.max_right_y_value": "Changes what the mod considers the highest value for the right Y axis. Useful if your axis does not use the full range and seems slow.",
"lambdacontrols.tooltip.mouse_speed": "The controller's emulated mouse speed.",
"lambdacontrols.tooltip.reacharound.horizontal": "Enables front block placing, §cmight be considered cheating on some servers§r.",
"lambdacontrols.tooltip.reacharound.vertical": "Enables vertical reacharound, §cmight be considered cheating on some servers§r.",
"lambdacontrols.tooltip.reload_controller_mappings": "Reloads the controller mappings file.",
"lambdacontrols.tooltip.right_dead_zone": "The dead zone for the controller's right analogue stick.",
"lambdacontrols.tooltip.rotation_speed": "The camera rotation speed in controller mode.",
"lambdacontrols.tooltip.unfocused_input": "Allow controller input when the window is not focused.",
"lambdacontrols.tooltip.virtual_mouse": "Enable the virtual mouse which is handful in the case of a splitscreen.",
"lambdacontrols.virtual_mouse.skin.default_light": "Default Light",
"lambdacontrols.virtual_mouse.skin.default_dark": "Default Dark",
"lambdacontrols.virtual_mouse.skin.second_light": "Second Light",
"lambdacontrols.virtual_mouse.skin.second_dark": "Second Dark"
}

View File

@@ -1,150 +0,0 @@
{
"key.lambdacontrols.look_down": "Mirar hacia abajo",
"key.lambdacontrols.look_left": "Mirar hacia izquierda",
"key.lambdacontrols.look_right": "Mirar hacia derecha",
"key.lambdacontrols.look_up": "Mirar hacia arriba",
"key.lambdacontrols.ring": "Mostrar anillo de controles",
"lambdacontrols.action.attack": "Atacar",
"lambdacontrols.action.back": "Retroceder",
"lambdacontrols.action.chat": "Abrir chat",
"lambdacontrols.action.drop_item": "Tirar ítem",
"lambdacontrols.action.exit": "Salir",
"lambdacontrols.action.forward": "Avanzar",
"lambdacontrols.action.hit": "Golpear",
"lambdacontrols.action.hotbar_left": "Hotbar a la izquierda",
"lambdacontrols.action.hotbar_right": "Hotbar a la derecha",
"lambdacontrols.action.inventory": "Inventario",
"lambdacontrols.action.jump": "Saltar",
"lambdacontrols.action.left": "Izquierda",
"lambdacontrols.action.pause_game": "Pausar juego",
"lambdacontrols.action.pick_block": "Recoger bloque",
"lambdacontrols.action.pickup": "Recoger",
"lambdacontrols.action.pickup_all": "Recoger todo",
"lambdacontrols.action.place": "Poner",
"lambdacontrols.action.player_list": "Lista de jugadores",
"lambdacontrols.action.quick_move": "Mover items rápidamente",
"lambdacontrols.action.right": "Derecha",
"lambdacontrols.action.screenshot": "Tomar captura de pantalla",
"lambdacontrols.action.sneak": "Agacharse",
"lambdacontrols.action.sprint": "Correr",
"lambdacontrols.action.swap_hands": "Intercambiar manos",
"lambdacontrols.action.toggle_perspective": "Cambiar perspectiva",
"lambdacontrols.action.toggle_smooth_camera": "Cambiar cámara cinematográfica",
"lambdacontrols.action.use": "Usar",
"lambdacontrols.action.zoom": "Zoom",
"lambdacontrols.action.zoom_in": "Aumentar zoom",
"lambdacontrols.action.zoom_out": "Disminuir zoom",
"lambdacontrols.action.zoom_reset": "Restablecer zoom",
"lambdacontrols.button.a": "A",
"lambdacontrols.button.b": "B",
"lambdacontrols.button.x": "X",
"lambdacontrols.button.y": "Y",
"lambdacontrols.button.left_bumper": "Bumper izquierda",
"lambdacontrols.button.right_bumper": "Bumper derecha",
"lambdacontrols.button.back": "Regresar",
"lambdacontrols.button.start": "Iniciar",
"lambdacontrols.button.guide": "Guía",
"lambdacontrols.button.left_thumb": "Joystick izquierda",
"lambdacontrols.button.right_thumb": "Joystick derecha",
"lambdacontrols.button.dpad_up": "Cruceta arriba",
"lambdacontrols.button.dpad_right": "Cruceta derecha",
"lambdacontrols.button.dpad_down": "Cruceta abajo",
"lambdacontrols.button.dpad_left": "Cruceta izquierda",
"lambdacontrols.axis.left_x+": "Izquierda X+",
"lambdacontrols.axis.left_y+": "Izquierda Y+",
"lambdacontrols.axis.right_x+": "Derecha X+",
"lambdacontrols.axis.right_y+": "Derecha Y+",
"lambdacontrols.axis.left_trigger": "Gatillo izquierda",
"lambdacontrols.axis.right_trigger": "Gatillo derecha",
"lambdacontrols.axis.left_x-": "Izquierda X-",
"lambdacontrols.axis.left_y-": "Izquierda Y-",
"lambdacontrols.axis.right_x-": "Derecha X-",
"lambdacontrols.axis.right_y-": "Derecha Y-",
"lambdacontrols.button.unknown": "Desconocido (%d)",
"lambdacontrols.controller.connected": "Controlador %d conectado.",
"lambdacontrols.controller.disconnected": "Controlador %d desconectado.",
"lambdacontrols.controller.mappings.1": "Para configurar las asignaciones del controlador, utilice %s",
"lambdacontrols.controller.mappings.3": "y poner el mapeo de asignaciones en `%s.minecraft/config/gamecontrollerdb.txt%s`.",
"lambdacontrols.controller.mappings.error": "Error al cargar asignaciones.",
"lambdacontrols.controller.mappings.error.write": "Error al escribir asignaciones al archivo.",
"lambdacontrols.controller.mappings.updated": "Asignaciones actualizados!",
"lambdacontrols.controller_type.default": "por defecto",
"lambdacontrols.controller_type.dualshock": "DualShock",
"lambdacontrols.controller_type.switch": "Switch",
"lambdacontrols.controller_type.xbox": "Xbox",
"lambdacontrols.controller_type.steam": "Steam",
"lambdacontrols.controller_type.ouya": "OUYA",
"lambdacontrols.controls_mode.default": "Teclado/Ratón",
"lambdacontrols.controls_mode.controller": "Controlador",
"lambdacontrols.controls_mode.touchscreen": "Pantalla táctil",
"lambdacontrols.hud_side.left": "izquierda",
"lambdacontrols.hud_side.right": "derecha",
"lambdacontrols.menu.analog_movement": "Movimiento analógico",
"lambdacontrols.menu.auto_switch_mode": "Cambio de modo automático",
"lambdacontrols.menu.controller": "Controlador",
"lambdacontrols.menu.controller2": "Segundo controlador",
"lambdacontrols.menu.controller_type": "Tipo de controlador",
"lambdacontrols.menu.controls_mode": "Modo",
"lambdacontrols.menu.fast_block_placing": "Colocación rápida de bloques",
"lambdacontrols.menu.fly_drifting": "Volar a la deriva",
"lambdacontrols.menu.fly_drifting_vertical": "Volar a la deriva vertical",
"lambdacontrols.menu.hud_enable": "Habilitar HUD",
"lambdacontrols.menu.hud_side": "Lado de HUD",
"lambdacontrols.menu.invert_right_x_axis": "Invertir derecha X",
"lambdacontrols.menu.invert_right_y_axis": "Invertir derecha Y",
"lambdacontrols.menu.keyboard_controls": "Controles del teclado...",
"lambdacontrols.menu.left_dead_zone": "Zona muerta izquierda",
"lambdacontrols.menu.mappings.open_input_str": "Abrir el editor de archivo de asignaciones",
"lambdacontrols.menu.max_left_x_value": "Valor máximo del eje X izquierdo",
"lambdacontrols.menu.max_left_y_value": "Valor máximo del eje Y izquierdo",
"lambdacontrols.menu.max_right_x_value": "Valor máximo del eje X derecho",
"lambdacontrols.menu.max_right_y_value": "Valor máximo del eje Y derecho",
"lambdacontrols.menu.mouse_speed": "Velocidad del ratón",
"lambdacontrols.menu.reacharound.horizontal": "Colocación de bloque frontal",
"lambdacontrols.menu.reacharound.vertical": "Alcance vertical",
"lambdacontrols.menu.reload_controller_mappings": "Recargar asignaciones de controlador",
"lambdacontrols.menu.right_dead_zone": "Zona muerta derecha",
"lambdacontrols.menu.rotation_speed": "Velocidad de rotación",
"lambdacontrols.menu.separator.controller": "Controlador",
"lambdacontrols.menu.separator.general": "General",
"lambdacontrols.menu.title": "LambdaControls - Configuraciones",
"lambdacontrols.menu.title.controller": "Opciones de controlador",
"lambdacontrols.menu.title.controller_controls": "Controles de controlador",
"lambdacontrols.menu.title.gameplay": "Opciones de juego",
"lambdacontrols.menu.title.general": "Opciones generales",
"lambdacontrols.menu.title.hud": "Opciones de HUD",
"lambdacontrols.menu.title.mappings.string": "Editor de archivo de asignaciones",
"lambdacontrols.menu.title.visual": "Opciones de apariencia",
"lambdacontrols.menu.unfocused_input": "Entrada desenfocada",
"lambdacontrols.menu.virtual_mouse": "Ratón virtual",
"lambdacontrols.menu.virtual_mouse.skin": "Piel de ratón virtual",
"lambdacontrols.narrator.unbound": "Resetear %s",
"lambdacontrols.not_bound": "No ligado",
"lambdacontrols.tooltip.analog_movement": "Habilita el movimiento analógico cuando es posible.",
"lambdacontrols.tooltip.auto_switch_mode": "Si el modo de controles debe cambiarse a Controlador automáticamente si hay uno conectado.",
"lambdacontrols.tooltip.controller2": "Segundo controlador a uso, que permite el soporte de Joy-Cons por ejemplo.",
"lambdacontrols.tooltip.controller_type": "El tipo de controlador para mostrar los botones correctos.",
"lambdacontrols.tooltip.controls_mode": "El modo de controles.",
"lambdacontrols.tooltip.fast_block_placing": "Mientras vuela en modo creativo, permite la colocación rápida de bloques dependiendo su velocidad. §cEn algunos servidores, esto podría considerarse como trampa.",
"lambdacontrols.tooltip.fly_drifting": "Mientras vuela, habilita la deriva/inercia de vainilla.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Mientras vuela, habilita la deriva/inercia vertical de vainilla.",
"lambdacontrols.tooltip.hud_enable": "Alterna el indicador del botón del controlador en pantalla.",
"lambdacontrols.tooltip.hud_side": "La posición del HUD.",
"lambdacontrols.tooltip.left_dead_zone": "La zona muerta de la palanca analógica izquierda del controlador.",
"lambdacontrols.tooltip.max_left_x_value": "Cambia lo que el mod considera el valor más alto para el eje X izquierdo. Útil si su eje no usa el rango completo y parece lento.",
"lambdacontrols.tooltip.max_left_y_value": "Cambia lo que el mod considera el valor más alto para el eje Y izquierdo. Útil si su eje no usa el rango completo y parece lento.",
"lambdacontrols.tooltip.max_right_x_value": "Cambia lo que el mod considera el valor más alto para el eje X derecho. Útil si su eje no usa el rango completo y parece lento.",
"lambdacontrols.tooltip.max_right_y_value": "Cambia lo que el mod considera el valor más alto para el eje Y derecho. Útil si su eje no usa el rango completo y parece lento.",
"lambdacontrols.tooltip.mouse_speed": "La velocidad del ratón emulada del controlador.",
"lambdacontrols.tooltip.reacharound.horizontal": "Habilita la colocación del bloque frontal, §cpodría considerarse trampa en algunos servidores§r.",
"lambdacontrols.tooltip.reacharound.vertical": "Habilita el alcance vertical, §cpodría considerarse trampa en algunos servidores§r.",
"lambdacontrols.tooltip.reload_controller_mappings": "Vuelve a cargar el archivo de asignaciones del controlador.",
"lambdacontrols.tooltip.right_dead_zone": "La zona muerta de la palanca analógica derecha del controlador.",
"lambdacontrols.tooltip.rotation_speed": "La velocidad de rotación de la cámara en modo controlador.",
"lambdacontrols.tooltip.unfocused_input": "Habilita entrada del controlador cuando la ventana no está enfocada.",
"lambdacontrols.tooltip.virtual_mouse": "Habilite el ratón virtual que es útil en el caso de una pantalla dividida.",
"lambdacontrols.virtual_mouse.skin.default_light": "Ligera por defecto",
"lambdacontrols.virtual_mouse.skin.default_dark": "Oscura por defecto",
"lambdacontrols.virtual_mouse.skin.second_light": "Ligera segundario",
"lambdacontrols.virtual_mouse.skin.second_dark": "Oscura segundario"
}

View File

@@ -1,150 +0,0 @@
{
"key.lambdacontrols.look_down": "Regarder en bas",
"key.lambdacontrols.look_left": "Regarder à gauche",
"key.lambdacontrols.look_right": "Regarder à droite",
"key.lambdacontrols.look_up": "Regarder en haut",
"key.lambdacontrols.ring": "Affiche l'anneau de contrôle",
"lambdacontrols.action.attack": "Attaquer",
"lambdacontrols.action.back": "Reculer",
"lambdacontrols.action.chat": "Ouvrir le tchat",
"lambdacontrols.action.drop_item": "Jeter l'objet",
"lambdacontrols.action.exit": "Sortir",
"lambdacontrols.action.forward": "Avancer",
"lambdacontrols.action.hit": "Taper",
"lambdacontrols.action.hotbar_left": "Case à gauche de la barre d'action",
"lambdacontrols.action.hotbar_right": "Case à droite de la barre d'action",
"lambdacontrols.action.inventory": "Inventaire",
"lambdacontrols.action.jump": "Sauter",
"lambdacontrols.action.left": "Aller à gauche",
"lambdacontrols.action.pause_game": "Mettre en pause le jeu",
"lambdacontrols.action.pick_block": "Choisir le bloc",
"lambdacontrols.action.pickup": "Prendre",
"lambdacontrols.action.pickup_all": "Prendre tout",
"lambdacontrols.action.place": "Placer",
"lambdacontrols.action.player_list": "Afficher la liste des joueurs",
"lambdacontrols.action.quick_move": "Mouvement rapide",
"lambdacontrols.action.right": "Aller à droite",
"lambdacontrols.action.screenshot": "Prendre une capture d'écran",
"lambdacontrols.action.sneak": "S'accroupir",
"lambdacontrols.action.sprint": "Courir",
"lambdacontrols.action.swap_hands": "Échanger de mains",
"lambdacontrols.action.toggle_perspective": "Changer de point de vue",
"lambdacontrols.action.toggle_smooth_camera": "Basculer en mode cinématique",
"lambdacontrols.action.use": "Utiliser",
"lambdacontrols.action.zoom": "Zoom",
"lambdacontrols.action.zoom_in": "Augmenter le zoom",
"lambdacontrols.action.zoom_out": "Diminuer le zoom",
"lambdacontrols.action.zoom_reset": "Remettre le zoom à zéro",
"lambdacontrols.button.a": "A",
"lambdacontrols.button.b": "B",
"lambdacontrols.button.x": "X",
"lambdacontrols.button.y": "Y",
"lambdacontrols.button.left_bumper": "Gâchette gauche",
"lambdacontrols.button.right_bumper": "Gâchette droite",
"lambdacontrols.button.back": "Retour",
"lambdacontrols.button.start": "Touche Menu",
"lambdacontrols.button.guide": "Guide",
"lambdacontrols.button.left_thumb": "Stick gauche",
"lambdacontrols.button.right_thumb": "Stick droit",
"lambdacontrols.button.dpad_up": "D-Pad haut",
"lambdacontrols.button.dpad_right": "D-Pad droit",
"lambdacontrols.button.dpad_down": "D-Pad bas",
"lambdacontrols.button.dpad_left": "D-Pad gauche",
"lambdacontrols.axis.left_x+": "X+ Gauche",
"lambdacontrols.axis.left_y+": "Y+ Gauche",
"lambdacontrols.axis.right_x+": "X+ Droit",
"lambdacontrols.axis.right_y+": "Y+ Droit",
"lambdacontrols.axis.left_trigger": "Gâchette gauche",
"lambdacontrols.axis.right_trigger": "Gâchette droite",
"lambdacontrols.axis.left_x-": "X- Gauche",
"lambdacontrols.axis.left_y-": "Y- Gauche",
"lambdacontrols.axis.right_x-": "X- Droit",
"lambdacontrols.axis.right_y-": "Y- Droit",
"lambdacontrols.button.unknown": "Inconnu (%d)",
"lambdacontrols.controller.connected": "Manette %d connecté.",
"lambdacontrols.controller.disconnected": "Manette %d déconnecté.",
"lambdacontrols.controller.mappings.1": "Pour configurer les correspondances de la manette, veuillez utiliser %s",
"lambdacontrols.controller.mappings.3": "et copier/coller les correspondances dans l'éditeur de manette.",
"lambdacontrols.controller.mappings.error": "Une erreur est apparue pendant le chargement des manettes.",
"lambdacontrols.controller.mappings.error.write": "Une erreur est apparue pendant l'écriture des manettes au fichier.",
"lambdacontrols.controller.mappings.updated": "Configuration des manettes mise à jour!",
"lambdacontrols.controller_type.default": "default",
"lambdacontrols.controller_type.dualshock": "DualShock",
"lambdacontrols.controller_type.switch": "Switch",
"lambdacontrols.controller_type.xbox": "Xbox",
"lambdacontrols.controller_type.steam": "Steam",
"lambdacontrols.controller_type.ouya": "OUYA",
"lambdacontrols.controls_mode.default": "Clavier/Souris",
"lambdacontrols.controls_mode.controller": "Manette",
"lambdacontrols.controls_mode.touchscreen": "Tactile",
"lambdacontrols.hud_side.left": "gauche",
"lambdacontrols.hud_side.right": "droit",
"lambdacontrols.menu.analog_movement": "Mouvement analogique",
"lambdacontrols.menu.auto_switch_mode": "Changement auto de mode",
"lambdacontrols.menu.controller": "Manette",
"lambdacontrols.menu.controller2": "Deuxième manette",
"lambdacontrols.menu.controller_type": "Type de manette",
"lambdacontrols.menu.controls_mode": "Mode",
"lambdacontrols.menu.fast_block_placing": "Placement rapide de blocs",
"lambdacontrols.menu.fly_drifting": "Inertie de vol",
"lambdacontrols.menu.fly_drifting_vertical": "Inertie verticale de vol",
"lambdacontrols.menu.hud_enable": "Activer le HUD",
"lambdacontrols.menu.hud_side": "Côté du HUD",
"lambdacontrols.menu.invert_right_x_axis": "Inverser le stick droit (X)",
"lambdacontrols.menu.invert_right_y_axis": "Inverser le stick droit (Y)",
"lambdacontrols.menu.keyboard_controls": "Contrôles clavier...",
"lambdacontrols.menu.left_dead_zone": "Zone morte axe gauche",
"lambdacontrols.menu.mappings.open_input_str": "Ouvrir l'éditeur de fichier des manettes",
"lambdacontrols.menu.max_left_x_value": "Valeur maximale de l'axe X gauche",
"lambdacontrols.menu.max_left_y_value": "Valeur maximale de l'axe Y gauche",
"lambdacontrols.menu.max_right_x_value": "Valeur maximale de l'axe X droit",
"lambdacontrols.menu.max_right_y_value": "Valeur maximale de l'axe Y droit",
"lambdacontrols.menu.mouse_speed": "Vitesse de la souris",
"lambdacontrols.menu.reacharound.horizontal": "Placement avant de bloc",
"lambdacontrols.menu.reacharound.vertical": "Placement vertical",
"lambdacontrols.menu.reload_controller_mappings": "Recharger les manettes",
"lambdacontrols.menu.right_dead_zone": "Zone morte axe droit",
"lambdacontrols.menu.rotation_speed": "Vitesse de rotation",
"lambdacontrols.menu.separator.general": "Général",
"lambdacontrols.menu.separator.controller": "Manette",
"lambdacontrols.menu.title": "LambdaControls - Paramètres",
"lambdacontrols.menu.title.controller": "Options de manettes",
"lambdacontrols.menu.title.controller_controls": "Contrôles de la manette",
"lambdacontrols.menu.title.gameplay": "Options de Gameplay",
"lambdacontrols.menu.title.general": "Options générales",
"lambdacontrols.menu.title.hud": "Options du HUD",
"lambdacontrols.menu.title.mappings.string": "Éditeur de manettes",
"lambdacontrols.menu.title.visual": "Options d'apparences",
"lambdacontrols.menu.unfocused_input": "Entrée en fond",
"lambdacontrols.menu.virtual_mouse": "Souris virtuelle",
"lambdacontrols.menu.virtual_mouse.skin": "Apparence souris virtuelle",
"lambdacontrols.narrator.unbound": "Délier %s",
"lambdacontrols.not_bound": "Non défini",
"lambdacontrols.tooltip.analog_movement": "Active le mouvement analogique si possible.",
"lambdacontrols.tooltip.auto_switch_mode": "Détermine si le mode de contrôle doit automatiquement changer sur Manette si une manette est connectée et inversement.",
"lambdacontrols.tooltip.controller2": "Défini une deuxième manette, utile dans le cas d'utilisation de Joy-Cons.",
"lambdacontrols.tooltip.controller_type": "Le type de contrôle n'influe que sur les boutons affichés.",
"lambdacontrols.tooltip.controls_mode": "Change le mode de contrôle.",
"lambdacontrols.tooltip.fast_block_placing": "Active le placement rapide de blocs en vol.",
"lambdacontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement Vanilla.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical Vanilla.",
"lambdacontrols.tooltip.hud_enable": "Détermine si l'indicateur des buttons de la manette doit être affiché ou non.",
"lambdacontrols.tooltip.hud_side": "Change la position du HUD.",
"lambdacontrols.tooltip.left_dead_zone": "Zone morte de l'axe gauche de la manette.",
"lambdacontrols.tooltip.max_left_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.max_left_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.max_right_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.max_right_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.mouse_speed": "Change la vitesse de la souris émulée par la manette.",
"lambdacontrols.tooltip.reacharound.horizontal": "Active le placement avant de blocs, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"lambdacontrols.tooltip.reacharound.vertical": "Active le placement vertical de blocs, c'est-à-dire de blocs en dessous du bloc sur lequel vous êtes placé, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"lambdacontrols.tooltip.reload_controller_mappings": "Recharge le fichier de configuration des manettes.",
"lambdacontrols.tooltip.right_dead_zone": "Zone morte de l'axe droit de la manette.",
"lambdacontrols.tooltip.rotation_speed": "Change la vitesse de rotation de la caméra.",
"lambdacontrols.tooltip.unfocused_input": "Autorise les entrées manette quand la fenêtre n'est pas sélectionnée.",
"lambdacontrols.tooltip.virtual_mouse": "Active la souris virtuelle qui est pratique dans le cas d'un écran partagé.",
"lambdacontrols.virtual_mouse.skin.default_light": "défaut clair",
"lambdacontrols.virtual_mouse.skin.default_dark": "défaut foncé",
"lambdacontrols.virtual_mouse.skin.second_light": "second clair",
"lambdacontrols.virtual_mouse.skin.second_dark": "second foncé"
}

View File

@@ -1,150 +0,0 @@
{
"key.lambdacontrols.look_down": "Regarder en bas",
"key.lambdacontrols.look_left": "Regarder à gauche",
"key.lambdacontrols.look_right": "Regarder à droite",
"key.lambdacontrols.look_up": "Regarder en haut",
"key.lambdacontrols.ring": "Affiche l'anneau de contrôle",
"lambdacontrols.action.attack": "Attaquer",
"lambdacontrols.action.back": "Reculer",
"lambdacontrols.action.chat": "Ouvrir le tchat",
"lambdacontrols.action.drop_item": "Jeter l'objet",
"lambdacontrols.action.exit": "Sortir",
"lambdacontrols.action.forward": "Avancer",
"lambdacontrols.action.hit": "Taper",
"lambdacontrols.action.hotbar_left": "Case à gauche de la barre d'action",
"lambdacontrols.action.hotbar_right": "Case à droite de la barre d'action",
"lambdacontrols.action.inventory": "Inventaire",
"lambdacontrols.action.jump": "Sauter",
"lambdacontrols.action.left": "Aller à gauche",
"lambdacontrols.action.pause_game": "Mettre en pause le jeu",
"lambdacontrols.action.pick_block": "Choisir le bloc",
"lambdacontrols.action.pickup": "Prendre",
"lambdacontrols.action.pickup_all": "Prendre tout",
"lambdacontrols.action.place": "Placer",
"lambdacontrols.action.player_list": "Afficher la liste des joueurs",
"lambdacontrols.action.quick_move": "Mouvement rapide",
"lambdacontrols.action.right": "Aller à droite",
"lambdacontrols.action.screenshot": "Prendre une capture d'écran",
"lambdacontrols.action.sneak": "S'accroupir",
"lambdacontrols.action.sprint": "Courir",
"lambdacontrols.action.swap_hands": "Échanger de mains",
"lambdacontrols.action.toggle_perspective": "Changer de point de vue",
"lambdacontrols.action.toggle_smooth_camera": "Basculer en mode cinématique",
"lambdacontrols.action.use": "Utiliser",
"lambdacontrols.action.zoom": "Zoom",
"lambdacontrols.action.zoom_in": "Augmenter le zoom",
"lambdacontrols.action.zoom_out": "Diminuer le zoom",
"lambdacontrols.action.zoom_reset": "Remettre le zoom à zéro",
"lambdacontrols.button.a": "A",
"lambdacontrols.button.b": "B",
"lambdacontrols.button.x": "X",
"lambdacontrols.button.y": "Y",
"lambdacontrols.button.left_bumper": "Gâchette gauche",
"lambdacontrols.button.right_bumper": "Gâchette droite",
"lambdacontrols.button.back": "Retour",
"lambdacontrols.button.start": "Touche Menu",
"lambdacontrols.button.guide": "Guide",
"lambdacontrols.button.left_thumb": "Stick gauche",
"lambdacontrols.button.right_thumb": "Stick droit",
"lambdacontrols.button.dpad_up": "D-Pad haut",
"lambdacontrols.button.dpad_right": "D-Pad droit",
"lambdacontrols.button.dpad_down": "D-Pad bas",
"lambdacontrols.button.dpad_left": "D-Pad gauche",
"lambdacontrols.axis.left_x+": "X+ Gauche",
"lambdacontrols.axis.left_y+": "Y+ Gauche",
"lambdacontrols.axis.right_x+": "X+ Droit",
"lambdacontrols.axis.right_y+": "Y+ Droit",
"lambdacontrols.axis.left_trigger": "Gâchette gauche",
"lambdacontrols.axis.right_trigger": "Gâchette droite",
"lambdacontrols.axis.left_x-": "X- Gauche",
"lambdacontrols.axis.left_y-": "Y- Gauche",
"lambdacontrols.axis.right_x-": "X- Droit",
"lambdacontrols.axis.right_y-": "Y- Droit",
"lambdacontrols.button.unknown": "Inconnu (%d)",
"lambdacontrols.controller.connected": "Manette %d connecté.",
"lambdacontrols.controller.disconnected": "Manette %d déconnecté.",
"lambdacontrols.controller.mappings.1": "Pour configurer les correspondances de la manette, veuillez utiliser %s",
"lambdacontrols.controller.mappings.3": "et copier/coller les correspondances dans l'éditeur de manette.",
"lambdacontrols.controller.mappings.error": "Une erreur est apparue pendant le chargement des manettes.",
"lambdacontrols.controller.mappings.error.write": "Une erreur est apparue pendant l'écriture des manettes au fichier.",
"lambdacontrols.controller.mappings.updated": "Configuration des manettes mise à jour!",
"lambdacontrols.controller_type.default": "default",
"lambdacontrols.controller_type.dualshock": "DualShock",
"lambdacontrols.controller_type.switch": "Switch",
"lambdacontrols.controller_type.xbox": "Xbox",
"lambdacontrols.controller_type.steam": "Steam",
"lambdacontrols.controller_type.ouya": "OUYA",
"lambdacontrols.controls_mode.default": "Clavier/Souris",
"lambdacontrols.controls_mode.controller": "Manette",
"lambdacontrols.controls_mode.touchscreen": "Tactile",
"lambdacontrols.hud_side.left": "gauche",
"lambdacontrols.hud_side.right": "droit",
"lambdacontrols.menu.analog_movement": "Mouvement analogique",
"lambdacontrols.menu.auto_switch_mode": "Changement auto de mode",
"lambdacontrols.menu.controller": "Manette",
"lambdacontrols.menu.controller2": "Deuxième manette",
"lambdacontrols.menu.controller_type": "Type de manette",
"lambdacontrols.menu.controls_mode": "Mode",
"lambdacontrols.menu.fast_block_placing": "Placement rapide de blocs",
"lambdacontrols.menu.fly_drifting": "Inertie de vol",
"lambdacontrols.menu.fly_drifting_vertical": "Inertie verticale de vol",
"lambdacontrols.menu.hud_enable": "Activer le HUD",
"lambdacontrols.menu.hud_side": "Côté du HUD",
"lambdacontrols.menu.invert_right_x_axis": "Inverser le stick droit (X)",
"lambdacontrols.menu.invert_right_y_axis": "Inverser le stick droit (Y)",
"lambdacontrols.menu.keyboard_controls": "Contrôles clavier...",
"lambdacontrols.menu.left_dead_zone": "Zone morte axe gauche",
"lambdacontrols.menu.mappings.open_input_str": "Ouvrir l'éditeur de fichier des manettes",
"lambdacontrols.menu.max_left_x_value": "Valeur maximale de l'axe X gauche",
"lambdacontrols.menu.max_left_y_value": "Valeur maximale de l'axe Y gauche",
"lambdacontrols.menu.max_right_x_value": "Valeur maximale de l'axe X droit",
"lambdacontrols.menu.max_right_y_value": "Valeur maximale de l'axe Y droit",
"lambdacontrols.menu.mouse_speed": "Vitesse de la souris",
"lambdacontrols.menu.reacharound.horizontal": "Placement avant de bloc",
"lambdacontrols.menu.reacharound.vertical": "Placement vertical",
"lambdacontrols.menu.reload_controller_mappings": "Recharger les manettes",
"lambdacontrols.menu.right_dead_zone": "Zone morte axe droit",
"lambdacontrols.menu.rotation_speed": "Vitesse de rotation",
"lambdacontrols.menu.separator.general": "Général",
"lambdacontrols.menu.separator.controller": "Manette",
"lambdacontrols.menu.title": "LambdaControls - Paramètres",
"lambdacontrols.menu.title.controller": "Options de manettes",
"lambdacontrols.menu.title.controller_controls": "Contrôles de la manette",
"lambdacontrols.menu.title.gameplay": "Options de Gameplay",
"lambdacontrols.menu.title.general": "Options générales",
"lambdacontrols.menu.title.hud": "Options du HUD",
"lambdacontrols.menu.title.mappings.string": "Éditeur de manettes",
"lambdacontrols.menu.title.visual": "Options d'apparences",
"lambdacontrols.menu.unfocused_input": "Entrée en fond",
"lambdacontrols.menu.virtual_mouse": "Souris virtuelle",
"lambdacontrols.menu.virtual_mouse.skin": "Apparence souris virtuelle",
"lambdacontrols.narrator.unbound": "Délier %s",
"lambdacontrols.not_bound": "Non défini",
"lambdacontrols.tooltip.analog_movement": "Active le mouvement analogique si possible.",
"lambdacontrols.tooltip.auto_switch_mode": "Détermine si le mode de contrôle doit automatiquement changer sur Manette si une manette est connectée et inversement.",
"lambdacontrols.tooltip.controller2": "Défini une deuxième manette, utile dans le cas d'utilisation de Joy-Cons.",
"lambdacontrols.tooltip.controller_type": "Le type de contrôle n'influe que sur les boutons affichés.",
"lambdacontrols.tooltip.controls_mode": "Change le mode de contrôle.",
"lambdacontrols.tooltip.fast_block_placing": "Active le placement rapide de blocs en vol.",
"lambdacontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement Vanilla.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical Vanilla.",
"lambdacontrols.tooltip.hud_enable": "Détermine si l'indicateur des buttons de la manette doit être affiché ou non.",
"lambdacontrols.tooltip.hud_side": "Change la position du HUD.",
"lambdacontrols.tooltip.left_dead_zone": "Zone morte de l'axe gauche de la manette.",
"lambdacontrols.tooltip.max_left_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.max_left_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.max_right_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.max_right_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"lambdacontrols.tooltip.mouse_speed": "Change la vitesse de la souris émulée par la manette.",
"lambdacontrols.tooltip.reacharound.horizontal": "Active le placement avant de blocs, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"lambdacontrols.tooltip.reacharound.vertical": "Active le placement vertical de blocs, c'est-à-dire de blocs en dessous du bloc sur lequel vous êtes placé, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"lambdacontrols.tooltip.reload_controller_mappings": "Recharge le fichier de configuration des manettes.",
"lambdacontrols.tooltip.right_dead_zone": "Zone morte de l'axe droit de la manette.",
"lambdacontrols.tooltip.rotation_speed": "Change la vitesse de rotation de la caméra.",
"lambdacontrols.tooltip.unfocused_input": "Autorise les entrées manette quand la fenêtre n'est pas sélectionnée.",
"lambdacontrols.tooltip.virtual_mouse": "Active la souris virtuelle qui est pratique dans le cas d'un écran partagé.",
"lambdacontrols.virtual_mouse.skin.default_light": "défaut clair",
"lambdacontrols.virtual_mouse.skin.default_dark": "défaut foncé",
"lambdacontrols.virtual_mouse.skin.second_light": "second clair",
"lambdacontrols.virtual_mouse.skin.second_dark": "second foncé"
}

View File

@@ -1,135 +0,0 @@
{
"key.lambdacontrols.look_down": "Aşağı bak",
"key.lambdacontrols.look_left": "Sola bak",
"key.lambdacontrols.look_right": "Sağa bak",
"key.lambdacontrols.look_up": "Yukarıya bak",
"key.lambdacontrols.ring": "Kontroller halkasını göster",
"lambdacontrols.action.attack": "Saldırma/Kazma",
"lambdacontrols.action.back": "Geri",
"lambdacontrols.action.chat": "Sohbeti Açma",
"lambdacontrols.action.drop_item": "Seçili Eşyayı Bırakma",
"lambdacontrols.action.exit": ık",
"lambdacontrols.action.forward": "İleri",
"lambdacontrols.action.hit": "Vurma",
"lambdacontrols.action.hotbar_left": "Sık Kullanılanlar'da sola git",
"lambdacontrols.action.hotbar_right": "Sık Kullanılanlar'da sağa git",
"lambdacontrols.action.inventory": "Envanter",
"lambdacontrols.action.jump": "Zıplama",
"lambdacontrols.action.left": "Sol",
"lambdacontrols.action.pause_game": "Oyunu durdur",
"lambdacontrols.action.pick_block": "Blok Seçme",
"lambdacontrols.action.pickup": "Al",
"lambdacontrols.action.pickup_all": "Hepsini Al",
"lambdacontrols.action.place": "Yerleştir",
"lambdacontrols.action.player_list": "Oyuncu Listesi",
"lambdacontrols.action.quick_move": "Hızlı Hareket",
"lambdacontrols.action.right": "Sağ",
"lambdacontrols.action.screenshot": "Ekran Görüntüsü Alma",
"lambdacontrols.action.sneak": "Eğilme",
"lambdacontrols.action.sprint": "Koşma",
"lambdacontrols.action.swap_hands": "Ögeyi Elden Ele Değiştir",
"lambdacontrols.action.toggle_perspective": "Perspektifi Değiştirme",
"lambdacontrols.action.toggle_smooth_camera": "Sinemaitk Kameraya Geçme",
"lambdacontrols.action.use": "Kullanma",
"lambdacontrols.action.zoom": "Büyütme",
"lambdacontrols.action.zoom_in": "Büyütmeyi Arttır",
"lambdacontrols.action.zoom_out": "Büyütmeyi Azalt",
"lambdacontrols.action.zoom_reset": "Büyütmeyi Sıfırla",
"lambdacontrols.button.a": "A",
"lambdacontrols.button.b": "B",
"lambdacontrols.button.x": "X",
"lambdacontrols.button.y": "Y",
"lambdacontrols.button.left_bumper": "Sol yassı tuş",
"lambdacontrols.button.right_bumper": "Sağ yassı tuş",
"lambdacontrols.button.back": "Back",
"lambdacontrols.button.start": "Start",
"lambdacontrols.button.guide": "Guide",
"lambdacontrols.button.left_thumb": "Sol çubuk",
"lambdacontrols.button.right_thumb": "Sağ çubuk",
"lambdacontrols.button.dpad_up": "Yukarı yön tuşu",
"lambdacontrols.button.dpad_right": "Sağ yön tuşu",
"lambdacontrols.button.dpad_down": "Aşağı yön tuşu",
"lambdacontrols.button.dpad_left": "Sol yön tuşu",
"lambdacontrols.axis.left_x+": "Sol X+",
"lambdacontrols.axis.left_y+": "Sol Y+",
"lambdacontrols.axis.right_x+": "Sağ X+",
"lambdacontrols.axis.right_y+": "Sağ Y+",
"lambdacontrols.axis.left_trigger": "Sol tetik tuşu",
"lambdacontrols.axis.right_trigger": "Sağ tetik tuşu",
"lambdacontrols.axis.left_x-": "Sol X-",
"lambdacontrols.axis.left_y-": "Sol Y-",
"lambdacontrols.axis.right_x-": "Sağ X-",
"lambdacontrols.axis.right_y-": "Sağ Y-",
"lambdacontrols.button.unknown": "Bilinmeyen (%d)",
"lambdacontrols.controller.connected": "%d oyun kolu bağlandı.",
"lambdacontrols.controller.disconnected": "%d oyun kolunun bağlantısı kesildi.",
"lambdacontrols.controller.mappings.1": "Oyun kolunun tuş eşleştirme ayarını yapacaksanız, lütfen sunu kullanın: %sSDL2 Gamepad Tool%s",
"lambdacontrols.controller.mappings.3": "ve eşleştirme dosyasını da şuraya koyun: `%s.minecraft/config/gamecontrollerdb.txt%s`.",
"lambdacontrols.controller.mappings.error": "Eşleştirme yüklenirken hata oluştu.",
"lambdacontrols.controller.mappings.error.write": "Dosyaya eşleştirme yazılırken hata oluştu.",
"lambdacontrols.controller.mappings.updated": "Eşleştirme güncellendi!",
"lambdacontrols.controller_type.default": "varsayılan",
"lambdacontrols.controller_type.dualshock": "DualShock",
"lambdacontrols.controller_type.switch": "Switch",
"lambdacontrols.controller_type.xbox": "Xbox",
"lambdacontrols.controller_type.steam": "Steam",
"lambdacontrols.controller_type.ouya": "OUYA",
"lambdacontrols.controls_mode.default": "Klavye/Fare",
"lambdacontrols.controls_mode.controller": "Oyun Kolu",
"lambdacontrols.controls_mode.touchscreen": "Dokunmatik Ekran",
"lambdacontrols.hud_side.left": "sol",
"lambdacontrols.hud_side.right": "sağ",
"lambdacontrols.menu.auto_switch_mode": "Otomatik Değiştirme Modu",
"lambdacontrols.menu.controller": "Oyun Kolu",
"lambdacontrols.menu.controller2": "İkincil Oyun Kolu",
"lambdacontrols.menu.controller_type": "Oyun Kolu Türü",
"lambdacontrols.menu.controls_mode": "Mod",
"lambdacontrols.menu.dead_zone": "Ölü Bölge",
"lambdacontrols.menu.fast_block_placing": "Hızlı Blok Yerleştirme",
"lambdacontrols.menu.fly_drifting": "Kayarak Uç",
"lambdacontrols.menu.fly_drifting_vertical": "Dikey uçuşta kayaaak git",
"lambdacontrols.menu.hud_enable": "HUD'u Etkinleştir",
"lambdacontrols.menu.hud_side": "HUD Yanı",
"lambdacontrols.menu.invert_right_x_axis": "Sağ X'i Terse Çevir",
"lambdacontrols.menu.invert_right_y_axis": "Sağ Y'i Terse Çevir.",
"lambdacontrols.menu.keyboard_controls": "Klavye Kontrolleri...",
"lambdacontrols.menu.mappings.open_input_str": "Eşleştirme Dosya Editörünü Aç",
"lambdacontrols.menu.mouse_speed": "Fare Hızı",
"lambdacontrols.menu.reacharound.horizontal": "Alt Öne Blok Koyma",
"lambdacontrols.menu.reacharound.vertical": "En Alta Blok Koyma",
"lambdacontrols.menu.reload_controller_mappings": "Oyun Kolu Eşleştirmelerini Yenile",
"lambdacontrols.menu.rotation_speed": "Dönme Hızı",
"lambdacontrols.menu.title": "LambdaControls - Ayarlar",
"lambdacontrols.menu.title.controller": "Oyun Kolu Seçenekleri",
"lambdacontrols.menu.title.controller_controls": "Oyun Kolu Kontrolleri",
"lambdacontrols.menu.title.gameplay": "Oynanış Seçenekleri",
"lambdacontrols.menu.title.general": "Genel Seçenekler",
"lambdacontrols.menu.title.hud": "HUD Seçenekleri",
"lambdacontrols.menu.title.mappings.string": "Eşleştirme Dosya Editörü",
"lambdacontrols.menu.unfocused_input": "Odaklanmamış Giriş Aygıtı",
"lambdacontrols.menu.virtual_mouse": "Sanal Fare",
"lambdacontrols.menu.virtual_mouse.skin": "Sanal Fare Görünümü",
"lambdacontrols.narrator.unbound": "%s Atanmamış",
"lambdacontrols.not_bound": "Tuş ataması yok",
"lambdacontrols.tooltip.auto_switch_mode": "Eğer bir tanesi bağlandıysa, kontrol modu Oyun Kolu olarak değişmeli.",
"lambdacontrols.tooltip.controller2": "Kullanılacak ikinci oyun kolu, örnek olarak Joy-Con desteği de mümkün.",
"lambdacontrols.tooltip.controller_type": "Doğru tuşları göstermesi için oyun kolu türü.",
"lambdacontrols.tooltip.controls_mode": "Kontrol Modu",
"lambdacontrols.tooltip.dead_zone": "Oyun kolunun analog çubukları için ayarlanan ölü bölge/dead zone",
"lambdacontrols.tooltip.fast_block_placing": "Yaratıcı modda uçarken, hızına bağlı olarak hızlı blok koymayı etkinleştirir. §cBazı sunucular bunun hile olduğunu düşünebilir.",
"lambdacontrols.tooltip.fly_drifting": "Uçarken, Vanilla'daki gibi ani duruşlarda kayma efektini etkinleştirir.",
"lambdacontrols.tooltip.fly_drifting_vertical": "Yukarı/aşağı uçarken, Vanilla'daki gibi ani duruşlarda kayma efektini etkinleştirir.",
"lambdacontrols.tooltip.hud_enable": "Ekranın üstünde oyun kolu tuşu göstergesini açar/kapatır.",
"lambdacontrols.tooltip.hud_side": "HUD'un konumu",
"lambdacontrols.tooltip.mouse_speed": "Oyun kolunun taklit edilen fare hızı.",
"lambdacontrols.tooltip.reacharound.horizontal": "Hızlı blok koymayı etkinleştirir. §cBazı sunucular bunun hile olduğunu düşünebilir.§r.",
"lambdacontrols.tooltip.reacharound.vertical": "En alta blok koymayı etkinleştirir. §cBazı sunucular bunun hile olduğunu düşünebilir.§r.",
"lambdacontrols.tooltip.reload_controller_mappings": "Oyun kolu için eşleştirme dosyasını yeniler.",
"lambdacontrols.tooltip.rotation_speed": "Oyun kolu modunda olan kamera dönme hızı",
"lambdacontrols.tooltip.unfocused_input": "Oyun penceresinde değilken oyun kolu girişine izine verir.",
"lambdacontrols.tooltip.virtual_mouse": "Sanal fareyi etkinleştirir. Çift ekran oynanılacağı zaman işe yarar.",
"lambdacontrols.virtual_mouse.skin.default_light": "Varsayılan Aydınlık Tema",
"lambdacontrols.virtual_mouse.skin.default_dark": "Varsayılan Karanlık Tema",
"lambdacontrols.virtual_mouse.skin.second_light": "İkincil Aydınlık Tema",
"lambdacontrols.virtual_mouse.skin.second_dark": "İkincil Karanlık Tema"
}

View File

@@ -1,150 +0,0 @@
{
"key.lambdacontrols.look_down": "视角下移",
"key.lambdacontrols.look_left": "视角左移",
"key.lambdacontrols.look_right": "视角右移",
"key.lambdacontrols.look_up": "视角上移",
"key.lambdacontrols.ring": "显示额外按键菜单",
"lambdacontrols.action.attack": "攻击",
"lambdacontrols.action.back": "向后移动",
"lambdacontrols.action.chat": "打开聊天栏",
"lambdacontrols.action.drop_item": "丢弃所选物品",
"lambdacontrols.action.exit": "退出",
"lambdacontrols.action.forward": "向前移动",
"lambdacontrols.action.hit": "挖掘",
"lambdacontrols.action.hotbar_left": "向左循环选择快捷栏",
"lambdacontrols.action.hotbar_right": "向右循环选择快捷栏",
"lambdacontrols.action.inventory": "物品栏",
"lambdacontrols.action.jump": "跳跃",
"lambdacontrols.action.left": "向左移动",
"lambdacontrols.action.pause_game": "暂停游戏",
"lambdacontrols.action.pick_block": "选取方块",
"lambdacontrols.action.pickup": "拿取一个/拿取一半",
"lambdacontrols.action.pickup_all": "拿取一组/拿取全部",
"lambdacontrols.action.place": "放置方块",
"lambdacontrols.action.player_list": "玩家列表",
"lambdacontrols.action.quick_move": "快速移动物品",
"lambdacontrols.action.right": "向右移动",
"lambdacontrols.action.screenshot": "截图",
"lambdacontrols.action.sneak": "潜行",
"lambdacontrols.action.sprint": "疾跑",
"lambdacontrols.action.swap_hands": "与副手交换",
"lambdacontrols.action.toggle_perspective": "切换视角",
"lambdacontrols.action.toggle_smooth_camera": "切换电影视角",
"lambdacontrols.action.use": "使用物品/放置方块",
"lambdacontrols.action.zoom": "视野缩放",
"lambdacontrols.action.zoom_in": "缩放时将视野推近",
"lambdacontrols.action.zoom_out": "缩放时将视野拉远",
"lambdacontrols.action.zoom_reset": "缩放时重置缩放距离",
"lambdacontrols.button.a": "A",
"lambdacontrols.button.b": "B",
"lambdacontrols.button.x": "X",
"lambdacontrols.button.y": "Y",
"lambdacontrols.button.left_bumper": "左肩键",
"lambdacontrols.button.right_bumper": "右肩键",
"lambdacontrols.button.back": "选择键",
"lambdacontrols.button.start": "开始键",
"lambdacontrols.button.guide": "功能键",
"lambdacontrols.button.left_thumb": "左摇杆(按压)",
"lambdacontrols.button.right_thumb": "右摇杆(按压)",
"lambdacontrols.button.dpad_up": "十字键上",
"lambdacontrols.button.dpad_right": "十字键右",
"lambdacontrols.button.dpad_down": "十字键下",
"lambdacontrols.button.dpad_left": "十字键左",
"lambdacontrols.axis.left_x+": "左摇杆右X轴正向",
"lambdacontrols.axis.left_y+": "左摇杆上Y轴正向",
"lambdacontrols.axis.right_x+": "右摇杆右X轴正向",
"lambdacontrols.axis.right_y+": "右摇杆上Y轴正向",
"lambdacontrols.axis.left_trigger": "左扳机键",
"lambdacontrols.axis.right_trigger": "右扳机键",
"lambdacontrols.axis.left_x-": "左摇杆左X轴负向",
"lambdacontrols.axis.left_y-": "左摇杆下Y轴负向",
"lambdacontrols.axis.right_x-": "右摇杆左X轴负向",
"lambdacontrols.axis.right_y-": "右摇杆下Y轴负向",
"lambdacontrols.button.unknown": "未知(%d",
"lambdacontrols.controller.connected": "手柄 %d 已连接。",
"lambdacontrols.controller.disconnected": "手柄 %d 已断开。",
"lambdacontrols.controller.mappings.1": "请使用 %s 配置手柄按键映射",
"lambdacontrols.controller.mappings.3": "并将按键映射文件放入此路径:`%s.minecraft/config/gamecontrollerdb.txt%s`。",
"lambdacontrols.controller.mappings.error": "发生错误,无法读取按键映射文件。",
"lambdacontrols.controller.mappings.error.write": "发生错误,无法保存按键映射文件。",
"lambdacontrols.controller.mappings.updated": "按键映射已更新!",
"lambdacontrols.controller_type.default": "默认",
"lambdacontrols.controller_type.dualshock": "DualShock",
"lambdacontrols.controller_type.switch": "Switch",
"lambdacontrols.controller_type.xbox": "Xbox",
"lambdacontrols.controller_type.steam": "Steam",
"lambdacontrols.controller_type.ouya": "OUYA",
"lambdacontrols.controls_mode.default": "键鼠",
"lambdacontrols.controls_mode.controller": "手柄",
"lambdacontrols.controls_mode.touchscreen": "触摸屏",
"lambdacontrols.hud_side.left": "左侧",
"lambdacontrols.hud_side.right": "右侧",
"lambdacontrols.menu.analog_movement": "识别摇杆输入的精确值",
"lambdacontrols.menu.auto_switch_mode": "自动切换模式",
"lambdacontrols.menu.controller": "手柄",
"lambdacontrols.menu.controller2": "额外手柄",
"lambdacontrols.menu.controller_type": "手柄类型",
"lambdacontrols.menu.controls_mode": "模式",
"lambdacontrols.menu.fast_block_placing": "方块快速放置",
"lambdacontrols.menu.fly_drifting": "水平方向飞行惯性",
"lambdacontrols.menu.fly_drifting_vertical": "垂直方向飞行惯性",
"lambdacontrols.menu.hud_enable": "启用HUD",
"lambdacontrols.menu.hud_side": "HUD位置",
"lambdacontrols.menu.invert_right_x_axis": "反转右摇杆X轴",
"lambdacontrols.menu.invert_right_y_axis": "反转右摇杆Y轴",
"lambdacontrols.menu.keyboard_controls": "键盘控制…",
"lambdacontrols.menu.left_dead_zone": "左摇杆死区",
"lambdacontrols.menu.mappings.open_input_str": "编辑按键映射文件",
"lambdacontrols.menu.max_left_x_value": "左摇杆X轴最大值识别范围",
"lambdacontrols.menu.max_left_y_value": "左摇杆Y轴最大值识别范围",
"lambdacontrols.menu.max_right_x_value": "右摇杆X轴最大值识别范围",
"lambdacontrols.menu.max_right_y_value": "右摇杆Y轴最大值识别范围",
"lambdacontrols.menu.mouse_speed": "鼠标移动速度",
"lambdacontrols.menu.reacharound.horizontal": "水平方向方块放置辅助",
"lambdacontrols.menu.reacharound.vertical": "垂直方向方块放置辅助",
"lambdacontrols.menu.reload_controller_mappings": "重新加载手柄按键映射",
"lambdacontrols.menu.right_dead_zone": "右摇杆死区",
"lambdacontrols.menu.rotation_speed": "镜头旋转速度",
"lambdacontrols.menu.separator.controller": "手柄",
"lambdacontrols.menu.separator.general": "通用",
"lambdacontrols.menu.title": "LambdaControls — 设置",
"lambdacontrols.menu.title.controller": "手柄选项",
"lambdacontrols.menu.title.controller_controls": "手柄控制",
"lambdacontrols.menu.title.gameplay": "游戏内容选项",
"lambdacontrols.menu.title.general": "通用选项",
"lambdacontrols.menu.title.hud": "HUD选项",
"lambdacontrols.menu.title.mappings.string": "编辑按键映射文件",
"lambdacontrols.menu.title.visual": "界面选项",
"lambdacontrols.menu.unfocused_input": "非活动状态输入",
"lambdacontrols.menu.virtual_mouse": "虚拟鼠标",
"lambdacontrols.menu.virtual_mouse.skin": "虚拟鼠标指针样式",
"lambdacontrols.narrator.unbound": "取消绑定 %s",
"lambdacontrols.not_bound": "未绑定",
"lambdacontrols.tooltip.analog_movement": "若游戏机制允许,则可根据推动摇杆的力度与幅度决定移动的速度。",
"lambdacontrols.tooltip.auto_switch_mode": "如果已有手柄连接,则自动切换为手柄操作模式。",
"lambdacontrols.tooltip.controller2": "使用额外的手柄,比如将一左一右的两个 Joy-Con 合为一个功能完全的手柄。",
"lambdacontrols.tooltip.controller_type": "选择手柄类型,以显示对应的按键图标。",
"lambdacontrols.tooltip.controls_mode": "操作模式",
"lambdacontrols.tooltip.fast_block_placing": "在创造模式中处于飞行状态时,可以根据你飞行的速度快速放置方块。\n§c在部分服务器可能会被认定为作弊。",
"lambdacontrols.tooltip.fly_drifting": "处于飞行状态时,启用原版的水平方向飞行惯性(缓停滑行)。",
"lambdacontrols.tooltip.fly_drifting_vertical": "处于飞行状态时,启用原版的垂直方向飞行惯性(缓停滑行)。",
"lambdacontrols.tooltip.hud_enable": "显示手柄按键操作提示。",
"lambdacontrols.tooltip.hud_side": "HUD的位置位于画面的哪一侧。",
"lambdacontrols.tooltip.left_dead_zone": "左摇杆配置的死区。\n死区决定摇杆要偏离中心位置多远才能让摇杆的输入有效。",
"lambdacontrols.tooltip.max_left_x_value": "更改左摇杆X轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致在识别摇杆输入的精确值的情况下左右移动较为缓慢等问题本项可能会有所帮助。",
"lambdacontrols.tooltip.max_left_y_value": "更改左摇杆Y轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致在识别摇杆输入的精确值的情况下前后移动较为缓慢等问题本项可能会有所帮助。",
"lambdacontrols.tooltip.max_right_x_value": "更改右摇杆X轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致镜头左右旋转较为缓慢等问题本项可能会有所帮助。",
"lambdacontrols.tooltip.max_right_y_value": "更改右摇杆Y轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致镜头上下旋转较为缓慢等问题本项可能会有所帮助。",
"lambdacontrols.tooltip.mouse_speed": "手柄模拟的鼠标的移动速度。",
"lambdacontrols.tooltip.reacharound.horizontal": "启用水平方向方块放置辅助,可在脚下方块的前方放置方块。\n§c在部分服务器可能会被认定为作弊。",
"lambdacontrols.tooltip.reacharound.vertical": "启用垂直方向方块放置辅助,可在脚下方块的下方放置方块。\n§c在部分服务器可能会被认定为作弊。",
"lambdacontrols.tooltip.reload_controller_mappings": "重新加载手柄的按键映射文件。",
"lambdacontrols.tooltip.right_dead_zone": "右摇杆配置的死区。\n死区决定摇杆要偏离中心位置多远才能让摇杆的输入有效。",
"lambdacontrols.tooltip.rotation_speed": "手柄操作模式下的镜头旋转速度。",
"lambdacontrols.tooltip.unfocused_input": "即使游戏窗口处于非活动状态,也允许手柄进行按键输入。",
"lambdacontrols.tooltip.virtual_mouse": "启用虚拟鼠标,在分屏的情况下很有用。",
"lambdacontrols.virtual_mouse.skin.default_light": "默认样式(白色)",
"lambdacontrols.virtual_mouse.skin.default_dark": "默认样式(黑色)",
"lambdacontrols.virtual_mouse.skin.second_light": "额外样式(白色)",
"lambdacontrols.virtual_mouse.skin.second_dark": "额外样式(黑色)"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -0,0 +1,157 @@
{
"midnightcontrols.midnightconfig.title": "MidnightControls Advanced Config",
"key.midnightcontrols.look_down": "Look down",
"key.midnightcontrols.look_left": "Look left",
"key.midnightcontrols.look_right": "Look right",
"key.midnightcontrols.look_up": "Look up",
"key.midnightcontrols.ring": "Show controls ring",
"midnightcontrols.action.attack": "Attack",
"midnightcontrols.action.back": "Back",
"midnightcontrols.action.chat": "Open Chat",
"midnightcontrols.action.drop_item": "Drop Item",
"midnightcontrols.action.exit": "Exit",
"midnightcontrols.action.forward": "Forward",
"midnightcontrols.action.hit": "Hit",
"midnightcontrols.action.hotbar_left": "Hotbar left",
"midnightcontrols.action.hotbar_right": "Hotbar right",
"midnightcontrols.action.inventory": "Inventory",
"midnightcontrols.action.jump": "Jump",
"midnightcontrols.action.left": "Left",
"midnightcontrols.action.pause_game": "Pause Game",
"midnightcontrols.action.pick_block": "Pick Block",
"midnightcontrols.action.pickup": "Pickup",
"midnightcontrols.action.pickup_all": "Pickup all",
"midnightcontrols.action.place": "Place",
"midnightcontrols.action.player_list": "Player List",
"midnightcontrols.action.quick_move": "Quick move",
"midnightcontrols.action.right": "Right",
"midnightcontrols.action.screenshot": "Take Screenshot",
"midnightcontrols.action.sneak": "Sneak",
"midnightcontrols.action.sprint": "Sprint",
"midnightcontrols.action.swap_hands": "Swap Hands",
"midnightcontrols.action.toggle_perspective": "Toggle Perspective",
"midnightcontrols.action.toggle_smooth_camera": "Toggle Cinematic Camera",
"midnightcontrols.action.use": "Use",
"midnightcontrols.action.zoom": "Zoom",
"midnightcontrols.action.zoom_in": "Increase Zoom",
"midnightcontrols.action.zoom_out": "Decrease Zoom",
"midnightcontrols.action.zoom_reset": "Reset Zoom",
"midnightcontrols.action.key.emotecraft.fastchoose": "Fast Choose Emote",
"midnightcontrols.action.key.emotecraft.stop": "Stop Emote",
"midnightcontrols.button.a": "A",
"midnightcontrols.button.b": "B",
"midnightcontrols.button.x": "X",
"midnightcontrols.button.y": "Y",
"midnightcontrols.button.left_bumper": "Left bumper",
"midnightcontrols.button.right_bumper": "Right bumper",
"midnightcontrols.button.back": "Back",
"midnightcontrols.button.start": "Start",
"midnightcontrols.button.guide": "Guide",
"midnightcontrols.button.left_thumb": "Left thumb",
"midnightcontrols.button.right_thumb": "Right thumb",
"midnightcontrols.button.dpad_up": "DPAD up",
"midnightcontrols.button.dpad_right": "DPAD right",
"midnightcontrols.button.dpad_down": "DPAD down",
"midnightcontrols.button.dpad_left": "DPAD left",
"midnightcontrols.button.l4": "L4",
"midnightcontrols.button.l5": "L5",
"midnightcontrols.button.r4": "R4",
"midnightcontrols.button.r5": "L5",
"midnightcontrols.axis.left_x+": "Left X+",
"midnightcontrols.axis.left_y+": "Left Y+",
"midnightcontrols.axis.right_x+": "Right X+",
"midnightcontrols.axis.right_y+": "Right Y+",
"midnightcontrols.axis.left_trigger": "Left trigger",
"midnightcontrols.axis.right_trigger": "Right trigger",
"midnightcontrols.axis.left_x-": "Left X-",
"midnightcontrols.axis.left_y-": "Left Y-",
"midnightcontrols.axis.right_x-": "Right X-",
"midnightcontrols.axis.right_y-": "Right Y-",
"midnightcontrols.button.unknown": "Unknown (%d)",
"midnightcontrols.controller.connected": "Controller %d connected.",
"midnightcontrols.controller.disconnected": "Controller %d disconnected.",
"midnightcontrols.controller.mappings.1": "To configure the controller mappings, please use %s",
"midnightcontrols.controller.mappings.3": "and paste the mapping in the mappings file editor.",
"midnightcontrols.controller.mappings.error": "Error while loading mappings.",
"midnightcontrols.controller.mappings.error.write": "Error while writing mappings to file.",
"midnightcontrols.controller.mappings.updated": "Updated mappings!",
"midnightcontrols.controller_type.default": "default",
"midnightcontrols.controller_type.dualshock": "DualShock",
"midnightcontrols.controller_type.switch": "Switch",
"midnightcontrols.controller_type.xbox": "Xbox",
"midnightcontrols.controller_type.steam": "Steam",
"midnightcontrols.controller_type.ouya": "OUYA",
"midnightcontrols.controls_mode.default": "Keyboard/Mouse",
"midnightcontrols.controls_mode.controller": "Controller",
"midnightcontrols.controls_mode.touchscreen": "Touchscreen",
"midnightcontrols.hud_side.left": "left",
"midnightcontrols.hud_side.right": "right",
"midnightcontrols.menu.analog_movement": "Analog Movement",
"midnightcontrols.menu.auto_switch_mode": "Auto Switch Mode",
"midnightcontrols.menu.controller": "Controller",
"midnightcontrols.menu.controller2": "Second Controller",
"midnightcontrols.menu.controller_type": "Controller Type",
"midnightcontrols.menu.controls_mode": "Mode",
"midnightcontrols.menu.fast_block_placing": "Fast Block Placing",
"midnightcontrols.menu.fly_drifting": "Fly Drifting",
"midnightcontrols.menu.fly_drifting_vertical": "Vertical Fly Drifting",
"midnightcontrols.menu.hud_enable": "Enable HUD",
"midnightcontrols.menu.hud_side": "HUD Side",
"midnightcontrols.menu.invert_right_x_axis": "Invert Right X",
"midnightcontrols.menu.invert_right_y_axis": "Invert Right Y",
"midnightcontrols.menu.keyboard_controls": "Keyboard Controls...",
"midnightcontrols.menu.left_dead_zone": "Left Dead Zone",
"midnightcontrols.menu.mappings.open_input_str": "Open Mappings File Editor",
"midnightcontrols.menu.max_left_x_value": "Left X Axis Max Value",
"midnightcontrols.menu.max_left_y_value": "Left Y Axis Max Value",
"midnightcontrols.menu.max_right_x_value": "Right X Axis Max Value",
"midnightcontrols.menu.max_right_y_value": "Right Y Axis Max Value",
"midnightcontrols.menu.mouse_speed": "Mouse Speed",
"midnightcontrols.menu.reacharound.horizontal": "Front Block Placing",
"midnightcontrols.menu.reacharound.vertical": "Vertical Reacharound",
"midnightcontrols.menu.reload_controller_mappings": "Reload Controller Mappings",
"midnightcontrols.menu.right_dead_zone": "Right Dead Zone",
"midnightcontrols.menu.rotation_speed": "Rotation Speed",
"midnightcontrols.menu.separator.controller": "Controller",
"midnightcontrols.menu.separator.general": "General",
"midnightcontrols.menu.title": "MidnightControls - Settings",
"midnightcontrols.menu.title.controller": "Controller Options",
"midnightcontrols.menu.title.controller_controls": "Controller Controls",
"midnightcontrols.menu.title.gameplay": "Gameplay Options",
"midnightcontrols.menu.title.general": "General Options",
"midnightcontrols.menu.title.hud": "HUD Options",
"midnightcontrols.menu.title.mappings.string": "Mappings File Editor",
"midnightcontrols.menu.title.visual": "Appearance Options",
"midnightcontrols.menu.unfocused_input": "Unfocused Input",
"midnightcontrols.menu.virtual_mouse": "Virtual Mouse",
"midnightcontrols.menu.virtual_mouse.skin": "Virtual Mouse Skin",
"midnightcontrols.narrator.unbound": "Unbound %s",
"midnightcontrols.not_bound": "Not bound",
"midnightcontrols.tooltip.analog_movement": "Enables analog movement when possible.",
"midnightcontrols.tooltip.auto_switch_mode": "If the controls mode should be switched to Controller automatically if one is connected.",
"midnightcontrols.tooltip.controller2": "Second controller to use, which allows Joy-Cons support for example.",
"midnightcontrols.tooltip.controller_type": "The controller type to display the correct buttons.",
"midnightcontrols.tooltip.controls_mode": "The controls mode.",
"midnightcontrols.tooltip.fast_block_placing": "While flying in creative mode, enables fast block placing depending on your speed. §cOn some servers this might be considered as cheating.",
"midnightcontrols.tooltip.fly_drifting": "While flying, enables Vanilla drifting/inertia.",
"midnightcontrols.tooltip.fly_drifting_vertical": "While flying, enables Vanilla vertical drifting/intertia.",
"midnightcontrols.tooltip.hud_enable": "Toggles the on-screen controller button indicator.",
"midnightcontrols.tooltip.hud_side": "The position of the HUD.",
"midnightcontrols.tooltip.left_dead_zone": "The dead zone for the controller's left analogue stick.",
"midnightcontrols.tooltip.max_left_x_value": "Changes what the mod considers the highest value for the left X axis. Useful if your axis does not use the full range and seems slow.",
"midnightcontrols.tooltip.max_left_y_value": "Changes what the mod considers the highest value for the left Y axis. Useful if your axis does not use the full range and seems slow.",
"midnightcontrols.tooltip.max_right_x_value": "Changes what the mod considers the highest value for the right X axis. Useful if your axis does not use the full range and seems slow.",
"midnightcontrols.tooltip.max_right_y_value": "Changes what the mod considers the highest value for the right Y axis. Useful if your axis does not use the full range and seems slow.",
"midnightcontrols.tooltip.mouse_speed": "The controller's emulated mouse speed.",
"midnightcontrols.tooltip.reacharound.horizontal": "Enables front block placing, §cmight be considered cheating on some servers§r.",
"midnightcontrols.tooltip.reacharound.vertical": "Enables vertical reacharound, §cmight be considered cheating on some servers§r.",
"midnightcontrols.tooltip.reload_controller_mappings": "Reloads the controller mappings file.",
"midnightcontrols.tooltip.right_dead_zone": "The dead zone for the controller's right analogue stick.",
"midnightcontrols.tooltip.rotation_speed": "The camera rotation speed in controller mode.",
"midnightcontrols.tooltip.unfocused_input": "Allow controller input when the window is not focused.",
"midnightcontrols.tooltip.virtual_mouse": "Enable the virtual mouse which is handful in the case of a splitscreen.",
"midnightcontrols.virtual_mouse.skin.default_light": "Default Light",
"midnightcontrols.virtual_mouse.skin.default_dark": "Default Dark",
"midnightcontrols.virtual_mouse.skin.second_light": "Second Light",
"midnightcontrols.virtual_mouse.skin.second_dark": "Second Dark"
}

View File

@@ -0,0 +1,150 @@
{
"key.midnightcontrols.look_down": "Mirar hacia abajo",
"key.midnightcontrols.look_left": "Mirar hacia izquierda",
"key.midnightcontrols.look_right": "Mirar hacia derecha",
"key.midnightcontrols.look_up": "Mirar hacia arriba",
"key.midnightcontrols.ring": "Mostrar anillo de controles",
"midnightcontrols.action.attack": "Atacar",
"midnightcontrols.action.back": "Retroceder",
"midnightcontrols.action.chat": "Abrir chat",
"midnightcontrols.action.drop_item": "Tirar ítem",
"midnightcontrols.action.exit": "Salir",
"midnightcontrols.action.forward": "Avanzar",
"midnightcontrols.action.hit": "Golpear",
"midnightcontrols.action.hotbar_left": "Hotbar a la izquierda",
"midnightcontrols.action.hotbar_right": "Hotbar a la derecha",
"midnightcontrols.action.inventory": "Inventario",
"midnightcontrols.action.jump": "Saltar",
"midnightcontrols.action.left": "Izquierda",
"midnightcontrols.action.pause_game": "Pausar juego",
"midnightcontrols.action.pick_block": "Recoger bloque",
"midnightcontrols.action.pickup": "Recoger",
"midnightcontrols.action.pickup_all": "Recoger todo",
"midnightcontrols.action.place": "Poner",
"midnightcontrols.action.player_list": "Lista de jugadores",
"midnightcontrols.action.quick_move": "Mover items rápidamente",
"midnightcontrols.action.right": "Derecha",
"midnightcontrols.action.screenshot": "Tomar captura de pantalla",
"midnightcontrols.action.sneak": "Agacharse",
"midnightcontrols.action.sprint": "Correr",
"midnightcontrols.action.swap_hands": "Intercambiar manos",
"midnightcontrols.action.toggle_perspective": "Cambiar perspectiva",
"midnightcontrols.action.toggle_smooth_camera": "Cambiar cámara cinematográfica",
"midnightcontrols.action.use": "Usar",
"midnightcontrols.action.zoom": "Zoom",
"midnightcontrols.action.zoom_in": "Aumentar zoom",
"midnightcontrols.action.zoom_out": "Disminuir zoom",
"midnightcontrols.action.zoom_reset": "Restablecer zoom",
"midnightcontrols.button.a": "A",
"midnightcontrols.button.b": "B",
"midnightcontrols.button.x": "X",
"midnightcontrols.button.y": "Y",
"midnightcontrols.button.left_bumper": "Bumper izquierda",
"midnightcontrols.button.right_bumper": "Bumper derecha",
"midnightcontrols.button.back": "Regresar",
"midnightcontrols.button.start": "Iniciar",
"midnightcontrols.button.guide": "Guía",
"midnightcontrols.button.left_thumb": "Joystick izquierda",
"midnightcontrols.button.right_thumb": "Joystick derecha",
"midnightcontrols.button.dpad_up": "Cruceta arriba",
"midnightcontrols.button.dpad_right": "Cruceta derecha",
"midnightcontrols.button.dpad_down": "Cruceta abajo",
"midnightcontrols.button.dpad_left": "Cruceta izquierda",
"midnightcontrols.axis.left_x+": "Izquierda X+",
"midnightcontrols.axis.left_y+": "Izquierda Y+",
"midnightcontrols.axis.right_x+": "Derecha X+",
"midnightcontrols.axis.right_y+": "Derecha Y+",
"midnightcontrols.axis.left_trigger": "Gatillo izquierda",
"midnightcontrols.axis.right_trigger": "Gatillo derecha",
"midnightcontrols.axis.left_x-": "Izquierda X-",
"midnightcontrols.axis.left_y-": "Izquierda Y-",
"midnightcontrols.axis.right_x-": "Derecha X-",
"midnightcontrols.axis.right_y-": "Derecha Y-",
"midnightcontrols.button.unknown": "Desconocido (%d)",
"midnightcontrols.controller.connected": "Controlador %d conectado.",
"midnightcontrols.controller.disconnected": "Controlador %d desconectado.",
"midnightcontrols.controller.mappings.1": "Para configurar las asignaciones del controlador, utilice %s",
"midnightcontrols.controller.mappings.3": "y poner el mapeo de asignaciones en `%s.minecraft/config/gamecontrollerdb.txt%s`.",
"midnightcontrols.controller.mappings.error": "Error al cargar asignaciones.",
"midnightcontrols.controller.mappings.error.write": "Error al escribir asignaciones al archivo.",
"midnightcontrols.controller.mappings.updated": "Asignaciones actualizados!",
"midnightcontrols.controller_type.default": "por defecto",
"midnightcontrols.controller_type.dualshock": "DualShock",
"midnightcontrols.controller_type.switch": "Switch",
"midnightcontrols.controller_type.xbox": "Xbox",
"midnightcontrols.controller_type.steam": "Steam",
"midnightcontrols.controller_type.ouya": "OUYA",
"midnightcontrols.controls_mode.default": "Teclado/Ratón",
"midnightcontrols.controls_mode.controller": "Controlador",
"midnightcontrols.controls_mode.touchscreen": "Pantalla táctil",
"midnightcontrols.hud_side.left": "izquierda",
"midnightcontrols.hud_side.right": "derecha",
"midnightcontrols.menu.analog_movement": "Movimiento analógico",
"midnightcontrols.menu.auto_switch_mode": "Cambio de modo automático",
"midnightcontrols.menu.controller": "Controlador",
"midnightcontrols.menu.controller2": "Segundo controlador",
"midnightcontrols.menu.controller_type": "Tipo de controlador",
"midnightcontrols.menu.controls_mode": "Modo",
"midnightcontrols.menu.fast_block_placing": "Colocación rápida de bloques",
"midnightcontrols.menu.fly_drifting": "Volar a la deriva",
"midnightcontrols.menu.fly_drifting_vertical": "Volar a la deriva vertical",
"midnightcontrols.menu.hud_enable": "Habilitar HUD",
"midnightcontrols.menu.hud_side": "Lado de HUD",
"midnightcontrols.menu.invert_right_x_axis": "Invertir derecha X",
"midnightcontrols.menu.invert_right_y_axis": "Invertir derecha Y",
"midnightcontrols.menu.keyboard_controls": "Controles del teclado...",
"midnightcontrols.menu.left_dead_zone": "Zona muerta izquierda",
"midnightcontrols.menu.mappings.open_input_str": "Abrir el editor de archivo de asignaciones",
"midnightcontrols.menu.max_left_x_value": "Valor máximo del eje X izquierdo",
"midnightcontrols.menu.max_left_y_value": "Valor máximo del eje Y izquierdo",
"midnightcontrols.menu.max_right_x_value": "Valor máximo del eje X derecho",
"midnightcontrols.menu.max_right_y_value": "Valor máximo del eje Y derecho",
"midnightcontrols.menu.mouse_speed": "Velocidad del ratón",
"midnightcontrols.menu.reacharound.horizontal": "Colocación de bloque frontal",
"midnightcontrols.menu.reacharound.vertical": "Alcance vertical",
"midnightcontrols.menu.reload_controller_mappings": "Recargar asignaciones de controlador",
"midnightcontrols.menu.right_dead_zone": "Zona muerta derecha",
"midnightcontrols.menu.rotation_speed": "Velocidad de rotación",
"midnightcontrols.menu.separator.controller": "Controlador",
"midnightcontrols.menu.separator.general": "General",
"midnightcontrols.menu.title": "midnightcontrols - Configuraciones",
"midnightcontrols.menu.title.controller": "Opciones de controlador",
"midnightcontrols.menu.title.controller_controls": "Controles de controlador",
"midnightcontrols.menu.title.gameplay": "Opciones de juego",
"midnightcontrols.menu.title.general": "Opciones generales",
"midnightcontrols.menu.title.hud": "Opciones de HUD",
"midnightcontrols.menu.title.mappings.string": "Editor de archivo de asignaciones",
"midnightcontrols.menu.title.visual": "Opciones de apariencia",
"midnightcontrols.menu.unfocused_input": "Entrada desenfocada",
"midnightcontrols.menu.virtual_mouse": "Ratón virtual",
"midnightcontrols.menu.virtual_mouse.skin": "Piel de ratón virtual",
"midnightcontrols.narrator.unbound": "Resetear %s",
"midnightcontrols.not_bound": "No ligado",
"midnightcontrols.tooltip.analog_movement": "Habilita el movimiento analógico cuando es posible.",
"midnightcontrols.tooltip.auto_switch_mode": "Si el modo de controles debe cambiarse a Controlador automáticamente si hay uno conectado.",
"midnightcontrols.tooltip.controller2": "Segundo controlador a uso, que permite el soporte de Joy-Cons por ejemplo.",
"midnightcontrols.tooltip.controller_type": "El tipo de controlador para mostrar los botones correctos.",
"midnightcontrols.tooltip.controls_mode": "El modo de controles.",
"midnightcontrols.tooltip.fast_block_placing": "Mientras vuela en modo creativo, permite la colocación rápida de bloques dependiendo su velocidad. §cEn algunos servidores, esto podría considerarse como trampa.",
"midnightcontrols.tooltip.fly_drifting": "Mientras vuela, habilita la deriva/inercia de vainilla.",
"midnightcontrols.tooltip.fly_drifting_vertical": "Mientras vuela, habilita la deriva/inercia vertical de vainilla.",
"midnightcontrols.tooltip.hud_enable": "Alterna el indicador del botón del controlador en pantalla.",
"midnightcontrols.tooltip.hud_side": "La posición del HUD.",
"midnightcontrols.tooltip.left_dead_zone": "La zona muerta de la palanca analógica izquierda del controlador.",
"midnightcontrols.tooltip.max_left_x_value": "Cambia lo que el mod considera el valor más alto para el eje X izquierdo. Útil si su eje no usa el rango completo y parece lento.",
"midnightcontrols.tooltip.max_left_y_value": "Cambia lo que el mod considera el valor más alto para el eje Y izquierdo. Útil si su eje no usa el rango completo y parece lento.",
"midnightcontrols.tooltip.max_right_x_value": "Cambia lo que el mod considera el valor más alto para el eje X derecho. Útil si su eje no usa el rango completo y parece lento.",
"midnightcontrols.tooltip.max_right_y_value": "Cambia lo que el mod considera el valor más alto para el eje Y derecho. Útil si su eje no usa el rango completo y parece lento.",
"midnightcontrols.tooltip.mouse_speed": "La velocidad del ratón emulada del controlador.",
"midnightcontrols.tooltip.reacharound.horizontal": "Habilita la colocación del bloque frontal, §cpodría considerarse trampa en algunos servidores§r.",
"midnightcontrols.tooltip.reacharound.vertical": "Habilita el alcance vertical, §cpodría considerarse trampa en algunos servidores§r.",
"midnightcontrols.tooltip.reload_controller_mappings": "Vuelve a cargar el archivo de asignaciones del controlador.",
"midnightcontrols.tooltip.right_dead_zone": "La zona muerta de la palanca analógica derecha del controlador.",
"midnightcontrols.tooltip.rotation_speed": "La velocidad de rotación de la cámara en modo controlador.",
"midnightcontrols.tooltip.unfocused_input": "Habilita entrada del controlador cuando la ventana no está enfocada.",
"midnightcontrols.tooltip.virtual_mouse": "Habilite el ratón virtual que es útil en el caso de una pantalla dividida.",
"midnightcontrols.virtual_mouse.skin.default_light": "Ligera por defecto",
"midnightcontrols.virtual_mouse.skin.default_dark": "Oscura por defecto",
"midnightcontrols.virtual_mouse.skin.second_light": "Ligera segundario",
"midnightcontrols.virtual_mouse.skin.second_dark": "Oscura segundario"
}

View File

@@ -0,0 +1,150 @@
{
"key.midnightcontrols.look_down": "Regarder en bas",
"key.midnightcontrols.look_left": "Regarder à gauche",
"key.midnightcontrols.look_right": "Regarder à droite",
"key.midnightcontrols.look_up": "Regarder en haut",
"key.midnightcontrols.ring": "Affiche l'anneau de contrôle",
"midnightcontrols.action.attack": "Attaquer",
"midnightcontrols.action.back": "Reculer",
"midnightcontrols.action.chat": "Ouvrir le tchat",
"midnightcontrols.action.drop_item": "Jeter l'objet",
"midnightcontrols.action.exit": "Sortir",
"midnightcontrols.action.forward": "Avancer",
"midnightcontrols.action.hit": "Taper",
"midnightcontrols.action.hotbar_left": "Case à gauche de la barre d'action",
"midnightcontrols.action.hotbar_right": "Case à droite de la barre d'action",
"midnightcontrols.action.inventory": "Inventaire",
"midnightcontrols.action.jump": "Sauter",
"midnightcontrols.action.left": "Aller à gauche",
"midnightcontrols.action.pause_game": "Mettre en pause le jeu",
"midnightcontrols.action.pick_block": "Choisir le bloc",
"midnightcontrols.action.pickup": "Prendre",
"midnightcontrols.action.pickup_all": "Prendre tout",
"midnightcontrols.action.place": "Placer",
"midnightcontrols.action.player_list": "Afficher la liste des joueurs",
"midnightcontrols.action.quick_move": "Mouvement rapide",
"midnightcontrols.action.right": "Aller à droite",
"midnightcontrols.action.screenshot": "Prendre une capture d'écran",
"midnightcontrols.action.sneak": "S'accroupir",
"midnightcontrols.action.sprint": "Courir",
"midnightcontrols.action.swap_hands": "Échanger de mains",
"midnightcontrols.action.toggle_perspective": "Changer de point de vue",
"midnightcontrols.action.toggle_smooth_camera": "Basculer en mode cinématique",
"midnightcontrols.action.use": "Utiliser",
"midnightcontrols.action.zoom": "Zoom",
"midnightcontrols.action.zoom_in": "Augmenter le zoom",
"midnightcontrols.action.zoom_out": "Diminuer le zoom",
"midnightcontrols.action.zoom_reset": "Remettre le zoom à zéro",
"midnightcontrols.button.a": "A",
"midnightcontrols.button.b": "B",
"midnightcontrols.button.x": "X",
"midnightcontrols.button.y": "Y",
"midnightcontrols.button.left_bumper": "Gâchette gauche",
"midnightcontrols.button.right_bumper": "Gâchette droite",
"midnightcontrols.button.back": "Retour",
"midnightcontrols.button.start": "Touche Menu",
"midnightcontrols.button.guide": "Guide",
"midnightcontrols.button.left_thumb": "Stick gauche",
"midnightcontrols.button.right_thumb": "Stick droit",
"midnightcontrols.button.dpad_up": "D-Pad haut",
"midnightcontrols.button.dpad_right": "D-Pad droit",
"midnightcontrols.button.dpad_down": "D-Pad bas",
"midnightcontrols.button.dpad_left": "D-Pad gauche",
"midnightcontrols.axis.left_x+": "X+ Gauche",
"midnightcontrols.axis.left_y+": "Y+ Gauche",
"midnightcontrols.axis.right_x+": "X+ Droit",
"midnightcontrols.axis.right_y+": "Y+ Droit",
"midnightcontrols.axis.left_trigger": "Gâchette gauche",
"midnightcontrols.axis.right_trigger": "Gâchette droite",
"midnightcontrols.axis.left_x-": "X- Gauche",
"midnightcontrols.axis.left_y-": "Y- Gauche",
"midnightcontrols.axis.right_x-": "X- Droit",
"midnightcontrols.axis.right_y-": "Y- Droit",
"midnightcontrols.button.unknown": "Inconnu (%d)",
"midnightcontrols.controller.connected": "Manette %d connecté.",
"midnightcontrols.controller.disconnected": "Manette %d déconnecté.",
"midnightcontrols.controller.mappings.1": "Pour configurer les correspondances de la manette, veuillez utiliser %s",
"midnightcontrols.controller.mappings.3": "et copier/coller les correspondances dans l'éditeur de manette.",
"midnightcontrols.controller.mappings.error": "Une erreur est apparue pendant le chargement des manettes.",
"midnightcontrols.controller.mappings.error.write": "Une erreur est apparue pendant l'écriture des manettes au fichier.",
"midnightcontrols.controller.mappings.updated": "Configuration des manettes mise à jour!",
"midnightcontrols.controller_type.default": "default",
"midnightcontrols.controller_type.dualshock": "DualShock",
"midnightcontrols.controller_type.switch": "Switch",
"midnightcontrols.controller_type.xbox": "Xbox",
"midnightcontrols.controller_type.steam": "Steam",
"midnightcontrols.controller_type.ouya": "OUYA",
"midnightcontrols.controls_mode.default": "Clavier/Souris",
"midnightcontrols.controls_mode.controller": "Manette",
"midnightcontrols.controls_mode.touchscreen": "Tactile",
"midnightcontrols.hud_side.left": "gauche",
"midnightcontrols.hud_side.right": "droit",
"midnightcontrols.menu.analog_movement": "Mouvement analogique",
"midnightcontrols.menu.auto_switch_mode": "Changement auto de mode",
"midnightcontrols.menu.controller": "Manette",
"midnightcontrols.menu.controller2": "Deuxième manette",
"midnightcontrols.menu.controller_type": "Type de manette",
"midnightcontrols.menu.controls_mode": "Mode",
"midnightcontrols.menu.fast_block_placing": "Placement rapide de blocs",
"midnightcontrols.menu.fly_drifting": "Inertie de vol",
"midnightcontrols.menu.fly_drifting_vertical": "Inertie verticale de vol",
"midnightcontrols.menu.hud_enable": "Activer le HUD",
"midnightcontrols.menu.hud_side": "Côté du HUD",
"midnightcontrols.menu.invert_right_x_axis": "Inverser le stick droit (X)",
"midnightcontrols.menu.invert_right_y_axis": "Inverser le stick droit (Y)",
"midnightcontrols.menu.keyboard_controls": "Contrôles clavier...",
"midnightcontrols.menu.left_dead_zone": "Zone morte axe gauche",
"midnightcontrols.menu.mappings.open_input_str": "Ouvrir l'éditeur de fichier des manettes",
"midnightcontrols.menu.max_left_x_value": "Valeur maximale de l'axe X gauche",
"midnightcontrols.menu.max_left_y_value": "Valeur maximale de l'axe Y gauche",
"midnightcontrols.menu.max_right_x_value": "Valeur maximale de l'axe X droit",
"midnightcontrols.menu.max_right_y_value": "Valeur maximale de l'axe Y droit",
"midnightcontrols.menu.mouse_speed": "Vitesse de la souris",
"midnightcontrols.menu.reacharound.horizontal": "Placement avant de bloc",
"midnightcontrols.menu.reacharound.vertical": "Placement vertical",
"midnightcontrols.menu.reload_controller_mappings": "Recharger les manettes",
"midnightcontrols.menu.right_dead_zone": "Zone morte axe droit",
"midnightcontrols.menu.rotation_speed": "Vitesse de rotation",
"midnightcontrols.menu.separator.general": "Général",
"midnightcontrols.menu.separator.controller": "Manette",
"midnightcontrols.menu.title": "midnightcontrols - Paramètres",
"midnightcontrols.menu.title.controller": "Options de manettes",
"midnightcontrols.menu.title.controller_controls": "Contrôles de la manette",
"midnightcontrols.menu.title.gameplay": "Options de Gameplay",
"midnightcontrols.menu.title.general": "Options générales",
"midnightcontrols.menu.title.hud": "Options du HUD",
"midnightcontrols.menu.title.mappings.string": "Éditeur de manettes",
"midnightcontrols.menu.title.visual": "Options d'apparences",
"midnightcontrols.menu.unfocused_input": "Entrée en fond",
"midnightcontrols.menu.virtual_mouse": "Souris virtuelle",
"midnightcontrols.menu.virtual_mouse.skin": "Apparence souris virtuelle",
"midnightcontrols.narrator.unbound": "Délier %s",
"midnightcontrols.not_bound": "Non défini",
"midnightcontrols.tooltip.analog_movement": "Active le mouvement analogique si possible.",
"midnightcontrols.tooltip.auto_switch_mode": "Détermine si le mode de contrôle doit automatiquement changer sur Manette si une manette est connectée et inversement.",
"midnightcontrols.tooltip.controller2": "Défini une deuxième manette, utile dans le cas d'utilisation de Joy-Cons.",
"midnightcontrols.tooltip.controller_type": "Le type de contrôle n'influe que sur les boutons affichés.",
"midnightcontrols.tooltip.controls_mode": "Change le mode de contrôle.",
"midnightcontrols.tooltip.fast_block_placing": "Active le placement rapide de blocs en vol.",
"midnightcontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement Vanilla.",
"midnightcontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical Vanilla.",
"midnightcontrols.tooltip.hud_enable": "Détermine si l'indicateur des buttons de la manette doit être affiché ou non.",
"midnightcontrols.tooltip.hud_side": "Change la position du HUD.",
"midnightcontrols.tooltip.left_dead_zone": "Zone morte de l'axe gauche de la manette.",
"midnightcontrols.tooltip.max_left_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.max_left_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.max_right_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.max_right_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.mouse_speed": "Change la vitesse de la souris émulée par la manette.",
"midnightcontrols.tooltip.reacharound.horizontal": "Active le placement avant de blocs, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"midnightcontrols.tooltip.reacharound.vertical": "Active le placement vertical de blocs, c'est-à-dire de blocs en dessous du bloc sur lequel vous êtes placé, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"midnightcontrols.tooltip.reload_controller_mappings": "Recharge le fichier de configuration des manettes.",
"midnightcontrols.tooltip.right_dead_zone": "Zone morte de l'axe droit de la manette.",
"midnightcontrols.tooltip.rotation_speed": "Change la vitesse de rotation de la caméra.",
"midnightcontrols.tooltip.unfocused_input": "Autorise les entrées manette quand la fenêtre n'est pas sélectionnée.",
"midnightcontrols.tooltip.virtual_mouse": "Active la souris virtuelle qui est pratique dans le cas d'un écran partagé.",
"midnightcontrols.virtual_mouse.skin.default_light": "défaut clair",
"midnightcontrols.virtual_mouse.skin.default_dark": "défaut foncé",
"midnightcontrols.virtual_mouse.skin.second_light": "second clair",
"midnightcontrols.virtual_mouse.skin.second_dark": "second foncé"
}

View File

@@ -0,0 +1,150 @@
{
"key.midnightcontrols.look_down": "Regarder en bas",
"key.midnightcontrols.look_left": "Regarder à gauche",
"key.midnightcontrols.look_right": "Regarder à droite",
"key.midnightcontrols.look_up": "Regarder en haut",
"key.midnightcontrols.ring": "Affiche l'anneau de contrôle",
"midnightcontrols.action.attack": "Attaquer",
"midnightcontrols.action.back": "Reculer",
"midnightcontrols.action.chat": "Ouvrir le tchat",
"midnightcontrols.action.drop_item": "Jeter l'objet",
"midnightcontrols.action.exit": "Sortir",
"midnightcontrols.action.forward": "Avancer",
"midnightcontrols.action.hit": "Taper",
"midnightcontrols.action.hotbar_left": "Case à gauche de la barre d'action",
"midnightcontrols.action.hotbar_right": "Case à droite de la barre d'action",
"midnightcontrols.action.inventory": "Inventaire",
"midnightcontrols.action.jump": "Sauter",
"midnightcontrols.action.left": "Aller à gauche",
"midnightcontrols.action.pause_game": "Mettre en pause le jeu",
"midnightcontrols.action.pick_block": "Choisir le bloc",
"midnightcontrols.action.pickup": "Prendre",
"midnightcontrols.action.pickup_all": "Prendre tout",
"midnightcontrols.action.place": "Placer",
"midnightcontrols.action.player_list": "Afficher la liste des joueurs",
"midnightcontrols.action.quick_move": "Mouvement rapide",
"midnightcontrols.action.right": "Aller à droite",
"midnightcontrols.action.screenshot": "Prendre une capture d'écran",
"midnightcontrols.action.sneak": "S'accroupir",
"midnightcontrols.action.sprint": "Courir",
"midnightcontrols.action.swap_hands": "Échanger de mains",
"midnightcontrols.action.toggle_perspective": "Changer de point de vue",
"midnightcontrols.action.toggle_smooth_camera": "Basculer en mode cinématique",
"midnightcontrols.action.use": "Utiliser",
"midnightcontrols.action.zoom": "Zoom",
"midnightcontrols.action.zoom_in": "Augmenter le zoom",
"midnightcontrols.action.zoom_out": "Diminuer le zoom",
"midnightcontrols.action.zoom_reset": "Remettre le zoom à zéro",
"midnightcontrols.button.a": "A",
"midnightcontrols.button.b": "B",
"midnightcontrols.button.x": "X",
"midnightcontrols.button.y": "Y",
"midnightcontrols.button.left_bumper": "Gâchette gauche",
"midnightcontrols.button.right_bumper": "Gâchette droite",
"midnightcontrols.button.back": "Retour",
"midnightcontrols.button.start": "Touche Menu",
"midnightcontrols.button.guide": "Guide",
"midnightcontrols.button.left_thumb": "Stick gauche",
"midnightcontrols.button.right_thumb": "Stick droit",
"midnightcontrols.button.dpad_up": "D-Pad haut",
"midnightcontrols.button.dpad_right": "D-Pad droit",
"midnightcontrols.button.dpad_down": "D-Pad bas",
"midnightcontrols.button.dpad_left": "D-Pad gauche",
"midnightcontrols.axis.left_x+": "X+ Gauche",
"midnightcontrols.axis.left_y+": "Y+ Gauche",
"midnightcontrols.axis.right_x+": "X+ Droit",
"midnightcontrols.axis.right_y+": "Y+ Droit",
"midnightcontrols.axis.left_trigger": "Gâchette gauche",
"midnightcontrols.axis.right_trigger": "Gâchette droite",
"midnightcontrols.axis.left_x-": "X- Gauche",
"midnightcontrols.axis.left_y-": "Y- Gauche",
"midnightcontrols.axis.right_x-": "X- Droit",
"midnightcontrols.axis.right_y-": "Y- Droit",
"midnightcontrols.button.unknown": "Inconnu (%d)",
"midnightcontrols.controller.connected": "Manette %d connecté.",
"midnightcontrols.controller.disconnected": "Manette %d déconnecté.",
"midnightcontrols.controller.mappings.1": "Pour configurer les correspondances de la manette, veuillez utiliser %s",
"midnightcontrols.controller.mappings.3": "et copier/coller les correspondances dans l'éditeur de manette.",
"midnightcontrols.controller.mappings.error": "Une erreur est apparue pendant le chargement des manettes.",
"midnightcontrols.controller.mappings.error.write": "Une erreur est apparue pendant l'écriture des manettes au fichier.",
"midnightcontrols.controller.mappings.updated": "Configuration des manettes mise à jour!",
"midnightcontrols.controller_type.default": "default",
"midnightcontrols.controller_type.dualshock": "DualShock",
"midnightcontrols.controller_type.switch": "Switch",
"midnightcontrols.controller_type.xbox": "Xbox",
"midnightcontrols.controller_type.steam": "Steam",
"midnightcontrols.controller_type.ouya": "OUYA",
"midnightcontrols.controls_mode.default": "Clavier/Souris",
"midnightcontrols.controls_mode.controller": "Manette",
"midnightcontrols.controls_mode.touchscreen": "Tactile",
"midnightcontrols.hud_side.left": "gauche",
"midnightcontrols.hud_side.right": "droit",
"midnightcontrols.menu.analog_movement": "Mouvement analogique",
"midnightcontrols.menu.auto_switch_mode": "Changement auto de mode",
"midnightcontrols.menu.controller": "Manette",
"midnightcontrols.menu.controller2": "Deuxième manette",
"midnightcontrols.menu.controller_type": "Type de manette",
"midnightcontrols.menu.controls_mode": "Mode",
"midnightcontrols.menu.fast_block_placing": "Placement rapide de blocs",
"midnightcontrols.menu.fly_drifting": "Inertie de vol",
"midnightcontrols.menu.fly_drifting_vertical": "Inertie verticale de vol",
"midnightcontrols.menu.hud_enable": "Activer le HUD",
"midnightcontrols.menu.hud_side": "Côté du HUD",
"midnightcontrols.menu.invert_right_x_axis": "Inverser le stick droit (X)",
"midnightcontrols.menu.invert_right_y_axis": "Inverser le stick droit (Y)",
"midnightcontrols.menu.keyboard_controls": "Contrôles clavier...",
"midnightcontrols.menu.left_dead_zone": "Zone morte axe gauche",
"midnightcontrols.menu.mappings.open_input_str": "Ouvrir l'éditeur de fichier des manettes",
"midnightcontrols.menu.max_left_x_value": "Valeur maximale de l'axe X gauche",
"midnightcontrols.menu.max_left_y_value": "Valeur maximale de l'axe Y gauche",
"midnightcontrols.menu.max_right_x_value": "Valeur maximale de l'axe X droit",
"midnightcontrols.menu.max_right_y_value": "Valeur maximale de l'axe Y droit",
"midnightcontrols.menu.mouse_speed": "Vitesse de la souris",
"midnightcontrols.menu.reacharound.horizontal": "Placement avant de bloc",
"midnightcontrols.menu.reacharound.vertical": "Placement vertical",
"midnightcontrols.menu.reload_controller_mappings": "Recharger les manettes",
"midnightcontrols.menu.right_dead_zone": "Zone morte axe droit",
"midnightcontrols.menu.rotation_speed": "Vitesse de rotation",
"midnightcontrols.menu.separator.general": "Général",
"midnightcontrols.menu.separator.controller": "Manette",
"midnightcontrols.menu.title": "midnightcontrols - Paramètres",
"midnightcontrols.menu.title.controller": "Options de manettes",
"midnightcontrols.menu.title.controller_controls": "Contrôles de la manette",
"midnightcontrols.menu.title.gameplay": "Options de Gameplay",
"midnightcontrols.menu.title.general": "Options générales",
"midnightcontrols.menu.title.hud": "Options du HUD",
"midnightcontrols.menu.title.mappings.string": "Éditeur de manettes",
"midnightcontrols.menu.title.visual": "Options d'apparences",
"midnightcontrols.menu.unfocused_input": "Entrée en fond",
"midnightcontrols.menu.virtual_mouse": "Souris virtuelle",
"midnightcontrols.menu.virtual_mouse.skin": "Apparence souris virtuelle",
"midnightcontrols.narrator.unbound": "Délier %s",
"midnightcontrols.not_bound": "Non défini",
"midnightcontrols.tooltip.analog_movement": "Active le mouvement analogique si possible.",
"midnightcontrols.tooltip.auto_switch_mode": "Détermine si le mode de contrôle doit automatiquement changer sur Manette si une manette est connectée et inversement.",
"midnightcontrols.tooltip.controller2": "Défini une deuxième manette, utile dans le cas d'utilisation de Joy-Cons.",
"midnightcontrols.tooltip.controller_type": "Le type de contrôle n'influe que sur les boutons affichés.",
"midnightcontrols.tooltip.controls_mode": "Change le mode de contrôle.",
"midnightcontrols.tooltip.fast_block_placing": "Active le placement rapide de blocs en vol.",
"midnightcontrols.tooltip.fly_drifting": "Pendant que le joueur vole, active le glissement Vanilla.",
"midnightcontrols.tooltip.fly_drifting_vertical": "Pendant que le joueur vole, active le glissement vertical Vanilla.",
"midnightcontrols.tooltip.hud_enable": "Détermine si l'indicateur des buttons de la manette doit être affiché ou non.",
"midnightcontrols.tooltip.hud_side": "Change la position du HUD.",
"midnightcontrols.tooltip.left_dead_zone": "Zone morte de l'axe gauche de la manette.",
"midnightcontrols.tooltip.max_left_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.max_left_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y gauche. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.max_right_x_value": "Change ce que le mod considère comme valeur maximale pour l'axe X droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.max_right_y_value": "Change ce que le mod considère comme valeur maximale pour l'axe Y droit. Utile si votre axe n'utilise pas l'entièreté de l'ensemble des valeurs et paraît lent.",
"midnightcontrols.tooltip.mouse_speed": "Change la vitesse de la souris émulée par la manette.",
"midnightcontrols.tooltip.reacharound.horizontal": "Active le placement avant de blocs, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"midnightcontrols.tooltip.reacharound.vertical": "Active le placement vertical de blocs, c'est-à-dire de blocs en dessous du bloc sur lequel vous êtes placé, §cpeut être considérer comme de la triche sur certains serveurs§r.",
"midnightcontrols.tooltip.reload_controller_mappings": "Recharge le fichier de configuration des manettes.",
"midnightcontrols.tooltip.right_dead_zone": "Zone morte de l'axe droit de la manette.",
"midnightcontrols.tooltip.rotation_speed": "Change la vitesse de rotation de la caméra.",
"midnightcontrols.tooltip.unfocused_input": "Autorise les entrées manette quand la fenêtre n'est pas sélectionnée.",
"midnightcontrols.tooltip.virtual_mouse": "Active la souris virtuelle qui est pratique dans le cas d'un écran partagé.",
"midnightcontrols.virtual_mouse.skin.default_light": "défaut clair",
"midnightcontrols.virtual_mouse.skin.default_dark": "défaut foncé",
"midnightcontrols.virtual_mouse.skin.second_light": "second clair",
"midnightcontrols.virtual_mouse.skin.second_dark": "second foncé"
}

View File

@@ -0,0 +1,135 @@
{
"key.midnightcontrols.look_down": "Aşağı bak",
"key.midnightcontrols.look_left": "Sola bak",
"key.midnightcontrols.look_right": "Sağa bak",
"key.midnightcontrols.look_up": "Yukarıya bak",
"key.midnightcontrols.ring": "Kontroller halkasını göster",
"midnightcontrols.action.attack": "Saldırma/Kazma",
"midnightcontrols.action.back": "Geri",
"midnightcontrols.action.chat": "Sohbeti Açma",
"midnightcontrols.action.drop_item": "Seçili Eşyayı Bırakma",
"midnightcontrols.action.exit": ık",
"midnightcontrols.action.forward": "İleri",
"midnightcontrols.action.hit": "Vurma",
"midnightcontrols.action.hotbar_left": "Sık Kullanılanlar'da sola git",
"midnightcontrols.action.hotbar_right": "Sık Kullanılanlar'da sağa git",
"midnightcontrols.action.inventory": "Envanter",
"midnightcontrols.action.jump": "Zıplama",
"midnightcontrols.action.left": "Sol",
"midnightcontrols.action.pause_game": "Oyunu durdur",
"midnightcontrols.action.pick_block": "Blok Seçme",
"midnightcontrols.action.pickup": "Al",
"midnightcontrols.action.pickup_all": "Hepsini Al",
"midnightcontrols.action.place": "Yerleştir",
"midnightcontrols.action.player_list": "Oyuncu Listesi",
"midnightcontrols.action.quick_move": "Hızlı Hareket",
"midnightcontrols.action.right": "Sağ",
"midnightcontrols.action.screenshot": "Ekran Görüntüsü Alma",
"midnightcontrols.action.sneak": "Eğilme",
"midnightcontrols.action.sprint": "Koşma",
"midnightcontrols.action.swap_hands": "Ögeyi Elden Ele Değiştir",
"midnightcontrols.action.toggle_perspective": "Perspektifi Değiştirme",
"midnightcontrols.action.toggle_smooth_camera": "Sinemaitk Kameraya Geçme",
"midnightcontrols.action.use": "Kullanma",
"midnightcontrols.action.zoom": "Büyütme",
"midnightcontrols.action.zoom_in": "Büyütmeyi Arttır",
"midnightcontrols.action.zoom_out": "Büyütmeyi Azalt",
"midnightcontrols.action.zoom_reset": "Büyütmeyi Sıfırla",
"midnightcontrols.button.a": "A",
"midnightcontrols.button.b": "B",
"midnightcontrols.button.x": "X",
"midnightcontrols.button.y": "Y",
"midnightcontrols.button.left_bumper": "Sol yassı tuş",
"midnightcontrols.button.right_bumper": "Sağ yassı tuş",
"midnightcontrols.button.back": "Back",
"midnightcontrols.button.start": "Start",
"midnightcontrols.button.guide": "Guide",
"midnightcontrols.button.left_thumb": "Sol çubuk",
"midnightcontrols.button.right_thumb": "Sağ çubuk",
"midnightcontrols.button.dpad_up": "Yukarı yön tuşu",
"midnightcontrols.button.dpad_right": "Sağ yön tuşu",
"midnightcontrols.button.dpad_down": "Aşağı yön tuşu",
"midnightcontrols.button.dpad_left": "Sol yön tuşu",
"midnightcontrols.axis.left_x+": "Sol X+",
"midnightcontrols.axis.left_y+": "Sol Y+",
"midnightcontrols.axis.right_x+": "Sağ X+",
"midnightcontrols.axis.right_y+": "Sağ Y+",
"midnightcontrols.axis.left_trigger": "Sol tetik tuşu",
"midnightcontrols.axis.right_trigger": "Sağ tetik tuşu",
"midnightcontrols.axis.left_x-": "Sol X-",
"midnightcontrols.axis.left_y-": "Sol Y-",
"midnightcontrols.axis.right_x-": "Sağ X-",
"midnightcontrols.axis.right_y-": "Sağ Y-",
"midnightcontrols.button.unknown": "Bilinmeyen (%d)",
"midnightcontrols.controller.connected": "%d oyun kolu bağlandı.",
"midnightcontrols.controller.disconnected": "%d oyun kolunun bağlantısı kesildi.",
"midnightcontrols.controller.mappings.1": "Oyun kolunun tuş eşleştirme ayarını yapacaksanız, lütfen sunu kullanın: %sSDL2 Gamepad Tool%s",
"midnightcontrols.controller.mappings.3": "ve eşleştirme dosyasını da şuraya koyun: `%s.minecraft/config/gamecontrollerdb.txt%s`.",
"midnightcontrols.controller.mappings.error": "Eşleştirme yüklenirken hata oluştu.",
"midnightcontrols.controller.mappings.error.write": "Dosyaya eşleştirme yazılırken hata oluştu.",
"midnightcontrols.controller.mappings.updated": "Eşleştirme güncellendi!",
"midnightcontrols.controller_type.default": "varsayılan",
"midnightcontrols.controller_type.dualshock": "DualShock",
"midnightcontrols.controller_type.switch": "Switch",
"midnightcontrols.controller_type.xbox": "Xbox",
"midnightcontrols.controller_type.steam": "Steam",
"midnightcontrols.controller_type.ouya": "OUYA",
"midnightcontrols.controls_mode.default": "Klavye/Fare",
"midnightcontrols.controls_mode.controller": "Oyun Kolu",
"midnightcontrols.controls_mode.touchscreen": "Dokunmatik Ekran",
"midnightcontrols.hud_side.left": "sol",
"midnightcontrols.hud_side.right": "sağ",
"midnightcontrols.menu.auto_switch_mode": "Otomatik Değiştirme Modu",
"midnightcontrols.menu.controller": "Oyun Kolu",
"midnightcontrols.menu.controller2": "İkincil Oyun Kolu",
"midnightcontrols.menu.controller_type": "Oyun Kolu Türü",
"midnightcontrols.menu.controls_mode": "Mod",
"midnightcontrols.menu.dead_zone": "Ölü Bölge",
"midnightcontrols.menu.fast_block_placing": "Hızlı Blok Yerleştirme",
"midnightcontrols.menu.fly_drifting": "Kayarak Uç",
"midnightcontrols.menu.fly_drifting_vertical": "Dikey uçuşta kayaaak git",
"midnightcontrols.menu.hud_enable": "HUD'u Etkinleştir",
"midnightcontrols.menu.hud_side": "HUD Yanı",
"midnightcontrols.menu.invert_right_x_axis": "Sağ X'i Terse Çevir",
"midnightcontrols.menu.invert_right_y_axis": "Sağ Y'i Terse Çevir.",
"midnightcontrols.menu.keyboard_controls": "Klavye Kontrolleri...",
"midnightcontrols.menu.mappings.open_input_str": "Eşleştirme Dosya Editörünü Aç",
"midnightcontrols.menu.mouse_speed": "Fare Hızı",
"midnightcontrols.menu.reacharound.horizontal": "Alt Öne Blok Koyma",
"midnightcontrols.menu.reacharound.vertical": "En Alta Blok Koyma",
"midnightcontrols.menu.reload_controller_mappings": "Oyun Kolu Eşleştirmelerini Yenile",
"midnightcontrols.menu.rotation_speed": "Dönme Hızı",
"midnightcontrols.menu.title": "midnightcontrols - Ayarlar",
"midnightcontrols.menu.title.controller": "Oyun Kolu Seçenekleri",
"midnightcontrols.menu.title.controller_controls": "Oyun Kolu Kontrolleri",
"midnightcontrols.menu.title.gameplay": "Oynanış Seçenekleri",
"midnightcontrols.menu.title.general": "Genel Seçenekler",
"midnightcontrols.menu.title.hud": "HUD Seçenekleri",
"midnightcontrols.menu.title.mappings.string": "Eşleştirme Dosya Editörü",
"midnightcontrols.menu.unfocused_input": "Odaklanmamış Giriş Aygıtı",
"midnightcontrols.menu.virtual_mouse": "Sanal Fare",
"midnightcontrols.menu.virtual_mouse.skin": "Sanal Fare Görünümü",
"midnightcontrols.narrator.unbound": "%s Atanmamış",
"midnightcontrols.not_bound": "Tuş ataması yok",
"midnightcontrols.tooltip.auto_switch_mode": "Eğer bir tanesi bağlandıysa, kontrol modu Oyun Kolu olarak değişmeli.",
"midnightcontrols.tooltip.controller2": "Kullanılacak ikinci oyun kolu, örnek olarak Joy-Con desteği de mümkün.",
"midnightcontrols.tooltip.controller_type": "Doğru tuşları göstermesi için oyun kolu türü.",
"midnightcontrols.tooltip.controls_mode": "Kontrol Modu",
"midnightcontrols.tooltip.dead_zone": "Oyun kolunun analog çubukları için ayarlanan ölü bölge/dead zone",
"midnightcontrols.tooltip.fast_block_placing": "Yaratıcı modda uçarken, hızına bağlı olarak hızlı blok koymayı etkinleştirir. §cBazı sunucular bunun hile olduğunu düşünebilir.",
"midnightcontrols.tooltip.fly_drifting": "Uçarken, Vanilla'daki gibi ani duruşlarda kayma efektini etkinleştirir.",
"midnightcontrols.tooltip.fly_drifting_vertical": "Yukarı/aşağı uçarken, Vanilla'daki gibi ani duruşlarda kayma efektini etkinleştirir.",
"midnightcontrols.tooltip.hud_enable": "Ekranın üstünde oyun kolu tuşu göstergesini açar/kapatır.",
"midnightcontrols.tooltip.hud_side": "HUD'un konumu",
"midnightcontrols.tooltip.mouse_speed": "Oyun kolunun taklit edilen fare hızı.",
"midnightcontrols.tooltip.reacharound.horizontal": "Hızlı blok koymayı etkinleştirir. §cBazı sunucular bunun hile olduğunu düşünebilir.§r.",
"midnightcontrols.tooltip.reacharound.vertical": "En alta blok koymayı etkinleştirir. §cBazı sunucular bunun hile olduğunu düşünebilir.§r.",
"midnightcontrols.tooltip.reload_controller_mappings": "Oyun kolu için eşleştirme dosyasını yeniler.",
"midnightcontrols.tooltip.rotation_speed": "Oyun kolu modunda olan kamera dönme hızı",
"midnightcontrols.tooltip.unfocused_input": "Oyun penceresinde değilken oyun kolu girişine izine verir.",
"midnightcontrols.tooltip.virtual_mouse": "Sanal fareyi etkinleştirir. Çift ekran oynanılacağı zaman işe yarar.",
"midnightcontrols.virtual_mouse.skin.default_light": "Varsayılan Aydınlık Tema",
"midnightcontrols.virtual_mouse.skin.default_dark": "Varsayılan Karanlık Tema",
"midnightcontrols.virtual_mouse.skin.second_light": "İkincil Aydınlık Tema",
"midnightcontrols.virtual_mouse.skin.second_dark": "İkincil Karanlık Tema"
}

View File

@@ -0,0 +1,150 @@
{
"key.midnightcontrols.look_down": "视角下移",
"key.midnightcontrols.look_left": "视角左移",
"key.midnightcontrols.look_right": "视角右移",
"key.midnightcontrols.look_up": "视角上移",
"key.midnightcontrols.ring": "显示额外按键菜单",
"midnightcontrols.action.attack": "攻击",
"midnightcontrols.action.back": "向后移动",
"midnightcontrols.action.chat": "打开聊天栏",
"midnightcontrols.action.drop_item": "丢弃所选物品",
"midnightcontrols.action.exit": "退出",
"midnightcontrols.action.forward": "向前移动",
"midnightcontrols.action.hit": "挖掘",
"midnightcontrols.action.hotbar_left": "向左循环选择快捷栏",
"midnightcontrols.action.hotbar_right": "向右循环选择快捷栏",
"midnightcontrols.action.inventory": "物品栏",
"midnightcontrols.action.jump": "跳跃",
"midnightcontrols.action.left": "向左移动",
"midnightcontrols.action.pause_game": "暂停游戏",
"midnightcontrols.action.pick_block": "选取方块",
"midnightcontrols.action.pickup": "拿取一个/拿取一半",
"midnightcontrols.action.pickup_all": "拿取一组/拿取全部",
"midnightcontrols.action.place": "放置方块",
"midnightcontrols.action.player_list": "玩家列表",
"midnightcontrols.action.quick_move": "快速移动物品",
"midnightcontrols.action.right": "向右移动",
"midnightcontrols.action.screenshot": "截图",
"midnightcontrols.action.sneak": "潜行",
"midnightcontrols.action.sprint": "疾跑",
"midnightcontrols.action.swap_hands": "与副手交换",
"midnightcontrols.action.toggle_perspective": "切换视角",
"midnightcontrols.action.toggle_smooth_camera": "切换电影视角",
"midnightcontrols.action.use": "使用物品/放置方块",
"midnightcontrols.action.zoom": "视野缩放",
"midnightcontrols.action.zoom_in": "缩放时将视野推近",
"midnightcontrols.action.zoom_out": "缩放时将视野拉远",
"midnightcontrols.action.zoom_reset": "缩放时重置缩放距离",
"midnightcontrols.button.a": "A",
"midnightcontrols.button.b": "B",
"midnightcontrols.button.x": "X",
"midnightcontrols.button.y": "Y",
"midnightcontrols.button.left_bumper": "左肩键",
"midnightcontrols.button.right_bumper": "右肩键",
"midnightcontrols.button.back": "选择键",
"midnightcontrols.button.start": "开始键",
"midnightcontrols.button.guide": "功能键",
"midnightcontrols.button.left_thumb": "左摇杆(按压)",
"midnightcontrols.button.right_thumb": "右摇杆(按压)",
"midnightcontrols.button.dpad_up": "十字键上",
"midnightcontrols.button.dpad_right": "十字键右",
"midnightcontrols.button.dpad_down": "十字键下",
"midnightcontrols.button.dpad_left": "十字键左",
"midnightcontrols.axis.left_x+": "左摇杆右X轴正向",
"midnightcontrols.axis.left_y+": "左摇杆上Y轴正向",
"midnightcontrols.axis.right_x+": "右摇杆右X轴正向",
"midnightcontrols.axis.right_y+": "右摇杆上Y轴正向",
"midnightcontrols.axis.left_trigger": "左扳机键",
"midnightcontrols.axis.right_trigger": "右扳机键",
"midnightcontrols.axis.left_x-": "左摇杆左X轴负向",
"midnightcontrols.axis.left_y-": "左摇杆下Y轴负向",
"midnightcontrols.axis.right_x-": "右摇杆左X轴负向",
"midnightcontrols.axis.right_y-": "右摇杆下Y轴负向",
"midnightcontrols.button.unknown": "未知(%d",
"midnightcontrols.controller.connected": "手柄 %d 已连接。",
"midnightcontrols.controller.disconnected": "手柄 %d 已断开。",
"midnightcontrols.controller.mappings.1": "请使用 %s 配置手柄按键映射",
"midnightcontrols.controller.mappings.3": "并将按键映射文件放入此路径:`%s.minecraft/config/gamecontrollerdb.txt%s`。",
"midnightcontrols.controller.mappings.error": "发生错误,无法读取按键映射文件。",
"midnightcontrols.controller.mappings.error.write": "发生错误,无法保存按键映射文件。",
"midnightcontrols.controller.mappings.updated": "按键映射已更新!",
"midnightcontrols.controller_type.default": "默认",
"midnightcontrols.controller_type.dualshock": "DualShock",
"midnightcontrols.controller_type.switch": "Switch",
"midnightcontrols.controller_type.xbox": "Xbox",
"midnightcontrols.controller_type.steam": "Steam",
"midnightcontrols.controller_type.ouya": "OUYA",
"midnightcontrols.controls_mode.default": "键鼠",
"midnightcontrols.controls_mode.controller": "手柄",
"midnightcontrols.controls_mode.touchscreen": "触摸屏",
"midnightcontrols.hud_side.left": "左侧",
"midnightcontrols.hud_side.right": "右侧",
"midnightcontrols.menu.analog_movement": "识别摇杆输入的精确值",
"midnightcontrols.menu.auto_switch_mode": "自动切换模式",
"midnightcontrols.menu.controller": "手柄",
"midnightcontrols.menu.controller2": "额外手柄",
"midnightcontrols.menu.controller_type": "手柄类型",
"midnightcontrols.menu.controls_mode": "模式",
"midnightcontrols.menu.fast_block_placing": "方块快速放置",
"midnightcontrols.menu.fly_drifting": "水平方向飞行惯性",
"midnightcontrols.menu.fly_drifting_vertical": "垂直方向飞行惯性",
"midnightcontrols.menu.hud_enable": "启用HUD",
"midnightcontrols.menu.hud_side": "HUD位置",
"midnightcontrols.menu.invert_right_x_axis": "反转右摇杆X轴",
"midnightcontrols.menu.invert_right_y_axis": "反转右摇杆Y轴",
"midnightcontrols.menu.keyboard_controls": "键盘控制…",
"midnightcontrols.menu.left_dead_zone": "左摇杆死区",
"midnightcontrols.menu.mappings.open_input_str": "编辑按键映射文件",
"midnightcontrols.menu.max_left_x_value": "左摇杆X轴最大值识别范围",
"midnightcontrols.menu.max_left_y_value": "左摇杆Y轴最大值识别范围",
"midnightcontrols.menu.max_right_x_value": "右摇杆X轴最大值识别范围",
"midnightcontrols.menu.max_right_y_value": "右摇杆Y轴最大值识别范围",
"midnightcontrols.menu.mouse_speed": "鼠标移动速度",
"midnightcontrols.menu.reacharound.horizontal": "水平方向方块放置辅助",
"midnightcontrols.menu.reacharound.vertical": "垂直方向方块放置辅助",
"midnightcontrols.menu.reload_controller_mappings": "重新加载手柄按键映射",
"midnightcontrols.menu.right_dead_zone": "右摇杆死区",
"midnightcontrols.menu.rotation_speed": "镜头旋转速度",
"midnightcontrols.menu.separator.controller": "手柄",
"midnightcontrols.menu.separator.general": "通用",
"midnightcontrols.menu.title": "midnightcontrols — 设置",
"midnightcontrols.menu.title.controller": "手柄选项",
"midnightcontrols.menu.title.controller_controls": "手柄控制",
"midnightcontrols.menu.title.gameplay": "游戏内容选项",
"midnightcontrols.menu.title.general": "通用选项",
"midnightcontrols.menu.title.hud": "HUD选项",
"midnightcontrols.menu.title.mappings.string": "编辑按键映射文件",
"midnightcontrols.menu.title.visual": "界面选项",
"midnightcontrols.menu.unfocused_input": "非活动状态输入",
"midnightcontrols.menu.virtual_mouse": "虚拟鼠标",
"midnightcontrols.menu.virtual_mouse.skin": "虚拟鼠标指针样式",
"midnightcontrols.narrator.unbound": "取消绑定 %s",
"midnightcontrols.not_bound": "未绑定",
"midnightcontrols.tooltip.analog_movement": "若游戏机制允许,则可根据推动摇杆的力度与幅度决定移动的速度。",
"midnightcontrols.tooltip.auto_switch_mode": "如果已有手柄连接,则自动切换为手柄操作模式。",
"midnightcontrols.tooltip.controller2": "使用额外的手柄,比如将一左一右的两个 Joy-Con 合为一个功能完全的手柄。",
"midnightcontrols.tooltip.controller_type": "选择手柄类型,以显示对应的按键图标。",
"midnightcontrols.tooltip.controls_mode": "操作模式",
"midnightcontrols.tooltip.fast_block_placing": "在创造模式中处于飞行状态时,可以根据你飞行的速度快速放置方块。\n§c在部分服务器可能会被认定为作弊。",
"midnightcontrols.tooltip.fly_drifting": "处于飞行状态时,启用原版的水平方向飞行惯性(缓停滑行)。",
"midnightcontrols.tooltip.fly_drifting_vertical": "处于飞行状态时,启用原版的垂直方向飞行惯性(缓停滑行)。",
"midnightcontrols.tooltip.hud_enable": "显示手柄按键操作提示。",
"midnightcontrols.tooltip.hud_side": "HUD的位置位于画面的哪一侧。",
"midnightcontrols.tooltip.left_dead_zone": "左摇杆配置的死区。\n死区决定摇杆要偏离中心位置多远才能让摇杆的输入有效。",
"midnightcontrols.tooltip.max_left_x_value": "更改左摇杆X轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致在识别摇杆输入的精确值的情况下左右移动较为缓慢等问题本项可能会有所帮助。",
"midnightcontrols.tooltip.max_left_y_value": "更改左摇杆Y轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致在识别摇杆输入的精确值的情况下前后移动较为缓慢等问题本项可能会有所帮助。",
"midnightcontrols.tooltip.max_right_x_value": "更改右摇杆X轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致镜头左右旋转较为缓慢等问题本项可能会有所帮助。",
"midnightcontrols.tooltip.max_right_y_value": "更改右摇杆Y轴最大值的识别范围。\n若感觉即便推满摇杆也未达到最大的输入值导致镜头上下旋转较为缓慢等问题本项可能会有所帮助。",
"midnightcontrols.tooltip.mouse_speed": "手柄模拟的鼠标的移动速度。",
"midnightcontrols.tooltip.reacharound.horizontal": "启用水平方向方块放置辅助,可在脚下方块的前方放置方块。\n§c在部分服务器可能会被认定为作弊。",
"midnightcontrols.tooltip.reacharound.vertical": "启用垂直方向方块放置辅助,可在脚下方块的下方放置方块。\n§c在部分服务器可能会被认定为作弊。",
"midnightcontrols.tooltip.reload_controller_mappings": "重新加载手柄的按键映射文件。",
"midnightcontrols.tooltip.right_dead_zone": "右摇杆配置的死区。\n死区决定摇杆要偏离中心位置多远才能让摇杆的输入有效。",
"midnightcontrols.tooltip.rotation_speed": "手柄操作模式下的镜头旋转速度。",
"midnightcontrols.tooltip.unfocused_input": "即使游戏窗口处于非活动状态,也允许手柄进行按键输入。",
"midnightcontrols.tooltip.virtual_mouse": "启用虚拟鼠标,在分屏的情况下很有用。",
"midnightcontrols.virtual_mouse.skin.default_light": "默认样式(白色)",
"midnightcontrols.virtual_mouse.skin.default_dark": "默认样式(黑色)",
"midnightcontrols.virtual_mouse.skin.second_light": "额外样式(白色)",
"midnightcontrols.virtual_mouse.skin.second_dark": "额外样式(黑色)"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 334 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -1,119 +0,0 @@
# LambdaControls configuration.
# The controls mode. Available modes: default, controller, touchscreen
controls = "default"
# Auto switch mode.
auto_switch_mode = false
# Debug mode
debug = false
[hud]
# Enables the HUD.
enable = true
# Dertermines where the movements buttons are.
side = "left"
# Gameplay settings
[gameplay]
# Enables fast block placing like in Bedrock Edition.
fast_block_placing = true
# Enables analogic movement if possible.
analog_movement = true
# Fly behaviors
[gameplay.fly]
# Enables fly drifting.
drifting = false
# Enables vertical fly drifting.
vertical_drifting = true
[gameplay.reacharound]
# Enables front block placing like in Bedrock Edition.
horizontal = false
# Enables vertical reacharound.
vertical = false
# Enables front block placing outline.
outline = true
# The color in a hexadecimal format of the outline.
outline_color = "#ffffff66"
# Controller settings
[controller]
# Controller to use.
id = 0
# Second controller to use.
id2 = -1
# Controller's type.
type = "default"
# Controller's dead zone.
dead_zone = 0.20
# Rotation speed for look directions.
rotation_speed = 10.0
# Mouse speed in GUI.
mouse_speed = 30.0
# Inverts the right X axis.
invert_right_x_axis = false
# Inverts the right Y axis.
invert_right_y_axis = false
# Allow unfocused input.
unfocused_input = false
# Virtual mouse.
virtual_mouse = false
# Virtual mouse skin
virtual_mouse_skin = "default_light"
# Controller controls.
[controller.controls]
# Attack control.
attack = "105"
# Back control.
back = "201"
# Open chat control.
chat = "12"
# Drop item control.
drop_item = "1"
# Forward control.
forward = "101"
# Hot-bar left control.
hotbar_left = "4"
# Hot-bar right control.
hotbar_right = "5"
# Inventory control.
inventory = "3"
# Jump control.
jump = "0"
# Left movement control.
left = "200"
# Pause game control.
pause_game = "7"
# Pick block control.
pick_block = "14"
# Show player list control.
player_list = "6"
# Right movement control.
right = "100"
# Take screenshot control.
screenshot = "11+0"
# Down slot control.
slot_down = "13"
# Left slot control.
slot_left = "14"
# Right slot control.
slot_right = "12"
# Up slot control.
slot_up = "11"
# Sneak control.
sneak = "10"
# Sprint control.
sprint = "9"
# Swap hands control.
swap_hands = "2"
# Switch to back tab control.
tab_back = "4"
# Switch to next tab control.
tab_next = "5"
# Toggle perspective control.
toggle_perspective = "11+3"
# Toggle smooth camera control.
toggle_smooth_camera = "-1"
# Use control.
use = "104"
# Zoom control.
zoom = "11+2"

View File

@@ -1,35 +1,36 @@
{
"schemaVersion": 1,
"id": "lambdacontrols",
"name": "LambdaControls",
"id": "midnightcontrols",
"name": "MidnightControls",
"version": "${version}",
"description": "Adds better controls, and controller support.",
"authors": [
"LambdAurora"
"LambdAurora",
"Motschen"
],
"contact": {
"homepage": "https://modrinth.com/mod/lambdacontrols",
"sources": "https://github.com/LambdAurora/LambdaControls.git",
"issues": "https://github.com/LambdAurora/LambdaControls/issues"
"homepage": "https://modrinth.com/mod/midnightcontrols",
"sources": "https://github.com/LambdAurora/midnightcontrols.git",
"issues": "https://github.com/LambdAurora/midnightcontrols/issues"
},
"license": "MIT",
"icon": "assets/lambdacontrols/icon.png",
"icon": "assets/midnightcontrols/icon.png",
"environment": "client",
"entrypoints": {
"main": [
"dev.lambdaurora.lambdacontrols.LambdaControls"
"eu.midnightdust.midnightcontrols.MidnightControls"
],
"client": [
"dev.lambdaurora.lambdacontrols.client.LambdaControlsClient"
"eu.midnightdust.midnightcontrols.client.MidnightControlsClient"
],
"modmenu": [
"dev.lambdaurora.lambdacontrols.client.LambdaControlsModMenu"
"eu.midnightdust.midnightcontrols.client.MidnightControlsModMenu"
]
},
"accessWidener": "lambdacontrols.accesswidener",
"accessWidener": "midnightcontrols.accesswidener",
"mixins": [
"lambdacontrols.mixins.json",
"lambdacontrols_compat.mixins.json"
"midnightcontrols.mixins.json",
"midnightcontrols_compat.mixins.json"
],
"depends": {
"fabricloader": ">=0.11.3",
@@ -45,13 +46,8 @@
"flamingo": "*"
},
"breaks": {
"lambdacontrols": "*",
"modmenu": "<1.12.2",
"optifabric": "*"
},
"custom": {
"modupdater": {
"strategy": "curseforge",
"projectID": 354231
}
}
}

View File

@@ -1,11 +0,0 @@
{
"required": true,
"package": "dev.lambdaurora.lambdacontrols.client.compat.mixin",
"plugin": "dev.lambdaurora.lambdacontrols.client.compat.LambdaControlsMixinPlugin",
"compatibilityLevel": "JAVA_16",
"client": [
],
"injectors": {
"defaultRequire": 1
}
}

View File

@@ -1,6 +1,6 @@
{
"required": true,
"package": "dev.lambdaurora.lambdacontrols.client.mixin",
"package": "eu.midnightdust.midnightcontrols.client.mixin",
"compatibilityLevel": "JAVA_16",
"client": [
"ClickableWidgetAccessor",
@@ -15,7 +15,6 @@
"KeyBindingMixin",
"MinecraftClientMixin",
"MouseMixin",
"OptionsScreenMixin",
"RecipeBookWidgetAccessor",
"WorldRendererMixin"
],

View File

@@ -0,0 +1,11 @@
{
"required": true,
"package": "dev.lambdaurora.midnightcontrols.client.compat.mixin",
"plugin": "eu.midnightdust.midnightcontrols.client.compat.MidnightControlsMixinPlugin",
"compatibilityLevel": "JAVA_16",
"client": [
],
"injectors": {
"defaultRequire": 1
}
}