Skip to content

Commit

Permalink
Fixed RamWarningMenu screen opening after every Ignore button press.
Browse files Browse the repository at this point in the history
  • Loading branch information
VipCoder8 committed Nov 26, 2024
1 parent 7a8f0ce commit f89833f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ private void initEvents() {
if(configReader.readData().get("disableRamScreen").equals("false")) {
if(Ram.getAllocatedRam() < 4.5) {
if(screen instanceof TitleScreen) {
client.setScreenAndRender(ramWarningMenu);
if(!ramWarningMenu.wasOpened) {
client.setScreen(ramWarningMenu);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class RamWarningMenu extends Screen {
private final String minimumRam;

private final ElysiumDaysTweaks client;
public boolean wasOpened = false;

public RamWarningMenu(ElysiumDaysTweaks client, Text title, String currentRam,
String recommendedRam, String minimumRam) {
Expand Down Expand Up @@ -58,9 +59,8 @@ private void addIgnoreButton() {
this.height/2-20, 200, 20, 0, 0, 200,20,
Constants.Other.Ram.WidgetsText.IGNORE_TEXT,
Textures.DEFAULT_BUTTON_UNFOCUSED, Textures.DEFAULT_BUTTON_FOCUSED, button -> {
System.out.println("This is being printed.");
this.close(); // Doesn't do anything lol.
System.out.println("This is also being printed.");
wasOpened = true;
this.close();
}));
}

Expand Down

0 comments on commit f89833f

Please sign in to comment.