Enum Class ScreenKind
- All Implemented Interfaces:
Serializable, Comparable<ScreenKind>, Constable
The look of the screen an element is on, which decides how it draws (6.1.0;
renamed in 7.3.0). There is one set of elements; each draws itself for the look
of the screen it is on. No element, panel or screen picks a look any other way.
Where the look comes from (
PANEL, the Panel look: inventories, chests, anything built on vanilla'sAbstractContainerScreen. MenuKit's own look: raised gray controls on a light gray panel, dark text without a shadow.DEFAULT, the Default look: the screens reached from the pause menu and the title screen (vanilla's Options, Video Settings, Controls, Create World). Vanilla's look there: its stone buttons, checkbox, tab and slot sprites, white text with a shadow, its separators and darker list background, over the blurred world or the panorama.
Renamed in 7.3.0
The looks wereOPTIONS (now DEFAULT) and CONTAINER (now
PANEL). The old names stay until 8.0.0 as deprecated aliases: static
fields holding the same two constants, so a mod built against 7.2.0 keeps working,
and ScreenKind.OPTIONS == ScreenKind.DEFAULT. They are not enum constants:
values() lists only the two looks, and a switch names the new ones.
Where the look comes from (of(Screen))
- A panel injected into a vanilla screen: the host knows. A vanilla
AbstractContainerScreenhas the Panel look, any other vanilla screen the Default look, so a panel on Controls gets the Default look with no code. - An anchor's panels: the look of the screen the anchor is on.
- A standalone
MKScreen: the look it declared when it was created (super(title, ScreenKind.DEFAULT, panels)),PANELwhen it declared none, which is how every standalone screen looked before 6.1.0. - The HUD:
PANEL, the look it has always had. - A dialog or overlay follows the screen it opens on, since it is a panel on
that screen; so does the dialog an
ItemPickeropens.
What the look changes
Drawing only, never size or behavior: a panel's background, every control's sprite and every text color. A piece with no vanilla twin (a radio button, a color swatch, an info box, a consumer's own sprite) keeps MenuKit's drawing in both looks; only its text follows the look.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ScreenKindDeprecated, for removal: This API element is subject to removal in a future version.static final ScreenKindDeprecated, for removal: This API element is subject to removal in a future version.RenamedDEFAULTin 7.3.0; removed in 8.0.0. -
Method Summary
Modifier and TypeMethodDescriptionstatic ScreenKindof(@Nullable net.minecraft.client.gui.screens.Screen screen) The look ofscreen.intThe color of text inrolein this look.booleanWhether text in this look has a drop shadow: the Default look's does (vanilla's menu text), the Panel look's does not (vanilla's container labels).static ScreenKindReturns the enum constant of this class with the specified name.static ScreenKind[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PANEL
The Panel look: inventories, chests, anything built onAbstractContainerScreen. MenuKit's gray. -
DEFAULT
The Default look: vanilla's Options, Controls, Create World and the like. The pause-menu look.
-
-
Field Details
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
of
-
textShadow
public boolean textShadow()Whether text in this look has a drop shadow: the Default look's does (vanilla's menu text), the Panel look's does not (vanilla's container labels).
-
PANELin 7.3.0; removed in 8.0.0.