@Environment(value=CLIENT) public class ChatScreen extends Screen
| Modifier and Type | Field and Description |
|---|---|
protected TextFieldWidget |
chatField |
private CommandSuggestor |
commandSuggestor |
private String |
field_2389 |
private int |
messageHistorySize |
private String |
originalChatText |
buttons, children, client, height, itemRenderer, passEvents, textRenderer, title, widthGUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE| Constructor and Description |
|---|
ChatScreen(String originalChatText) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
init()
Called when a screen should be initialized.
|
protected void |
insertText(String text,
boolean override) |
boolean |
isPauseScreen() |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers)
Callback for when a key down event has been captured.
|
boolean |
mouseClicked(double mouseX,
double mouseY,
int button)
Callback for when a mouse button down event
has been captured.
|
boolean |
mouseScrolled(double mouseX,
double mouseY,
double amount)
Callback for when a mouse button scroll event
has been captured.
|
private void |
onChatFieldUpdate(String chatText) |
void |
removed() |
void |
render(MatrixStack matrices,
int mouseX,
int mouseY,
float delta) |
void |
resize(MinecraftClient client,
int width,
int height) |
void |
setChatFromHistory(int int2) |
private void |
setText(String text) |
void |
tick() |
addButton, addChild, children, filesDragged, getNarrationMessage, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, init, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, onClose, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, sendMessage, sendMessage, shouldCloseOnEsc, wrapScreenErrorgetFocused, isDragging, setDragging, setFocuseddrawCenteredString, drawCenteredText, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, fill, fillGradient, fillGradient, getZOffset, method_29343, setZOffsetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchangeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseDragged, mouseReleased, setInitialFocusmouseMovedprivate String field_2389
private int messageHistorySize
protected TextFieldWidget chatField
private String originalChatText
private CommandSuggestor commandSuggestor
public ChatScreen(String originalChatText)
protected void init()
This method is called when this screen is opened or resized.
public void resize(MinecraftClient client, int width, int height)
public void tick()
tick in interface TickableElementtick in class Screenprivate void onChatFieldUpdate(String chatText)
public boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
GLFW class.keyPressed in interface ElementkeyPressed in interface ParentElementkeyPressed in class ScreenkeyCode - the named key code of the event as described in the GLFW classscanCode - the unique/platform-specific scan code of the keyboard inputmodifiers - a GLFW bitfield describing the modifier keys that are held down (see GLFW Modifier key flags)true to indicate that the event handling is successful/validKeyboard.onKey(long, int, int, int, int),
GLFW.GLFW_KEY_Q,
GLFWKeyCallbackI.invoke(long, int, int, int, int)public boolean mouseScrolled(double mouseX,
double mouseY,
double amount)
mouseX - the X coordinate of the mousemouseY - the Y coordinate of the mouseamount - value is > 1 if scrolled down, < 1 if scrolled uptrue to indicate that the event handling is successful/validMouse.onMouseScroll(long, double, double)public boolean mouseClicked(double mouseX,
double mouseY,
int button)
GLFW class.mouseX - the X coordinate of the mousemouseY - the Y coordinate of the mousebutton - the mouse button numbertrue to indicate that the event handling is successful/validMouse.onMouseButton(long, int, int, int),
GLFW.GLFW_MOUSE_BUTTON_1protected void insertText(String text, boolean override)
insertText in class Screenpublic void setChatFromHistory(int int2)
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta)
public boolean isPauseScreen()
isPauseScreen in class Screenprivate void setText(String text)