public class GuiScreenBook extends GuiScreen
Modifier and Type | Class and Description |
---|---|
(package private) static class |
GuiScreenBook.NextPageButton |
Modifier and Type | Field and Description |
---|---|
private boolean |
bookGettingSigned
Determines if the signing screen is open
|
private static ResourceLocation |
bookGuiTextures |
private int |
bookImageHeight |
private int |
bookImageWidth |
private boolean |
bookIsModified
Whether the book's title or contents has been modified since being opened
|
private boolean |
bookIsUnsigned
Whether the book is signed or can still be edited
|
private ItemStack |
bookObj |
private NBTTagList |
bookPages |
private java.lang.String |
bookTitle |
private int |
bookTotalPages |
private GuiButton |
buttonCancel |
private GuiButton |
buttonDone |
private GuiButton |
buttonFinalize |
private GuiScreenBook.NextPageButton |
buttonNextPage |
private GuiScreenBook.NextPageButton |
buttonPreviousPage |
private GuiButton |
buttonSign
The GuiButton to sign this book.
|
private int |
currPage |
private EntityPlayer |
editingPlayer
The player editing the book
|
private java.util.List<IChatComponent> |
field_175386_A |
private int |
field_175387_B |
private static org.apache.logging.log4j.Logger |
logger |
private int |
updateCount
Update ticks since the gui was opened
|
allowUserInput, buttonList, fontRendererObj, height, itemRender, labelList, mc, width
icons, optionsBackground, statIcons, zLevel
Constructor and Description |
---|
GuiScreenBook(EntityPlayer player,
ItemStack book,
boolean isUnsigned) |
Modifier and Type | Method and Description |
---|---|
protected void |
actionPerformed(GuiButton button)
Called by the controls from the buttonList when activated.
|
private void |
addNewPage() |
void |
drawScreen(int mouseX,
int mouseY,
float partialTicks)
Draws the screen and all the components in it.
|
IChatComponent |
func_175385_b(int p_175385_1_,
int p_175385_2_) |
protected boolean |
handleComponentClick(IChatComponent p_175276_1_)
Executes the click event specified by the given chat component
|
void |
initGui()
Adds the buttons (and other controls) to the screen in question.
|
protected void |
keyTyped(char typedChar,
int keyCode)
Fired when a key is typed (except F11 which toggles full screen).
|
private void |
keyTypedInBook(char typedChar,
int keyCode)
Processes keystrokes when editing the text of a book
|
private void |
keyTypedInTitle(char p_146460_1_,
int p_146460_2_)
Processes keystrokes when editing the title of a book
|
protected void |
mouseClicked(int mouseX,
int mouseY,
int mouseButton)
Called when the mouse is clicked.
|
void |
onGuiClosed()
Called when the screen is unloaded.
|
private java.lang.String |
pageGetCurrent()
Returns the entire text of the current page as determined by currPage
|
private void |
pageInsertIntoCurrent(java.lang.String p_146459_1_)
Processes any text getting inserted into the current page, enforcing the page size limit
|
private void |
pageSetCurrent(java.lang.String p_146457_1_)
Sets the text of the current page as determined by currPage
|
private void |
sendBookToServer(boolean publish) |
private void |
updateButtons() |
void |
updateScreen()
Called from the main game loop to update the screen.
|
confirmClicked, doesGuiPauseGame, drawBackground, drawCreativeTabHoveringText, drawDefaultBackground, drawHoveringText, drawWorldBackground, getClipboardString, handleComponentHover, handleInput, handleKeyboardInput, handleMouseInput, isAltKeyDown, isCtrlKeyDown, isKeyComboCtrlA, isKeyComboCtrlC, isKeyComboCtrlV, isKeyComboCtrlX, isShiftKeyDown, mouseClickMove, mouseReleased, onResize, renderToolTip, sendChatMessage, sendChatMessage, setClipboardString, setText, setWorldAndResolution
drawCenteredString, drawGradientRect, drawHorizontalLine, drawModalRectWithCustomSizedTexture, drawRect, drawScaledCustomSizeModalRect, drawString, drawTexturedModalRect, drawTexturedModalRect, drawTexturedModalRect, drawVerticalLine
private static final org.apache.logging.log4j.Logger logger
private static final ResourceLocation bookGuiTextures
private final EntityPlayer editingPlayer
private final ItemStack bookObj
private final boolean bookIsUnsigned
private boolean bookIsModified
private boolean bookGettingSigned
private int updateCount
private int bookImageWidth
private int bookImageHeight
private int bookTotalPages
private int currPage
private NBTTagList bookPages
private java.lang.String bookTitle
private java.util.List<IChatComponent> field_175386_A
private int field_175387_B
private GuiScreenBook.NextPageButton buttonNextPage
private GuiScreenBook.NextPageButton buttonPreviousPage
private GuiButton buttonDone
private GuiButton buttonSign
private GuiButton buttonFinalize
private GuiButton buttonCancel
public GuiScreenBook(EntityPlayer player, ItemStack book, boolean isUnsigned)
public void updateScreen()
updateScreen
in class GuiScreen
public void initGui()
public void onGuiClosed()
onGuiClosed
in class GuiScreen
private void updateButtons()
private void sendBookToServer(boolean publish) throws java.io.IOException
java.io.IOException
protected void actionPerformed(GuiButton button) throws java.io.IOException
actionPerformed
in class GuiScreen
java.io.IOException
private void addNewPage()
protected void keyTyped(char typedChar, int keyCode) throws java.io.IOException
private void keyTypedInBook(char typedChar, int keyCode)
private void keyTypedInTitle(char p_146460_1_, int p_146460_2_) throws java.io.IOException
java.io.IOException
private java.lang.String pageGetCurrent()
private void pageSetCurrent(java.lang.String p_146457_1_)
private void pageInsertIntoCurrent(java.lang.String p_146459_1_)
public void drawScreen(int mouseX, int mouseY, float partialTicks)
drawScreen
in class GuiScreen
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws java.io.IOException
mouseClicked
in class GuiScreen
java.io.IOException
protected boolean handleComponentClick(IChatComponent p_175276_1_)
handleComponentClick
in class GuiScreen
public IChatComponent func_175385_b(int p_175385_1_, int p_175385_2_)