Package net.minecraft.client.gui.screens
Class ChatScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.ChatScreen
- All Implemented Interfaces:
ContainerEventHandler
,GuiEventListener
,Renderable
,TabOrderedElement
- Direct Known Subclasses:
InBedChatScreen
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
Screen.NarratableSearchResult
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) CommandSuggestions
private String
private int
keeps position of which chat message you will select when you press up, (does not increase for duplicated messages sent immediately after each other)private String
is the text that appears when you press the chat key and the input box appears pre-filledprotected EditBox
Chat entry fieldstatic final double
private static final int
private static final Component
Fields inherited from class net.minecraft.client.gui.screens.Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Style
getComponentStyleAt
(double pMouseX, double pMouseY) void
handleChatInput
(String pMessage, boolean pAddToRecentChat) protected void
init()
protected void
insertText
(String pText, boolean pOverwrite) boolean
boolean
keyPressed
(int pKeyCode, int pScanCode, int pModifiers) Called when a keyboard key is pressed within the GUI element.boolean
mouseClicked
(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.boolean
mouseScrolled
(double pMouseX, double pMouseY, double pScrollX, double pScrollY) void
moveInHistory
(int pMsgPos) Input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next message from the current cursor position.normalizeChatMessage
(String pMessage) private void
void
removed()
void
render
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) Renders the graphical user interface (GUI) element.void
renderBackground
(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) void
private void
setChatLine
(String pChatLine) protected void
protected void
Methods inherited from class net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleClickEvent, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onClose, onFilesDrop, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarratorStatus
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
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseDragged, mouseReleased, nextFocusPath, setFocused
Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMoved
Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
MOUSE_SCROLL_SPEED
public static final double MOUSE_SCROLL_SPEED- See Also:
-
USAGE_TEXT
-
TOOLTIP_MAX_WIDTH
private static final int TOOLTIP_MAX_WIDTH- See Also:
-
historyBuffer
-
historyPos
private int historyPoskeeps position of which chat message you will select when you press up, (does not increase for duplicated messages sent immediately after each other) -
input
Chat entry field -
initial
is the text that appears when you press the chat key and the input box appears pre-filled -
commandSuggestions
CommandSuggestions commandSuggestions
-
-
Constructor Details
-
ChatScreen
-
-
Method Details
-
init
protected void init() -
setInitialFocus
protected void setInitialFocus()- Overrides:
setInitialFocus
in classScreen
-
resize
-
removed
public void removed() -
onEdited
-
keyPressed
public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers) Description copied from class:Screen
Called when a keyboard key is pressed within the GUI element.- Specified by:
keyPressed
in interfaceContainerEventHandler
- Specified by:
keyPressed
in interfaceGuiEventListener
- Overrides:
keyPressed
in classScreen
- Parameters:
pKeyCode
- the key code of the pressed key.pScanCode
- the scan code of the pressed key.pModifiers
- the keyboard modifiers.- Returns:
true
if the event is consumed,false
otherwise.
-
mouseScrolled
public boolean mouseScrolled(double pMouseX, double pMouseY, double pScrollX, double pScrollY) -
mouseClicked
public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) Called when a mouse button is clicked within the GUI element.- Parameters:
pMouseX
- the X coordinate of the mouse.pMouseY
- the Y coordinate of the mouse.pButton
- the button that was clicked.- Returns:
true
if the event is consumed,false
otherwise.
-
insertText
- Overrides:
insertText
in classScreen
-
moveInHistory
public void moveInHistory(int pMsgPos) Input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next message from the current cursor position. -
render
Renders the graphical user interface (GUI) element.- Specified by:
render
in interfaceRenderable
- Overrides:
render
in classScreen
- Parameters:
pGuiGraphics
- the GuiGraphics object used for rendering.pMouseX
- the x-coordinate of the mouse cursor.pMouseY
- the y-coordinate of the mouse cursor.pPartialTick
- the partial tick time.
-
renderBackground
public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) - Overrides:
renderBackground
in classScreen
-
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreen
in classScreen
-
setChatLine
-
updateNarrationState
- Overrides:
updateNarrationState
in classScreen
-
getComponentStyleAt
-
handleChatInput
-
normalizeChatMessage
-