Class ConfigScreens

java.lang.Object
net.ixdarklord.coolcatcore.api.config.client.ConfigScreens

public final class ConfigScreens extends Object
Client only: the generated config screens. On NeoForge every mod with a config gets its screen in the mod list automatically; elsewhere, open it from a button or key with these. /coolcatlib_client config open [mod] [category] opens them too.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable net.minecraft.client.gui.screens.Screen
    categoryPopup(@Nullable net.minecraft.client.gui.screens.Screen parent, String modId, String path)
    categoryPopup(Screen, Config, String) for a mod's config named by the path's first part, e.g.
    static net.minecraft.client.gui.screens.Screen
    categoryPopup(@Nullable net.minecraft.client.gui.screens.Screen parent, Config config, String path)
    A small window with one category of a config: a group's settings, like the full screen's, with Save and Cancel.
    static net.minecraft.client.gui.screens.Screen
    categoryPopup(@Nullable net.minecraft.client.gui.screens.Screen parent, Config config, String path, ConfigTheme theme)
    categoryPopup(Screen, Config, String) drawn with its own theme instead of the config's, e.g.
    static net.minecraft.client.gui.screens.Screen
    colorPicker(@Nullable net.minecraft.client.gui.screens.Screen parent, net.minecraft.network.chat.Component title, int color, boolean alpha, IntConsumer onDone)
    The color picker config screens use for colors, for any color a mod lets players choose.
    static @Nullable net.minecraft.client.gui.screens.Screen
    create(@Nullable net.minecraft.client.gui.screens.Screen parent, String modId)
    The main screen for a mod's configs: a card for each of them, even when there's only one.
    static net.minecraft.client.gui.screens.Screen
    create(@Nullable net.minecraft.client.gui.screens.Screen parent, Config config)
    The screen editing one config.
    static net.minecraft.client.gui.screens.Screen
    createModList(@Nullable net.minecraft.client.gui.screens.Screen parent)
    A screen listing every mod's configs.
    static boolean
     
    static void
    open(String modId)
    Opens a mod's config screen on top of the current screen.
    static void
    openCategory(String modId, String path)
    Opens categoryPopup(Screen, String, String) over the current screen, or over the game.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      @Nullable public static @Nullable net.minecraft.client.gui.screens.Screen create(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent, String modId)
      The main screen for a mod's configs: a card for each of them, even when there's only one.
      Returns:
      null when the mod registered no config
    • create

      public static net.minecraft.client.gui.screens.Screen create(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent, Config config)
      The screen editing one config.
    • categoryPopup

      public static net.minecraft.client.gui.screens.Screen categoryPopup(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent, Config config, String path)
      A small window with one category of a config: a group's settings, like the full screen's, with Save and Cancel. It floats over parent (or over the game when null). The path is the group's keys joined by / or ., e.g. "rendering/particles"; a single setting's path shows just that setting, and an empty path the whole config.
      Throws:
      IllegalArgumentException - when the config has nothing at the path
    • categoryPopup

      public static net.minecraft.client.gui.screens.Screen categoryPopup(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent, Config config, String path, ConfigTheme theme)
      categoryPopup(Screen, Config, String) drawn with its own theme instead of the config's, e.g. to match the screen it's opened from (with ConfigTheme.Builder.popupSprite for the panel).
    • categoryPopup

      @Nullable public static @Nullable net.minecraft.client.gui.screens.Screen categoryPopup(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent, String modId, String path)
      categoryPopup(Screen, Config, String) for a mod's config named by the path's first part, e.g. "client/example_category" for the example_category group of the mod's client config.
      Returns:
      null when the mod has no such config or category
    • openCategory

      public static void openCategory(String modId, String path)
      Opens categoryPopup(Screen, String, String) over the current screen, or over the game.
    • createModList

      public static net.minecraft.client.gui.screens.Screen createModList(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent)
      A screen listing every mod's configs.
    • open

      public static void open(String modId)
      Opens a mod's config screen on top of the current screen.
    • colorPicker

      public static net.minecraft.client.gui.screens.Screen colorPicker(@Nullable @Nullable net.minecraft.client.gui.screens.Screen parent, net.minecraft.network.chat.Component title, int color, boolean alpha, IntConsumer onDone)
      The color picker config screens use for colors, for any color a mod lets players choose. "Done" passes the picked color (ARGB; opaque unless alpha) to onDone, then returns to parent.
    • hasConfigs

      public static boolean hasConfigs(String modId)