Skip to content

Commit

Permalink
Fix custom screens rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Aizistral committed May 10, 2024
1 parent 6865a2f commit bb902ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.client.gui.components.Checkbox;
import net.minecraft.client.gui.components.Checkbox.OnValueChange;
import net.minecraft.client.gui.components.MultiLineLabel;
import net.minecraft.client.gui.components.Renderable;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;

Expand Down Expand Up @@ -56,11 +57,10 @@ protected void init() {

@Override
public void render(GuiGraphics graphics, int i, int j, float f) {
this.renderBackground(graphics, i, j, f);
super.render(graphics, i, j, f);
this.renderTitle(graphics);
int k = this.width / 2 - this.message.getWidth() / 2;
this.message.renderLeftAligned(graphics, k, this.hugeGUI() ? 35 : 70, this.getLineHeight(), 0xFFFFFF);
super.render(graphics, i, j, f);
}

private void renderTitle(GuiGraphics graphics) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void render(GuiGraphics graphics, int i, int j, float f) {
this.passField.setEditable(false);
}

this.renderBackground(graphics, j, j, f);
super.render(graphics, i, j, f);
graphics.drawCenteredString(this.font, HEADER, this.width / 2, this.hugeGUI() ? 8 : 16, 0xFFFFFF);

this.keyDesc.renderLeftAligned(graphics, this.keyField.getX() - 20, (this.hugeGUI() ? 25 : FIELDS_Y_START), this.getLineHeight(), 0xFFFFFF);
Expand All @@ -189,8 +189,6 @@ public void render(GuiGraphics graphics, int i, int j, float f) {
// this.renderTooltip(poseStack, this.algorithmButton.getTooltip(), i, j);
// }

super.render(graphics, i, j, f);

if (StringUtil.isNullOrEmpty(this.keyField.getValue()) && !this.keyField.isFocused()) {
graphics.drawString(this.font,
Component.translatable("gui.nochatreports.encryption_config.default_key",
Expand Down

0 comments on commit bb902ce

Please sign in to comment.