Refactored to expose the ModMenu Integration to other Mods
This commit is contained in:
parent
5808bab08e
commit
0486b56ec3
4 changed files with 136 additions and 50 deletions
28
src/main/java/ru/bclib/gui/modmenu/MainScreen.java
Normal file
28
src/main/java/ru/bclib/gui/modmenu/MainScreen.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package ru.bclib.gui.modmenu;
|
||||
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import ru.bclib.gui.gridlayout.GridRow;
|
||||
import ru.bclib.gui.gridlayout.GridScreen;
|
||||
|
||||
public class MainScreen extends GridScreen{
|
||||
|
||||
public MainScreen(@Nullable Screen parent) {
|
||||
super(parent, new TranslatableComponent("title.bclib.modmenu.main"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initLayout() {
|
||||
final int BUTTON_HEIGHT = 20;
|
||||
grid.addSpacerRow(20);
|
||||
GridRow row = grid.addRow();
|
||||
|
||||
row.addFiller();
|
||||
row.addButton(CommonComponents.GUI_BACK, BUTTON_HEIGHT, font, (button)->{
|
||||
onClose();
|
||||
});
|
||||
row.addFiller();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue