RealmsConfirmScreen.java
com.mojang.realmsclient.gui.screens.RealmsConfirmScreen
信息
- 全限定名:com.mojang.realmsclient.gui.screens.RealmsConfirmScreen
- 类型:public class
- 包:com.mojang.realmsclient.gui.screens
- 源码路径:src/main/java/com/mojang/realmsclient/gui/screens/RealmsConfirmScreen.java
- 起始行号:L14
- 继承:RealmsScreen
- 职责:
TODO
字段/常量
-
callback- 类型:
BooleanConsumer - 修饰符:
protected final - 源码定位:
L15 - 说明:
TODO
- 类型:
-
title1- 类型:
Component - 修饰符:
private final - 源码定位:
L16 - 说明:
TODO
- 类型:
-
title2- 类型:
Component - 修饰符:
private final - 源码定位:
L17 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public RealmsConfirmScreen(BooleanConsumer callback, Component title1, Component title2) @ L19
- 构造器名:RealmsConfirmScreen
- 源码定位:L19
- 修饰符:public
参数:
- callback: BooleanConsumer
- title1: Component
- title2: Component
说明:
TODO
方法
下面的方法块按源码顺序生成。
public void init() @ L26
- 方法名:init
- 源码定位:L26
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
public void extractRenderState(GuiGraphicsExtractor graphics, int xm, int ym, float a) @ L36
- 方法名:extractRenderState
- 源码定位:L36
- 返回类型:void
- 修饰符:public
参数:
- graphics: GuiGraphicsExtractor
- xm: int
- ym: int
- a: float
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class RealmsConfirmScreen extends RealmsScreen {
protected final BooleanConsumer callback;
private final Component title1;
private final Component title2;
public RealmsConfirmScreen(BooleanConsumer callback, Component title1, Component title2) {
super(GameNarrator.NO_TITLE);
this.callback = callback;
this.title1 = title1;
this.title2 = title2;
}
@Override
public void init() {
this.addRenderableWidget(
Button.builder(CommonComponents.GUI_YES, button -> this.callback.accept(true)).bounds(this.width / 2 - 105, row(9), 100, 20).build()
);
this.addRenderableWidget(
Button.builder(CommonComponents.GUI_NO, button -> this.callback.accept(false)).bounds(this.width / 2 + 5, row(9), 100, 20).build()
);
}
@Override
public void extractRenderState(GuiGraphicsExtractor graphics, int xm, int ym, float a) {
super.extractRenderState(graphics, xm, ym, a);
graphics.centeredText(this.font, this.title1, this.width / 2, row(3), -1);
graphics.centeredText(this.font, this.title2, this.width / 2, row(5), -1);
}
}引用的其他类
-
- 引用位置:
参数
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
Button.builder()
- 引用位置:
-
- 引用位置:
参数/字段
- 引用位置:
-
- 引用位置:
继承
- 引用位置: