Class AbstractConfigScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
fr.rodofire.ewc.client.gui.screen.BackgroundScreen
fr.rodofire.ewc.config.client.AbstractConfigScreen
All Implemented Interfaces:
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
Direct Known Subclasses:
DefaultConfigScreen

public abstract class AbstractConfigScreen extends BackgroundScreen
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final com.google.common.collect.BiMap<String,Integer>
     
    protected final String
     
    protected int
     

    Fields inherited from class fr.rodofire.ewc.client.gui.screen.BackgroundScreen

    TEXTURE

    Fields inherited from class net.minecraft.client.gui.screens.Screen

    CUBE_MAP, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, PANORAMA, renderables, screenExecutor, title, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
     
    AbstractConfigScreen(net.minecraft.resources.ResourceLocation background, int backgroundWidth, int backgroundHeight, int backgroundShaderColor, ModClientConfig config, String modId)
     
     
    AbstractConfigScreen(net.minecraft.resources.ResourceLocation background, int backgroundWidth, int backgroundHeight, ModClientConfig config, String modId)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    addInfoButton(int startX, int yOffset, T obj)
     
    addResetButton(int startX, int yOffset, T obj)
     
    protected boolean
     
    void
    cycleEnum(EnumConfigObject configObject, net.minecraft.client.gui.components.Button button)
    method to change the actual value of an enum to the next value
     
    protected boolean
     
    protected void
     
    protected abstract void
    init(ConfigCategory category)
     
    protected void
    this saves the config
    protected boolean
    method to know if the game should restart in the case one or many config got changed that requires the game to restart
    protected void
    toggleBoolean(BooleanConfigObject configObject, net.minecraft.client.gui.components.Button button)
     
    protected void
    Method to verify that the input is an integer and manage the addition of "-".

    Methods inherited from class fr.rodofire.ewc.client.gui.screen.BackgroundScreen

    render, renderBackground, renderBackgroundTexture, renderDarkRectangle, renderOverBackground

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, changeFocus, children, clearFocus, clearTooltipForNextRenderPass, clearWidgets, findNarratableWidget, getBackgroundMusic, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleComponentClicked, handleDelayedNarration, hasAltDown, hasControlDown, hasShiftDown, init, insertText, isCopy, isCut, isMouseOver, isPaste, isPauseScreen, isSelectAll, isValidCharacterForName, keyPressed, onClose, onFilesDrop, rebuildWidgets, removed, removeWidget, renderBlurredBackground, renderMenuBackground, renderMenuBackground, renderMenuBackgroundTexture, renderPanorama, renderTransparentBackground, renderWithTooltip, repositionElements, resize, setInitialFocus, setInitialFocus, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, setTooltipForNextRenderPass, shouldCloseOnEsc, shouldNarrateNavigation, tick, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    mouseMoved

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

    • selected

      protected int selected
    • modId

      protected final String modId
    • indexes

      protected final com.google.common.collect.BiMap<String,Integer> indexes
  • Constructor Details

    • AbstractConfigScreen

      protected AbstractConfigScreen(ModClientConfig config, String modId)
    • AbstractConfigScreen

      public AbstractConfigScreen(net.minecraft.resources.ResourceLocation background, int backgroundWidth, int backgroundHeight, ModClientConfig config, String modId)
    • AbstractConfigScreen

      public AbstractConfigScreen(net.minecraft.resources.ResourceLocation background, int backgroundWidth, int backgroundHeight, int backgroundShaderColor, ModClientConfig config, String modId)
  • Method Details

    • init

      protected void init()
      Overrides:
      init in class net.minecraft.client.gui.screens.Screen
    • init

      protected abstract void init(ConfigCategory category)
    • addResetButton

      public <T extends AbstractConfigObject<U>, U> ImageButtonWidget addResetButton(int startX, int yOffset, T obj)
    • addInfoButton

      public <T extends AbstractInfoScreen> InfoButtonWidget addInfoButton(int startX, int yOffset, T obj)
    • hasInfoScreen

      protected boolean hasInfoScreen(AbstractConfigObject<?> category)
    • getInfoScreen

      protected AbstractInfoScreen getInfoScreen(AbstractConfigObject<?> category)
    • toggleBoolean

      protected void toggleBoolean(BooleanConfigObject configObject, net.minecraft.client.gui.components.Button button)
    • cycleEnum

      public void cycleEnum(EnumConfigObject configObject, net.minecraft.client.gui.components.Button button)
      method to change the actual value of an enum to the next value
      Parameters:
      configObject - the enum that will be cycled
      button - the button on which the enum appears
    • verifyInteger

      protected void verifyInteger(IntegerConfigObject configObject, AbstractEntryWidget button, String cgr)
      Method to verify that the input is an integer and manage the addition of "-". It also manage the color of the text
      Parameters:
      configObject - the config object that will be verified
      button - the entry that is used
      cgr - the text
    • configEquals

      protected boolean configEquals()
    • saveConfig

      protected void saveConfig()
      this saves the config
    • shouldRestart

      protected boolean shouldRestart()
      method to know if the game should restart in the case one or many config got changed that requires the game to restart
      Returns:
      • true if the game should restart
      • false if not