Skip to content

Commit

Permalink
Fix menu z-fighting in config screen
Browse files Browse the repository at this point in the history
  • Loading branch information
shedaniel committed Sep 24, 2024
1 parent c97b1a4 commit 91cc0c4
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ public class REIConfigScreen extends Screen implements ConfigAccess {
@Nullable
private Menu menu;
@Nullable
private Widget menuWidget;
@Nullable
private CompositeOption<ModifierKeyCode> focusedKeycodeOption = null;
private ModifierKeyCode partialKeycode = null;

Expand Down Expand Up @@ -398,14 +400,18 @@ public boolean keyReleased(int keyCode, int scanCode, int modifiers) {

@Override
public void openMenu(Menu menu) {
if (this.menu != null) {
this.widgets.remove(this.menuWidget);
}
this.menu = menu;
this.widgets.add(menu);
this.widgets.add(this.menuWidget = Widgets.withTranslate(menu, 0, 0, 300));
}

@Override
public void closeMenu() {
this.widgets.remove(menu);
this.widgets.remove(this.menuWidget);
this.menu = null;
this.menuWidget = null;
}

@Override
Expand Down

0 comments on commit 91cc0c4

Please sign in to comment.