Class EditBookScreen

All Implemented Interfaces:
IGuiEventListener, INestedGuiEventHandler, IRenderable, IScreen

public class EditBookScreen extends Screen
  • Field Details

    • EDIT_TITLE_LABEL

      private static final ITextComponent EDIT_TITLE_LABEL
    • FINALIZE_WARNING_LABEL

      private static final ITextComponent FINALIZE_WARNING_LABEL
    • BLACK_CURSOR

      private static final IReorderingProcessor BLACK_CURSOR
    • GRAY_CURSOR

      private static final IReorderingProcessor GRAY_CURSOR
    • owner

      private final PlayerEntity 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 TextInputUtil pageEdit
    • titleEdit

      private final TextInputUtil titleEdit
    • lastClickTime

      private long lastClickTime
    • lastIndex

      private int lastIndex
    • forwardButton

      private ChangePageButton forwardButton
    • backButton

      private ChangePageButton backButton
    • doneButton

      private Button doneButton
    • signButton

      private Button signButton
    • finalizeButton

      private Button finalizeButton
    • cancelButton

      private Button cancelButton
    • hand

      private final Hand hand
    • displayCache

      @Nullable private EditBookScreen.BookPage displayCache
    • pageMsg

      private ITextComponent pageMsg
    • ownerText

      private final ITextComponent ownerText
  • Constructor Details

  • Method Details

    • setClipboard

      private void setClipboard(String p_238760_1_)
    • getClipboard

      private String getClipboard()
    • getNumPages

      private int getNumPages()
    • tick

      public void tick()
      Specified by:
      tick in interface IScreen
      Overrides:
      tick in class Screen
    • init

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

      private void pageBack()
    • pageForward

      private void pageForward()
    • removed

      public void removed()
      Overrides:
      removed in class Screen
    • updateButtonVisibility

      private void updateButtonVisibility()
    • eraseEmptyTrailingPages

      private void eraseEmptyTrailingPages()
    • saveChanges

      private void saveChanges(boolean p_214198_1_)
    • appendPageToBook

      private void appendPageToBook()
    • keyPressed

      public boolean keyPressed(int p_231046_1_, int p_231046_2_, int p_231046_3_)
      Specified by:
      keyPressed in interface IGuiEventListener
      Specified by:
      keyPressed in interface INestedGuiEventHandler
      Overrides:
      keyPressed in class Screen
    • charTyped

      public boolean charTyped(char p_231042_1_, int p_231042_2_)
    • bookKeyPressed

      private boolean bookKeyPressed(int p_214230_1_, int p_214230_2_, int p_214230_3_)
    • keyUp

      private void keyUp()
    • keyDown

      private void keyDown()
    • changeLine

      private void changeLine(int p_238755_1_)
    • keyHome

      private void keyHome()
    • keyEnd

      private void keyEnd()
    • titleKeyPressed

      private boolean titleKeyPressed(int p_214196_1_, int p_214196_2_, int p_214196_3_)
    • getCurrentPageText

      private String getCurrentPageText()
    • setCurrentPageText

      private void setCurrentPageText(String p_214217_1_)
    • render

      public void render(MatrixStack p_230430_1_, int p_230430_2_, int p_230430_3_, float p_230430_4_)
      Specified by:
      render in interface IRenderable
      Overrides:
      render in class Screen
    • renderCursor

      private void renderCursor(MatrixStack p_238756_1_, EditBookScreen.Point p_238756_2_, boolean p_238756_3_)
    • renderHighlight

      private void renderHighlight(Rectangle2d[] p_238764_1_)
    • convertScreenToLocal

      private EditBookScreen.Point convertScreenToLocal(EditBookScreen.Point p_238758_1_)
    • convertLocalToScreen

      private EditBookScreen.Point convertLocalToScreen(EditBookScreen.Point p_238767_1_)
    • mouseClicked

      public boolean mouseClicked(double p_231044_1_, double p_231044_3_, int p_231044_5_)
    • selectWord

      private void selectWord(int p_238765_1_)
    • mouseDragged

      public boolean mouseDragged(double p_231045_1_, double p_231045_3_, int p_231045_5_, double p_231045_6_, double p_231045_8_)
    • getDisplayCache

      private EditBookScreen.BookPage getDisplayCache()
    • clearDisplayCache

      private void clearDisplayCache()
    • clearDisplayCacheAfterPageChange

      private void clearDisplayCacheAfterPageChange()
    • rebuildDisplayCache

      private EditBookScreen.BookPage rebuildDisplayCache()
    • findLineFromPos

      private static int findLineFromPos(int[] p_238768_0_, int p_238768_1_)
    • createPartialLineSelection

      private Rectangle2d createPartialLineSelection(String p_238761_1_, CharacterManager p_238761_2_, int p_238761_3_, int p_238761_4_, int p_238761_5_, int p_238761_6_)
    • createSelection

      private Rectangle2d createSelection(EditBookScreen.Point p_238759_1_, EditBookScreen.Point p_238759_2_)