@Environment(value=CLIENT) public class BookEditScreen extends Screen
Modifier and Type | Class and Description |
---|---|
(package private) static class |
BookEditScreen.Line |
(package private) static class |
BookEditScreen.PageContent |
(package private) static class |
BookEditScreen.Position |
Modifier and Type | Field and Description |
---|---|
private ButtonWidget |
cancelButton |
private int |
currentPage |
private boolean |
dirty |
private ButtonWidget |
doneButton |
private SelectionManager |
field_24269 |
private SelectionManager |
field_24270 |
private Text |
field_25891 |
private Text |
field_25892 |
private static Text |
field_25893 |
private static Text |
field_25894 |
private static OrderedText |
field_25895 |
private static OrderedText |
field_25896 |
private ButtonWidget |
finalizeButton |
private Hand |
hand |
private ItemStack |
itemStack |
private int |
lastClickIndex |
private long |
lastClickTime |
private PageTurnWidget |
nextPageButton |
private BookEditScreen.PageContent |
pageContent |
private List<String> |
pages |
private PlayerEntity |
player |
private PageTurnWidget |
previousPageButton |
private ButtonWidget |
signButton |
private boolean |
signing |
private int |
tickCounter |
private String |
title |
buttons, children, client, height, itemRenderer, passEvents, textRenderer, width
GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE
Constructor and Description |
---|
BookEditScreen(PlayerEntity playerEntity,
ItemStack itemStack,
Hand hand) |
Modifier and Type | Method and Description |
---|---|
private void |
appendNewPage() |
boolean |
charTyped(char chr,
int keyCode)
Callback for when a character input has been captured.
|
private int |
countPages() |
private BookEditScreen.PageContent |
createPageContent() |
private void |
finalizeBook(boolean signBook) |
private String |
getCurrentPageContent() |
private BookEditScreen.PageContent |
getPageContent() |
protected void |
init()
Called when a screen should be initialized.
|
private void |
invalidatePageContent() |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
private boolean |
keyPressedSignMode(int keyCode,
int scanCode,
int modifiers) |
private void |
method_27580(int int2) |
private void |
method_27581(MatrixStack matrixStack,
BookEditScreen.Position position,
boolean bool) |
private BookEditScreen.Position |
method_27582(BookEditScreen.Position position) |
private Rect2i |
method_27583(BookEditScreen.Position position,
BookEditScreen.Position position2) |
private void |
method_27584(String string) |
private Rect2i |
method_27585(String string,
TextHandler textHandler,
int int2,
int int3,
int int4,
int int5) |
private void |
method_27588(Rect2i[] rect2i) |
private void |
method_27589(int int2) |
private BookEditScreen.Position |
method_27590(BookEditScreen.Position position) |
private static int |
method_27591(int[] int2,
int int3) |
private boolean |
method_27592(int int2,
int int3,
int int4) |
private String |
method_27595() |
private void |
method_27597() |
private void |
method_27598() |
private void |
method_27872() |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double deltaX,
double deltaY)
Callback for when a mouse button drag event
has been captured.
|
private void |
moveCursorToBottom() |
private void |
moveCursorToTop() |
private void |
openNextPage() |
private void |
openPreviousPage() |
void |
removed() |
private void |
removeEmptyPages() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
private void |
setPageContent(String newContent) |
void |
tick() |
private void |
updateButtons() |
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onClose, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenError
getFocused, isDragging, setDragging, setFocused
drawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffset
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
changeFocus, focusOn, hoveredElement, keyReleased, mouseReleased, mouseScrolled, setInitialFocus
mouseMoved
private static final Text field_25893
private static final Text field_25894
private static final OrderedText field_25895
private static final OrderedText field_25896
private final PlayerEntity player
private final ItemStack itemStack
private boolean dirty
private boolean signing
private int tickCounter
private int currentPage
private String title
private final SelectionManager field_24269
private final SelectionManager field_24270
private long lastClickTime
private int lastClickIndex
private PageTurnWidget nextPageButton
private PageTurnWidget previousPageButton
private ButtonWidget doneButton
private ButtonWidget signButton
private ButtonWidget finalizeButton
private ButtonWidget cancelButton
private final Hand hand
@Nullable private BookEditScreen.PageContent pageContent
private Text field_25891
private final Text field_25892
public BookEditScreen(PlayerEntity playerEntity, ItemStack itemStack, Hand hand)
private void method_27584(String string)
private String method_27595()
private int countPages()
public void tick()
tick
in interface TickableElement
tick
in class Screen
protected void init()
This method is called when this screen is opened
or resized.
private void openPreviousPage()
private void openNextPage()
private void updateButtons()
private void removeEmptyPages()
private void finalizeBook(boolean signBook)
private void appendNewPage()
public boolean keyPressed(int keyCode, int scanCode, int modifiers)
GLFW
class.keyPressed
in interface Element
keyPressed
in interface ParentElement
keyPressed
in class Screen
keyCode
- the named key code of the event as described in the GLFW
classscanCode
- the unique/platform-specific scan code of the keyboard inputmodifiers
- a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true
to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
public boolean charTyped(char chr, int keyCode)
GLFW
class.chr
- the captured characterkeyCode
- the associated key codetrue
to indicate that the event handling is successful/validKeyboard.onChar(long, int, int)
,
GLFW.GLFW_KEY_Q
,
GLFWKeyCallbackI.invoke(long, int, int, int, int)
private boolean method_27592(int int2, int int3, int int4)
private void method_27597()
private void method_27598()
private void method_27580(int int2)
private void moveCursorToTop()
private void moveCursorToBottom()
private boolean keyPressedSignMode(int keyCode, int scanCode, int modifiers)
private String getCurrentPageContent()
private void setPageContent(String newContent)
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
private void method_27581(MatrixStack matrixStack, BookEditScreen.Position position, boolean bool)
private void method_27588(Rect2i[] rect2i)
private BookEditScreen.Position method_27582(BookEditScreen.Position position)
private BookEditScreen.Position method_27590(BookEditScreen.Position position)
public boolean mouseClicked(double mouseX, double mouseY, int button)
GLFW
class.mouseX
- the X coordinate of the mousemouseY
- the Y coordinate of the mousebutton
- the mouse button numbertrue
to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int)
,
GLFW.GLFW_MOUSE_BUTTON_1
private void method_27589(int int2)
public boolean mouseDragged(double mouseX, double mouseY, int button, double deltaX, double deltaY)
GLFW
class.mouseX
- the current X coordinate of the mousemouseY
- the current Y coordinate of the mousebutton
- the mouse button numberdeltaX
- the difference of the current X with the previous X coordinatedeltaY
- the difference of the current Y with the previous Y coordinatetrue
to indicate that the event handling is successful/validMouse.onCursorPos(long, double, double)
,
GLFW.GLFW_MOUSE_BUTTON_1
private BookEditScreen.PageContent getPageContent()
private void invalidatePageContent()
private void method_27872()
private BookEditScreen.PageContent createPageContent()
private static int method_27591(int[] int2, int int3)
private Rect2i method_27585(String string, TextHandler textHandler, int int2, int int3, int int4, int int5)
private Rect2i method_27583(BookEditScreen.Position position, BookEditScreen.Position position2)