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
Modifier and TypeFieldDescriptionstatic boolean
Whether the chatbox is open.protected net.minecraft.client.gui.components.EditBox
Chat entry fieldFields inherited from class com.pixelmonmod.tcg.client.gui.base.TCGScreenBase
debug, textFieldList, visible
Fields inherited from class net.minecraft.client.gui.screens.Screen
BACKGROUND_LOCATION, children, font, height, minecraft, renderables, screenExecutor, title, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
calculateChatboxHeight
(double p_146243_0_) Calculates the height of the chatbox..static int
calculateChatboxWidth
(double p_146233_0_) Calculates the width of the chatbox.boolean
charTyped
(char key, int keyCode) void
Closes the chatbox.void
chatOpened
(String start) Opens the chatbox.void
Auto-completes player name.int
Calculates the height of the chatbox.double
Returns the chatscale from mc.gameSettings.chatScale.int
Calculates the width of the chatbox.int
Calculates the number of lines in the chatbox.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.void
init()
boolean
keyPressed
(int keyCode, int scanCode, int modifiers) boolean
mouseClicked
(double mouseX, double mouseY, int mouseButton) void
onClose()
void
render
(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) void
renderTransparentBackground
(net.minecraft.client.gui.GuiGraphics graphics) Draws the dark grey background for the chat box the player types in.void
sendMessage
(String text) void
tick()
Methods inherited from class com.pixelmonmod.tcg.client.gui.base.TCGScreenBase
drawEffectTooltip, drawHoveringText, drawRectWithBorder, drawRectWithBorder, getScaledHeight, getScaledWidth, isLeftMousePressed, isRightMousePressed, mouseReleased, renderBackground
Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addEventWidget, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, confirmLink, createArrowEvent, createTabEvent, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, hideWidgets, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, narrationEnabled, onFilesDrop, openLink, rebuildWidgets, removed, removeWidget, renderDirtBackground, renderWithTooltip, repositionElements, resize, runNarration, scheduleNarration, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, shouldRunNarration, suppressNarration, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, wrapScreenError
Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocused
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
getChildAt, getCurrentFocusPath, isFocused, keyReleased, magicalSpecialHackyFocus, mouseDragged, mouseScrolled, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMoved
Methods 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:
init
in classnet.minecraft.client.gui.screens.Screen
-
tick
public void tick()- Overrides:
tick
in classTCGScreenBase
-
render
public void render(net.minecraft.client.gui.GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) - Specified by:
render
in interfacenet.minecraft.client.gui.components.Renderable
- Overrides:
render
in 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:
renderTransparentBackground
in classTCGScreenBase
- Parameters:
graphics
- The PoseStack matrix.
-
onClose
public void onClose()- Overrides:
onClose
in 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:
keyPressed
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
keyPressed
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
keyPressed
in classTCGScreenBase
-
charTyped
public boolean charTyped(char key, int keyCode) - Specified by:
charTyped
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
charTyped
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
charTyped
in 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:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.ContainerEventHandler
- Specified by:
mouseClicked
in interfacenet.minecraft.client.gui.components.events.GuiEventListener
- Overrides:
mouseClicked
in 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
-