CreditsAndAttributionScreen.java
net.minecraft.client.gui.screens.CreditsAndAttributionScreen
信息
- 全限定名:net.minecraft.client.gui.screens.CreditsAndAttributionScreen
- 类型:public class
- 包:net.minecraft.client.gui.screens
- 源码路径:src/main/java/net/minecraft/client/gui/screens/CreditsAndAttributionScreen.java
- 起始行号:L13
- 继承:Screen
- 职责:
TODO
字段/常量
-
BUTTON_SPACING- 类型:
int - 修饰符:
private static final - 源码定位:
L14 - 说明:
TODO
- 类型:
-
BUTTON_WIDTH- 类型:
int - 修饰符:
private static final - 源码定位:
L15 - 说明:
TODO
- 类型:
-
TITLE- 类型:
Component - 修饰符:
private static final - 源码定位:
L16 - 说明:
TODO
- 类型:
-
CREDITS_BUTTON- 类型:
Component - 修饰符:
private static final - 源码定位:
L17 - 说明:
TODO
- 类型:
-
ATTRIBUTION_BUTTON- 类型:
Component - 修饰符:
private static final - 源码定位:
L18 - 说明:
TODO
- 类型:
-
LICENSES_BUTTON- 类型:
Component - 修饰符:
private static final - 源码定位:
L19 - 说明:
TODO
- 类型:
-
lastScreen- 类型:
Screen - 修饰符:
private final - 源码定位:
L20 - 说明:
TODO
- 类型:
-
layout- 类型:
HeaderAndFooterLayout - 修饰符:
private final - 源码定位:
L21 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
public CreditsAndAttributionScreen(Screen lastScreen) @ L23
- 构造器名:CreditsAndAttributionScreen
- 源码定位:L23
- 修饰符:public
参数:
- lastScreen: Screen
说明:
TODO
方法
下面的方法块按源码顺序生成。
protected void init() @ L28
- 方法名:init
- 源码定位:L28
- 返回类型:void
- 修饰符:protected
参数:
- 无
说明:
TODO
protected void repositionElements() @ L41
- 方法名:repositionElements
- 源码定位:L41
- 返回类型:void
- 修饰符:protected
参数:
- 无
说明:
TODO
private void openCreditsScreen() @ L46
- 方法名:openCreditsScreen
- 源码定位:L46
- 返回类型:void
- 修饰符:private
参数:
- 无
说明:
TODO
public void onClose() @ L50
- 方法名:onClose
- 源码定位:L50
- 返回类型:void
- 修饰符:public
参数:
- 无
说明:
TODO
代码
@OnlyIn(Dist.CLIENT)
public class CreditsAndAttributionScreen extends Screen {
private static final int BUTTON_SPACING = 8;
private static final int BUTTON_WIDTH = 210;
private static final Component TITLE = Component.translatable("credits_and_attribution.screen.title");
private static final Component CREDITS_BUTTON = Component.translatable("credits_and_attribution.button.credits");
private static final Component ATTRIBUTION_BUTTON = Component.translatable("credits_and_attribution.button.attribution");
private static final Component LICENSES_BUTTON = Component.translatable("credits_and_attribution.button.licenses");
private final Screen lastScreen;
private final HeaderAndFooterLayout layout = new HeaderAndFooterLayout(this);
public CreditsAndAttributionScreen(Screen lastScreen) {
super(TITLE);
this.lastScreen = lastScreen;
}
@Override
protected void init() {
this.layout.addTitleHeader(TITLE, this.font);
LinearLayout content = this.layout.addToContents(LinearLayout.vertical()).spacing(8);
content.defaultCellSetting().alignHorizontallyCenter();
content.addChild(Button.builder(CREDITS_BUTTON, button -> this.openCreditsScreen()).width(210).build());
content.addChild(Button.builder(ATTRIBUTION_BUTTON, ConfirmLinkScreen.confirmLink(this, CommonLinks.ATTRIBUTION)).width(210).build());
content.addChild(Button.builder(LICENSES_BUTTON, ConfirmLinkScreen.confirmLink(this, CommonLinks.LICENSES)).width(210).build());
this.layout.addToFooter(Button.builder(CommonComponents.GUI_DONE, button -> this.onClose()).width(200).build());
this.layout.arrangeElements();
this.layout.visitWidgets(this::addRenderableWidget);
}
@Override
protected void repositionElements() {
this.layout.arrangeElements();
}
private void openCreditsScreen() {
this.minecraft.setScreen(new WinScreen(false, () -> this.minecraft.setScreen(this)));
}
@Override
public void onClose() {
this.minecraft.setScreen(this.lastScreen);
}
}引用的其他类
-
- 引用位置:
方法调用 - 关联成员:
Button.builder()
- 引用位置:
-
- 引用位置:
字段/构造调用 - 关联成员:
HeaderAndFooterLayout()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
LinearLayout.vertical()
- 引用位置:
-
- 引用位置:
方法调用 - 关联成员:
ConfirmLinkScreen.confirmLink()
- 引用位置:
-
- 引用位置:
参数/字段/继承
- 引用位置:
-
- 引用位置:
构造调用 - 关联成员:
WinScreen()
- 引用位置:
-
- 引用位置:
字段/方法调用 - 关联成员:
Component.translatable()
- 引用位置: