mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-13 15:25:08 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3863c45f26 | ||
|
|
0036baee3e | ||
|
|
5323b72268 | ||
|
|
fdb1024ee3 |
20
build.gradle
20
build.gradle
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.1-SNAPSHOT'
|
id 'fabric-loom' version '1.0-SNAPSHOT'
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
id 'com.github.johnrengelman.shadow' version '7.0.0'
|
||||||
@@ -32,7 +32,7 @@ boolean isMCVersionNonRelease() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getMCVersionString() {
|
String getMCVersionString() {
|
||||||
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.4") {
|
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.3") {
|
||||||
return project.minecraft_version
|
return project.minecraft_version
|
||||||
}
|
}
|
||||||
def version = project.minecraft_version.split('\\.')
|
def version = project.minecraft_version.split('\\.')
|
||||||
@@ -94,9 +94,7 @@ dependencies {
|
|||||||
// Fabric API. This is technically optional, but you probably want it anyway.
|
// Fabric API. This is technically optional, but you probably want it anyway.
|
||||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
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}"
|
include "dev.lambdaurora:spruceui:${project.spruceui_version}"
|
||||||
api('org.aperlambda:lambdajcommon:1.8.1') {
|
api('org.aperlambda:lambdajcommon:1.8.1') {
|
||||||
exclude group: 'com.google.code.gson'
|
exclude group: 'com.google.code.gson'
|
||||||
@@ -114,17 +112,21 @@ dependencies {
|
|||||||
// modImplementation("maven.modrinth:ok-zoomer:${project.ok_zoomer_version}")
|
// modImplementation("maven.modrinth:ok-zoomer:${project.ok_zoomer_version}")
|
||||||
// modImplementation "io.github.ennuil:LibZoomer:${project.libzoomer_version}"
|
// modImplementation "io.github.ennuil:LibZoomer:${project.libzoomer_version}"
|
||||||
|
|
||||||
modCompileOnlyApi "io.github.cottonmc:LibGui:${project.libgui_version}"
|
modCompileOnlyApi ("io.github.cottonmc:LibGui:${project.libgui_version}") {
|
||||||
|
exclude(group: "net.fabricmc.fabric-api")
|
||||||
|
}
|
||||||
modCompileOnlyApi "org.quiltmc:quilt-json5:1.0.0"
|
modCompileOnlyApi "org.quiltmc:quilt-json5:1.0.0"
|
||||||
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
|
modCompileOnly "maven.modrinth:sodium:${project.sodium_version}"
|
||||||
modCompileOnlyApi "maven.modrinth:emi:${project.emi_version}"
|
modImplementation "maven.modrinth:emi:${project.emi_version}"
|
||||||
modCompileOnlyApi "maven.modrinth:emotecraft:${project.emotecraft_version}"
|
modCompileOnlyApi "maven.modrinth:emotecraft:${project.emotecraft_version}"
|
||||||
modCompileOnlyApi "io.github.kosmx:bendy-lib:${project.bendylib_version}"
|
modCompileOnlyApi "io.github.kosmx:bendy-lib:${project.bendylib_version}"
|
||||||
modCompileOnlyApi "dev.isxander:yet-another-config-lib:${project.yacl_version}"
|
modImplementation ("dev.isxander:yet-another-config-lib:${project.yacl_version}") {
|
||||||
|
exclude(group: "net.fabricmc.fabric-api")
|
||||||
|
}
|
||||||
modCompileOnlyApi "maven.modrinth:inventory-tabs-updated:${project.inventorytabs_version}"
|
modCompileOnlyApi "maven.modrinth:inventory-tabs-updated:${project.inventorytabs_version}"
|
||||||
modCompileOnlyApi "maven.modrinth:bedrockify:${project.bedrockify_version}"
|
modCompileOnlyApi "maven.modrinth:bedrockify:${project.bedrockify_version}"
|
||||||
// Required for Inventory Tabs
|
// Required for Inventory Tabs
|
||||||
modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
||||||
exclude(group: "net.fabricmc.fabric-api")
|
exclude(group: "net.fabricmc.fabric-api")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,30 +3,30 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://fabricmc.net/use
|
# check these on https://fabricmc.net/use
|
||||||
minecraft_version=1.19.4
|
minecraft_version=1.19.2
|
||||||
yarn_mappings=1.19.4+build.1
|
yarn_mappings=1.19.2+build.28
|
||||||
loader_version=0.14.17
|
loader_version=0.14.12
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.8.1
|
mod_version = 1.7.4
|
||||||
maven_group = eu.midnightdust
|
maven_group = eu.midnightdust
|
||||||
archives_base_name = midnightcontrols
|
archives_base_name = midnightcontrols
|
||||||
modrinth_id=bXX9h73M
|
modrinth_id=bXX9h73M
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||||
fabric_version=0.75.3+1.19.4
|
fabric_version=0.72.0+1.19.2
|
||||||
sodium_version=mc1.19.2-0.4.4
|
sodium_version=mc1.19.2-0.4.4
|
||||||
spruceui_version=4.2.0+1.19.4
|
spruceui_version=4.0.0+1.19
|
||||||
midnightlib_version=1.2.1-fabric
|
midnightlib_version=1.0.0-fabric
|
||||||
modmenu_version=5.0.1
|
modmenu_version=5.0.1
|
||||||
emotecraft_version=2.1.3-SNAPSHOT-build.29-MC1.19-fabric
|
emotecraft_version=2.1.3-SNAPSHOT-build.29-MC1.19-fabric
|
||||||
bendylib_version=2.0.+
|
bendylib_version=2.0.+
|
||||||
emi_version=0.5.0+1.19.3
|
emi_version=0.5.3+1.19.2
|
||||||
libgui_version=6.0.0+1.19
|
libgui_version=6.0.0+1.19
|
||||||
inventorytabs_version=inventorytabs-0.9.beta-1.19.x
|
inventorytabs_version=inventorytabs-0.9.beta-1.19.x
|
||||||
clothconfig_version=7.0.72
|
clothconfig_version=7.0.72
|
||||||
yacl_version=2.2.0
|
yacl_version=1.7.1
|
||||||
bedrockify_version=1.5+mc1.19.1-2
|
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.
|
# 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,14 +144,6 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
|||||||
public void onMcInit(@NotNull MinecraftClient client) {
|
public void onMcInit(@NotNull MinecraftClient client) {
|
||||||
ButtonBinding.init(client.options);
|
ButtonBinding.init(client.options);
|
||||||
MidnightControlsConfig.load();
|
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);
|
this.hud.setVisible(MidnightControlsConfig.hudEnable);
|
||||||
Controller.updateMappings();
|
Controller.updateMappings();
|
||||||
GLFW.glfwSetJoystickCallback((jid, event) -> {
|
GLFW.glfwSetJoystickCallback((jid, event) -> {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package eu.midnightdust.midnightcontrols.client;
|
|||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.mojang.blaze3d.platform.GlDebugInfo;
|
|
||||||
import eu.midnightdust.lib.config.MidnightConfig;
|
import eu.midnightdust.lib.config.MidnightConfig;
|
||||||
import eu.midnightdust.midnightcontrols.ControlsMode;
|
import eu.midnightdust.midnightcontrols.ControlsMode;
|
||||||
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
|
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
|
||||||
@@ -34,61 +33,58 @@ import static org.lwjgl.glfw.GLFW.*;
|
|||||||
*/
|
*/
|
||||||
public class MidnightControlsConfig extends MidnightConfig {
|
public class MidnightControlsConfig extends MidnightConfig {
|
||||||
public static boolean isEditing = false;
|
public static boolean isEditing = false;
|
||||||
@Hidden @Entry public static int configVersion = 2;
|
@Hidden @Entry public static int configVersion = 1;
|
||||||
// General
|
// General
|
||||||
@Entry(category = "controller", name = "midnightcontrols.menu.controls_mode") public static ControlsMode controlsMode = ControlsMode.DEFAULT;
|
@Entry(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(name = "midnightcontrols.menu.auto_switch_mode") public static boolean autoSwitchMode = true;
|
||||||
@Entry(category = "misc", name = "Debug") public static boolean debug = false;
|
@Entry(name = "Debug") public static boolean debug = false;
|
||||||
// HUD
|
// HUD
|
||||||
@Entry(category = "visual", name = "midnightcontrols.menu.hud_enable") public static boolean hudEnable = true;
|
@Entry(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(name = "midnightcontrols.menu.hud_side") public static HudSide hudSide = HudSide.LEFT;
|
||||||
@Entry(category = "screens", name = "midnightcontrols.menu.move_chat") public static boolean moveChat = false;
|
@Entry(name = "midnightcontrols.menu.move_chat") public static boolean moveChat = false;
|
||||||
// Gameplay
|
// Gameplay
|
||||||
@Entry(category = "gameplay", name = "midnightcontrols.menu.analog_movement") public static boolean analogMovement = true;
|
@Entry(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(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(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(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(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(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(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(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(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(name = "Reacharound Outline") public static boolean shouldRenderReacharoundOutline = true;
|
||||||
@Entry(category = "visual", name = "Reacharound Outline Color", isColor = true) public static String reacharoundOutlineColorHex = "#ffffff";
|
@Entry(name = "Reacharound Outline Color (WIP)", 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(name = "Reacharound Outline Alpha", 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(name = "midnightcontrols.menu.right_dead_zone") 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(name = "midnightcontrols.menu.left_dead_zone") public static double leftDeadZone = 0.25;
|
||||||
@Entry(category = "controller", name = "midnightcontrols.menu.invert_right_y_axis") public static boolean invertRightYAxis = false;
|
@Entry(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(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(name = "midnightcontrols.menu.rotation_speed") public static double rotationSpeed = 40.0; //used for x-axis, name kept for compatability
|
||||||
@Entry(category = "controller", name = "midnightcontrols.menu.y_axis_rotation_speed", isSlider = true, min = 0, max = 100, precision = 10) public static double yAxisRotationSpeed = rotationSpeed;
|
@Entry(name = "midnightcontrols.menu.y_axis_rotation_speed") 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(name = "midnightcontrols.menu.mouse_speed") public static double mouseSpeed = 25.0;
|
||||||
@Entry(category = "screens", name = "midnightcontrols.menu.joystick_as_mouse") public static boolean joystickAsMouse = false;
|
@Entry(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(name = "midnightcontrols.menu.unfocused_input") public static boolean unfocusedInput = false;
|
||||||
@Entry(category = "screens", name = "midnightcontrols.menu.virtual_mouse") public static boolean virtualMouse = false;
|
@Entry(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(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(name = "Controller ID") public static Object controllerID = 0;
|
||||||
@Entry(category = "controller", name = "2nd Controller ID") @Hidden public static Object secondControllerID = -1;
|
@Entry(name = "2nd Controller ID") public static Object secondControllerID = -1;
|
||||||
@Entry(category = "visual", name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
|
@Entry(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",
|
@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",
|
||||||
"net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen",
|
"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",
|
"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");
|
"me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||||
@Entry(category = "screens", name = "Arrow screens") public static List<String> arrowScreens = Lists.newArrayList(ChatScreen.class.getCanonicalName());
|
@Entry(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(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<>();
|
@Entry(name = "Keybindings") public static Map<String, String> BINDING = new HashMap<>();
|
||||||
|
|
||||||
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
|
private static final Pattern BUTTON_BINDING_PATTERN = Pattern.compile("(-?\\d+)\\+?");
|
||||||
@Deprecated @Hidden @Entry public static double[] maxAnalogValues = new double[]{1, 1, 1, 1};
|
@Entry(name = "Max analog values") 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(name = "Trigger button fix") public static boolean triggerFix = true;
|
||||||
@Entry(category = "controller", name = "Max analog value: Left Y", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueLeftY = maxAnalogValues[1];
|
@Entry(name = "Enable Hints") public static boolean enableHints = true;
|
||||||
@Entry(category = "controller", name = "Max analog value: Right X", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueRightX = maxAnalogValues[2];
|
@Entry(name = "Enable Shortcut in Controls Options") public static boolean shortcutInControls = true;
|
||||||
@Entry(category = "controller", name = "Max analog value: Right Y", isSlider = true, min = .25f, max = 1.f) public static double maxAnalogValueRightY = maxAnalogValues[3];
|
@Entry(name = "Ring Bindings (WIP)") public static List<String> ringBindings = new ArrayList<>();
|
||||||
@Entry(category = "controller", name = "Trigger button fix") public static boolean triggerFix = true;
|
@Entry(name = "Ignored Unbound Keys") public static List<String> ignoredUnboundKeys = Lists.newArrayList("inventorytabs.key.next_tab");
|
||||||
@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<>();
|
@Entry @Hidden public static Map<String, Map<String, String>> controllerBindingProfiles = new HashMap<>();
|
||||||
private static Map<String, String> currentBindingProfile = new HashMap<>();
|
private static Map<String, String> currentBindingProfile = new HashMap<>();
|
||||||
private static Controller prevController;
|
private static Controller prevController;
|
||||||
@@ -202,21 +198,14 @@ public class MidnightControlsConfig extends MidnightConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double getAxisMaxValue(int axis) {
|
public static double getAxisMaxValue(int axis) {
|
||||||
return switch (axis) {
|
if (axis >= MidnightControlsConfig.maxAnalogValues.length)
|
||||||
case GLFW_GAMEPAD_AXIS_LEFT_X -> MidnightControlsConfig.maxAnalogValueLeftX;
|
return 1;
|
||||||
case GLFW_GAMEPAD_AXIS_LEFT_Y -> MidnightControlsConfig.maxAnalogValueLeftY;
|
return MidnightControlsConfig.maxAnalogValues[axis];
|
||||||
case GLFW_GAMEPAD_AXIS_RIGHT_X -> MidnightControlsConfig.maxAnalogValueRightX;
|
|
||||||
default -> MidnightControlsConfig.maxAnalogValueRightY;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setAxisMaxValue(int axis, double value) {
|
public static void setAxisMaxValue(int axis, double value) {
|
||||||
switch (axis) {
|
if (axis < MidnightControlsConfig.maxAnalogValues.length)
|
||||||
case GLFW_GAMEPAD_AXIS_LEFT_X -> MidnightControlsConfig.maxAnalogValueLeftX = value;
|
MidnightControlsConfig.maxAnalogValues[axis] = value;
|
||||||
case GLFW_GAMEPAD_AXIS_LEFT_Y -> MidnightControlsConfig.maxAnalogValueLeftY = value;
|
|
||||||
case GLFW_GAMEPAD_AXIS_RIGHT_X -> MidnightControlsConfig.maxAnalogValueRightX = value;
|
|
||||||
default -> MidnightControlsConfig.maxAnalogValueRightY = value;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -341,12 +330,9 @@ public class MidnightControlsConfig extends MidnightConfig {
|
|||||||
controllerID = 0;
|
controllerID = 0;
|
||||||
secondControllerID = -1;
|
secondControllerID = -1;
|
||||||
controllerType = ControllerType.DEFAULT;
|
controllerType = ControllerType.DEFAULT;
|
||||||
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");
|
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");
|
||||||
BINDING = new HashMap<>();
|
BINDING = new HashMap<>();
|
||||||
maxAnalogValueLeftX = 1;
|
maxAnalogValues = new double[]{1, 1, 1, 1};
|
||||||
maxAnalogValueLeftY = 1;
|
|
||||||
maxAnalogValueRightX = 1;
|
|
||||||
maxAnalogValueRightY = 1;
|
|
||||||
triggerFix = true;
|
triggerFix = true;
|
||||||
enableHints = true;
|
enableHints = true;
|
||||||
shortcutInControls = true;
|
shortcutInControls = true;
|
||||||
@@ -364,7 +350,7 @@ public class MidnightControlsConfig extends MidnightConfig {
|
|||||||
String controller = getController().getName().toLowerCase();
|
String controller = getController().getName().toLowerCase();
|
||||||
if (controller.contains("xbox 360")) return ControllerType.XBOX_360;
|
if (controller.contains("xbox 360")) return ControllerType.XBOX_360;
|
||||||
else if (controller.contains("xbox") || controller.contains("afterglow")) return ControllerType.XBOX;
|
else if (controller.contains("xbox") || controller.contains("afterglow")) return ControllerType.XBOX;
|
||||||
else if (controller.contains("steam") && GlDebugInfo.getCpuInfo().contains("AMD Custom APU")) return ControllerType.STEAM_DECK;
|
else if (controller.contains("steam deck")) return ControllerType.STEAM_DECK;
|
||||||
else if (controller.contains("steam")) return ControllerType.STEAM_CONTROLLER;
|
else if (controller.contains("steam")) return ControllerType.STEAM_CONTROLLER;
|
||||||
else if (controller.contains("dualsense") || controller.contains("ps5")) return ControllerType.DUALSENSE;
|
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;
|
else if (controller.contains("dualshock") || controller.contains("ps4") || controller.contains("sony")) return ControllerType.DUALSHOCK;
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ public class MidnightInput {
|
|||||||
private static final Map<Integer, Integer> BUTTON_COOLDOWNS = new HashMap<>();
|
private static final Map<Integer, Integer> BUTTON_COOLDOWNS = new HashMap<>();
|
||||||
// Cooldowns
|
// Cooldowns
|
||||||
public int actionGuiCooldown = 0;
|
public int actionGuiCooldown = 0;
|
||||||
public int joystickCooldown = 0;
|
|
||||||
public boolean ignoreNextARelease = false;
|
public boolean ignoreNextARelease = false;
|
||||||
public boolean ignoreNextXRelease = false;
|
public boolean ignoreNextXRelease = false;
|
||||||
private double targetYaw = 0.0;
|
private double targetYaw = 0.0;
|
||||||
@@ -127,8 +126,6 @@ public class MidnightInput {
|
|||||||
--this.actionGuiCooldown;
|
--this.actionGuiCooldown;
|
||||||
if (this.screenCloseCooldown > 0)
|
if (this.screenCloseCooldown > 0)
|
||||||
--this.screenCloseCooldown;
|
--this.screenCloseCooldown;
|
||||||
if (this.joystickCooldown > 0)
|
|
||||||
--this.joystickCooldown;
|
|
||||||
|
|
||||||
InputManager.updateStates();
|
InputManager.updateStates();
|
||||||
|
|
||||||
@@ -330,13 +327,15 @@ public class MidnightInput {
|
|||||||
&& (button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_UP || button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_DOWN
|
&& (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)) {
|
|| button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_LEFT || button == GLFW.GLFW_GAMEPAD_BUTTON_DPAD_RIGHT)) {
|
||||||
if (this.actionGuiCooldown == 0) {
|
if (this.actionGuiCooldown == 0) {
|
||||||
switch (button) {
|
if (MidnightControlsConfig.arrowScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> this.changeFocus(client.currentScreen, NavigationDirection.UP);
|
switch (button) {
|
||||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> this.changeFocus(client.currentScreen, NavigationDirection.DOWN);
|
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_UP);
|
||||||
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> this.handleLeftRight(client.currentScreen, false);
|
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_DOWN);
|
||||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> this.handleLeftRight(client.currentScreen, true);
|
case GLFW_GAMEPAD_BUTTON_DPAD_LEFT -> pressKeyboardKey(client, GLFW.GLFW_KEY_LEFT);
|
||||||
|
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> pressKeyboardKey(client, GLFW.GLFW_KEY_RIGHT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (MidnightControlsConfig.wasdScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
else if (MidnightControlsConfig.wasdScreens.contains(client.currentScreen.getClass().getCanonicalName())) {
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_W);
|
case GLFW_GAMEPAD_BUTTON_DPAD_UP -> pressKeyboardKey(client, GLFW.GLFW_KEY_W);
|
||||||
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_S);
|
case GLFW_GAMEPAD_BUTTON_DPAD_DOWN -> pressKeyboardKey(client, GLFW.GLFW_KEY_S);
|
||||||
@@ -344,6 +343,11 @@ public class MidnightInput {
|
|||||||
case GLFW_GAMEPAD_BUTTON_DPAD_RIGHT -> pressKeyboardKey(client, GLFW.GLFW_KEY_D);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
@@ -422,9 +426,6 @@ public class MidnightInput {
|
|||||||
public void pressKeyboardKey(MinecraftClient client, int key) {
|
public void pressKeyboardKey(MinecraftClient client, int key) {
|
||||||
client.keyboard.onKey(client.getWindow().getHandle(), key, 0, 1, 0);
|
client.keyboard.onKey(client.getWindow().getHandle(), key, 0, 1, 0);
|
||||||
}
|
}
|
||||||
public void pressKeyboardKey(Screen screen, int key) {
|
|
||||||
screen.keyPressed(key, 0, 1);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -570,8 +571,9 @@ public class MidnightInput {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (client.currentScreen != null) {
|
} else if (client.currentScreen != null) {
|
||||||
float finalValue = value;
|
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y && absValue >= deadZone) {
|
||||||
if (axis == GLFW_GAMEPAD_AXIS_RIGHT_Y && absValue >= deadZone && client.currentScreen.children().stream().filter(element -> element instanceof SpruceEntryListWidget)
|
float finalValue = value;
|
||||||
|
if (client.currentScreen.children().stream().filter(element -> element instanceof SpruceEntryListWidget)
|
||||||
.map(element -> (SpruceEntryListWidget<?>) element)
|
.map(element -> (SpruceEntryListWidget<?>) element)
|
||||||
.filter(AbstractSpruceWidget::isFocusedOrHovered)
|
.filter(AbstractSpruceWidget::isFocusedOrHovered)
|
||||||
.noneMatch(element -> {
|
.noneMatch(element -> {
|
||||||
@@ -589,20 +591,7 @@ public class MidnightInput {
|
|||||||
{
|
{
|
||||||
client.currentScreen.mouseScrolled(0.0, 0.0, -(value * 1.5f));
|
client.currentScreen.mouseScrolled(0.0, 0.0, -(value * 1.5f));
|
||||||
}
|
}
|
||||||
else if (isScreenInteractive(client.currentScreen) && 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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -706,7 +695,6 @@ public class MidnightInput {
|
|||||||
} else if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleAButton(screen, focused)) {
|
} else if (FabricLoader.getInstance().isModLoaded("yet-another-config-lib") && YACLCompat.handleAButton(screen, focused)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else pressKeyboardKey(screen, GLFW_KEY_ENTER);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -740,13 +728,11 @@ public class MidnightInput {
|
|||||||
return !spruceElement.onNavigation(right ? NavigationDirection.RIGHT : NavigationDirection.LEFT, false);
|
return !spruceElement.onNavigation(right ? NavigationDirection.RIGHT : NavigationDirection.LEFT, false);
|
||||||
}
|
}
|
||||||
if (element instanceof SliderWidget slider) {
|
if (element instanceof SliderWidget slider) {
|
||||||
if (slider.active) {
|
slider.keyPressed(right ? 262 : 263, 0, 0);
|
||||||
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.
|
||||||
this.actionGuiCooldown = 2; // Prevent to press too quickly the focused element, so we have to skip 5 ticks.
|
return false;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
} else if (element instanceof AlwaysSelectedEntryListWidget) {
|
} else if (element instanceof AlwaysSelectedEntryListWidget) {
|
||||||
//TODO((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.DOWN : EntryListWidget.MoveDirection.UP);
|
((EntryListWidgetAccessor) element).midnightcontrols$moveSelection(right ? EntryListWidget.MoveDirection.DOWN : EntryListWidget.MoveDirection.UP);
|
||||||
return false;
|
return false;
|
||||||
} else if (element instanceof ParentElement entryList) {
|
} else if (element instanceof ParentElement entryList) {
|
||||||
var focused = entryList.getFocused();
|
var focused = entryList.getFocused();
|
||||||
@@ -795,14 +781,81 @@ public class MidnightInput {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
switch (direction) {
|
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
||||||
case UP -> pressKeyboardKey(screen, GLFW.GLFW_KEY_UP);
|
SodiumCompat.handleInput(screen, direction.isLookingForward());
|
||||||
case DOWN -> pressKeyboardKey(screen, GLFW.GLFW_KEY_DOWN);
|
// This still needs some work
|
||||||
case LEFT -> pressKeyboardKey(screen, GLFW.GLFW_KEY_LEFT);
|
// ScreenAccessor accessor = (ScreenAccessor) screen;
|
||||||
case RIGHT -> pressKeyboardKey(screen, GLFW.GLFW_KEY_RIGHT);
|
// 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;
|
||||||
}
|
}
|
||||||
this.actionGuiCooldown = 5;
|
|
||||||
return false;
|
|
||||||
} catch (Exception exception) {MidnightControls.get().warn("Unknown exception encountered while trying to change focus: "+exception);}
|
} catch (Exception exception) {MidnightControls.get().warn("Unknown exception encountered while trying to change focus: "+exception);}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,39 +120,31 @@ public class MidnightReacharound {
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (client.player != null && client.crosshairTarget != null && client.crosshairTarget.getType() == HitResult.Type.MISS
|
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())
|
if (client.player.isRiding())
|
||||||
return null;
|
return null;
|
||||||
// Temporary pos, do not use
|
var playerPos = client.player.getBlockPos().down();
|
||||||
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) {
|
if (client.player.getY() - playerPos.getY() - 1.0 >= 0.25) {
|
||||||
// Imitates playerPos = playerPos.up();
|
playerPos = playerPos.up();
|
||||||
playerPos = playerPosi;
|
|
||||||
this.onSlab = true;
|
this.onSlab = true;
|
||||||
} else {
|
} else {
|
||||||
this.onSlab = false;
|
this.onSlab = false;
|
||||||
}
|
}
|
||||||
var targetPos = new Vec3d(client.crosshairTarget.getPos().getX(), client.crosshairTarget.getPos().getY(), client.crosshairTarget.getPos().getZ()).subtract(playerPos);
|
var targetPos = new BlockPos(client.crosshairTarget.getPos()).subtract(playerPos);
|
||||||
var vector = new Vec3d(MathHelper.clamp(targetPos.getX(), -1, 1), 0, MathHelper.clamp(targetPos.getZ(), -1, 1));
|
var vector = new BlockPos.Mutable(MathHelper.clamp(targetPos.getX(), -1, 1), 0, MathHelper.clamp(targetPos.getZ(), -1, 1));
|
||||||
var blockPos = playerPos.add(vector);
|
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 direction = client.player.getHorizontalFacing();
|
||||||
|
|
||||||
var state = client.world.getBlockState(blockyPos);
|
var state = client.world.getBlockState(blockPos);
|
||||||
if (!state.isAir())
|
if (!state.isAir())
|
||||||
return null;
|
return null;
|
||||||
var adjacentBlockState = client.world.getBlockState(blockyPos.offset(direction.getOpposite()));
|
var adjacentBlockState = client.world.getBlockState(blockPos.offset(direction.getOpposite()));
|
||||||
if (adjacentBlockState.isAir() || adjacentBlockState.getBlock() instanceof FluidBlock || (vector.getX() == 0 && vector.getZ() == 0)) {
|
if (adjacentBlockState.isAir() || adjacentBlockState.getBlock() instanceof FluidBlock || (vector.getX() == 0 && vector.getZ() == 0)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new BlockHitResult(blockPos, direction, blockyPos, false);
|
return new BlockHitResult(new Vec3d(blockPos.getX(),blockPos.getY(),blockPos.getZ()), direction, blockPos, false);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class MidnightControlsMixinPlugin implements IMixinConfigPlugin {
|
|||||||
private final HashMap<String, Boolean> conditionalMixins = new HashMap<>();
|
private final HashMap<String, Boolean> conditionalMixins = new HashMap<>();
|
||||||
|
|
||||||
public MidnightControlsMixinPlugin() {
|
public MidnightControlsMixinPlugin() {
|
||||||
//this.putConditionalMixin("SodiumOptionsGUIAccessor", FabricLoader.getInstance().isModLoaded("sodium"));
|
this.putConditionalMixin("SodiumOptionsGUIAccessor", FabricLoader.getInstance().isModLoaded("sodium"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void putConditionalMixin(@NotNull String path, boolean condition) {
|
private void putConditionalMixin(@NotNull String path, boolean condition) {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
package eu.midnightdust.midnightcontrols.client.controller;
|
package eu.midnightdust.midnightcontrols.client.controller;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import eu.midnightdust.midnightcontrols.client.ButtonState;
|
import eu.midnightdust.midnightcontrols.client.ButtonState;
|
||||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
import eu.midnightdust.midnightcontrols.client.MidnightControlsClient;
|
||||||
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
import eu.midnightdust.midnightcontrols.client.MidnightControlsConfig;
|
||||||
@@ -22,25 +21,17 @@ import eu.midnightdust.midnightcontrols.client.gui.RingScreen;
|
|||||||
import eu.midnightdust.midnightcontrols.client.mixin.AdvancementsScreenAccessor;
|
import eu.midnightdust.midnightcontrols.client.mixin.AdvancementsScreenAccessor;
|
||||||
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
|
import eu.midnightdust.midnightcontrols.client.mixin.CreativeInventoryScreenAccessor;
|
||||||
import eu.midnightdust.midnightcontrols.client.mixin.RecipeBookWidgetAccessor;
|
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.HandledScreenAccessor;
|
||||||
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
|
import eu.midnightdust.midnightcontrols.client.util.MouseAccessor;
|
||||||
import net.fabricmc.fabric.impl.client.itemgroup.CreativeGuiExtensions;
|
|
||||||
import net.fabricmc.fabric.impl.client.itemgroup.FabricCreativeGuiComponents;
|
|
||||||
import net.fabricmc.fabric.impl.itemgroup.FabricItemGroup;
|
|
||||||
import net.fabricmc.fabric.impl.itemgroup.ItemGroupHelper;
|
|
||||||
import net.fabricmc.loader.api.FabricLoader;
|
import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.gui.screen.TitleScreen;
|
import net.minecraft.client.gui.screen.TitleScreen;
|
||||||
import net.minecraft.client.gui.screen.advancement.AdvancementsScreen;
|
import net.minecraft.client.gui.screen.advancement.AdvancementsScreen;
|
||||||
import net.minecraft.client.gui.screen.ingame.*;
|
import net.minecraft.client.gui.screen.ingame.*;
|
||||||
import net.minecraft.client.gui.screen.recipebook.RecipeBookWidget;
|
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.PressableWidget;
|
||||||
import net.minecraft.client.gui.widget.TabNavigationWidget;
|
|
||||||
import net.minecraft.client.util.ScreenshotRecorder;
|
import net.minecraft.client.util.ScreenshotRecorder;
|
||||||
import net.minecraft.item.ItemGroup;
|
import net.minecraft.item.ItemGroup;
|
||||||
import net.minecraft.item.ItemGroups;
|
|
||||||
import net.minecraft.screen.slot.Slot;
|
import net.minecraft.screen.slot.Slot;
|
||||||
import net.minecraft.screen.slot.SlotActionType;
|
import net.minecraft.screen.slot.SlotActionType;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
@@ -67,13 +58,6 @@ import static org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_2;
|
|||||||
public class InputHandlers {
|
public class InputHandlers {
|
||||||
private InputHandlers() {
|
private InputHandlers() {
|
||||||
}
|
}
|
||||||
private static List<ItemGroup> getVisibleGroups(CreativeInventoryScreen screen) {
|
|
||||||
return ItemGroupHelper.sortedGroups.stream()
|
|
||||||
.filter(itemGroup -> {
|
|
||||||
if (FabricCreativeGuiComponents.COMMON_GROUPS.contains(itemGroup)) return true;
|
|
||||||
return ((CreativeGuiExtensions)screen).fabric_currentPage() == ((FabricItemGroup)itemGroup).getPage() && itemGroup.shouldDisplay();
|
|
||||||
}).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PressAction handleHotbar(boolean next) {
|
public static PressAction handleHotbar(boolean next) {
|
||||||
return (client, button, value, action) -> {
|
return (client, button, value, action) -> {
|
||||||
@@ -100,31 +84,13 @@ public class InputHandlers {
|
|||||||
} else if (client.currentScreen instanceof RingScreen) {
|
} else if (client.currentScreen instanceof RingScreen) {
|
||||||
MidnightControlsClient.get().ring.cyclePage(next);
|
MidnightControlsClient.get().ring.cyclePage(next);
|
||||||
} else if (client.currentScreen instanceof CreativeInventoryScreenAccessor inventory) {
|
} else if (client.currentScreen instanceof CreativeInventoryScreenAccessor inventory) {
|
||||||
ItemGroup currentTab = CreativeInventoryScreenAccessor.getSelectedTab();
|
int currentTab = CreativeInventoryScreenAccessor.getSelectedTab();
|
||||||
int currentColumn = currentTab.getColumn();
|
int nextTab = currentTab + (next ? 1 : -1);
|
||||||
ItemGroup.Row currentRow = currentTab.getRow();
|
if (nextTab < 0)
|
||||||
ItemGroup newTab = null;
|
nextTab = ItemGroup.GROUPS.length - 1;
|
||||||
List<ItemGroup> visibleTabs = getVisibleGroups((CreativeInventoryScreen) client.currentScreen);
|
else if (nextTab >= ItemGroup.GROUPS.length)
|
||||||
for (ItemGroup tab : visibleTabs) {
|
nextTab = 0;
|
||||||
if (tab.getRow().equals(currentRow) && ((newTab == null && ((next && tab.getColumn() > currentColumn) ||
|
inventory.midnightcontrols$setSelectedTab(ItemGroup.GROUPS[nextTab]);
|
||||||
(!next && tab.getColumn() < currentColumn))) || (newTab != null && ((next && tab.getColumn() > currentColumn && tab.getColumn() < newTab.getColumn()) ||
|
|
||||||
(!next && tab.getColumn() < currentColumn && tab.getColumn() > newTab.getColumn())))))
|
|
||||||
newTab = tab;
|
|
||||||
}
|
|
||||||
if (newTab == null)
|
|
||||||
for (ItemGroup tab : visibleTabs) {
|
|
||||||
if ((tab.getRow().compareTo(currentRow)) != 0 && ((next && newTab == null || next && newTab.getColumn() > tab.getColumn()) || (!next && newTab == null) || (!next && newTab.getColumn() < tab.getColumn())))
|
|
||||||
newTab = tab;
|
|
||||||
}
|
|
||||||
if (newTab == null) {
|
|
||||||
for (ItemGroup tab : visibleTabs) {
|
|
||||||
if ((next && tab.getRow() == ItemGroup.Row.TOP && tab.getColumn() == 0) ||
|
|
||||||
!next && tab.getRow() == ItemGroup.Row.BOTTOM && (newTab == null || tab.getColumn() > newTab.getColumn()))
|
|
||||||
newTab = tab;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (newTab == null || newTab.equals(currentTab)) newTab = ItemGroups.getDefaultTab();
|
|
||||||
inventory.midnightcontrols$setSelectedTab(newTab);
|
|
||||||
return true;
|
return true;
|
||||||
} else if (client.currentScreen instanceof InventoryScreen || client.currentScreen instanceof CraftingScreen || client.currentScreen instanceof AbstractFurnaceScreen<?>) {
|
} else if (client.currentScreen instanceof InventoryScreen || client.currentScreen instanceof CraftingScreen || client.currentScreen instanceof AbstractFurnaceScreen<?>) {
|
||||||
RecipeBookWidget recipeBook;
|
RecipeBookWidget recipeBook;
|
||||||
@@ -165,19 +131,6 @@ public class InputHandlers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
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 {
|
} else {
|
||||||
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
if (FabricLoader.getInstance().isModLoaded("sodium"))
|
||||||
SodiumCompat.handleTabs(client.currentScreen, next);
|
SodiumCompat.handleTabs(client.currentScreen, next);
|
||||||
@@ -191,20 +144,31 @@ public class InputHandlers {
|
|||||||
public static PressAction handlePage(boolean next) {
|
public static PressAction handlePage(boolean next) {
|
||||||
return (client, button, value, action) -> {
|
return (client, button, value, action) -> {
|
||||||
if (client.currentScreen instanceof CreativeInventoryScreen) {
|
if (client.currentScreen instanceof CreativeInventoryScreen) {
|
||||||
|
var screen = (HandledScreenAccessor) client.currentScreen;
|
||||||
try {
|
try {
|
||||||
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
if (next) {
|
||||||
.map(element -> (PressableWidget) element)
|
return client.currentScreen.children().stream().filter(element -> element instanceof PressableWidget)
|
||||||
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
.map(element -> (PressableWidget) element)
|
||||||
.anyMatch(element -> {
|
.filter(element -> element.getMessage() != null && element.getMessage().getContent() != null)
|
||||||
if (next && element.getMessage().getString().equals(">")) {
|
.anyMatch(element -> {
|
||||||
element.onPress();
|
if (element.getMessage().getString().equals(">")) {
|
||||||
return true;
|
element.onPress();
|
||||||
} else if (element.getMessage().getString().equals("<")) {
|
return true;
|
||||||
element.onPress();
|
}
|
||||||
return true;
|
return false;
|
||||||
}
|
});
|
||||||
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;
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
}
|
}
|
||||||
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryPage(client.currentScreen, next);
|
if (MidnightControlsCompat.isInventoryTabsPresent()) InventoryTabsCompat.handleInventoryPage(client.currentScreen, next);
|
||||||
@@ -252,21 +216,23 @@ public class InputHandlers {
|
|||||||
|
|
||||||
MidnightControlsClient.get().input.inventoryInteractionCooldown = 5;
|
MidnightControlsClient.get().input.inventoryInteractionCooldown = 5;
|
||||||
switch (button.getName()) {
|
switch (button.getName()) {
|
||||||
case "take_all" -> {
|
case "take_all": {
|
||||||
if (screen instanceof CreativeInventoryScreen) {
|
if (screen instanceof CreativeInventoryScreen) {
|
||||||
if (slot != null && (((CreativeInventoryScreenAccessor) accessor).midnightcontrols$isCreativeInventorySlot(slot) || MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot))))
|
if (slot != null && (((CreativeInventoryScreenAccessor) accessor).midnightcontrols$isCreativeInventorySlot(slot) || MidnightControlsCompat.streamCompatHandlers().anyMatch(handler -> handler.isCreativeSlot(screen, slot))))
|
||||||
actionType = SlotActionType.CLONE;
|
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);
|
accessor.midnightcontrols$onMouseClick(slot, slotId, clickData, actionType);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import net.minecraft.text.MutableText;
|
|||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
import net.minecraft.util.Util;
|
import net.minecraft.util.Util;
|
||||||
import org.joml.Matrix4f;
|
import net.minecraft.util.math.Matrix4f;
|
||||||
import org.lwjgl.glfw.GLFW;
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@@ -299,8 +299,7 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
|||||||
this.buildTabs();
|
this.buildTabs();
|
||||||
|
|
||||||
this.addDrawableChild(this.resetOption.createWidget(Position.of(this.width / 2 - 155, this.height - 29), 150));
|
this.addDrawableChild(this.resetOption.createWidget(Position.of(this.width / 2 - 155, this.height - 29), 150));
|
||||||
this.addDrawableChild(ButtonWidget.builder(SpruceTexts.GUI_DONE, btn -> this.client.setScreen(this.parent))
|
this.addDrawableChild(new ButtonWidget(this.width / 2 - 155 + 160, this.height - 29, 150, 20, SpruceTexts.GUI_DONE, btn -> this.client.setScreen(this.parent)));
|
||||||
.dimensions(this.width / 2 - 155 + 160, this.height - 29, 150, 20).build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void buildTabs() {
|
public void buildTabs() {
|
||||||
@@ -424,20 +423,20 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderTitle(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
public void renderTitle(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||||
drawCenteredTextWithShadow(matrices, this.textRenderer, I18n.translate("midnightcontrols.menu.title"), this.width / 2, 8, 16777215);
|
drawCenteredText(matrices, this.textRenderer, I18n.translate("midnightcontrols.menu.title"), this.width / 2, 8, 16777215);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MidnightControlsBackground implements Background {
|
public static class MidnightControlsBackground implements Background {
|
||||||
private static int transparency = 160;
|
private int transparency = 160;
|
||||||
public MidnightControlsBackground() {}
|
public MidnightControlsBackground() {}
|
||||||
public MidnightControlsBackground(int transparency) {
|
public MidnightControlsBackground(int transparency) {
|
||||||
MidnightControlsBackground.transparency = transparency;
|
this.transparency = transparency;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void render(MatrixStack matrixStack, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) {
|
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"));
|
fill(matrixStack, widget.getX(), widget.getY(), widget.getX() + widget.getWidth(), widget.getY() + widget.getHeight(), MidnightColorUtil.hex2Rgb("#000000"));
|
||||||
}
|
}
|
||||||
private static void fill(MatrixStack matrixStack, int x2, int y2, int x1, int y1, Color color) {
|
private void fill(MatrixStack matrixStack, int x2, int y2, int x1, int y1, Color color) {
|
||||||
matrixStack.push();
|
matrixStack.push();
|
||||||
|
|
||||||
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
|
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
|
||||||
@@ -447,14 +446,16 @@ public class MidnightControlsSettingsScreen extends SpruceScreen {
|
|||||||
float t = (float)(transparency) / 255.0F;
|
float t = (float)(transparency) / 255.0F;
|
||||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||||
RenderSystem.enableBlend();
|
RenderSystem.enableBlend();
|
||||||
|
RenderSystem.disableTexture();
|
||||||
RenderSystem.defaultBlendFunc();
|
RenderSystem.defaultBlendFunc();
|
||||||
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
|
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||||
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
|
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
|
||||||
bufferBuilder.vertex(matrix, (float)x1, (float)y2, 0.0F).color(r, g, b, t).next();
|
bufferBuilder.vertex(matrix, (float)x1, (float)y2, 0.0F).color(r, g, b, t).next();
|
||||||
bufferBuilder.vertex(matrix, (float)x2, (float)y2, 0.0F).color(r, g, b, t).next();
|
bufferBuilder.vertex(matrix, (float)x2, (float)y2, 0.0F).color(r, g, b, t).next();
|
||||||
bufferBuilder.vertex(matrix, (float)x2, (float)y1, 0.0F).color(r, g, b, t).next();
|
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();
|
bufferBuilder.vertex(matrix, (float)x1, (float)y1, 0.0F).color(r, g, b, t).next();
|
||||||
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
|
BufferRenderer.drawWithShader(bufferBuilder.end());
|
||||||
|
RenderSystem.enableTexture();
|
||||||
RenderSystem.disableBlend();
|
RenderSystem.disableBlend();
|
||||||
matrixStack.pop();
|
matrixStack.pop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ public class RingScreen extends Screen {
|
|||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
if (mod.ring.getMaxPages() > 1) {
|
if (mod.ring.getMaxPages() > 1) {
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.of("◀"), button -> this.mod.ring.cyclePage(false)).dimensions(5, 5, 20, 20).build());
|
this.addDrawableChild(new ButtonWidget(5, 5, 20, 20, Text.of("◀"), button -> this.mod.ring.cyclePage(false)));
|
||||||
this.addDrawableChild(ButtonWidget.builder(Text.of("▶"), button -> this.mod.ring.cyclePage(true)).dimensions(width - 25, 5, 20, 20).build());
|
this.addDrawableChild(new ButtonWidget(width - 25, 5, 20, 20, Text.of("▶"), button -> this.mod.ring.cyclePage(true)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,18 +65,18 @@ public class RingScreen extends Screen {
|
|||||||
RingPage.selected = -1;
|
RingPage.selected = -1;
|
||||||
this.removed();
|
this.removed();
|
||||||
}
|
}
|
||||||
// @Override
|
@Override
|
||||||
// public boolean changeFocus(boolean lookForwards) {
|
public boolean changeFocus(boolean lookForwards) {
|
||||||
// if (lookForwards) {
|
if (lookForwards) {
|
||||||
// if (RingPage.selected < 7) ++RingPage.selected;
|
if (RingPage.selected < 7) ++RingPage.selected;
|
||||||
// else RingPage.selected = -1;
|
else RingPage.selected = -1;
|
||||||
// }
|
}
|
||||||
// else {
|
else {
|
||||||
// if (RingPage.selected > -1) --RingPage.selected;
|
if (RingPage.selected > -1) --RingPage.selected;
|
||||||
// else RingPage.selected = 7;
|
else RingPage.selected = 7;
|
||||||
// }
|
}
|
||||||
// return true;
|
return true;
|
||||||
// }
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
public boolean mouseReleased(double mouseX, double mouseY, int button) {
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ControllerControlsWidget extends SpruceContainerWidget {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderWidget(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
public void renderWidget(MatrixStack matrices, int mouseX, int mouseY, float delta) {
|
||||||
drawCenteredTextWithShadow(matrices, this.client.textRenderer, Text.translatable("midnightcontrols.menu.title.controller_controls"),
|
drawCenteredText(matrices, this.client.textRenderer, Text.translatable("midnightcontrols.menu.title.controller_controls"),
|
||||||
this.getX() + this.width / 2, this.getY() + 4, 16777215);
|
this.getX() + this.width / 2, this.getY() + 4, 16777215);
|
||||||
this.resetButton.setActive(InputManager.streamBindings().anyMatch(Predicates.not(ButtonBinding::isDefault)));
|
this.resetButton.setActive(InputManager.streamBindings().anyMatch(Predicates.not(ButtonBinding::isDefault)));
|
||||||
super.renderWidget(matrices, mouseX, mouseY, delta);
|
super.renderWidget(matrices, mouseX, mouseY, delta);
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public abstract class ChatScreenMixin extends Screen {
|
|||||||
|
|
||||||
@Inject(at = @At("TAIL"), method = "init")
|
@Inject(at = @At("TAIL"), method = "init")
|
||||||
private void midnightcontrols$moveInputField(CallbackInfo ci) {
|
private void midnightcontrols$moveInputField(CallbackInfo ci) {
|
||||||
if (MidnightControlsConfig.moveChat) chatField.setY(4);
|
if (MidnightControlsConfig.moveChat) chatField.y = 4;
|
||||||
}
|
}
|
||||||
@Inject(method = "render", at = @At("HEAD"))
|
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/TextFieldWidget;setTextFieldFocused(Z)V", shift = At.Shift.AFTER))
|
||||||
private void midnightcontrols$moveInputFieldBackground(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
private void midnightcontrols$moveInputFieldBackground(MatrixStack matrices, int mouseX, int mouseY, float delta, CallbackInfo ci) {
|
||||||
if (MidnightControlsConfig.moveChat) matrices.translate(0f, -this.height + 16, 0f);
|
if (MidnightControlsConfig.moveChat) matrices.translate(0f, -this.height + 16, 0f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity {
|
public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntity {
|
||||||
private boolean midnightcontrols$driftingPrevented = false;
|
private boolean midnightcontrols$driftingPrevented = false;
|
||||||
|
|
||||||
public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile) {
|
public ClientPlayerEntityMixin(ClientWorld world, GameProfile profile, @Nullable PlayerPublicKey publicKey) {
|
||||||
super(world, profile);
|
super(world, profile, publicKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Shadow
|
@Shadow
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package eu.midnightdust.midnightcontrols.client.mixin;
|
|||||||
|
|
||||||
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
|
||||||
import net.minecraft.item.ItemGroup;
|
import net.minecraft.item.ItemGroup;
|
||||||
import net.minecraft.item.ItemGroups;
|
|
||||||
import net.minecraft.screen.slot.Slot;
|
import net.minecraft.screen.slot.Slot;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -30,8 +29,8 @@ public interface CreativeInventoryScreenAccessor {
|
|||||||
* @return the selected tab index
|
* @return the selected tab index
|
||||||
*/
|
*/
|
||||||
@Accessor("selectedTab")
|
@Accessor("selectedTab")
|
||||||
static ItemGroup getSelectedTab() {
|
static int getSelectedTab() {
|
||||||
return ItemGroups.getDefaultTab();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,13 +9,12 @@
|
|||||||
|
|
||||||
package eu.midnightdust.midnightcontrols.client.mixin;
|
package eu.midnightdust.midnightcontrols.client.mixin;
|
||||||
|
|
||||||
import net.minecraft.client.gui.navigation.NavigationDirection;
|
|
||||||
import net.minecraft.client.gui.widget.EntryListWidget;
|
import net.minecraft.client.gui.widget.EntryListWidget;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||||
|
|
||||||
@Mixin(EntryListWidget.class)
|
@Mixin(EntryListWidget.class)
|
||||||
public interface EntryListWidgetAccessor {
|
public interface EntryListWidgetAccessor {
|
||||||
//@Invoker("getNeighbouringEntry")
|
@Invoker("moveSelection")
|
||||||
//void midnightcontrols$getNeighbouringEntry(NavigationDirection direction);
|
void midnightcontrols$moveSelection(EntryListWidget.MoveDirection direction);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
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();
|
|
||||||
}
|
|
||||||
@@ -22,8 +22,8 @@ import net.minecraft.item.ItemPlacementContext;
|
|||||||
import net.minecraft.item.ItemUsageContext;
|
import net.minecraft.item.ItemUsageContext;
|
||||||
import net.minecraft.util.Hand;
|
import net.minecraft.util.Hand;
|
||||||
import net.minecraft.util.hit.HitResult;
|
import net.minecraft.util.hit.HitResult;
|
||||||
|
import net.minecraft.util.math.Matrix4f;
|
||||||
import net.minecraft.util.shape.VoxelShape;
|
import net.minecraft.util.shape.VoxelShape;
|
||||||
import org.joml.Matrix4f;
|
|
||||||
import org.spongepowered.asm.mixin.Final;
|
import org.spongepowered.asm.mixin.Final;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ public final class MidnightRing {
|
|||||||
for (String binding : configBindings) {
|
for (String binding : configBindings) {
|
||||||
ButtonBinding buttonBinding = InputManager.getBinding(binding);
|
ButtonBinding buttonBinding = InputManager.getBinding(binding);
|
||||||
if (buttonBinding != null) {
|
if (buttonBinding != null) {
|
||||||
RingPage page = this.pages.get(MathHelper.floor(bindingIndex / 8f));
|
RingPage page = this.pages.get(MathHelper.fastFloor(bindingIndex / 8f));
|
||||||
page.actions[bindingIndex - 8 * (MathHelper.floor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
page.actions[bindingIndex - 8 * (MathHelper.fastFloor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||||
++bindingIndex;
|
++bindingIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,8 +88,8 @@ public final class MidnightRing {
|
|||||||
|
|
||||||
for (ButtonBinding buttonBinding : unboundBindings) {
|
for (ButtonBinding buttonBinding : unboundBindings) {
|
||||||
if (buttonBinding != null) {
|
if (buttonBinding != null) {
|
||||||
RingPage page = this.pages.get(MathHelper.floor(bindingIndex / 8f));
|
RingPage page = this.pages.get(MathHelper.fastFloor(bindingIndex / 8f));
|
||||||
page.actions[bindingIndex - 8 * (MathHelper.floor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
page.actions[bindingIndex - 8 * (MathHelper.fastFloor(bindingIndex / 8f))] = (new ButtonBindingRingAction(buttonBinding));
|
||||||
++bindingIndex;
|
++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) {
|
public void render(@NotNull MatrixStack matrices, @NotNull TextRenderer textRenderer, int width, int height, int mouseX, int mouseY, float tickDelta) {
|
||||||
int centerX = width / 2;
|
int centerX = width / 2;
|
||||||
int centerY = height / 2;
|
int centerY = height / 2;
|
||||||
if (MidnightControlsClient.get().ring.getMaxPages() > 1) drawCenteredTextWithShadow(matrices, textRenderer, name, centerX, 5, 0xffffff);
|
if (MidnightControlsClient.get().ring.getMaxPages() > 1) drawCenteredText(matrices, textRenderer, name, centerX, 5, 0xffffff);
|
||||||
|
|
||||||
int offset = MidnightRing.ELEMENT_SIZE + (MidnightRing.ELEMENT_SIZE / 2) + 5;
|
int offset = MidnightRing.ELEMENT_SIZE + (MidnightRing.ELEMENT_SIZE / 2) + 5;
|
||||||
|
|
||||||
|
|||||||
@@ -203,10 +203,5 @@
|
|||||||
"midnightcontrols.virtual_mouse.skin.default_dark": "Default Dark",
|
"midnightcontrols.virtual_mouse.skin.default_dark": "Default Dark",
|
||||||
"midnightcontrols.virtual_mouse.skin.second_light": "Second Light",
|
"midnightcontrols.virtual_mouse.skin.second_light": "Second Light",
|
||||||
"midnightcontrols.virtual_mouse.skin.second_dark": "Second Dark",
|
"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."
|
"modmenu.descriptionTranslation.midnightcontrols": "Adds controller support and enhanced controls overall.\nForked from LambdaControls, which sadly got discontinued."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,184 +0,0 @@
|
|||||||
{
|
|
||||||
"midnightcontrols.midnightconfig.title": "Розширена конфігурація MidnightControls",
|
|
||||||
"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.debug_screen": "Відкрити налагодження (F3)",
|
|
||||||
"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.slot_up": "Двинути на слот вгору",
|
|
||||||
"midnightcontrols.action.slot_down": "Повернути на слот вниз",
|
|
||||||
"midnightcontrols.action.slot_left": "Двинути на слот вліво",
|
|
||||||
"midnightcontrols.action.slot_right": "Повернути на слот вправо",
|
|
||||||
"midnightcontrols.action.sneak": "Крастися",
|
|
||||||
"midnightcontrols.action.sprint": "Біг",
|
|
||||||
"midnightcontrols.action.swap_hands": "Змінити руку",
|
|
||||||
"midnightcontrols.action.toggle_perspective": "Переключити перспективу",
|
|
||||||
"midnightcontrols.action.toggle_smooth_camera": "Переключити кінематографічну камеру",
|
|
||||||
"midnightcontrols.action.page_back": "Попередня сторінка",
|
|
||||||
"midnightcontrols.action.page_next": "Наступна сторінка",
|
|
||||||
"midnightcontrols.action.tab_back": "Попередня секція",
|
|
||||||
"midnightcontrols.action.tab_next": "Наступна секція",
|
|
||||||
"midnightcontrols.action.take": "Взяти предмет",
|
|
||||||
"midnightcontrols.action.take_all": "Взяти стак",
|
|
||||||
"midnightcontrols.action.use": "Використовувати",
|
|
||||||
"midnightcontrols.action.zoom": "Наблизити",
|
|
||||||
"midnightcontrols.action.zoom_in": "Збільшити масштаб",
|
|
||||||
"midnightcontrols.action.zoom_out": "Зменшити масштаб",
|
|
||||||
"midnightcontrols.action.zoom_reset": "Скинути масштаб",
|
|
||||||
"midnightcontrols.action.emi_page_left": "Попередня сторінка",
|
|
||||||
"midnightcontrols.action.emi_page_right": "Наступна сторінка",
|
|
||||||
"midnightcontrols.category.emi": "ЕМІ",
|
|
||||||
"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.button.l4": "L4",
|
|
||||||
"midnightcontrols.button.l5": "L5",
|
|
||||||
"midnightcontrols.button.r4": "R4",
|
|
||||||
"midnightcontrols.button.r5": "L5",
|
|
||||||
"midnightcontrols.axis.left_x+": "Лівий cтік X+",
|
|
||||||
"midnightcontrols.axis.left_y+": "Лівий cтік Y+",
|
|
||||||
"midnightcontrols.axis.right_x+": "Правий cтік X+",
|
|
||||||
"midnightcontrols.axis.right_y+": "Правий cтік 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": "і вставте ваш підсумок у редактор файлів розкладок.",
|
|
||||||
"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.dualsense": "DualSense",
|
|
||||||
"midnightcontrols.controller_type.switch": "Switch",
|
|
||||||
"midnightcontrols.controller_type.xbox": "Xbox",
|
|
||||||
"midnightcontrols.controller_type.xbox_360": "Xbox 360",
|
|
||||||
"midnightcontrols.controller_type.steam_controller": "Steam Controller",
|
|
||||||
"midnightcontrols.controller_type.steam_deck": "Steam Deck",
|
|
||||||
"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.double_tap_to_sprint": "Двічі відвести лівий стік, щоб почати бігти",
|
|
||||||
"midnightcontrols.menu.fast_block_placing": "Швидка постачання блоків",
|
|
||||||
"midnightcontrols.menu.fly_drifting": "Інерція при польоті",
|
|
||||||
"midnightcontrols.menu.fly_drifting_vertical": "Вертикальна інерція при польоті",
|
|
||||||
"midnightcontrols.menu.hud_enable": "Увімкнути іконоки контролера",
|
|
||||||
"midnightcontrols.menu.hud_side": "Розташування інтерфейсу",
|
|
||||||
"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": "Швидкість обертання по осі X",
|
|
||||||
"midnightcontrols.menu.y_axis_rotation_speed": "Швидкість обертання по осі Y",
|
|
||||||
"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": "Налаштування інтерфейсу",
|
|
||||||
"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": "Додатковий контролер, наприклад для джой-конів.",
|
|
||||||
"midnightcontrols.tooltip.controller_type": "Тип контролера, щоб правильно зіставити іконки кнопок.",
|
|
||||||
"midnightcontrols.tooltip.controls_mode": "Тип контролю за грою.",
|
|
||||||
"midnightcontrols.tooltip.double_tap_to_sprint": "При подвійному переміщенні на лівий стик, персонаж починає бігти.",
|
|
||||||
"midnightcontrols.tooltip.fast_block_placing": "Під час польоту в творчому режимі дозволяє швидко розміщувати блоки в залежності від вашої швидкості. §cНа деяких серверах це може розцінюватися як читерство.§r",
|
|
||||||
"midnightcontrols.tooltip.fly_drifting": "Під час польоту включає ванільну інерцію.",
|
|
||||||
"midnightcontrols.tooltip.fly_drifting_vertical": "Під час польоту включає ванільну вертикальну інерцію.",
|
|
||||||
"midnightcontrols.tooltip.hud_enable": "Переключає бачення іконок кнопок контролера на екрані.",
|
|
||||||
"midnightcontrols.tooltip.hud_side": "Розташування інтерфейсу у певний бік.",
|
|
||||||
"midnightcontrols.tooltip.left_dead_zone": "Мертва зона для лівого аналогового стику контролера.",
|
|
||||||
"midnightcontrols.tooltip.max_left_x_value": "Змінює те, що мод в результаті вважає максимальним значенням для лівої осі X. Корисно, якщо ваша вісь не використовує весь діапазон і здається повільною.",
|
|
||||||
"midnightcontrols.tooltip.max_left_y_value": "Змінює те, що мод в результаті вважає максимальним значенням для лівої осі Y. Корисно, якщо ваша вісь не використовує весь діапазон і здається повільною.",
|
|
||||||
"midnightcontrols.tooltip.max_right_x_value": "Змінює те, що мод в результаті вважає максимальним значенням для правої осі X. Корисно, якщо ваша вісь не використовує весь діапазон і здається повільною.",
|
|
||||||
"midnightcontrols.tooltip.max_right_y_value": "Змінює те, що мод в результаті вважає максимальним значенням для правої осі Y. Корисно, якщо ваша вісь не використовує весь діапазон і здається повільною.",
|
|
||||||
"midnightcontrols.tooltip.mouse_speed": "Швидкість миші, що емульується контролером.",
|
|
||||||
"midnightcontrols.tooltip.reacharound.horizontal": "Дозволяє розміщувати передній блок перед собою. §cМоже розглядатися як читерство на деяких серверах§r.",
|
|
||||||
"midnightcontrols.tooltip.reacharound.vertical": "Забезпечує вертикальне охоплення. §cМоже розглядатися як шахрайство на деяких серверах§r.",
|
|
||||||
"midnightcontrols.tooltip.reload_controller_mappings": "Перезавантажує файл розкладки контролерів.",
|
|
||||||
"midnightcontrols.tooltip.right_dead_zone": "Мертва зона для правого аналогового стику контролера.",
|
|
||||||
"midnightcontrols.tooltip.rotation_speed": "Швидкість обертання камери по осі X в режимі контролера.",
|
|
||||||
"midnightcontrols.tooltip.y_axis_rotation_speed": "Швидкість обертання камери по осі Y в режимі контролера.",
|
|
||||||
"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": "Додатковий темний",
|
|
||||||
"modmenu.descriptionTranslation.midnightcontrols": "Додавання підтримки контролера та покращення елементів керування в цілому.\nРозгалужений від LambdaControls, підтримка якого, на жаль, припинена..",
|
|
||||||
"midnightcontrols.menu.joystick_as_mouse": "Завжди використовуйте лівий стік як мишку",
|
|
||||||
"midnightcontrols.tooltip.joystick_as_mouse": "Джойстик поводиться як миша в кожному меню.",
|
|
||||||
"midnightcontrols.menu.controller_toggle_sneak": "Перемикач присідання на контролері",
|
|
||||||
"midnightcontrols.menu.controller_toggle_sprint": "Перемикач бігу на контролері",
|
|
||||||
"midnightcontrols.menu.move_chat": "Перемістити поле введення чату вгору",
|
|
||||||
"midnightcontrols.action.controls_ring": "Показати кільце Управління",
|
|
||||||
"midnightcontrols.menu.separate_controller_profile": "Окремий профіль контролера"
|
|
||||||
}
|
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=0.11.3",
|
"fabricloader": ">=0.11.3",
|
||||||
"fabric": ">=0.71.0",
|
"fabric": ">=0.71.0",
|
||||||
"minecraft": "~1.19.3",
|
"minecraft": "<1.19.3",
|
||||||
"spruceui": ">=3.2.0",
|
"spruceui": ">=3.2.0",
|
||||||
"java": ">=17"
|
"java": ">=17"
|
||||||
},
|
},
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
"kontrolo": "*"
|
"kontrolo": "*"
|
||||||
},
|
},
|
||||||
"breaks": {
|
"breaks": {
|
||||||
|
"emi": "<0.5.0",
|
||||||
"lambdacontrols": "*",
|
"lambdacontrols": "*",
|
||||||
"modmenu": "<1.12.2"
|
"modmenu": "<1.12.2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
accessWidener v1 named
|
accessWidener v1 named
|
||||||
|
|
||||||
#accessible class net/minecraft/client/gui/widget/EntryListWidget$MoveDirection
|
accessible class net/minecraft/client/gui/widget/EntryListWidget$MoveDirection
|
||||||
@@ -20,8 +20,7 @@
|
|||||||
"WorldRendererMixin",
|
"WorldRendererMixin",
|
||||||
"KeyBindingRegistryImplAccessor",
|
"KeyBindingRegistryImplAccessor",
|
||||||
"KeyBindingIDAccessor",
|
"KeyBindingIDAccessor",
|
||||||
"ScreenAccessor",
|
"ScreenAccessor"
|
||||||
"TabNavigationWidgetAccessor"
|
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"pack_format": 13,
|
"pack_format": 12,
|
||||||
"description": "Makes controller tooltips use similar icons to Bedrock Edition"
|
"description": "Makes controller tooltips use similar icons to Bedrock Edition"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"pack_format": 13,
|
"pack_format": 12,
|
||||||
"description": "Makes controller icons look similar to Legacy Console Edit."
|
"description": "Makes controller icons look similar to Legacy Console Edit."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user