mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 07:15:10 +01:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66cdca30fe | ||
|
|
6e49667ada | ||
|
|
d4c3208cee | ||
|
|
35a4fbee1b | ||
|
|
2aac2ad4e7 | ||
|
|
4b2919bfca | ||
|
|
1c999137ba | ||
|
|
d48952fec9 | ||
|
|
9deab7228d | ||
|
|
b4d82a7230 | ||
|
|
36e241e438 | ||
|
|
bdbee99fe2 | ||
|
|
439cd0858e | ||
|
|
617648cf57 | ||
|
|
89914a1b6e | ||
|
|
c272fb457f | ||
|
|
187844db2b | ||
|
|
24ced76d06 |
16
build.gradle
16
build.gradle
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version '1.0-SNAPSHOT'
|
||||
id 'fabric-loom' version '1.1-SNAPSHOT'
|
||||
id 'java-library'
|
||||
id 'maven-publish'
|
||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||
@@ -32,7 +32,7 @@ boolean isMCVersionNonRelease() {
|
||||
}
|
||||
|
||||
String getMCVersionString() {
|
||||
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.3") {
|
||||
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.4") {
|
||||
return project.minecraft_version
|
||||
}
|
||||
def version = project.minecraft_version.split('\\.')
|
||||
@@ -94,7 +94,9 @@ dependencies {
|
||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||
|
||||
modImplementation "dev.lambdaurora:spruceui:${project.spruceui_version}"
|
||||
modImplementation ("dev.lambdaurora:spruceui:${project.spruceui_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
include "dev.lambdaurora:spruceui:${project.spruceui_version}"
|
||||
api('org.aperlambda:lambdajcommon:1.8.1') {
|
||||
exclude group: 'com.google.code.gson'
|
||||
@@ -102,7 +104,9 @@ dependencies {
|
||||
}
|
||||
include 'org.aperlambda:lambdajcommon:1.8.1'
|
||||
|
||||
modCompileOnlyApi "com.terraformersmc:modmenu:${project.modmenu_version}"
|
||||
modCompileOnlyApi ("com.terraformersmc:modmenu:${project.modmenu_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
||||
// Compatibility mods
|
||||
|
||||
@@ -113,14 +117,14 @@ dependencies {
|
||||
modCompileOnlyApi "io.github.cottonmc:LibGui:${project.libgui_version}"
|
||||
modCompileOnlyApi "org.quiltmc:quilt-json5:1.0.0"
|
||||
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
|
||||
modImplementation "maven.modrinth:emi:${project.emi_version}"
|
||||
modCompileOnlyApi "maven.modrinth:emi:${project.emi_version}"
|
||||
modCompileOnlyApi "maven.modrinth:emotecraft:${project.emotecraft_version}"
|
||||
modCompileOnlyApi "io.github.kosmx:bendy-lib:${project.bendylib_version}"
|
||||
modCompileOnlyApi "dev.isxander:yet-another-config-lib:${project.yacl_version}"
|
||||
modCompileOnlyApi "maven.modrinth:inventory-tabs-updated:${project.inventorytabs_version}"
|
||||
modCompileOnlyApi "maven.modrinth:bedrockify:${project.bedrockify_version}"
|
||||
// Required for Inventory Tabs
|
||||
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
||||
modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
||||
exclude(group: "net.fabricmc.fabric-api")
|
||||
}
|
||||
|
||||
|
||||
@@ -3,22 +3,22 @@ org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://fabricmc.net/use
|
||||
minecraft_version=1.19.3
|
||||
yarn_mappings=1.19.3+build.2
|
||||
loader_version=0.14.11
|
||||
minecraft_version=1.19.4
|
||||
yarn_mappings=1.19.4+build.1
|
||||
loader_version=0.14.17
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.7.2
|
||||
mod_version = 1.8.0
|
||||
maven_group = eu.midnightdust
|
||||
archives_base_name = midnightcontrols
|
||||
modrinth_id=bXX9h73M
|
||||
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.68.1+1.19.3
|
||||
fabric_version=0.75.3+1.19.4
|
||||
sodium_version=mc1.19.2-0.4.4
|
||||
spruceui_version=4.1.0+1.19.3
|
||||
midnightlib_version=1.1.0-fabric
|
||||
spruceui_version=4.2.0+1.19.4
|
||||
midnightlib_version=1.2.1-fabric
|
||||
modmenu_version=5.0.1
|
||||
emotecraft_version=2.1.3-SNAPSHOT-build.29-MC1.19-fabric
|
||||
bendylib_version=2.0.+
|
||||
@@ -26,7 +26,7 @@ emi_version=0.5.0+1.19.3
|
||||
libgui_version=6.0.0+1.19
|
||||
inventorytabs_version=inventorytabs-0.9.beta-1.19.x
|
||||
clothconfig_version=7.0.72
|
||||
yacl_version=0.1.2
|
||||
yacl_version=2.2.0
|
||||
bedrockify_version=1.5+mc1.19.1-2
|
||||
|
||||
# Ok Zoomer and LibZoomer are temporarily disabled for the time being, as we are currently using Reflection at runtime instead in OkZoomerCompat due to there being two major, completely incompatible API versions.
|
||||
|
||||
@@ -144,6 +144,14 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
||||
public void onMcInit(@NotNull MinecraftClient client) {
|
||||
ButtonBinding.init(client.options);
|
||||
MidnightControlsConfig.load();
|
||||
if (MidnightControlsConfig.configVersion < 2) {
|
||||
MidnightControlsConfig.mouseScreens.remove("me.jellysquid.mods.sodium.client.gui");
|
||||
MidnightControlsConfig.mouseScreens.remove("net.coderbot.iris.gui");
|
||||
MidnightControlsConfig.mouseScreens.remove("net.minecraft.class_5375");
|
||||
MidnightControlsConfig.mouseScreens.remove("net.minecraft.client.gui.screen.pack.PackScreen");
|
||||
MidnightControlsConfig.configVersion = 2;
|
||||
MidnightControlsConfig.write("midnightcontrols");
|
||||
}
|
||||
this.hud.setVisible(MidnightControlsConfig.hudEnable);
|
||||
Controller.updateMappings();
|
||||
GLFW.glfwSetJoystickCallback((jid, event) -> {
|
||||
@@ -173,9 +181,9 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
||||
voxelmapInitDone = true;
|
||||
}
|
||||
if (lateInitDone) return;
|
||||
if (KeyBindingRegistryImplAccessor.getModdedKeyBindings() == null || KeyBindingRegistryImplAccessor.getModdedKeyBindings().isEmpty()) return;
|
||||
for (int i = 0; i < KeyBindingRegistryImplAccessor.getModdedKeyBindings().size(); ++i) {
|
||||
KeyBinding keyBinding = KeyBindingRegistryImplAccessor.getModdedKeyBindings().get(i);
|
||||
if (KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS() == null || KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS().isEmpty()) return;
|
||||
for (int i = 0; i < KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS().size(); ++i) {
|
||||
KeyBinding keyBinding = KeyBindingRegistryImplAccessor.getMODDED_KEY_BINDINGS().get(i);
|
||||
if (!keyBinding.getTranslationKey().contains("midnightcontrols") && !keyBinding.getTranslationKey().contains("ok_zoomer") && !keyBinding.getTranslationKey().contains("okzoomer")) {
|
||||
category = null;
|
||||
InputManager.streamCategories().forEach(buttonCategory -> {
|
||||
|
||||
@@ -11,6 +11,7 @@ package eu.midnightdust.midnightcontrols.client;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.mojang.blaze3d.platform.GlDebugInfo;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import eu.midnightdust.midnightcontrols.ControlsMode;
|
||||
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
|
||||
@@ -33,58 +34,61 @@ import static org.lwjgl.glfw.GLFW.*;
|
||||
*/
|
||||
public class MidnightControlsConfig extends MidnightConfig {
|
||||
public static boolean isEditing = false;
|
||||
@Hidden @Entry public static int configVersion = 1;
|
||||
@Hidden @Entry public static int configVersion = 2;
|
||||
// General
|
||||
@Entry(name = "midnightcontrols.menu.controls_mode") public static ControlsMode controlsMode = ControlsMode.DEFAULT;
|
||||
@Entry(name = "midnightcontrols.menu.auto_switch_mode") public static boolean autoSwitchMode = true;
|
||||
@Entry(name = "Debug") public static boolean debug = false;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.controls_mode") public static ControlsMode controlsMode = ControlsMode.DEFAULT;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.auto_switch_mode") public static boolean autoSwitchMode = true;
|
||||
@Entry(category = "misc", name = "Debug") public static boolean debug = false;
|
||||
// HUD
|
||||
@Entry(name = "midnightcontrols.menu.hud_enable") public static boolean hudEnable = true;
|
||||
@Entry(name = "midnightcontrols.menu.hud_side") public static HudSide hudSide = HudSide.LEFT;
|
||||
@Entry(name = "midnightcontrols.menu.move_chat") public static boolean moveChat = false;
|
||||
@Entry(category = "visual", name = "midnightcontrols.menu.hud_enable") public static boolean hudEnable = true;
|
||||
@Entry(category = "visual", name = "midnightcontrols.menu.hud_side") public static HudSide hudSide = HudSide.LEFT;
|
||||
@Entry(category = "screens", name = "midnightcontrols.menu.move_chat") public static boolean moveChat = false;
|
||||
// Gameplay
|
||||
@Entry(name = "midnightcontrols.menu.analog_movement") public static boolean analogMovement = true;
|
||||
@Entry(name = "midnightcontrols.menu.double_tap_to_sprint") public static boolean doubleTapToSprint = true;
|
||||
@Entry(name = "midnightcontrols.menu.controller_toggle_sneak") public static boolean controllerToggleSneak = MinecraftClient.getInstance().options.getSneakToggled().getValue();
|
||||
@Entry(name = "midnightcontrols.menu.controller_toggle_sprint") public static boolean controllerToggleSprint = MinecraftClient.getInstance().options.getSprintToggled().getValue();
|
||||
@Entry(name = "midnightcontrols.menu.fast_block_placing") public static boolean fastBlockPlacing = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "midnightcontrols.menu.fly_drifting") public static boolean flyDrifting = true; // Enabled by default as disabling this behaviour can be considered cheating on multiplayer servers. It can also conflict with some other mods.
|
||||
@Entry(name = "midnightcontrols.menu.fly_drifting_vertical") public static boolean verticalFlyDrifting = true; // Enabled by default as disabling this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "midnightcontrols.menu.reacharound.horizontal") public static boolean horizontalReacharound = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "midnightcontrols.menu.reacharound.vertical") public static boolean verticalReacharound = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(name = "Reacharound Outline") public static boolean shouldRenderReacharoundOutline = true;
|
||||
@Entry(name = "Reacharound Outline Color (WIP)", isColor = true) public static String reacharoundOutlineColorHex = "#ffffff";
|
||||
@Entry(name = "Reacharound Outline Alpha", min = 0, max = 255) public static int reacharoundOutlineColorAlpha = 102;
|
||||
@Entry(name = "midnightcontrols.menu.right_dead_zone") public static double rightDeadZone = 0.25;
|
||||
@Entry(name = "midnightcontrols.menu.left_dead_zone") public static double leftDeadZone = 0.25;
|
||||
@Entry(name = "midnightcontrols.menu.invert_right_y_axis") public static boolean invertRightYAxis = false;
|
||||
@Entry(name = "midnightcontrols.menu.invert_right_x_axis") public static boolean invertRightXAxis = false;
|
||||
@Entry(name = "midnightcontrols.menu.rotation_speed") public static double rotationSpeed = 40.0; //used for x-axis, name kept for compatability
|
||||
@Entry(name = "midnightcontrols.menu.y_axis_rotation_speed") public static double yAxisRotationSpeed = rotationSpeed;
|
||||
@Entry(name = "midnightcontrols.menu.mouse_speed") public static double mouseSpeed = 25.0;
|
||||
@Entry(name = "midnightcontrols.menu.joystick_as_mouse") public static boolean joystickAsMouse = false;
|
||||
@Entry(name = "midnightcontrols.menu.unfocused_input") public static boolean unfocusedInput = false;
|
||||
@Entry(name = "midnightcontrols.menu.virtual_mouse") public static boolean virtualMouse = false;
|
||||
@Entry(name = "midnightcontrols.menu.virtual_mouse.skin") public static VirtualMouseSkin virtualMouseSkin = VirtualMouseSkin.DEFAULT_LIGHT;
|
||||
@Entry(name = "Controller ID") public static Object controllerID = 0;
|
||||
@Entry(name = "2nd Controller ID") public static Object secondControllerID = -1;
|
||||
@Entry(name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
|
||||
@Entry(name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("me.jellysquid.mods.sodium.client.gui",
|
||||
"net.coderbot.iris.gui", "net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375",
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.analog_movement") public static boolean analogMovement = true;
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.double_tap_to_sprint") public static boolean doubleTapToSprint = true;
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.controller_toggle_sneak") public static boolean controllerToggleSneak = MinecraftClient.getInstance().options.getSneakToggled().getValue();
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.controller_toggle_sprint") public static boolean controllerToggleSprint = MinecraftClient.getInstance().options.getSprintToggled().getValue();
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.fast_block_placing") public static boolean fastBlockPlacing = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.fly_drifting") public static boolean flyDrifting = true; // Enabled by default as disabling this behaviour can be considered cheating on multiplayer servers. It can also conflict with some other mods.
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.fly_drifting_vertical") public static boolean verticalFlyDrifting = true; // Enabled by default as disabling this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.reacharound.horizontal") public static boolean horizontalReacharound = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.reacharound.vertical") public static boolean verticalReacharound = false; // Disabled by default as this behaviour can be considered cheating on multiplayer servers.
|
||||
@Entry(category = "visual", name = "Reacharound Outline") public static boolean shouldRenderReacharoundOutline = true;
|
||||
@Entry(category = "visual", name = "Reacharound Outline Color", isColor = true) public static String reacharoundOutlineColorHex = "#ffffff";
|
||||
@Entry(category = "visual", name = "Reacharound Outline Alpha", isSlider = true, min = 0, max = 255) public static int reacharoundOutlineColorAlpha = 102;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.right_dead_zone", isSlider = true, min = 0.05, max = 1) public static double rightDeadZone = 0.25;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.left_dead_zone", isSlider = true, min = 0.05, max = 1) public static double leftDeadZone = 0.25;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.invert_right_y_axis") public static boolean invertRightYAxis = false;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.invert_right_x_axis") public static boolean invertRightXAxis = false;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.rotation_speed", isSlider = true, min = 0, max = 100, precision = 10) public static double rotationSpeed = 40.0; //used for x-axis, name kept for compatibility
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.y_axis_rotation_speed", isSlider = true, min = 0, max = 100, precision = 10) public static double yAxisRotationSpeed = rotationSpeed;
|
||||
@Entry(category = "screens", name = "midnightcontrols.menu.mouse_speed", isSlider = true, min = 0, max = 150, precision = 10) public static double mouseSpeed = 25.0;
|
||||
@Entry(category = "screens", name = "midnightcontrols.menu.joystick_as_mouse") public static boolean joystickAsMouse = false;
|
||||
@Entry(category = "controller", name = "midnightcontrols.menu.unfocused_input") public static boolean unfocusedInput = false;
|
||||
@Entry(category = "screens", name = "midnightcontrols.menu.virtual_mouse") public static boolean virtualMouse = false;
|
||||
@Entry(category = "screens", name = "midnightcontrols.menu.virtual_mouse.skin") public static VirtualMouseSkin virtualMouseSkin = VirtualMouseSkin.DEFAULT_LIGHT;
|
||||
@Entry(category = "controller", name = "Controller ID") @Hidden public static Object controllerID = 0;
|
||||
@Entry(category = "controller", name = "2nd Controller ID") @Hidden public static Object secondControllerID = -1;
|
||||
@Entry(category = "visual", name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
|
||||
@Entry(category = "screens", name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("net.minecraft.client.gui.screen.advancement",
|
||||
"net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen",
|
||||
"hardcorequesting.client.interfaces.GuiQuestBook", "hardcorequesting.client.interfaces.GuiReward", "hardcorequesting.client.interfaces.EditTrackerScreen",
|
||||
"me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||
@Entry(name = "Arrow screens") public static List<String> arrowScreens = Lists.newArrayList(ChatScreen.class.getCanonicalName());
|
||||
@Entry(name = "WASD screens") public static List<String> wasdScreens = Lists.newArrayList("com.ultreon.devices.core.Laptop");
|
||||
@Entry(name = "Keybindings") public static Map<String, String> BINDING = new HashMap<>();
|
||||
@Entry(category = "screens", name = "Arrow screens") public static List<String> arrowScreens = Lists.newArrayList(ChatScreen.class.getCanonicalName());
|
||||
@Entry(category = "screens", name = "WASD screens") public static List<String> wasdScreens = Lists.newArrayList("com.ultreon.devices.core.Laptop");
|
||||
@Entry @Hidden public static Map<String, String> BINDING = new HashMap<>();
|
||||
|
||||
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
|
||||
@Entry(name = "Max analog values") public static double[] maxAnalogValues = new double[]{1, 1, 1, 1};
|
||||
@Entry(name = "Trigger button fix") public static boolean triggerFix = true;
|
||||
@Entry(name = "Enable Hints") public static boolean enableHints = true;
|
||||
@Entry(name = "Enable Shortcut in Controls Options") public static boolean shortcutInControls = true;
|
||||
@Entry(name = "Ring Bindings (WIP)") public static List<String> ringBindings = new ArrayList<>();
|
||||
@Entry(name = "Ignored Unbound Keys") public static List<String> ignoredUnboundKeys = Lists.newArrayList("inventorytabs.key.next_tab");
|
||||
@Deprecated @Hidden @Entry public static double[] maxAnalogValues = new double[]{1, 1, 1, 1};
|
||||
@Entry(category = "controller", name = "Max analog value: Left X", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueLeftX = maxAnalogValues[0];
|
||||
@Entry(category = "controller", name = "Max analog value: Left Y", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueLeftY = maxAnalogValues[1];
|
||||
@Entry(category = "controller", name = "Max analog value: Right X", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueRightX = maxAnalogValues[2];
|
||||
@Entry(category = "controller", name = "Max analog value: Right Y", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueRightY = maxAnalogValues[3];
|
||||
@Entry(category = "controller", name = "Trigger button fix") public static boolean triggerFix = true;
|
||||
@Entry(category = "gameplay", name = "Enable Hints") public static boolean enableHints = true;
|
||||
@Entry(category = "screens", name = "Enable Shortcut in Controls Options") public static boolean shortcutInControls = true;
|
||||
@Entry(category = "misc", name = "Ring Bindings (WIP)") public static List<String> ringBindings = new ArrayList<>();
|
||||
@Entry(category = "misc", name = "Ignored Unbound Keys") public static List<String> ignoredUnboundKeys = Lists.newArrayList("inventorytabs.key.next_tab");
|
||||
@Entry @Hidden public static Map<String, Map<String, String>> controllerBindingProfiles = new HashMap<>();
|
||||
private static Map<String, String> currentBindingProfile = new HashMap<>();
|
||||
private static Controller prevController;
|
||||
@@ -198,14 +202,21 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
}
|
||||
|
||||
public static double getAxisMaxValue(int axis) {
|
||||
if (axis >= MidnightControlsConfig.maxAnalogValues.length)
|
||||
return 1;
|
||||
return MidnightControlsConfig.maxAnalogValues[axis];
|
||||
return switch (axis) {
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_X -> MidnightControlsConfig.maxAnalogValueLeftX;
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_Y -> MidnightControlsConfig.maxAnalogValueLeftY;
|
||||
case GLFW_GAMEPAD_AXIS_RIGHT_X -> MidnightControlsConfig.maxAnalogValueRightX;
|
||||
default -> MidnightControlsConfig.maxAnalogValueRightY;
|
||||
};
|
||||
}
|
||||
|
||||
public static void setAxisMaxValue(int axis, double value) {
|
||||
if (axis < MidnightControlsConfig.maxAnalogValues.length)
|
||||
MidnightControlsConfig.maxAnalogValues[axis] = value;
|
||||
switch (axis) {
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_X -> MidnightControlsConfig.maxAnalogValueLeftX = value;
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_Y -> MidnightControlsConfig.maxAnalogValueLeftY = value;
|
||||
case GLFW_GAMEPAD_AXIS_RIGHT_X -> MidnightControlsConfig.maxAnalogValueRightX = value;
|
||||
default -> MidnightControlsConfig.maxAnalogValueRightY = value;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,9 +341,12 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
controllerID = 0;
|
||||
secondControllerID = -1;
|
||||
controllerType = ControllerType.DEFAULT;
|
||||
mouseScreens = Lists.newArrayList("me.jellysquid.mods.sodium.client.gui", "net.coderbot.iris.gui", "net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375", "net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen", "me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||
mouseScreens = Lists.newArrayList("net.minecraft.client.gui.screen.advancement", "net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen", "me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||
BINDING = new HashMap<>();
|
||||
maxAnalogValues = new double[]{1, 1, 1, 1};
|
||||
maxAnalogValueLeftX = 1;
|
||||
maxAnalogValueLeftY = 1;
|
||||
maxAnalogValueRightX = 1;
|
||||
maxAnalogValueRightY = 1;
|
||||
triggerFix = true;
|
||||
enableHints = true;
|
||||
shortcutInControls = true;
|
||||
@@ -350,7 +364,7 @@ public class MidnightControlsConfig extends MidnightConfig {
|
||||
String controller = getController().getName().toLowerCase();
|
||||
if (controller.contains("xbox 360")) return ControllerType.XBOX_360;
|
||||
else if (controller.contains("xbox") || controller.contains("afterglow")) return ControllerType.XBOX;
|
||||
else if (controller.contains("steam deck")) return ControllerType.STEAM_DECK;
|
||||
else if (controller.contains("steam") && GlDebugInfo.getCpuInfo().contains("AMD Custom APU")) return ControllerType.STEAM_DECK;
|
||||
else if (controller.contains("steam")) return ControllerType.STEAM_CONTROLLER;
|
||||
else if (controller.contains("dualsense") || controller.contains("ps5")) return ControllerType.DUALSENSE;
|
||||
else if (controller.contains("dualshock") || controller.contains("ps4") || controller.contains("sony")) return ControllerType.DUALSHOCK;
|
||||
|
||||
@@ -13,10 +13,7 @@ import com.google.common.collect.ImmutableSet;
|
||||
import dev.lambdaurora.spruceui.widget.AbstractSpruceWidget;
|
||||
import dev.lambdaurora.spruceui.widget.container.SpruceEntryListWidget;
|
||||
import eu.midnightdust.midnightcontrols.MidnightControls;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.EmotecraftCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.LibGuiCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.SodiumCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.*;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.ButtonBinding;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.Controller;
|
||||
import eu.midnightdust.midnightcontrols.client.controller.InputManager;
|
||||
@@ -75,6 +72,7 @@ public class MidnightInput {
|
||||
private static final Map<Integer, Integer> BUTTON_COOLDOWNS = new HashMap<>();
|
||||
// Cooldowns
|
||||
public int actionGuiCooldown = 0;
|
||||
public int joystickCooldown = 0;
|
||||
public boolean ignoreNextARelease = false;
|
||||
public boolean ignoreNextXRelease = false;
|
||||
private double targetYaw = 0.0;
|
||||
@@ -129,6 +127,8 @@ public class MidnightInput {
|
||||
--this.actionGuiCooldown;
|
||||
if (this.screenCloseCooldown > 0)
|
||||
--this.screenCloseCooldown;
|
||||
if (this.joystickCooldown > 0)
|
||||
--this.joystickCooldown;
|
||||
|
||||
InputManager.updateStates();
|
||||
|
||||
@@ -330,15 +330,13 @@ public class MidnightInput {
|
||||
&& (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP || button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN
|
||||
|| button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_LEFT || button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_RIGHT)) {
|
||||
if (this.actionGuiCooldown == 0) {
|
||||
if (MidnightControlsConfig.arrowScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||
switch (button) {
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_UP);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_DOWN);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> pressKeyboardKey(client, GLFW.GLFW_KEY_LEFT);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> pressKeyboardKey(client, GLFW.GLFW_KEY_RIGHT);
|
||||
}
|
||||
switch (button) {
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> this.changeFocus(client.currentScreen, NavigationDirection.UP);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> this.changeFocus(client.currentScreen, NavigationDirection.DOWN);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> this.handleLeftRight(client.currentScreen, false);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> this.handleLeftRight(client.currentScreen, true);
|
||||
}
|
||||
else if (MidnightControlsConfig.wasdScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||
if (MidnightControlsConfig.wasdScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||
switch (button) {
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_W);
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_S);
|
||||
@@ -346,11 +344,6 @@ public class MidnightInput {
|
||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> pressKeyboardKey(client, GLFW.GLFW_KEY_D);
|
||||
}
|
||||
}
|
||||
else if (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP) {
|
||||
this.changeFocus(client.currentScreen, NavigationDirection.UP);
|
||||
} else if (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN) {
|
||||
this.changeFocus(client.currentScreen, NavigationDirection.DOWN);
|
||||
} else this.handleLeftRight(client.currentScreen, button != GLFW.GLFW_GAMEPAD_BUTTON_DPAD_LEFT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -429,6 +422,9 @@ public class MidnightInput {
|
||||
public void pressKeyboardKey(MinecraftClient client, int key) {
|
||||
client.keyboard.onKey(client.getWindow().getHandle(), key, 0, 1, 0);
|
||||
}
|
||||
public void pressKeyboardKey(Screen screen, int key) {
|
||||
screen.keyPressed(key, 0, 1);
|
||||
}
|
||||
/**
|
||||
|
||||
/**
|
||||
@@ -574,9 +570,8 @@ public class MidnightInput {
|
||||
return;
|
||||
}
|
||||
} else if (client.currentScreen != null) {
|
||||
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y && absValue >= deadZone) {
|
||||
float finalValue = value;
|
||||
if (client.currentScreen.children().stream().filter(element -> element instanceof SpruceEntryListWidget)
|
||||
float finalValue = value;
|
||||
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y && absValue >= deadZone && client.currentScreen.children().stream().filter(element -> element instanceof SpruceEntryListWidget)
|
||||
.map(element -> (SpruceEntryListWidget<?>) element)
|
||||
.filter(AbstractSpruceWidget::isFocusedOrHovered)
|
||||
.noneMatch(element -> {
|
||||
@@ -594,7 +589,20 @@ public class MidnightInput {
|
||||
{
|
||||
client.currentScreen.mouseScrolled(0.0, 0.0, -(value * 1.5f));
|
||||
}
|
||||
|
||||
else if (absValue >= deadZone) {
|
||||
if (value > 0 && joystickCooldown == 0) {
|
||||
switch (axis) {
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_Y -> this.changeFocus(client.currentScreen, NavigationDirection.UP);
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_X -> this.handleLeftRight(client.currentScreen, true);
|
||||
}
|
||||
if (axis == GLFW_GAMEPAD_AXIS_LEFT_Y || axis == GLFW_GAMEPAD_AXIS_LEFT_X) joystickCooldown = 4;
|
||||
} else if (value < 0 && joystickCooldown == 0) {
|
||||
switch (axis) {
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_Y -> this.changeFocus(client.currentScreen, NavigationDirection.DOWN);
|
||||
case GLFW_GAMEPAD_AXIS_LEFT_X -> this.handleLeftRight(client.currentScreen, false);
|
||||
}
|
||||
if (axis == GLFW_GAMEPAD_AXIS_LEFT_Y || axis == GLFW_GAMEPAD_AXIS_LEFT_X) joystickCooldown = 4;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -695,7 +703,10 @@ public class MidnightInput {
|
||||
var childFocused = widget.getFocused();
|
||||
if (childFocused != null)
|
||||
return this.handleAButton(screen, childFocused);
|
||||
} else if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleAButton(screen, focused)) {
|
||||
return true;
|
||||
}
|
||||
else pressKeyboardKey(screen, GLFW_KEY_ENTER);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -711,6 +722,10 @@ public class MidnightInput {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleLeftRight(screen, right)) {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
var focused = screen.getFocused();
|
||||
if (focused != null)
|
||||
if (this.handleRightLeftElement(focused, right))
|
||||
@@ -725,11 +740,13 @@ public class MidnightInput {
|
||||
return !spruceElement.onNavigation(right ? NavigationDirection.RIGHT : NavigationDirection.LEFT, false);
|
||||
}
|
||||
if (element instanceof SliderWidget slider) {
|
||||
slider.keyPressed(right ? 262 : 263, 0, 0);
|
||||
this.actionGuiCooldown = 2; // Prevent to press too quickly the focused element, so we have to skip 5 ticks.
|
||||
return false;
|
||||
if (slider.active) {
|
||||
slider.keyPressed(right ? 262 : 263, 0, 0);
|
||||
this.actionGuiCooldown = 2; // Prevent to press too quickly the focused element, so we have to skip 5 ticks.
|
||||
return true;
|
||||
}
|
||||
} else if (element instanceof AlwaysSelectedEntryListWidget) {
|
||||
((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.DOWN : EntryListWidget.MoveDirection.UP);
|
||||
//TODO((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.DOWN : EntryListWidget.MoveDirection.UP);
|
||||
return false;
|
||||
} else if (element instanceof ParentElement entryList) {
|
||||
var focused = entryList.getFocused();
|
||||
@@ -778,81 +795,14 @@ public class MidnightInput {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
||||
SodiumCompat.handleInput(screen, direction.isLookingForward());
|
||||
// This still needs some work
|
||||
// ScreenAccessor accessor = (ScreenAccessor) screen;
|
||||
// if (accessor.getSelected() != null && accessor.getSelected() instanceof ClickableWidget selected && accessor.getSelectables() != null) {
|
||||
// //System.out.println(direction);
|
||||
// if (accessor.getSelectables().size() >= 2) {
|
||||
// //System.out.println(direction + " 2");
|
||||
// int xDifference = Integer.MAX_VALUE;
|
||||
// int yDifference = Integer.MAX_VALUE;
|
||||
// ClickableWidget newWidget = null;
|
||||
// for (int i = 0; i < accessor.getSelectables().size(); ++i) {
|
||||
// if (accessor.getSelectables().get(i) instanceof ClickableWidget candidate) {
|
||||
// if (!(candidate.x == selected.x && candidate.y == selected.y)) {
|
||||
// int canXDifference = Math.abs(candidate.x - selected.x);
|
||||
// int canYDifference = Math.abs(candidate.y - selected.y);
|
||||
// if (direction.isHorizontal()) {
|
||||
// if (direction.isLookingForward()) {
|
||||
// if (candidate.x >= selected.x && canYDifference <= yDifference && canXDifference <= xDifference) {
|
||||
// System.out.println(direction + " forward horizontal " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// } else {
|
||||
// if (candidate.x <= selected.x && canYDifference <= yDifference && canXDifference >= xDifference) {
|
||||
// System.out.println(direction + " backward horizontal " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// if (direction.isLookingForward()) {
|
||||
// if (candidate.y >= selected.y && canYDifference <= yDifference && canXDifference <= xDifference) {
|
||||
// System.out.println(direction + " forward vertical " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// } else {
|
||||
// if (candidate.y <= selected.y && canYDifference >= yDifference && canXDifference <= xDifference) {
|
||||
// System.out.println(direction + " backward vertical " + candidate);
|
||||
// newWidget = candidate;
|
||||
// xDifference = canXDifference;
|
||||
// yDifference = canYDifference;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (newWidget != null) {
|
||||
// //selected.changeFocus(true);
|
||||
// ((ClickableWidgetAccessor) selected).setFocused(false);
|
||||
// ((ClickableWidgetAccessor) newWidget).setFocused(true);
|
||||
// screen.setFocused(newWidget);
|
||||
// screen.changeFocus(false);
|
||||
// screen.changeFocus(true);
|
||||
// this.actionGuiCooldown = 5;
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
if (!screen.changeFocus(direction.isLookingForward())) {
|
||||
if (screen.changeFocus(direction.isLookingForward())) {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
switch (direction) {
|
||||
case UP -> pressKeyboardKey(screen, GLFW.GLFW_KEY_UP);
|
||||
case DOWN -> pressKeyboardKey(screen, GLFW.GLFW_KEY_DOWN);
|
||||
case LEFT -> pressKeyboardKey(screen, GLFW.GLFW_KEY_LEFT);
|
||||
case RIGHT -> pressKeyboardKey(screen, GLFW.GLFW_KEY_RIGHT);
|
||||
}
|
||||
this.actionGuiCooldown = 5;
|
||||
return false;
|
||||
} catch (Exception exception) {MidnightControls.get().warn("Unknown exception encountered while trying to change focus: "+exception);}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -120,31 +120,39 @@ public class MidnightReacharound {
|
||||
return null;
|
||||
|
||||
if (client.player != null && client.crosshairTarget != null && client.crosshairTarget.getType() == HitResult.Type.MISS
|
||||
&& client.player.isOnGround() && client.player.getPitch(0.f) > 35.f) {
|
||||
&& client.player.isOnGround() && client.player.getPitch(0.f) >= 35.f) {
|
||||
if (client.player.isRiding())
|
||||
return null;
|
||||
var playerPos = client.player.getBlockPos().down();
|
||||
// Temporary pos, do not use
|
||||
Vec3d playerPosi = client.player.getPos();
|
||||
|
||||
// Imitates var playerPos = client.player.getBlockPos().down();
|
||||
Vec3d playerPos = new Vec3d(playerPosi.getX(), playerPosi.getY() - 1.0, playerPosi.getZ());
|
||||
if (client.player.getY() - playerPos.getY() - 1.0 >= 0.25) {
|
||||
playerPos = playerPos.up();
|
||||
// Imitates playerPos = playerPos.up();
|
||||
playerPos = playerPosi;
|
||||
this.onSlab = true;
|
||||
} else {
|
||||
this.onSlab = false;
|
||||
}
|
||||
var targetPos = new BlockPos(client.crosshairTarget.getPos()).subtract(playerPos);
|
||||
var vector = new BlockPos.Mutable(MathHelper.clamp(targetPos.getX(), -1, 1), 0, MathHelper.clamp(targetPos.getZ(), -1, 1));
|
||||
var targetPos = new Vec3d(client.crosshairTarget.getPos().getX(), client.crosshairTarget.getPos().getY(), client.crosshairTarget.getPos().getZ()).subtract(playerPos);
|
||||
var vector = new Vec3d(MathHelper.clamp(targetPos.getX(), -1, 1), 0, MathHelper.clamp(targetPos.getZ(), -1, 1));
|
||||
var blockPos = playerPos.add(vector);
|
||||
|
||||
// Some functions still need BlockPos, so this is here to let that happen
|
||||
var blockyPos = BlockPos.ofFloored(blockPos);
|
||||
|
||||
var direction = client.player.getHorizontalFacing();
|
||||
|
||||
var state = client.world.getBlockState(blockPos);
|
||||
var state = client.world.getBlockState(blockyPos);
|
||||
if (!state.isAir())
|
||||
return null;
|
||||
var adjacentBlockState = client.world.getBlockState(blockPos.offset(direction.getOpposite()));
|
||||
var adjacentBlockState = client.world.getBlockState(blockyPos.offset(direction.getOpposite()));
|
||||
if (adjacentBlockState.isAir() || adjacentBlockState.getBlock() instanceof FluidBlock || (vector.getX() == 0 && vector.getZ() == 0)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new BlockHitResult(new Vec3d(blockPos.getX(),blockPos.getY(),blockPos.getZ()), direction, blockPos, false);
|
||||
return new BlockHitResult(blockPos, direction, blockyPos, false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class MidnightControlsMixinPlugin implements IMixinConfigPlugin {
|
||||
private final HashMap<String, Boolean> conditionalMixins = new HashMap<>();
|
||||
|
||||
public MidnightControlsMixinPlugin() {
|
||||
this.putConditionalMixin("SodiumOptionsGUIAccessor", FabricLoader.getInstance().isModLoaded("sodium"));
|
||||
//this.putConditionalMixin("SodiumOptionsGUIAccessor", FabricLoader.getInstance().isModLoaded("sodium"));
|
||||
}
|
||||
|
||||
private void putConditionalMixin(@NotNull String path, boolean condition) {
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package eu.midnightdust.midnightcontrols.client.compat;
|
||||
|
||||
import dev.isxander.yacl.gui.AbstractWidget;
|
||||
import dev.isxander.yacl.gui.OptionListWidget;
|
||||
import dev.isxander.yacl.gui.YACLScreen;
|
||||
import dev.isxander.yacl.gui.controllers.ControllerWidget;
|
||||
import dev.isxander.yacl.gui.controllers.slider.SliderControllerElement;
|
||||
import net.minecraft.client.gui.Element;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class YACLCompat {
|
||||
public static boolean handleAButton(Screen screen, Element element) {
|
||||
if (element instanceof AbstractWidget abstractWidget) {
|
||||
// imitate ender key press
|
||||
return abstractWidget.keyPressed(GLFW.GLFW_KEY_ENTER, 0, 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean handleLeftRight(Screen screen, boolean direction) {
|
||||
if (screen instanceof YACLScreen yaclScreen) {
|
||||
SliderControllerElement focusedSlider = yaclScreen.optionList.children().stream()
|
||||
.filter(OptionListWidget.OptionEntry.class::isInstance)
|
||||
.map(entry -> ((OptionListWidget.OptionEntry) entry).widget)
|
||||
.filter(ControllerWidget.class::isInstance)
|
||||
.map(ControllerWidget.class::cast)
|
||||
.filter(SliderControllerElement.class::isInstance)
|
||||
.map(SliderControllerElement.class::cast)
|
||||
.filter(ControllerWidget::isHovered)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
|
||||
if (focusedSlider == null)
|
||||
return false;
|
||||
|
||||
focusedSlider.incrementValue(direction ? 1 : -1);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean handleCategories(Screen screen, boolean direction) {
|
||||
if (screen instanceof YACLScreen yaclScreen) {
|
||||
int categoryIdx = yaclScreen.getCurrentCategoryIdx();
|
||||
if (direction) categoryIdx++; else categoryIdx--;
|
||||
if (categoryIdx < 0) categoryIdx = yaclScreen.config.categories().size() - 1;
|
||||
if (categoryIdx >= yaclScreen.config.categories().size()) categoryIdx = 0;
|
||||
|
||||
yaclScreen.changeCategory(categoryIdx);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -92,9 +92,9 @@ public class ButtonBinding {
|
||||
.actions(InputHandlers::handleToggleSprint).onlyInGame().register();
|
||||
public static final ButtonBinding SWAP_HANDS = new Builder("swap_hands").buttons(GLFW_GAMEPAD_BUTTON_X).onlyInGame().cooldown().register();
|
||||
public static final ButtonBinding TAB_LEFT = new Builder("tab_back").buttons(GLFW_GAMEPAD_BUTTON_LEFT_BUMPER)
|
||||
.action(InputHandlers.handleHotbar(false)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null && client.currentScreen.getClass().toString().contains("sodium"))).cooldown().register();
|
||||
.action(InputHandlers.handleHotbar(false)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null)).cooldown().register();
|
||||
public static final ButtonBinding TAB_RIGHT = new Builder("tab_next").buttons(GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER)
|
||||
.action(InputHandlers.handleHotbar(true)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null && client.currentScreen.getClass().toString().contains("sodium"))).cooldown().register();
|
||||
.action(InputHandlers.handleHotbar(true)).filter(Predicates.or(InputHandlers::inInventory, InputHandlers::inAdvancements).or((client, binding) -> client.currentScreen != null)).cooldown().register();
|
||||
public static final ButtonBinding PAGE_LEFT = new Builder("page_back").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_LEFT_TRIGGER, true))
|
||||
.action(InputHandlers.handlePage(false)).filter(InputHandlers::inInventory).cooldown(30).register();
|
||||
public static final ButtonBinding PAGE_RIGHT = new Builder("page_next").buttons(axisAsButton(GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER, true))
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.controller;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import eu.midnightdust.midnightcontrols.client.ButtonState;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||
@@ -16,10 +17,12 @@ import eu.midnightdust.midnightcontrols.client.MidnightInput;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.InventoryTabsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.MidnightControlsCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.SodiumCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.compat.YACLCompat;
|
||||
import eu.midnightdust.midnightcontrols.client.gui.RingScreen;
|
||||
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.mixin.TabNavigationWidgetAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.util.HandledScreenAccessor;
|
||||
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
|
||||
import net.fabricmc.fabric.impl.client.itemgroup.CreativeGuiExtensions;
|
||||
@@ -32,7 +35,9 @@ import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.gui.screen.advancement.AdvancementsScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.*;
|
||||
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
|
||||
import net.minecraft.client.gui.tab.TabManager;
|
||||
import net.minecraft.client.gui.widget.PressableWidget;
|
||||
import net.minecraft.client.gui.widget.TabNavigationWidget;
|
||||
import net.minecraft.client.util.ScreenshotRecorder;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemGroups;
|
||||
@@ -66,7 +71,7 @@ public class InputHandlers {
|
||||
return ItemGroupHelper.sortedGroups.stream()
|
||||
.filter(itemGroup -> {
|
||||
if (FabricCreativeGuiComponents.COMMON_GROUPS.contains(itemGroup)) return true;
|
||||
return ((CreativeGuiExtensions)screen).fabric_currentPage() == ((FabricItemGroup)itemGroup).getPage() && itemGroup.shouldDisplay() && (!itemGroup.equals(ItemGroups.OPERATOR) || ItemGroups.operatorEnabled);
|
||||
return ((CreativeGuiExtensions)screen).fabric_currentPage() == ((FabricItemGroup)itemGroup).getPage() && itemGroup.shouldDisplay();
|
||||
}).toList();
|
||||
}
|
||||
|
||||
@@ -160,8 +165,24 @@ public class InputHandlers {
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (client.currentScreen != null && client.currentScreen.children().stream().anyMatch(e -> e instanceof TabNavigationWidget)) {
|
||||
return Lists.newCopyOnWriteArrayList(client.currentScreen.children()).stream().anyMatch(e -> {
|
||||
if (e instanceof TabNavigationWidget tabs) {
|
||||
TabNavigationWidgetAccessor accessor = (TabNavigationWidgetAccessor) tabs;
|
||||
int tabIndex = accessor.getTabs().indexOf(accessor.getTabManager().getCurrentTab());
|
||||
if (next ? tabIndex+1 < accessor.getTabs().size() : tabIndex > 0) {
|
||||
if (next) tabs.selectTab(tabIndex + 1, true);
|
||||
else tabs.selectTab(tabIndex - 1, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
if (FabricLoader.getInstance().isModLoaded("sodium")) SodiumCompat.handleTabs(client.currentScreen, next);
|
||||
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
||||
SodiumCompat.handleTabs(client.currentScreen, next);
|
||||
if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleCategories(client.currentScreen, next))
|
||||
return true;
|
||||
}
|
||||
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryTabs(client.currentScreen, next);
|
||||
return false;
|
||||
@@ -170,34 +191,24 @@ public class InputHandlers {
|
||||
public static PressAction handlePage(boolean next) {
|
||||
return (client, button, value, action) -> {
|
||||
if (client.currentScreen instanceof CreativeInventoryScreen) {
|
||||
var screen = (HandledScreenAccessor) client.currentScreen;
|
||||
try {
|
||||
if (next) {
|
||||
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||
.map(element -> (PressableWidget) element)
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (element.getMessage().getString().equals(">")) {
|
||||
element.onPress();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||
.map(element -> (PressableWidget) element)
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (element.getMessage().getString().equals("<")) {
|
||||
element.onPress();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||
.map(element -> (PressableWidget) element)
|
||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||
.anyMatch(element -> {
|
||||
if (next && element.getMessage().getString().equals(">")) {
|
||||
element.onPress();
|
||||
return true;
|
||||
} else if (element.getMessage().getString().equals("<")) {
|
||||
element.onPress();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryPage(client.currentScreen, next);
|
||||
|
||||
return false;
|
||||
};
|
||||
}
|
||||
@@ -241,23 +252,21 @@ public class InputHandlers {
|
||||
|
||||
MidnightControlsClient.get().input.inventoryInteractionCooldown = 5;
|
||||
switch (button.getName()) {
|
||||
case "take_all": {
|
||||
if (screen instanceof CreativeInventoryScreen) {
|
||||
if (slot != null && (((CreativeInventoryScreenAccessor) accessor).midnightcontrols$isCreativeInventorySlot(slot) || MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot))))
|
||||
actionType = SlotActionType.CLONE;
|
||||
case "take_all" -> {
|
||||
if (screen instanceof CreativeInventoryScreen) {
|
||||
if (slot != null && (((CreativeInventoryScreenAccessor) accessor).midnightcontrols$isCreativeInventorySlot(slot) || MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot))))
|
||||
actionType = SlotActionType.CLONE;
|
||||
}
|
||||
}
|
||||
case "take" -> {
|
||||
clickData = GLFW_MOUSE_BUTTON_2;
|
||||
}
|
||||
case "quick_move" -> {
|
||||
actionType = SlotActionType.QUICK_MOVE;
|
||||
}
|
||||
default -> {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "take": {
|
||||
clickData = GLFW_MOUSE_BUTTON_2;
|
||||
break;
|
||||
}
|
||||
case "quick_move": {
|
||||
actionType = SlotActionType.QUICK_MOVE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
accessor.midnightcontrols$onMouseClick(slot, slotId, clickData, actionType);
|
||||
return true;
|
||||
|
||||
@@ -424,20 +424,20 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
|
||||
@Override
|
||||
public void renderTitle(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
drawCenteredText(matrices, this.textRenderer, I18n.translate("midnightcontrols.menu.title"), this.width / 2, 8, 16777215);
|
||||
drawCenteredTextWithShadow(matrices, this.textRenderer, I18n.translate("midnightcontrols.menu.title"), this.width / 2, 8, 16777215);
|
||||
}
|
||||
|
||||
public static class MidnightControlsBackground implements Background {
|
||||
private int transparency = 160;
|
||||
private static int transparency = 160;
|
||||
public MidnightControlsBackground() {}
|
||||
public MidnightControlsBackground(int transparency) {
|
||||
this.transparency = transparency;
|
||||
MidnightControlsBackground.transparency = transparency;
|
||||
}
|
||||
@Override
|
||||
public void render(MatrixStack matrixStack, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) {
|
||||
fill(matrixStack, widget.getX(), widget.getY(), widget.getX() + widget.getWidth(), widget.getY() + widget.getHeight(), MidnightColorUtil.hex2Rgb("#000000"));
|
||||
}
|
||||
private void fill(MatrixStack matrixStack, int x2, int y2, int x1, int y1, Color color) {
|
||||
private static void fill(MatrixStack matrixStack, int x2, int y2, int x1, int y1, Color color) {
|
||||
matrixStack.push();
|
||||
|
||||
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
|
||||
@@ -447,7 +447,6 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
float t = (float)(transparency) / 255.0F;
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.disableTexture();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
|
||||
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
|
||||
@@ -456,7 +455,6 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
||||
bufferBuilder.vertex(matrix, (float)x2, (float)y1, 0.0F).color(r, g, b, t).next();
|
||||
bufferBuilder.vertex(matrix, (float)x1, (float)y1, 0.0F).color(r, g, b, t).next();
|
||||
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
|
||||
RenderSystem.enableTexture();
|
||||
RenderSystem.disableBlend();
|
||||
matrixStack.pop();
|
||||
}
|
||||
|
||||
@@ -65,18 +65,18 @@ public class RingScreen extends Screen {
|
||||
RingPage.selected = -1;
|
||||
this.removed();
|
||||
}
|
||||
@Override
|
||||
public boolean changeFocus(boolean lookForwards) {
|
||||
if (lookForwards) {
|
||||
if (RingPage.selected < 7) ++RingPage.selected;
|
||||
else RingPage.selected = -1;
|
||||
}
|
||||
else {
|
||||
if (RingPage.selected > -1) --RingPage.selected;
|
||||
else RingPage.selected = 7;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// @Override
|
||||
// public boolean changeFocus(boolean lookForwards) {
|
||||
// if (lookForwards) {
|
||||
// if (RingPage.selected < 7) ++RingPage.selected;
|
||||
// else RingPage.selected = -1;
|
||||
// }
|
||||
// else {
|
||||
// if (RingPage.selected > -1) --RingPage.selected;
|
||||
// else RingPage.selected = 7;
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ControllerControlsWidget extends SpruceContainerWidget {
|
||||
|
||||
@Override
|
||||
public void renderWidget(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||
drawCenteredText(matrices, this.client.textRenderer, Text.translatable("midnightcontrols.menu.title.controller_controls"),
|
||||
drawCenteredTextWithShadow(matrices, this.client.textRenderer, Text.translatable("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);
|
||||
|
||||
@@ -24,7 +24,7 @@ public abstract class ChatScreenMixin extends Screen {
|
||||
private void midnightcontrols$moveInputField(CallbackInfo ci) {
|
||||
if (MidnightControlsConfig.moveChat) chatField.setY(4);
|
||||
}
|
||||
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setTextFieldFocused(Z)V", shift = At.Shift.AFTER))
|
||||
@Inject(method = "render", at = @At("HEAD"))
|
||||
private void midnightcontrols$moveInputFieldBackground(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||
if (MidnightControlsConfig.moveChat) matrices.translate(0f, -this.height + 16, 0f);
|
||||
}
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import net.minecraft.client.gui.navigation.NavigationDirection;
|
||||
import net.minecraft.client.gui.widget.EntryListWidget;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(EntryListWidget.class)
|
||||
public interface EntryListWidgetAccessor {
|
||||
@Invoker("moveSelection")
|
||||
void midnightcontrols$moveSelection(EntryListWidget.MoveDirection direction);
|
||||
//@Invoker("getNeighbouringEntry")
|
||||
//void midnightcontrols$getNeighbouringEntry(NavigationDirection direction);
|
||||
}
|
||||
|
||||
@@ -10,8 +10,10 @@ import java.util.List;
|
||||
|
||||
@Mixin(value = KeyBindingRegistryImpl.class, remap = false)
|
||||
public interface KeyBindingRegistryImplAccessor {
|
||||
|
||||
@Accessor @Final
|
||||
static List<KeyBinding> getModdedKeyBindings() {
|
||||
static List<KeyBinding> getMODDED_KEY_BINDINGS() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import net.minecraft.client.gui.tab.Tab;
|
||||
import net.minecraft.client.gui.tab.TabManager;
|
||||
import net.minecraft.client.gui.widget.TabNavigationWidget;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
@Mixin(TabNavigationWidget.class)
|
||||
public interface TabNavigationWidgetAccessor {
|
||||
@Accessor
|
||||
TabManager getTabManager();
|
||||
@Accessor
|
||||
ImmutableList<Tab> getTabs();
|
||||
}
|
||||
@@ -64,8 +64,8 @@ public final class MidnightRing {
|
||||
for (String binding : configBindings) {
|
||||
ButtonBinding buttonBinding = InputManager.getBinding(binding);
|
||||
if (buttonBinding != null) {
|
||||
RingPage page = this.pages.get(MathHelper.fastFloor(bindingIndex / 8f));
|
||||
page.actions[bindingIndex - 8 * (MathHelper.fastFloor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||
RingPage page = this.pages.get(MathHelper.floor(bindingIndex / 8f));
|
||||
page.actions[bindingIndex - 8 * (MathHelper.floor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||
++bindingIndex;
|
||||
}
|
||||
}
|
||||
@@ -88,8 +88,8 @@ public final class MidnightRing {
|
||||
|
||||
for (ButtonBinding buttonBinding : unboundBindings) {
|
||||
if (buttonBinding != null) {
|
||||
RingPage page = this.pages.get(MathHelper.fastFloor(bindingIndex / 8f));
|
||||
page.actions[bindingIndex - 8 * (MathHelper.fastFloor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||
RingPage page = this.pages.get(MathHelper.floor(bindingIndex / 8f));
|
||||
page.actions[bindingIndex - 8 * (MathHelper.floor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||
++bindingIndex;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class RingPage extends DrawableHelper {
|
||||
public void render(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int width, int height, int mouseX, int mouseY, float tickDelta) {
|
||||
int centerX = width / 2;
|
||||
int centerY = height / 2;
|
||||
if (MidnightControlsClient.get().ring.getMaxPages() > 1) drawCenteredText(matrices, textRenderer, name, centerX, 5, 0xffffff);
|
||||
if (MidnightControlsClient.get().ring.getMaxPages() > 1) drawCenteredTextWithShadow(matrices, textRenderer, name, centerX, 5, 0xffffff);
|
||||
|
||||
int offset = MidnightRing.ELEMENT_SIZE + (MidnightRing.ELEMENT_SIZE / 2) + 5;
|
||||
|
||||
|
||||
@@ -203,5 +203,10 @@
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "Default Dark",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "Second Light",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "Second Dark",
|
||||
"midnightcontrols.midnightconfig.category.controller": "Controller",
|
||||
"midnightcontrols.midnightconfig.category.misc": "Miscellaneous",
|
||||
"midnightcontrols.midnightconfig.category.screens": "Screens",
|
||||
"midnightcontrols.midnightconfig.category.gameplay": "Gameplay",
|
||||
"midnightcontrols.midnightconfig.category.visual": "Visual",
|
||||
"modmenu.descriptionTranslation.midnightcontrols": "Adds controller support and enhanced controls overall.\nForked from LambdaControls, which sadly got discontinued."
|
||||
}
|
||||
|
||||
203
src/main/resources/assets/midnightcontrols/lang/it_it.json
Normal file
203
src/main/resources/assets/midnightcontrols/lang/it_it.json
Normal file
@@ -0,0 +1,203 @@
|
||||
{
|
||||
"midnightcontrols.midnightconfig.title": "Configurazione Avanzata MidnightControls",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.DEFAULT_LIGHT": "Default Chiaro",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.DEFAULT_DARK": "Default Scuro",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.SECOND_LIGHT": "Chiaro Secondario",
|
||||
"midnightcontrols.midnightconfig.enum.VirtualMouseSkin.SECOND_DARK": "Scuro secondario",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DEFAULT": "Default",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DUALSHOCK": "DualShock",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.DUALSENSE": "DualSense",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.SWITCH": "Controller Switch/Wii",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.XBOX": "Controller Xbox One/Series",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.XBOX_360": "Controller Xbox 360",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.STEAM_CONTROLLER": "Controller Steam",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.STEAM_DECK": "Steam Deck",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.OUYA": "Controller OUYA",
|
||||
"midnightcontrols.midnightconfig.enum.ControllerType.NUMBERED": "Controller Numerato",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.DEFAULT": "Tastiera/Mouse",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.CONTROLLER": "Controller",
|
||||
"midnightcontrols.midnightconfig.enum.ControlsMode.TOUCHSCREEN": "Touchscreen (WIP)",
|
||||
"midnightcontrols.midnightconfig.enum.HudSide.LEFT": "Sinistra",
|
||||
"midnightcontrols.midnightconfig.enum.HudSide.RIGHT": "Destra",
|
||||
"key.midnightcontrols.look_down": "Guarda in basso",
|
||||
"key.midnightcontrols.look_left": "Guarda a sinistra",
|
||||
"key.midnightcontrols.look_right": "Guarda a destra",
|
||||
"key.midnightcontrols.look_up": "Guarda sopra",
|
||||
"key.midnightcontrols.ring": "Apri Tasti non impostati",
|
||||
"midnightcontrols.action.attack": "Attacca",
|
||||
"midnightcontrols.action.back": "Indietro",
|
||||
"midnightcontrols.action.chat": "Apri Chat",
|
||||
"midnightcontrols.action.controls_ring": "Apri Tasti non impostati",
|
||||
"midnightcontrols.action.debug_screen": "Apri HUD di Debug (F3)",
|
||||
"midnightcontrols.action.drop_item": "Rilascia oggetto",
|
||||
"midnightcontrols.action.exit": "Esci",
|
||||
"midnightcontrols.action.forward": "Avanti",
|
||||
"midnightcontrols.action.hit": "Colpisci",
|
||||
"midnightcontrols.action.hotbar_left": "Hotbar sinistra",
|
||||
"midnightcontrols.action.hotbar_right": "Hotbar destra",
|
||||
"midnightcontrols.action.inventory": "Inventario",
|
||||
"midnightcontrols.action.jump": "Salta",
|
||||
"midnightcontrols.action.left": "Sinistra",
|
||||
"midnightcontrols.action.pause_game": "Pausa il gioco",
|
||||
"midnightcontrols.action.pick_block": "Prendi Blocco",
|
||||
"midnightcontrols.action.pickup": "Raccogli",
|
||||
"midnightcontrols.action.pickup_all": "Raccogli Tutto",
|
||||
"midnightcontrols.action.place": "Piazza",
|
||||
"midnightcontrols.action.player_list": "Lista Giocatori",
|
||||
"midnightcontrols.action.quick_move": "Muovi veloce",
|
||||
"midnightcontrols.action.right": "Destra",
|
||||
"midnightcontrols.action.screenshot": "Fai uno Screenshot",
|
||||
"midnightcontrols.action.slot_up": "Muovi slot sopra",
|
||||
"midnightcontrols.action.slot_down": "Muovi slot sotto",
|
||||
"midnightcontrols.action.slot_left": "Muovi slot a sinistra",
|
||||
"midnightcontrols.action.slot_right": "Muovi slot a destra",
|
||||
"midnightcontrols.action.sneak": "Accovaccia",
|
||||
"midnightcontrols.action.sprint": "Corri",
|
||||
"midnightcontrols.action.swap_hands": "Scambia le mani",
|
||||
"midnightcontrols.action.toggle_perspective": "Cambia la prospettiva",
|
||||
"midnightcontrols.action.toggle_smooth_camera": "Cambia Camera Cinematica",
|
||||
"midnightcontrols.action.page_back": "Pagina precedente",
|
||||
"midnightcontrols.action.page_next": "Pagina Successica",
|
||||
"midnightcontrols.action.tab_back": "Tab Precedente",
|
||||
"midnightcontrols.action.tab_next": "Tab Successiva",
|
||||
"midnightcontrols.action.take": "Prendi Item",
|
||||
"midnightcontrols.action.take_all": "Prendi Stack",
|
||||
"midnightcontrols.action.use": "Usa",
|
||||
"midnightcontrols.action.zoom": "Zoom",
|
||||
"midnightcontrols.action.zoom_in": "Aumenta Zoom",
|
||||
"midnightcontrols.action.zoom_out": "Diminuisci Zoom",
|
||||
"midnightcontrols.action.zoom_reset": "Resetta Zoom",
|
||||
"midnightcontrols.action.emi_page_left": "Pagina Precedente",
|
||||
"midnightcontrols.action.emi_page_right": "Pagina Successiva",
|
||||
"midnightcontrols.category.emi": "EMI",
|
||||
"midnightcontrols.button.a": "A",
|
||||
"midnightcontrols.button.b": "B",
|
||||
"midnightcontrols.button.x": "X",
|
||||
"midnightcontrols.button.y": "Y",
|
||||
"midnightcontrols.button.left_bumper": "Bumper Destro",
|
||||
"midnightcontrols.button.right_bumper": "Bumper Sinistro",
|
||||
"midnightcontrols.button.back": "Indietro",
|
||||
"midnightcontrols.button.start": "Avvia",
|
||||
"midnightcontrols.button.guide": "Guida",
|
||||
"midnightcontrols.button.left_thumb": "Pollice Sinistro",
|
||||
"midnightcontrols.button.right_thumb": "Pollice Destro",
|
||||
"midnightcontrols.button.dpad_up": "DPAD Sopra",
|
||||
"midnightcontrols.button.dpad_right": "DPAD Destra",
|
||||
"midnightcontrols.button.dpad_down": "DPAD Sotto",
|
||||
"midnightcontrols.button.dpad_left": "DPAD Sinistra",
|
||||
"midnightcontrols.button.l4": "L4",
|
||||
"midnightcontrols.button.l5": "L5",
|
||||
"midnightcontrols.button.r4": "R4",
|
||||
"midnightcontrols.button.r5": "L5",
|
||||
"midnightcontrols.axis.left_x+": "Sinistra X+",
|
||||
"midnightcontrols.axis.left_y+": "Sinistra Y+",
|
||||
"midnightcontrols.axis.right_x+": "Destra X+",
|
||||
"midnightcontrols.axis.right_y+": "Destra Y+",
|
||||
"midnightcontrols.axis.left_trigger": "Trigger Sinistro",
|
||||
"midnightcontrols.axis.right_trigger": "Trigger Destro",
|
||||
"midnightcontrols.axis.left_x-": "Sinistra X-",
|
||||
"midnightcontrols.axis.left_y-": "Sinistra Y-",
|
||||
"midnightcontrols.axis.right_x-": "Destra X-",
|
||||
"midnightcontrols.axis.right_y-": "Destra Y-",
|
||||
"midnightcontrols.button.unknown": "Sconosciuto",
|
||||
"midnightcontrols.controller.tutorial.title": "Gioca il gioco con un Controller!",
|
||||
"midnightcontrols.controller.tutorial.description": "Vai a %s -> %s -> %s",
|
||||
"midnightcontrols.controller.connected": "Controller %d connesso.",
|
||||
"midnightcontrols.controller.disconnected": "Controller %d disconnesso",
|
||||
"midnightcontrols.controller.mappings.1": "Per configurare le mappature dei controller, per favore usa %s",
|
||||
"midnightcontrols.controller.mappings.3": "e incolla le mappature nel file editor.",
|
||||
"midnightcontrols.controller.mappings.error": "Errore durante il caricamento delle mappature",
|
||||
"midnightcontrols.controller.mappings.error.write": "Errore durante la scrittura delle mappature su file",
|
||||
"midnightcontrols.controller.mappings.updated": "Aggiornate le mappature!",
|
||||
"midnightcontrols.controller_type.default": "Default",
|
||||
"midnightcontrols.controller_type.dualshock": "DualShock",
|
||||
"midnightcontrols.controller_type.dualsense": "DualSense",
|
||||
"midnightcontrols.controller_type.switch": "Controller Switch/Wii",
|
||||
"midnightcontrols.controller_type.xbox": "Controller Xbox One/Series",
|
||||
"midnightcontrols.controller_type.xbox_360": "Controller Xbox 360",
|
||||
"midnightcontrols.controller_type.steam_controller": "Controller Steam",
|
||||
"midnightcontrols.controller_type.steam_deck": "Steam Deck",
|
||||
"midnightcontrols.controller_type.ouya": "Controller OUYA",
|
||||
"midnightcontrols.controller_type.numbered": "Controller Numerato",
|
||||
"midnightcontrols.controls_mode.default": "Tastiera/Mouse",
|
||||
"midnightcontrols.controls_mode.controller": "Controller",
|
||||
"midnightcontrols.controls_mode.touchscreen": "Touchscreen (WIP)",
|
||||
"midnightcontrols.hud_side.left": "Left",
|
||||
"midnightcontrols.hud_side.right": "Destra",
|
||||
"midnightcontrols.menu.analog_movement": "Movimento Analogo",
|
||||
"midnightcontrols.menu.auto_switch_mode": "Modalità Cambio Automatico",
|
||||
"midnightcontrols.menu.controller": "Controller",
|
||||
"midnightcontrols.menu.controller2": "Controller Secondario",
|
||||
"midnightcontrols.menu.controller_toggle_sneak": "Attiva/Disattiva Accovacciamento su Controller",
|
||||
"midnightcontrols.menu.controller_toggle_sprint": "Attiva/Disattiva Correre su Controller",
|
||||
"midnightcontrols.menu.controller_type": "Tipo di Controller",
|
||||
"midnightcontrols.menu.controls_mode": "Modalità",
|
||||
"midnightcontrols.menu.double_tap_to_sprint": "Doppio Tap per Sprintare",
|
||||
"midnightcontrols.menu.fast_block_placing": "Veloce Piazzamento di Blocchi",
|
||||
"midnightcontrols.menu.fly_drifting": "Drift in Volo",
|
||||
"midnightcontrols.menu.fly_drifting_vertical": "Drift in Volo Verticale",
|
||||
"midnightcontrols.menu.hud_enable": "Attiva HUD",
|
||||
"midnightcontrols.menu.hud_side": "Lato HUD",
|
||||
"midnightcontrols.menu.invert_right_x_axis": "Inverti Destro X",
|
||||
"midnightcontrols.menu.invert_right_y_axis": "Inverti Destro Y",
|
||||
"midnightcontrols.menu.keyboard_controls": "Controlli da Tastiera...",
|
||||
"midnightcontrols.menu.left_dead_zone": "Zona Morta dello Stick Sinistro",
|
||||
"midnightcontrols.menu.mappings.open_input_str": "Apri il File Editor delle Mappature",
|
||||
"midnightcontrols.menu.max_left_x_value": "Asse X Sinistro Massimo Valore",
|
||||
"midnightcontrols.menu.max_left_y_value": "Asse Y Sinistro Massimo Valore",
|
||||
"midnightcontrols.menu.max_right_x_value": "Asse Destro X Massimo Valore",
|
||||
"midnightcontrols.menu.max_right_y_value": "Asse Destro Y Massimo Valore",
|
||||
"midnightcontrols.menu.mouse_speed": "Velocità Mouse",
|
||||
"midnightcontrols.menu.reacharound.horizontal": "Piazza blocchi Davanti",
|
||||
"midnightcontrols.menu.reacharound.vertical": "Reach Verticale",
|
||||
"midnightcontrols.menu.reload_controller_mappings": "Ricarica Mappature del Controller",
|
||||
"midnightcontrols.menu.right_dead_zone": "Zona Morta Stick Destro",
|
||||
"midnightcontrols.menu.rotation_speed": "Velocità di rotazione dell'Asse X",
|
||||
"midnightcontrols.menu.y_axis_rotation_speed": "Velocità di rotazione dell'Asse Y",
|
||||
"midnightcontrols.menu.separate_controller_profile": "Profilo Controller Separato",
|
||||
"midnightcontrols.menu.separator.controller": "Controller",
|
||||
"midnightcontrols.menu.separator.general": "Generale",
|
||||
"midnightcontrols.menu.title": "MidnightControls - Impostazioni",
|
||||
"midnightcontrols.menu.title.controller": "Opzioni Controller",
|
||||
"midnightcontrols.menu.title.controller_controls": "Tasti Controller",
|
||||
"midnightcontrols.menu.title.gameplay": "Opzioni del Gameplay",
|
||||
"midnightcontrols.menu.title.general": "Impostazioni Generali",
|
||||
"midnightcontrols.menu.title.hud": "Opzioni della HUD",
|
||||
"midnightcontrols.menu.title.mappings.string": "Editor di file delle Mappature",
|
||||
"midnightcontrols.menu.title.visual": "Aspetto",
|
||||
"midnightcontrols.menu.unfocused_input": "Input non a fuoco",
|
||||
"midnightcontrols.menu.virtual_mouse": "Mouse Virtuale",
|
||||
"midnightcontrols.menu.virtual_mouse.skin": "Aspetto Mouse Virtuale",
|
||||
"midnightcontrols.narrator.unbound": "Disimpostato %s",
|
||||
"midnightcontrols.not_bound": "Non Impostato",
|
||||
"midnightcontrols.tooltip.analog_movement": "Quando possibile, attiva movimento analogo.",
|
||||
"midnightcontrols.tooltip.auto_switch_mode": "Quando la modalità controlli dovrebbe passare a Controller automaticamente se uno è connesso",
|
||||
"midnightcontrols.tooltip.controller2": "Secondo controller da usare, che permette (per esempio) Supporto dei Joy-Cons.",
|
||||
"midnightcontrols.tooltip.controller_type": "Il tipo di controller che stai usando (usato per mostrare i pulsanti corretti)",
|
||||
"midnightcontrols.tooltip.controls_mode": "Modalita controlli.",
|
||||
"midnightcontrols.tooltip.double_tap_to_sprint": "Attiva quando il tasto \"Cammina Avanti\" fa correre il giocatore con doppio tap velocemente",
|
||||
"midnightcontrols.tooltip.fast_block_placing": "Quando si vola in creativa, attiva il movimento veloce dei blocchi in base alla tua velocità. §cSu alcuni server potrebbe essere considerato un cheat.§r",
|
||||
"midnightcontrols.tooltip.fly_drifting": "Quando si vola, attiva L'inerzia del Vanilla",
|
||||
"midnightcontrols.tooltip.fly_drifting_vertical": "Quando si vola, attiva l'inerzia verticale Vanilla",
|
||||
"midnightcontrols.tooltip.hud_enable": "Attiva gli indicatori dei pulsanti dei controller sullo schermo.",
|
||||
"midnightcontrols.tooltip.hud_side": "La posizione della HUD",
|
||||
"midnightcontrols.tooltip.left_dead_zone": "La zona morta per lo stick sinistro del controller.",
|
||||
"midnightcontrols.tooltip.max_left_x_value": "Cambia cosa la mod considera il più alto valore per l'asse X sinistro. Utile se il tuo asse non usa il range massimo e sembra lento",
|
||||
"midnightcontrols.tooltip.max_left_y_value": "Cambia cosa la mod considera il più alto valore per l'asse Y sinistro. Utile se il tuo asse non usa il range massimo e sembra lento",
|
||||
"midnightcontrols.tooltip.max_right_x_value": "Cambia cosa la mod considera il più alto valore per l'asse X Destro. Utile se il tuo asse non usa il range massimo e sembra lento.",
|
||||
"midnightcontrols.tooltip.max_right_y_value": "Cambia cosa la mod considera il più alto valore per l'asse Y Destro. Utile se il tuo asse non usa il range massimo e sembra lento.",
|
||||
"midnightcontrols.tooltip.mouse_speed": "La velocità del controller emulato.",
|
||||
"midnightcontrols.tooltip.reacharound.horizontal": "Attiva il piazzare blocchi davanti, Potrebbe essere considerato un cheat su alcuni server.",
|
||||
"midnightcontrols.tooltip.reacharound.vertical": "Attiva il reach verticale, potrebbe essere considerato cheating su alcuni server",
|
||||
"midnightcontrols.tooltip.reload_controller_mappings": "Riavvia il file dlle mappature del controller",
|
||||
"midnightcontrols.tooltip.right_dead_zone": "La zona morta per lo stick destro del controller",
|
||||
"midnightcontrols.tooltip.rotation_speed": "L'asse X della velocità di rotazione della camera im modalità controller",
|
||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "L'asse Y della velocità di rotazione della camera im modalità controller",
|
||||
"midnightcontrols.tooltip.unfocused_input": "Permette imput dei controller quando la finestra non è messa a fuoco",
|
||||
"midnightcontrols.tooltip.virtual_mouse": "Attiva il mouse virtuale, che può essere utile nello schermo diviso.",
|
||||
"midnightcontrols.virtual_mouse.skin.default_light": "Chiaro Default",
|
||||
"midnightcontrols.virtual_mouse.skin.default_dark": "Scuro Default",
|
||||
"midnightcontrols.virtual_mouse.skin.second_light": "Chiaro Secondario",
|
||||
"midnightcontrols.virtual_mouse.skin.second_dark": "Scuro Secondario",
|
||||
"modmenu.descriptionTranslation.midnightcontrols": "Aggiunge supporto e controlli migliorati in generale. \\nProveniente da LambdaControls, che è stato rimosso."
|
||||
}
|
||||
@@ -52,8 +52,8 @@
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.11.3",
|
||||
"fabric": ">=0.36.0",
|
||||
"minecraft": ">=1.17",
|
||||
"fabric": ">=0.71.0",
|
||||
"minecraft": "~1.19.3",
|
||||
"spruceui": ">=3.2.0",
|
||||
"java": ">=17"
|
||||
},
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
accessWidener v1 named
|
||||
|
||||
accessible class net/minecraft/client/gui/widget/EntryListWidget$MoveDirection
|
||||
#accessible class net/minecraft/client/gui/widget/EntryListWidget$MoveDirection
|
||||
@@ -20,7 +20,8 @@
|
||||
"WorldRendererMixin",
|
||||
"KeyBindingRegistryImplAccessor",
|
||||
"KeyBindingIDAccessor",
|
||||
"ScreenAccessor"
|
||||
"ScreenAccessor",
|
||||
"TabNavigationWidgetAccessor"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 12,
|
||||
"pack_format": 13,
|
||||
"description": "Makes controller tooltips use similar icons to Bedrock Edition"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 12,
|
||||
"pack_format": 13,
|
||||
"description": "Makes controller icons look similar to Legacy Console Edit."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user