Class BookEditScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable

public class BookEditScreen extends Screen
  • Field Details

    • TEXT_WIDTH

      private static final int TEXT_WIDTH
      See Also:
    • TEXT_HEIGHT

      private static final int TEXT_HEIGHT
      See Also:
    • IMAGE_WIDTH

      private static final int IMAGE_WIDTH
      See Also:
    • IMAGE_HEIGHT

      private static final int IMAGE_HEIGHT
      See Also:
    • EDIT_TITLE_LABEL

      private static final Component EDIT_TITLE_LABEL
    • FINALIZE_WARNING_LABEL

      private static final Component FINALIZE_WARNING_LABEL
    • BLACK_CURSOR

      private static final FormattedCharSequence BLACK_CURSOR
    • GRAY_CURSOR

      private static final FormattedCharSequence GRAY_CURSOR
    • owner

      private final Player owner
    • book

      private final ItemStack book
    • isModified

      private boolean isModified
    • isSigning

      private boolean isSigning
    • frameTick

      private int frameTick
    • currentPage

      private int currentPage
    • pages

      private final List<String> pages
    • title

      private String title
    • pageEdit

      private final TextFieldHelper pageEdit
    • titleEdit

      private final TextFieldHelper titleEdit
    • lastClickTime

      private long lastClickTime
    • lastIndex

      private int lastIndex
    • forwardButton

      private PageButton forwardButton
    • backButton

      private PageButton backButton
    • doneButton

      private Button doneButton
    • signButton

      private Button signButton
    • finalizeButton

      private Button finalizeButton
    • cancelButton

      private Button cancelButton
    • hand

      private final InteractionHand hand
    • displayCache

      @Nullable private BookEditScreen.DisplayCache displayCache
    • pageMsg

      private Component pageMsg
    • ownerText

      private final Component ownerText
  • Constructor Details

  • Method Details

    • setClipboard

      private void setClipboard(String p_98148_)
    • getClipboard

      private String getClipboard()
    • getNumPages

      private int getNumPages()
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • init

      protected void init()
      Overrides:
      init in class Screen
    • pageBack

      private void pageBack()
    • pageForward

      private void pageForward()
    • updateButtonVisibility

      private void updateButtonVisibility()
    • eraseEmptyTrailingPages

      private void eraseEmptyTrailingPages()
    • saveChanges

      private void saveChanges(boolean p_98161_)
    • updateLocalCopy

      private void updateLocalCopy(boolean p_182575_)
    • appendPageToBook

      private void appendPageToBook()
    • keyPressed

      public boolean keyPressed(int p_98100_, int p_98101_, int p_98102_)
      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
    • charTyped

      public boolean charTyped(char p_98085_, int p_98086_)
    • bookKeyPressed

      private boolean bookKeyPressed(int p_98153_, int p_98154_, int p_98155_)
    • keyUp

      private void keyUp()
    • keyDown

      private void keyDown()
    • changeLine

      private void changeLine(int p_98098_)
    • keyHome

      private void keyHome()
    • keyEnd

      private void keyEnd()
    • titleKeyPressed

      private boolean titleKeyPressed(int p_98164_, int p_98165_, int p_98166_)
    • getCurrentPageText

      private String getCurrentPageText()
    • setCurrentPageText

      private void setCurrentPageText(String p_98159_)
    • render

      public void render(PoseStack p_98104_, int p_98105_, int p_98106_, float p_98107_)
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
    • renderCursor

      private void renderCursor(PoseStack p_98109_, BookEditScreen.Pos2i p_98110_, boolean p_98111_)
    • renderHighlight

      private void renderHighlight(Rect2i[] p_98139_)
    • convertScreenToLocal

      private BookEditScreen.Pos2i convertScreenToLocal(BookEditScreen.Pos2i p_98115_)
    • convertLocalToScreen

      private BookEditScreen.Pos2i convertLocalToScreen(BookEditScreen.Pos2i p_98146_)
    • mouseClicked

      public boolean mouseClicked(double p_98088_, double p_98089_, int p_98090_)
    • selectWord

      private void selectWord(int p_98142_)
    • mouseDragged

      public boolean mouseDragged(double p_98092_, double p_98093_, int p_98094_, double p_98095_, double p_98096_)
    • getDisplayCache

      private BookEditScreen.DisplayCache getDisplayCache()
    • clearDisplayCache

      private void clearDisplayCache()
    • clearDisplayCacheAfterPageChange

      private void clearDisplayCacheAfterPageChange()
    • rebuildDisplayCache

      private BookEditScreen.DisplayCache rebuildDisplayCache()
    • findLineFromPos

      static int findLineFromPos(int[] p_98150_, int p_98151_)
    • createPartialLineSelection

      private Rect2i createPartialLineSelection(String p_98120_, StringSplitter p_98121_, int p_98122_, int p_98123_, int p_98124_, int p_98125_)
    • createSelection

      private Rect2i createSelection(BookEditScreen.Pos2i p_98117_, BookEditScreen.Pos2i p_98118_)