Skip to content

Commit

Permalink
Merge pull request #341 from Dragon-Seeker/1.21.4-TooltipFix
Browse files Browse the repository at this point in the history
[1.21.4] Fix issues where tooltip would stop rendering after screen reinits
  • Loading branch information
gliscowo authored Dec 15, 2024
2 parents 49a02fa + e08bbb6 commit 8ecca4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ protected void init() {
this.build(this.uiAdapter.rootComponent);

this.uiAdapter.inflateAndMount();

ScreenEvents.afterRender(this).register((screen, drawContext, mouseX, mouseY, tickDelta) -> {
if (this.uiAdapter != null) this.uiAdapter.drawTooltip(drawContext, mouseX, mouseY, tickDelta);
});
} catch (Exception error) {
Owo.LOGGER.warn("Could not initialize owo screen", error);
UIErrorToast.report(error);
this.invalid = true;
}
}

ScreenEvents.afterRender(this).register((screen, drawContext, mouseX, mouseY, tickDelta) -> {
if (this.uiAdapter != null) this.uiAdapter.drawTooltip(drawContext, mouseX, mouseY, tickDelta);
});
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/io/wispforest/owo/ui/base/BaseOwoScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ protected void init() {
this.build(this.uiAdapter.rootComponent);

this.uiAdapter.inflateAndMount();

ScreenEvents.afterRender(this).register((screen, drawContext, mouseX, mouseY, tickDelta) -> {
if (this.uiAdapter != null) this.uiAdapter.drawTooltip(drawContext, mouseX, mouseY, tickDelta);
});
} catch (Exception error) {
Owo.LOGGER.warn("Could not initialize owo screen", error);
UIErrorToast.report(error);
this.invalid = true;
}
}

ScreenEvents.afterRender(this).register((screen, drawContext, mouseX, mouseY, tickDelta) -> {
if (this.uiAdapter != null) this.uiAdapter.drawTooltip(drawContext, mouseX, mouseY, tickDelta);
});
}

/**
Expand Down

0 comments on commit 8ecca4f

Please sign in to comment.