public class LightweightGuiDescription extends java.lang.Object implements GuiDescription
| Modifier and Type | Field and Description |
|---|---|
protected int |
darkmodeTitleColor |
protected WWidget |
focus |
protected boolean |
fullscreen |
protected net.minecraft.screen.PropertyDelegate |
propertyDelegate |
protected WPanel |
rootPanel |
protected HorizontalAlignment |
titleAlignment |
protected int |
titleColor |
protected boolean |
titleVisible |
| Constructor and Description |
|---|
LightweightGuiDescription() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPainters()
Guis should use this method to add clientside styles and BackgroundPainters to their controls
|
void |
addSlotPeer(ValidatedSlot slot)
Typical users won't call this.
|
WWidget |
getFocus()
Gets the currently-focused WWidget.
|
@Nullable net.minecraft.screen.PropertyDelegate |
getPropertyDelegate()
Gets the object which manages the integer properties used by WBars and such.
|
WPanel |
getRootPanel() |
HorizontalAlignment |
getTitleAlignment()
Gets the horizontal alignment of the GUI title.
|
int |
getTitleColor() |
boolean |
isFocused(WWidget widget)
Tests whether the widget is the currently-focused one.
|
boolean |
isFullscreen()
Gets whether this GUI is fullscreen.
|
boolean |
isTitleVisible()
Gets whether the title of this GUI should be rendered by the screen.
|
void |
releaseFocus(WWidget widget)
Notifies this gui that the widget wants to give up its hold over focus.
|
void |
requestFocus(WWidget widget)
Notifies this gui that the widget wants to acquire focus.
|
void |
setFullscreen(boolean fullscreen)
Sets whether this GUI is fullscreen.
|
GuiDescription |
setPropertyDelegate(net.minecraft.screen.PropertyDelegate delegate)
Sets the object which manages the integer properties used by WBars
|
GuiDescription |
setRootPanel(WPanel panel) |
void |
setTitleAlignment(HorizontalAlignment titleAlignment)
Sets the horizontal alignment of the GUI title.
|
GuiDescription |
setTitleColor(int color)
Sets the title color of this GUI.
|
GuiDescription |
setTitleColor(int lightColor,
int darkColor)
Sets the light and dark title colors of this GUI.
|
void |
setTitleVisible(boolean titleVisible)
Sets whether the title of this GUI should be rendered by the screen.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcycleFocusprotected WPanel rootPanel
protected net.minecraft.screen.PropertyDelegate propertyDelegate
protected WWidget focus
protected int titleColor
protected int darkmodeTitleColor
protected boolean fullscreen
protected boolean titleVisible
protected HorizontalAlignment titleAlignment
public WPanel getRootPanel()
getRootPanel in interface GuiDescriptionpublic int getTitleColor()
getTitleColor in interface GuiDescriptionpublic GuiDescription setRootPanel(WPanel panel)
setRootPanel in interface GuiDescriptionpublic GuiDescription setTitleColor(int color)
GuiDescriptionThe dark-mode title color will also be set by this method.
If the specified color is WLabel.DEFAULT_TEXT_COLOR,
the dark-mode color will be WLabel.DEFAULT_DARKMODE_TEXT_COLOR;
otherwise it will be the specified color.
setTitleColor in interface GuiDescriptioncolor - the new title colorpublic GuiDescription setTitleColor(int lightColor, int darkColor)
GuiDescriptionsetTitleColor in interface GuiDescriptionlightColor - the light-mode colordarkColor - the dark-mode colorpublic void addPainters()
GuiDescriptionaddPainters in interface GuiDescriptionpublic void addSlotPeer(ValidatedSlot slot)
GuiDescriptionaddSlotPeer in interface GuiDescription@Nullable public @Nullable net.minecraft.screen.PropertyDelegate getPropertyDelegate()
GuiDescriptiongetPropertyDelegate in interface GuiDescriptionpublic GuiDescription setPropertyDelegate(net.minecraft.screen.PropertyDelegate delegate)
GuiDescriptionsetPropertyDelegate in interface GuiDescriptionpublic boolean isFocused(WWidget widget)
GuiDescriptionisFocused in interface GuiDescriptionpublic WWidget getFocus()
GuiDescriptiongetFocus in interface GuiDescriptionpublic void requestFocus(WWidget widget)
GuiDescriptionrequestFocus in interface GuiDescriptionpublic void releaseFocus(WWidget widget)
GuiDescriptionreleaseFocus in interface GuiDescriptionpublic boolean isFullscreen()
GuiDescriptionFullscreen GUIs have no default background painter and have the root panel stretched to fit the entire screen on the client.
isFullscreen in interface GuiDescriptionpublic void setFullscreen(boolean fullscreen)
GuiDescriptionsetFullscreen in interface GuiDescriptionfullscreen - true if this GUI is fullscreen, false otherwisepublic boolean isTitleVisible()
GuiDescriptionModders can disable this to render the title themselves with a widget.
isTitleVisible in interface GuiDescriptionpublic void setTitleVisible(boolean titleVisible)
GuiDescriptionsetTitleVisible in interface GuiDescriptiontitleVisible - true if the title is visible, false otherwisepublic HorizontalAlignment getTitleAlignment()
GuiDescriptiongetTitleAlignment in interface GuiDescriptionpublic void setTitleAlignment(HorizontalAlignment titleAlignment)
GuiDescriptionsetTitleAlignment in interface GuiDescriptiontitleAlignment - the new alignment