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:
Motschen
2023-03-15 19:14:48 +01:00
parent 6e49667ada
commit 66cdca30fe
11 changed files with 22 additions and 23 deletions

View File

@@ -32,7 +32,7 @@ boolean isMCVersionNonRelease() {
}
String getMCVersionString() {
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.3") {
if (isMCVersionNonRelease() || project.minecraft_version == "1.19.4") {
return project.minecraft_version
}
def version = project.minecraft_version.split('\\.')
@@ -78,9 +78,6 @@ repositories {
maven { url 'https://jitpack.io' }
maven { url "https://api.modrinth.com/maven" }
maven { url 'https://maven.quiltmc.org/repository/release'}
flatDir {
dirs "localMaven"
}
}
configurations {
@@ -127,7 +124,7 @@ dependencies {
modCompileOnlyApi "maven.modrinth:inventory-tabs-updated:${project.inventorytabs_version}"
modCompileOnlyApi "maven.modrinth:bedrockify:${project.bedrockify_version}"
// Required for Inventory Tabs
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
modCompileOnlyApi("me.shedaniel.cloth:cloth-config-fabric:${project.clothconfig_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

View File

@@ -3,12 +3,12 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19.4-pre4
yarn_mappings=1.19.4-pre4+build.1
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
# Mod Properties
mod_version = 1.7.4
mod_version = 1.8.0
maven_group = eu.midnightdust
archives_base_name = midnightcontrols
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
fabric_version=0.75.3+1.19.4
sodium_version=mc1.19.2-0.4.4
spruceui_version=4.2.0+23w06a
midnightlib_version=fabric-1.2.0
spruceui_version=4.2.0+1.19.4
midnightlib_version=1.2.1-fabric
modmenu_version=5.0.1
emotecraft_version=2.1.3-SNAPSHOT-build.29-MC1.19-fabric
bendylib_version=2.0.+

Binary file not shown.

View File

@@ -147,6 +147,9 @@ public class MidnightControlsClient extends MidnightControls implements ClientMo
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);

View File

@@ -11,6 +11,7 @@ package eu.midnightdust.midnightcontrols.client;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.mojang.blaze3d.platform.GlDebugInfo;
import eu.midnightdust.lib.config.MidnightConfig;
import eu.midnightdust.midnightcontrols.ControlsMode;
import eu.midnightdust.midnightcontrols.MidnightControlsFeature;
@@ -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 = "2nd Controller ID") @Hidden public static Object secondControllerID = -1;
@Entry(category = "visual", name = "midnightcontrols.menu.controller_type") public static ControllerType controllerType = ControllerType.DEFAULT;
@Entry(category = "screens", name = "Mouse screens") public static List<String> mouseScreens = Lists.newArrayList("net.minecraft.client.gui.screen.advancement", "net.minecraft.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",
"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");
@@ -340,7 +341,7 @@ public class MidnightControlsConfig extends MidnightConfig {
controllerID = 0;
secondControllerID = -1;
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<>();
maxAnalogValueLeftX = 1;
maxAnalogValueLeftY = 1;
@@ -363,7 +364,7 @@ public class MidnightControlsConfig extends MidnightConfig {
String controller = getController().getName().toLowerCase();
if (controller.contains("xbox 360")) return ControllerType.XBOX_360;
else if (controller.contains("xbox") || controller.contains("afterglow")) return ControllerType.XBOX;
else if (controller.contains("steam deck")) return ControllerType.STEAM_DECK;
else if (controller.contains("steam") && GlDebugInfo.getCpuInfo().contains("AMD Custom APU")) return ControllerType.STEAM_DECK;
else if (controller.contains("steam")) return ControllerType.STEAM_CONTROLLER;
else if (controller.contains("dualsense") || controller.contains("ps5")) return ControllerType.DUALSENSE;
else if (controller.contains("dualshock") || controller.contains("ps4") || controller.contains("sony")) return ControllerType.DUALSHOCK;

View File

@@ -140,7 +140,7 @@ public class MidnightReacharound {
var blockPos = playerPos.add(vector);
// 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();

View File

@@ -166,12 +166,13 @@ public class InputHandlers {
}
return true;
} 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) {
TabNavigationWidgetAccessor accessor = (TabNavigationWidgetAccessor) tabs;
if (next ? accessor.getCurrentTabIndex()+1 < accessor.getTabs().size() : accessor.getCurrentTabIndex() > 0) {
if (next) tabs.selectTab(accessor.getCurrentTabIndex() + 1, true);
else tabs.selectTab(accessor.getCurrentTabIndex() - 1, true);
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;
}
}

View File

@@ -6,7 +6,6 @@ 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;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(TabNavigationWidget.class)
public interface TabNavigationWidgetAccessor {
@@ -14,6 +13,4 @@ public interface TabNavigationWidgetAccessor {
TabManager getTabManager();
@Accessor
ImmutableList<Tab> getTabs();
@Invoker("getCurrentTabIndex")
int getCurrentTabIndex();
}

View File

@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 12,
"pack_format": 13,
"description": "Makes controller tooltips use similar icons to Bedrock Edition"
}
}

View File

@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 12,
"pack_format": 13,
"description": "Makes controller icons look similar to Legacy Console Edit."
}
}