Dieser Commit ist enthalten in:
Ursprung
fe037aa766
Commit
a6e2fa7fc5
@ -7,6 +7,7 @@ import de.zonlykroks.advancedscripts.lexer.TokenTypeColors;
|
||||
import net.minecraft.client.font.TextHandler;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.screen.ingame.BookEditScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.BookScreen;
|
||||
import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder;
|
||||
import net.minecraft.client.gui.widget.PressableWidget;
|
||||
@ -24,7 +25,10 @@ import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Hand;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class ScriptEditScreen extends Screen {
|
||||
@ -70,20 +74,27 @@ public class ScriptEditScreen extends Screen {
|
||||
@Override
|
||||
protected void init() {
|
||||
this.addDrawableChild(
|
||||
new DoneButton(this.width / 2 - 98 / 2, height - 40, () -> {
|
||||
new Button(DONE, this.width / 2 - 98 / 2, height - 55, () -> {
|
||||
this.client.setScreen(null);
|
||||
finalizeBook();
|
||||
})
|
||||
);
|
||||
this.addDrawableChild(
|
||||
new Button(BOOK, this.width - 98 - 5, height - 20 - 5, () -> {
|
||||
finalizeBook();
|
||||
this.client.setScreen(new BookEditScreen(player, itemStack, hand));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public static final Text DONE = Text.translatable("gui.done");
|
||||
public static final Text BOOK = Text.translatable("item.minecraft.book");
|
||||
|
||||
private class DoneButton extends PressableWidget {
|
||||
private static class Button extends PressableWidget {
|
||||
private Runnable onPress;
|
||||
|
||||
public DoneButton(int x, int y, Runnable onPress) {
|
||||
super(x, y, 98, 20, DONE);
|
||||
public Button(Text text, int x, int y, Runnable onPress) {
|
||||
super(x, y, 98, 20, text);
|
||||
visible = true;
|
||||
this.onPress = onPress;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren