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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user