mirror of
https://github.com/TeamMidnightDust/MidnightControls.git
synced 2025-12-14 07:35:10 +01:00
MidnightControls 1.8.0 - 1.19.4, New GUI handling, Better reacharound
- Port to 1.19.4 - Drastically improve GUI handling - Directions are now respected instead of acting like the Tab key (possible thanks to 1.19.4) - The new tabs can be navigated using the shoulder buttons - Sodium and Iris now have way better controller navigation thanks to isXander's PRs to them - Improved reacharound thanks to MonstoBusta - Cleaner advanced options screen - Better auto-detection of the Steam Deck
This commit is contained in:
@@ -32,7 +32,7 @@ boolean isMCVersionNonRelease() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getMCVersionString() {
|
String getMCVersionString() {
|
||||||
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.3") {
|
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.4") {
|
||||||
return project.minecraft_version
|
return project.minecraft_version
|
||||||
}
|
}
|
||||||
def version = project.minecraft_version.split('\\.')
|
def version = project.minecraft_version.split('\\.')
|
||||||
@@ -78,9 +78,6 @@ repositories {
|
|||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
maven { url "https://api.modrinth.com/maven" }
|
maven { url "https://api.modrinth.com/maven" }
|
||||||
maven { url 'https://maven.quiltmc.org/repository/release'}
|
maven { url 'https://maven.quiltmc.org/repository/release'}
|
||||||
flatDir {
|
|
||||||
dirs "localMaven"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
@@ -127,7 +124,7 @@ dependencies {
|
|||||||
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
|
||||||
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
|
||||||
exclude(group: "net.fabricmc.fabric-api")
|
exclude(group: "net.fabricmc.fabric-api")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ 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-pre4
|
minecraft_version=1.19.4
|
||||||
yarn_mappings=1.19.4-pre4+build.1
|
yarn_mappings=1.19.4+build.1
|
||||||
loader_version=0.14.17
|
loader_version=0.14.17
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.7.4
|
mod_version = 1.8.0
|
||||||
maven_group = eu.midnightdust
|
maven_group = eu.midnightdust
|
||||||
archives_base_name = midnightcontrols
|
archives_base_name = midnightcontrols
|
||||||
modrinth_id=bXX9h73M
|
modrinth_id=bXX9h73M
|
||||||
@@ -17,8 +17,8 @@ modrinth_id=bXX9h73M
|
|||||||
# 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.75.3+1.19.4
|
||||||
sodium_version=mc1.19.2-0.4.4
|
sodium_version=mc1.19.2-0.4.4
|
||||||
spruceui_version=4.2.0+23w06a
|
spruceui_version=4.2.0+1.19.4
|
||||||
midnightlib_version=fabric-1.2.0
|
midnightlib_version=1.2.1-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.+
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -147,6 +147,9 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
|
|||||||
if (MidnightControlsConfig.configVersion < 2) {
|
if (MidnightControlsConfig.configVersion < 2) {
|
||||||
MidnightControlsConfig.mouseScreens.remove("me.jellysquid.mods.sodium.client.gui");
|
MidnightControlsConfig.mouseScreens.remove("me.jellysquid.mods.sodium.client.gui");
|
||||||
MidnightControlsConfig.mouseScreens.remove("net.coderbot.iris.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");
|
MidnightControlsConfig.write("midnightcontrols");
|
||||||
}
|
}
|
||||||
this.hud.setVisible(MidnightControlsConfig.hudEnable);
|
this.hud.setVisible(MidnightControlsConfig.hudEnable);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ 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;
|
||||||
@@ -69,7 +70,7 @@ public class MidnightControlsConfig extends MidnightConfig {
|
|||||||
@Entry(category = "controller", name = "Controller ID") @Hidden public static Object controllerID = 0;
|
@Entry(category = "controller", name = "Controller ID") @Hidden public static Object controllerID = 0;
|
||||||
@Entry(category = "controller", name = "2nd Controller ID") @Hidden public static Object secondControllerID = -1;
|
@Entry(category = "controller", name = "2nd Controller ID") @Hidden public static Object secondControllerID = -1;
|
||||||
@Entry(category = "visual", name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
|
@Entry(category = "visual", name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
|
||||||
@Entry(category = "screens", name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("net.minecraft.client.gui.screen.advancement", "net.minecraft.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375",
|
@Entry(category = "screens", name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("net.minecraft.client.gui.screen.advancement",
|
||||||
"net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen",
|
"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");
|
||||||
@@ -340,7 +341,7 @@ 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.client.gui.screen.pack.PackScreen", "net.minecraft.class_5375", "net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen", "me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
mouseScreens = Lists.newArrayList("net.minecraft.client.gui.screen.advancement", "net.minecraft.class_457", "net.minecraft.class_408", "net.minecraft.class_3872", "me.flashyreese.mods.reeses_sodium_options.client.gui", "dev.emi.emi.screen", "me.shedaniel.clothconfig2.gui.ClothConfigScreen", "com.mamiyaotaru.voxelmap.gui.GuiWaypoints", "com.mamiyaotaru.voxelmap.gui.GuiPersistentMap");
|
||||||
BINDING = new HashMap<>();
|
BINDING = new HashMap<>();
|
||||||
maxAnalogValueLeftX = 1;
|
maxAnalogValueLeftX = 1;
|
||||||
maxAnalogValueLeftY = 1;
|
maxAnalogValueLeftY = 1;
|
||||||
@@ -363,7 +364,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 deck")) return ControllerType.STEAM_DECK;
|
else if (controller.contains("steam") && GlDebugInfo.getCpuInfo().contains("AMD Custom APU")) return ControllerType.STEAM_DECK;
|
||||||
else if (controller.contains("steam")) return ControllerType.STEAM_CONTROLLER;
|
else if (controller.contains("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;
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class MidnightReacharound {
|
|||||||
var blockPos = playerPos.add(vector);
|
var blockPos = playerPos.add(vector);
|
||||||
|
|
||||||
// Some functions still need BlockPos, so this is here to let that happen
|
// Some functions still need BlockPos, so this is here to let that happen
|
||||||
var blockyPos = new BlockPos(blockPos);
|
var blockyPos = BlockPos.ofFloored(blockPos);
|
||||||
|
|
||||||
var direction = client.player.getHorizontalFacing();
|
var direction = client.player.getHorizontalFacing();
|
||||||
|
|
||||||
|
|||||||
@@ -166,12 +166,13 @@ public class InputHandlers {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else if (client.currentScreen != null && client.currentScreen.children().stream().anyMatch(e -> e instanceof TabNavigationWidget)) {
|
} else if (client.currentScreen != null && client.currentScreen.children().stream().anyMatch(e -> e instanceof TabNavigationWidget)) {
|
||||||
Lists.newCopyOnWriteArrayList(client.currentScreen.children()).stream().anyMatch(e -> {
|
return Lists.newCopyOnWriteArrayList(client.currentScreen.children()).stream().anyMatch(e -> {
|
||||||
if (e instanceof TabNavigationWidget tabs) {
|
if (e instanceof TabNavigationWidget tabs) {
|
||||||
TabNavigationWidgetAccessor accessor = (TabNavigationWidgetAccessor) tabs;
|
TabNavigationWidgetAccessor accessor = (TabNavigationWidgetAccessor) tabs;
|
||||||
if (next ? accessor.getCurrentTabIndex()+1 < accessor.getTabs().size() : accessor.getCurrentTabIndex() > 0) {
|
int tabIndex = accessor.getTabs().indexOf(accessor.getTabManager().getCurrentTab());
|
||||||
if (next) tabs.selectTab(accessor.getCurrentTabIndex() + 1, true);
|
if (next ? tabIndex+1 < accessor.getTabs().size() : tabIndex > 0) {
|
||||||
else tabs.selectTab(accessor.getCurrentTabIndex() - 1, true);
|
if (next) tabs.selectTab(tabIndex + 1, true);
|
||||||
|
else tabs.selectTab(tabIndex - 1, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import net.minecraft.client.gui.tab.TabManager;
|
|||||||
import net.minecraft.client.gui.widget.TabNavigationWidget;
|
import net.minecraft.client.gui.widget.TabNavigationWidget;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
|
||||||
|
|
||||||
@Mixin(TabNavigationWidget.class)
|
@Mixin(TabNavigationWidget.class)
|
||||||
public interface TabNavigationWidgetAccessor {
|
public interface TabNavigationWidgetAccessor {
|
||||||
@@ -14,6 +13,4 @@ public interface TabNavigationWidgetAccessor {
|
|||||||
TabManager getTabManager();
|
TabManager getTabManager();
|
||||||
@Accessor
|
@Accessor
|
||||||
ImmutableList<Tab> getTabs();
|
ImmutableList<Tab> getTabs();
|
||||||
@Invoker("getCurrentTabIndex")
|
|
||||||
int getCurrentTabIndex();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"pack": {
|
"pack": {
|
||||||
"pack_format": 12,
|
"pack_format": 13,
|
||||||
"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": 12,
|
"pack_format": 13,
|
||||||
"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