Class AbstractMcbsGoalEditScreen<G extends McbsGoal>
java.lang.Object
com.thecsdev.common.scene.Node<com.thecsdev.commonmc.api.client.gui.TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.screen.TScreen
com.thecsdev.commonmc.api.client.gui.screen.TScreenPlus
com.thecsdev.betterstats.api.client.gui.screen.AbstractMcbsGoalEditScreen<G>
- All Implemented Interfaces:
com.thecsdev.common.scene.INode<com.thecsdev.commonmc.api.client.gui.TElement>, com.thecsdev.common.scene.INodeBounded<com.thecsdev.commonmc.api.client.gui.TElement, com.thecsdev.common.math.Bounds2i>, com.thecsdev.common.scene.INodeRenderable<com.thecsdev.commonmc.api.client.gui.TElement, com.thecsdev.commonmc.api.client.gui.render.TGuiGraphics>, com.thecsdev.commonmc.api.client.gui.screen.ILastScreenProvider, Iterable<com.thecsdev.commonmc.api.client.gui.TElement>, Collection<com.thecsdev.commonmc.api.client.gui.TElement>
- Direct Known Subclasses:
McbsSivGoalEditScreen
@Environment(CLIENT)
public abstract class AbstractMcbsGoalEditScreen<G extends McbsGoal>
extends com.thecsdev.commonmc.api.client.gui.screen.TScreenPlus
implements com.thecsdev.commonmc.api.client.gui.screen.ILastScreenProvider
Abstract
TScreen implementation that provides a template for
constructing McbsGoal editing interfaces.-
Field Summary
Fields inherited from class com.thecsdev.commonmc.api.client.gui.TElement
eInitialized -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMcbsGoalEditScreen(@Nullable net.minecraft.client.gui.screens.Screen lastScreen, @NotNull McbsEditorFileTab editorTab, G goal) Constructs an instance of this screen. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidApplies changes by replacing theMcbsEditorFileTab's existinggetGoal()instance with thegetPreviewGoal()instance.protected final @NotNull McbsEditorFileTabReturns theMcbsEditorFileTabthat the user used to open thisMcbsGoalediting interface.protected final GgetGoal()Returns the originalMcbsGoalinstance contained by thegetEditorTab(), that will eventually be replaced onceapplyChanges()is called.protected final @NotNull net.minecraft.resources.Identifierfinal @Nullable net.minecraft.client.gui.screens.Screenprotected final GReturns theMcbsGoalthis interface edits.protected final voidprotected abstract voidinitGoalEditorGui(@NotNull com.thecsdev.commonmc.api.client.gui.TElement body) Initializes GUI interface for editing thegetPreviewGoal(), to a givenTElementthat acts as the baseline "body".final booleanfinal voidRefreshes the goal preview interface.Methods inherited from class com.thecsdev.commonmc.api.client.gui.screen.TScreenPlus
inputCallbackMethods inherited from class com.thecsdev.commonmc.api.client.gui.screen.TScreen
close, closeCallback, createWrapperScreen, focusedElementProperty, getAsScreen, getClient, hoveredElementProperty, isOpen, isPauseScreen, openCallback, sendInput, titlePropertyMethods inherited from class com.thecsdev.commonmc.api.client.gui.TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, postRenderCallback, removeRel, renderCallback, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, tooltipProperty, toString, visiblePropertyMethods inherited from class com.thecsdev.common.scene.Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Constructor Details
-
AbstractMcbsGoalEditScreen
public AbstractMcbsGoalEditScreen(@Nullable @Nullable net.minecraft.client.gui.screens.Screen lastScreen, @NotNull @NotNull McbsEditorFileTab editorTab, @NotNull G goal) throws NoSuchElementException, IllegalStateException Constructs an instance of this screen.- Parameters:
lastScreen- TheScreenthat came before this one.editorTab- TheMcbsEditorFileTabwhere theMcbsGoalis from.goal- TheMcbsGoalcontained within theMcbsEditorFileTab.- Throws:
NoSuchElementException- IfMcbsEditorFileTabdoes not contain theMcbsGoal.IllegalStateException- IfMcbsGoal.clone()fails to clone the goal.
-
-
Method Details
-
getEditorTab
Returns theMcbsEditorFileTabthat the user used to open thisMcbsGoalediting interface.Important note:
Unless there is a good reason for it; Avoid making any changes to the tab or its underlying data, for any reason. Intended for reading purposes only. -
getGoalID
@NotNull protected final @NotNull net.minecraft.resources.Identifier getGoalID() -
getGoal
Returns the originalMcbsGoalinstance contained by thegetEditorTab(), that will eventually be replaced onceapplyChanges()is called.Important note:
Not intended to be modified. For reading purposes only. Please modifygetPreviewGoal()instead, and then callapplyChanges(). This object is solely for accessing original property values. -
getPreviewGoal
-
isAllowingInGameHud
public final boolean isAllowingInGameHud()- Overrides:
isAllowingInGameHudin classcom.thecsdev.commonmc.api.client.gui.screen.TScreen
-
getLastScreen
@Nullable public final @Nullable net.minecraft.client.gui.screens.Screen getLastScreen()- Specified by:
getLastScreenin interfacecom.thecsdev.commonmc.api.client.gui.screen.ILastScreenProvider
-
initCallback
protected final void initCallback()- Specified by:
initCallbackin classcom.thecsdev.commonmc.api.client.gui.screen.TScreen
-
initGoalEditorGui
protected abstract void initGoalEditorGui(@NotNull @NotNull com.thecsdev.commonmc.api.client.gui.TElement body) Initializes GUI interface for editing thegetPreviewGoal(), to a givenTElementthat acts as the baseline "body".- Parameters:
body- TheTElementwhere the editing iterface is to be placed.
-
applyChanges
public final void applyChanges()Applies changes by replacing theMcbsEditorFileTab's existinggetGoal()instance with thegetPreviewGoal()instance. Then, a new preview instance is generated here to allow further editing. -
refreshPreview
public final void refreshPreview()Refreshes the goal preview interface. Call this whenever changes are made togetPreviewGoal().
-