Class ScreenUtils
java.lang.Object
com.hammy275.immersivemc.client.config.screen.ScreenUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addOption
(String keyName, Function<ActiveConfig, Boolean> valueGetter, BiConsumer<ActiveConfig, Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list) static void
addOptionIfClient
(String keyName, Function<ClientActiveConfig, Boolean> valueGetter, BiConsumer<ClientActiveConfig, Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list) static void
addOptionIfModLoaded
(String modId, String keyName, Function<ActiveConfig, Boolean> valueGetter, BiConsumer<ActiveConfig, Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list) static net.minecraft.client.gui.components.Button
createButton
(int x, int y, int width, int height, String translationString, String tooltipTranslationString, Consumer<net.minecraft.client.gui.components.Button> clickHandler) static net.minecraft.client.gui.components.Button
createButton
(int x, int y, int width, int height, String translationString, Consumer<net.minecraft.client.gui.components.Button> clickHandler) static net.minecraft.client.gui.components.Button
createDoneButton
(int x, int y, int width, int height, net.minecraft.client.gui.screens.Screen currentScreen) static <E extends Enum<E>>
net.minecraft.client.OptionInstance<E>createEnumOption
(Class<E> enumClass, String titleTranslationKey, Function<E, net.minecraft.network.chat.Component> displayTextCreator, Function<E, net.minecraft.network.chat.Component> tooltipTextCreator, Supplier<E> valueGetter, BiConsumer<Integer, E> valueSetter) static net.minecraft.client.OptionInstance<Integer>
createIntSlider
(String titleTranslationKey, Function<Integer, net.minecraft.network.chat.Component> displayTextCreator, int minValue, int maxValue, Supplier<Integer> valueGetter, Consumer<Integer> valueSetter) static net.minecraft.client.OptionInstance<Boolean>
createOption
(String keyName, @Nullable net.minecraft.network.chat.Component tooltip, Supplier<Boolean> getter, Consumer<Boolean> setter) static net.minecraft.client.OptionInstance<Boolean>
createOption
(String keyName, Function<ActiveConfig, Boolean> valueGetter, BiConsumer<ActiveConfig, Boolean> valueSetter) static net.minecraft.client.gui.components.Button
createScreenButton
(int x, int y, int width, int height, String translationString, net.minecraft.client.gui.screens.Screen screen) static boolean
mouseInBox
(int mouseX, int mouseY, int leftX, int bottomY, int rightX, int topY)
-
Constructor Details
-
ScreenUtils
public ScreenUtils()
-
-
Method Details
-
createIntSlider
-
createOption
public static net.minecraft.client.OptionInstance<Boolean> createOption(String keyName, Function<ActiveConfig, Boolean> valueGetter, BiConsumer<ActiveConfig, Boolean> valueSetter) -
createOption
-
createEnumOption
public static <E extends Enum<E>> net.minecraft.client.OptionInstance<E> createEnumOption(Class<E> enumClass, String titleTranslationKey, Function<E, net.minecraft.network.chat.Component> displayTextCreator, Function<E, net.minecraft.network.chat.Component> tooltipTextCreator, Supplier<E> valueGetter, BiConsumer<Integer, E> valueSetter) -
createScreenButton
public static net.minecraft.client.gui.components.Button createScreenButton(int x, int y, int width, int height, String translationString, net.minecraft.client.gui.screens.Screen screen) -
createDoneButton
public static net.minecraft.client.gui.components.Button createDoneButton(int x, int y, int width, int height, net.minecraft.client.gui.screens.Screen currentScreen) -
createButton
-
createButton
-
addOptionIfModLoaded
public static void addOptionIfModLoaded(String modId, String keyName, Function<ActiveConfig, Boolean> valueGetter, BiConsumer<ActiveConfig, Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list) -
addOption
public static void addOption(String keyName, Function<ActiveConfig, Boolean> valueGetter, BiConsumer<ActiveConfig, Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list) -
addOptionIfClient
public static void addOptionIfClient(String keyName, Function<ClientActiveConfig, Boolean> valueGetter, BiConsumer<ClientActiveConfig, Boolean> valueSetter, net.minecraft.client.gui.components.OptionsList list) -
mouseInBox
public static boolean mouseInBox(int mouseX, int mouseY, int leftX, int bottomY, int rightX, int topY)
-