54 lines
1.5 KiB
Java
54 lines
1.5 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
package net.minecraft.client.gui.screens;
|
|
|
|
import net.minecraft.client.gui.GuiGraphics;
|
|
import net.minecraft.client.gui.components.FocusableTextWidget;
|
|
import net.minecraft.client.gui.screens.Screen;
|
|
import net.minecraft.network.chat.Component;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
public class GenericMessageScreen
|
|
extends Screen {
|
|
private @Nullable FocusableTextWidget textWidget;
|
|
|
|
public GenericMessageScreen(Component title) {
|
|
super(title);
|
|
}
|
|
|
|
@Override
|
|
protected void init() {
|
|
this.textWidget = this.addRenderableWidget(FocusableTextWidget.builder(this.title, this.font, 12).textWidth(this.font.width(this.title)).build());
|
|
this.repositionElements();
|
|
}
|
|
|
|
@Override
|
|
protected void repositionElements() {
|
|
if (this.textWidget != null) {
|
|
this.textWidget.setPosition(this.width / 2 - this.textWidget.getWidth() / 2, this.height / 2 - this.font.lineHeight / 2);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public boolean shouldCloseOnEsc() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
protected boolean shouldNarrateNavigation() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public void renderBackground(GuiGraphics graphics, int mouseX, int mouseY, float a) {
|
|
this.renderPanorama(graphics, a);
|
|
this.renderBlurredBackground(graphics);
|
|
this.renderMenuBackground(graphics);
|
|
}
|
|
}
|
|
|