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

    Constructors
    Constructor
    Description
    AbstractMcbsGoalEditScreen(@Nullable net.minecraft.client.gui.screens.Screen lastScreen, @NotNull McbsEditorFileTab editorTab, G goal)
    Constructs an instance of this screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Applies changes by replacing the McbsEditorFileTab's existing getGoal() instance with the getPreviewGoal() instance.
    protected final @NotNull McbsEditorFileTab
    Returns the McbsEditorFileTab that the user used to open this McbsGoal editing interface.
    protected final G
    Returns the original McbsGoal instance contained by the getEditorTab(), that will eventually be replaced once applyChanges() is called.
    protected final @NotNull net.minecraft.resources.Identifier
    Returns the McbsGoal's Identifier that is used when applying changes via applyChanges().
    final @Nullable net.minecraft.client.gui.screens.Screen
     
    protected final G
    Returns the McbsGoal this interface edits.
    protected final void
     
    protected abstract void
    initGoalEditorGui(@NotNull com.thecsdev.commonmc.api.client.gui.TElement body)
    Initializes GUI interface for editing the getPreviewGoal(), to a given TElement that acts as the baseline "body".
    final boolean
     
    final void
    Refreshes the goal preview interface.

    Methods inherited from class com.thecsdev.commonmc.api.client.gui.screen.TScreenPlus

    inputCallback

    Methods inherited from class com.thecsdev.commonmc.api.client.gui.screen.TScreen

    close, closeCallback, createWrapperScreen, focusedElementProperty, getAsScreen, getClient, hoveredElementProperty, isOpen, isPauseScreen, openCallback, sendInput, titleProperty

    Methods 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, visibleProperty

    Methods 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

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Iterable

    forEach
  • Constructor Details

  • Method Details

    • getEditorTab

      @NotNull protected final @NotNull McbsEditorFileTab getEditorTab()
      Returns the McbsEditorFileTab that the user used to open this McbsGoal editing 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()
      Returns the McbsGoal's Identifier that is used when applying changes via applyChanges().
    • getGoal

      @NotNull protected final G getGoal()
      Returns the original McbsGoal instance contained by the getEditorTab(), that will eventually be replaced once applyChanges() is called.

      Important note:
      Not intended to be modified. For reading purposes only. Please modify getPreviewGoal() instead, and then call applyChanges(). This object is solely for accessing original property values.

    • getPreviewGoal

      @NotNull protected final G getPreviewGoal()
      Returns the McbsGoal this interface edits. After submission, the real goal is replaced with this 'preview' one.
    • isAllowingInGameHud

      public final boolean isAllowingInGameHud()
      Overrides:
      isAllowingInGameHud in class com.thecsdev.commonmc.api.client.gui.screen.TScreen
    • getLastScreen

      @Nullable public final @Nullable net.minecraft.client.gui.screens.Screen getLastScreen()
      Specified by:
      getLastScreen in interface com.thecsdev.commonmc.api.client.gui.screen.ILastScreenProvider
    • initCallback

      protected final void initCallback()
      Specified by:
      initCallback in class com.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 the getPreviewGoal(), to a given TElement that acts as the baseline "body".
      Parameters:
      body - The TElement where the editing iterface is to be placed.
    • applyChanges

      public final void applyChanges()
      Applies changes by replacing the McbsEditorFileTab's existing getGoal() instance with the getPreviewGoal() 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 to getPreviewGoal().