Class TCGScreenChattableBase
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.pixelmonmod.tcg.client.gui.base.TCGScreenBase
com.pixelmonmod.tcg.client.gui.base.TCGScreenChattableBase
- All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler,net.minecraft.client.gui.components.events.GuiEventListener,net.minecraft.client.gui.components.Renderable,net.minecraft.client.gui.components.TabOrderedElement
- Direct Known Subclasses:
TCGScreen
Created by Hy on 6/27/2016.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanWhether the chatbox is open.protected net.minecraft.client.gui.components.EditBoxChat entry fieldFields inherited from class com.pixelmonmod.tcg.client.gui.base.TCGScreenBase
debug, textFieldList, visibleFields inherited from class net.minecraft.client.gui.screens.Screen
children, CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcalculateChatboxHeight(double p_146243_0_) Calculates the height of the chatbox..static intcalculateChatboxWidth(double p_146233_0_) Calculates the width of the chatbox.booleancharTyped(char key, int keyCode) voidCloses the chatbox.voidchatOpened(String start) Opens the chatbox.voidAuto-completes player name.intCalculates the height of the chatbox.doubleReturns the chatscale from mc.gameSettings.chatScale.intCalculates the width of the chatbox.intCalculates the number of lines in the chatbox.voidgetSentHistory(int par1) Input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message and 1 is the next message from the current cursor position.voidinit()booleankeyPressed(int keyCode, int scanCode, int modifiers) booleanmouseClicked(double mouseX, double mouseY, int mouseButton) voidonClose()voidrender(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) voidrenderTransparentBackground(net.minecraft.client.gui.GuiGraphics graphics) Draws the dark grey background for the chat box the player types in.voidsendMessage(String text) voidtick()Methods inherited from class com.pixelmonmod.tcg.client.gui.base.TCGScreenBase
drawEffectTooltip, drawHoveringText, drawRectWithBorder, drawRectWithBorder, getScaledHeight, getScaledWidth, isLeftMousePressed, isRightMousePressed, mouseReleased, renderBackgroundMethods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, onFilesDrop, rebuildWidgets, removed, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseDragged, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
chatOpen
public static boolean chatOpenWhether the chatbox is open. -
inputField
protected net.minecraft.client.gui.components.EditBox inputFieldChat entry field
-
-
Constructor Details
-
TCGScreenChattableBase
public TCGScreenChattableBase()
-
-
Method Details
-
init
public void init()- Overrides:
initin classnet.minecraft.client.gui.screens.Screen
-
tick
public void tick()- Overrides:
tickin classTCGScreenBase
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) - Specified by:
renderin interfacenet.minecraft.client.gui.components.Renderable- Overrides:
renderin classTCGScreenBase
-
renderTransparentBackground
public void renderTransparentBackground(net.minecraft.client.gui.GuiGraphics graphics) Draws the dark grey background for the chat box the player types in.- Overrides:
renderTransparentBackgroundin classTCGScreenBase- Parameters:
graphics- The PoseStack matrix.
-
onClose
public void onClose()- Overrides:
onClosein classnet.minecraft.client.gui.screens.Screen
-
chatOpened
Opens the chatbox.- Parameters:
start- The initial text in the chatbox.
-
chatClosed
public void chatClosed()Closes the chatbox. -
keyPressed
public boolean keyPressed(int keyCode, int scanCode, int modifiers) - Specified by:
keyPressedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
keyPressedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
keyPressedin classTCGScreenBase
-
charTyped
public boolean charTyped(char key, int keyCode) - Specified by:
charTypedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
charTypedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
charTypedin classTCGScreenBase
-
completePlayerName
public void completePlayerName()Auto-completes player name. -
getSentHistory
public void getSentHistory(int par1) Input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message and 1 is the next message from the current cursor position.- Parameters:
par1- The location of the text history to get.
-
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.ContainerEventHandler- Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Overrides:
mouseClickedin classTCGScreenBase
-
getChatWidth
public int getChatWidth()Calculates the width of the chatbox.- Returns:
- The width of the chatbox.
-
getChatHeight
public int getChatHeight()Calculates the height of the chatbox.- Returns:
- The height of the chatbox.
-
getChatScale
public double getChatScale()Returns the chatscale from mc.gameSettings.chatScale.- Returns:
- The chatscale from mc.gameSettings.chatScale.
-
calculateChatboxWidth
public static int calculateChatboxWidth(double p_146233_0_) Calculates the width of the chatbox.- Parameters:
p_146233_0_- The current settings for chatbox width.- Returns:
- The width of the chatbox.
-
calculateChatboxHeight
public static int calculateChatboxHeight(double p_146243_0_) Calculates the height of the chatbox..- Parameters:
p_146243_0_- The current settings for chatbox height.- Returns:
- The height of the chatbox.
-
getLineCount
public int getLineCount()Calculates the number of lines in the chatbox.- Returns:
- The number of lines in the chatbox.
-
sendMessage
-