Klasse VFPScreen
java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
com.viaversion.viafabricplus.screen.VFPScreen
- Alle implementierten Schnittstellen:
net.minecraft.client.gui.components.events.ContainerEventHandler,net.minecraft.client.gui.components.events.GuiEventListener,net.minecraft.client.gui.components.Renderable,net.minecraft.client.gui.components.TabOrderedElement
- Bekannte direkte Unterklassen:
AcceptInvitationCodeScreen,BedrockRealmsScreen,BetaCraftScreen,ClassiCubeLoginScreen,ClassiCubeMFAScreen,ClassiCubeServerListScreen,PerServerVersionScreen,ProtocolSelectionScreen,ReportIssuesScreen,ServerListScreen,SettingsScreen
public class VFPScreen
extends net.minecraft.client.gui.screens.Screen
This class is a wrapper for the
Screen class which provides some global
functions and features used in all screens which are added by ViaFabricPlus.
Features:
- Title and subtitle system, see:
- Automatically adds a back button when set inside the constructor
- Helper functions:
Terminology:
Instead of creating the screen every time it needs to be opened, the screen is created once and hold by a static
field and later opened by calling the open(Screen) method.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult -
Feldübersicht
FelderVon Klasse geerbte Felder 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, screenExecutor, title, width -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddRefreshButton(Runnable click) net.minecraft.client.gui.screens.Screenget(net.minecraft.client.gui.screens.Screen prevScreen) Returns this screen instance after setting the previous screen.@Nullable net.minecraft.network.chat.Component@Nullable net.minecraft.client.gui.components.PlainTextButtonprotected voidinit()voidonClose()voidopen(net.minecraft.client.gui.screens.Screen prevScreen) Intended method to open a VFP screenvoidrender(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float delta) voidrenderScreenTitle(net.minecraft.client.gui.GuiGraphics context) voidrenderSubtitle(net.minecraft.client.gui.GuiGraphics context) Renders the subtitle that doesn't have a press actionvoidrenderTitle(net.minecraft.client.gui.GuiGraphics context) Renders the ViaFabricPlus titlestatic voidsetScreen(net.minecraft.client.gui.screens.Screen screen) voidSets the subtitle and the subtitle press action to the default values The default value of the subtitle is the url to the GitHub repository of VFP The default value of the subtitle press action is to open the url in a confirmation screenvoidsetupSubtitle(@Nullable net.minecraft.network.chat.Component subtitle) Sets the subtitle and the subtitle press actionvoidsetupSubtitle(@Nullable net.minecraft.network.chat.Component subtitle, net.minecraft.client.gui.components.Button.OnPress subtitlePressAction) Sets the subtitle and the subtitle press actionvoidsetupUrlSubtitle(String subtitle) Sets the subtitle and the subtitle press action to the default valuesstatic voidshowErrorScreen(net.minecraft.network.chat.Component title, Throwable throwable, net.minecraft.client.gui.screens.Screen next) Opens an error screen with a specific title and throws the given throwableprotected booleanVon Klasse geerbte Methoden net.minecraft.client.gui.screens.Screen
added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, keyPressed, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removed, removeWidget, renderBackground, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltipAndSubtitles, repositionElements, resize, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatusVon Klasse geerbte Methoden net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedVon Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitVon Schnittstelle geerbte Methoden net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedVon Schnittstelle geerbte Methoden net.minecraft.client.gui.components.events.GuiEventListener
getBorderForArrowNavigation, mouseMoved, shouldTakeFocusAfterInteractionVon Schnittstelle geerbte Methoden net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Felddetails
-
prevScreen
public net.minecraft.client.gui.screens.Screen prevScreen
-
-
Konstruktordetails
-
VFPScreen
-
VFPScreen
public VFPScreen(net.minecraft.network.chat.Component title, boolean backButton)
-
-
Methodendetails
-
setupDefaultSubtitle
public void setupDefaultSubtitle()Sets the subtitle and the subtitle press action to the default values The default value of the subtitle is the url to the GitHub repository of VFP The default value of the subtitle press action is to open the url in a confirmation screen -
setupUrlSubtitle
Sets the subtitle and the subtitle press action to the default values- Parameter:
subtitle- The subtitle which should be rendered
-
setupSubtitle
public void setupSubtitle(@Nullable @Nullable net.minecraft.network.chat.Component subtitle) Sets the subtitle and the subtitle press action- Parameter:
subtitle- The subtitle which should be rendered
-
setupSubtitle
public void setupSubtitle(@Nullable @Nullable net.minecraft.network.chat.Component subtitle, @Nullable net.minecraft.client.gui.components.Button.OnPress subtitlePressAction) Sets the subtitle and the subtitle press action- Parameter:
subtitle- The subtitle which should be renderedsubtitlePressAction- The press action which should be executed when the subtitle is clicked
-
open
public void open(net.minecraft.client.gui.screens.Screen prevScreen) Intended method to open a VFP screen- Parameter:
prevScreen- The current screen from which the VFP screen is opened
-
get
public net.minecraft.client.gui.screens.Screen get(net.minecraft.client.gui.screens.Screen prevScreen) Returns this screen instance after setting the previous screen.- Parameter:
prevScreen- The screen to return to when this screen is closed- Gibt zurück:
- This screen instance
-
setScreen
public static void setScreen(net.minecraft.client.gui.screens.Screen screen) -
init
protected void init()- Setzt außer Kraft:
initin Klassenet.minecraft.client.gui.screens.Screen
-
addRefreshButton
-
render
public void render(net.minecraft.client.gui.GuiGraphics context, int mouseX, int mouseY, float delta) - Angegeben von:
renderin Schnittstellenet.minecraft.client.gui.components.Renderable- Setzt außer Kraft:
renderin Klassenet.minecraft.client.gui.screens.Screen
-
onClose
public void onClose()- Setzt außer Kraft:
onClosein Klassenet.minecraft.client.gui.screens.Screen
-
renderTitle
public void renderTitle(net.minecraft.client.gui.GuiGraphics context) Renders the ViaFabricPlus title- Parameter:
context- The current draw context
-
renderSubtitle
public void renderSubtitle(net.minecraft.client.gui.GuiGraphics context) Renders the subtitle that doesn't have a press action- Parameter:
context- The current draw context
-
subtitleCentered
protected boolean subtitleCentered() -
renderScreenTitle
public void renderScreenTitle(net.minecraft.client.gui.GuiGraphics context) -
getSubtitle
@Nullable public @Nullable net.minecraft.network.chat.Component getSubtitle() -
getSubtitleWidget
@Nullable public @Nullable net.minecraft.client.gui.components.PlainTextButton getSubtitleWidget() -
showErrorScreen
public static void showErrorScreen(net.minecraft.network.chat.Component title, Throwable throwable, net.minecraft.client.gui.screens.Screen next) Opens an error screen with a specific title and throws the given throwable- Parameter:
title- The title of the error screenthrowable- The throwable which should be thrownnext- The screen which should be opened after the error screen is closed
-