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

@@ -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;
}
}