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 ClassesModifier and TypeClassDescriptionstatic interfaceChatScreen.ChatConstructor<T extends ChatScreen>protected static enumNested classes/interfaces inherited from class Screen
Screen.NarratableSearchResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ChatAbilitiesprivate final booleanprivate CommandSuggestionsprivate final ChatComponent.DisplayModeprotected ChatScreen.ExitReasonprivate Stringprivate intkeeps position of which chat message you will select when you press up, (does not increase for duplicated messages sent immediately after each other)protected Stringis the text that appears when you press the chat key and the input box appears pre-filledprotected EditBoxChat entry fieldprotected booleanstatic final doubleprivate static final Componentstatic final intprivate static final ComponentFields inherited from class Screen
FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width -
Constructor Summary
ConstructorsConstructorDescriptionChatScreen(String initial, boolean isDraft, ChatAbilities chatAbilities) ChatScreen(String initial, boolean isDraft, ChatAbilities chatAbilities, boolean closeOnSubmit) -
Method Summary
Modifier and TypeMethodDescriptionprivate @Nullable FormattedCharSequenceformatChat(String text, int offset) voidhandleChatInput(String msg, boolean addToRecent) private booleanhandleComponentClicked(Style clicked, boolean allowInsertions) protected voidinit()private booleanvoidinsertText(String text, boolean replace) booleanbooleanbooleankeyPressed(KeyEvent event) booleanmouseClicked(MouseButtonEvent event, boolean doubleClick) booleanmouseScrolled(double x, double y, double scrollX, double scrollY) voidmoveInHistory(int dir) 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 message) voidonClose()private voidvoidremoved()voidrender(GuiGraphics graphics, int mouseX, int mouseY, float a) Renders the graphical user interface (GUI) element.voidrenderBackground(GuiGraphics graphics, int mouseX, int mouseY, float a) voidresize(int width, int height) protected voidprotected booleanprotected voidMethods inherited from class Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, isInGameUi, isMouseOver, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, repositionElements, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarratorStatusMethods inherited from class AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ContainerEventHandler
charTyped, getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseDragged, mouseReleased, nextFocusPath, setFocusedMethods inherited from interface GuiEventListener
mouseMoved, shouldTakeFocusAfterInteractionMethods inherited from interface TabOrderedElement
getTabOrderGroup
-
Field Details
-
MOUSE_SCROLL_SPEED
public static final double MOUSE_SCROLL_SPEED- See Also:
-
USAGE_TEXT
-
RESTRICTED_NARRATION_TEXT
-
USAGE_BACKGROUND_COLOR
public static final int USAGE_BACKGROUND_COLOR- See Also:
-
closeOnSubmit
private final boolean closeOnSubmit -
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 -
isDraft
protected boolean isDraft -
displayMode
-
chatAbilities
-
exitReason
-
commandSuggestions
-
-
Constructor Details
-
ChatScreen
-
ChatScreen
public ChatScreen(String initial, boolean isDraft, ChatAbilities chatAbilities, boolean closeOnSubmit)
-
-
Method Details
-
init
-
setInitialFocus
protected void setInitialFocus()- Overrides:
setInitialFocusin classScreen
-
resize
-
onClose
-
removed
-
shouldDiscardDraft
protected boolean shouldDiscardDraft() -
onEdited
-
keyPressed
- Specified by:
keyPressedin interfaceContainerEventHandler- Specified by:
keyPressedin interfaceGuiEventListener- Overrides:
keyPressedin classScreen
-
mouseScrolled
public boolean mouseScrolled(double x, double y, double scrollX, double scrollY) -
mouseClicked
-
insertionClickMode
private boolean insertionClickMode() -
handleComponentClicked
-
insertText
- Overrides:
insertTextin classScreen
-
moveInHistory
public void moveInHistory(int dir) 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. -
formatChat
-
render
Description copied from interface:RenderableRenders the graphical user interface (GUI) element.- Specified by:
renderin interfaceRenderable- Overrides:
renderin classScreen- Parameters:
graphics- the GuiGraphics object used for rendering.mouseX- the x-coordinate of the mouse cursor.mouseY- the y-coordinate of the mouse cursor.a- the partial tick time.
-
renderBackground
- Overrides:
renderBackgroundin classScreen
-
isPauseScreen
public boolean isPauseScreen()- Overrides:
isPauseScreenin classScreen
-
isAllowedInPortal
public boolean isAllowedInPortal()- Overrides:
isAllowedInPortalin classScreen
-
updateNarrationState
- Overrides:
updateNarrationStatein classScreen
-
handleChatInput
-
normalizeChatMessage
-