SimpleDialogScreen.java

net.minecraft.client.gui.screens.dialog.SimpleDialogScreen

信息

  • 全限定名:net.minecraft.client.gui.screens.dialog.SimpleDialogScreen
  • 类型:public class
  • 包:net.minecraft.client.gui.screens.dialog
  • 源码路径:src/main/java/net/minecraft/client/gui/screens/dialog/SimpleDialogScreen.java
  • 起始行号:L13
  • 继承:DialogScreen
  • 职责:

    TODO

字段/常量

内部类/嵌套类型

构造器

public SimpleDialogScreen(Screen previousScreen, T dialog, DialogConnectionAccess connectionAccess) @ L14

  • 构造器名:SimpleDialogScreen
  • 源码定位:L14
  • 修饰符:public

参数:

  • previousScreen: Screen
  • dialog: T
  • connectionAccess: DialogConnectionAccess

说明:

TODO

方法

下面的方法块按源码顺序生成。

protected void updateHeaderAndFooter(HeaderAndFooterLayout layout, DialogControlSet controlSet, T dialog, DialogConnectionAccess connectionAccess) @ L18

  • 方法名:updateHeaderAndFooter
  • 源码定位:L18
  • 返回类型:void
  • 修饰符:protected

参数:

  • layout: HeaderAndFooterLayout
  • controlSet: DialogControlSet
  • dialog: T
  • connectionAccess: DialogConnectionAccess

说明:

TODO

代码

@OnlyIn(Dist.CLIENT)
public class SimpleDialogScreen<T extends SimpleDialog> extends DialogScreen<T> {
    public SimpleDialogScreen(@Nullable Screen previousScreen, T dialog, DialogConnectionAccess connectionAccess) {
        super(previousScreen, dialog, connectionAccess);
    }
 
    protected void updateHeaderAndFooter(HeaderAndFooterLayout layout, DialogControlSet controlSet, T dialog, DialogConnectionAccess connectionAccess) {
        super.updateHeaderAndFooter(layout, controlSet, dialog, connectionAccess);
        LinearLayout buttonLayout = LinearLayout.horizontal().spacing(8);
 
        for (ActionButton action : dialog.mainActions()) {
            buttonLayout.addChild(controlSet.createActionButton(action).build());
        }
 
        layout.addToFooter(buttonLayout);
    }
}

引用的其他类