Package fr.rodofire.ewc.config.client
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
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.Screen.NarratableSearchResult -
Field Summary
FieldsFields inherited from class fr.rodofire.ewc.client.gui.screen.BackgroundScreen
TEXTUREFields 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, widthFields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConfigScreen(ModClientConfig config, String modId) 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 TypeMethodDescription<T extends AbstractInfoScreen>
InfoButtonWidgetaddInfoButton(int startX, int yOffset, T obj) <T extends AbstractConfigObject<U>,U>
ImageButtonWidgetaddResetButton(int startX, int yOffset, T obj) protected booleanvoidcycleEnum(EnumConfigObject configObject, net.minecraft.client.gui.components.Button button) method to change the actual value of an enum to the next valueprotected AbstractInfoScreengetInfoScreen(AbstractConfigObject<?> category) protected booleanhasInfoScreen(AbstractConfigObject<?> category) protected voidinit()protected abstract voidinit(ConfigCategory category) protected voidthis saves the configprotected booleanmethod to know if the game should restart in the case one or many config got changed that requires the game to restartprotected voidtoggleBoolean(BooleanConfigObject configObject, net.minecraft.client.gui.components.Button button) protected voidverifyInteger(IntegerConfigObject configObject, AbstractEntryWidget button, String cgr) 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, renderOverBackgroundMethods 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, wrapScreenErrorMethods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler
charTyped, getChildAt, getCurrentFocusPath, isFocused, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, nextFocusPath, setFocusedMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
mouseMovedMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Field Details
-
selected
protected int selected -
modId
-
indexes
-
-
Constructor Details
-
AbstractConfigScreen
-
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:
initin classnet.minecraft.client.gui.screens.Screen
-
init
-
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
-
getInfoScreen
-
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 cycledbutton- 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 verifiedbutton- the entry that is usedcgr- 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
-