Skip to content

Commit e417b42

Browse files
committed
fix overlay crash
1 parent 348798a commit e417b42

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/main/java/com/cleanroommc/modularui/screen/ModularScreen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ private static Class<?> getGuiActionClass(IGuiAction action) {
685685

686686
public ITheme getCurrentTheme() {
687687
if (this.currentTheme == null) {
688-
useTheme(this.context.getUISettings().getTheme());
688+
useTheme(null);
689689
}
690690
return this.currentTheme;
691691
}

src/main/java/com/cleanroommc/modularui/screen/viewport/ModularGuiContext.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ public void setSettings(UISettings settings) {
479479
throw new IllegalStateException("Tried to set settings twice");
480480
}
481481
this.settings = settings;
482+
if (this.settings.getTheme() != null) {
483+
this.screen.useTheme(this.settings.getTheme());
484+
}
482485
}
483486

484487
private static class HoveredIterable implements Iterable<IGuiElement> {

src/main/java/com/cleanroommc/modularui/test/OverlayTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public static void init() {
3131
AtomicInteger k = new AtomicInteger();
3232
return new ModularScreen(ModularPanel.defaultPanel("overlay").sizeRel(1f)
3333
.background(IDrawable.EMPTY)
34+
.disableHoverBackground()
3435
.child(title.scale(5f)
3536
.shadow(true)
3637
.color(colors[k.get()])

0 commit comments

Comments
 (0)