Class ConfigTheme
java.lang.Object
net.ixdarklord.coolcatcore.api.config.ConfigTheme
How a mod's config screens look: its
color schemes for dark and light mode, an optional
background texture, and the icon beside the title (the mod's own icon unless set). Players pick dark or light mode
for every mod with the sun/moon button in the top bar.
Set it for all of a mod's screens (its configs, config list and pickers) with setForMod(java.lang.String, net.ixdarklord.coolcatcore.api.config.ConfigTheme), or for one config
with ConfigBuilder.theme:
ConfigTheme.setForMod("mymod", ConfigTheme.builder()
.colors(ConfigColorScheme.tinted(0xFFFF8A3D))
.background(new ResourceLocation("mymod", "textures/gui/config_background.png"))
.mode(ConfigTheme.BackgroundMode.COVER)
.textureOpacity(0.8F) // lets the panorama or world show through the texture a little
.backgroundOpacity(0.3F) // how strongly the backdrop color covers it
.effects(new ResourceLocation("mymod", "snow")) // animated effects, instead of the starfall
.build());
The texture is a full path in a resource pack (assets/mymod/textures/gui/config_background.png). Without one,
the screens are see-through: the title panorama, or the world while playing, blurred behind the panels. While a
world is open, screens show the blurred world instead, so players still see where they are.
Resource packs can restyle a mod's screens too, with assets/<modid>/coolcatlib/config_theme.json:
{
"base": "tinted", // "dark", "light" or "tinted" (the dark scheme shaded toward the accent)
"colors": { "accent": "#FF8A3D", "panel": "#C0141018" },
"light_base": "light", // the light mode's scheme: "light", "dark" or "tinted"
"light_colors": { "accent": "#D9601A" },
"icon": "mymod:textures/gui/config_icon.png", // instead of the mod's own icon
"background": "mymod:textures/gui/config_background.png",
"background_mode": "cover", // "cover", "stretch" or "tile"
"tile_size": 32,
"texture_opacity": 0.8, // the texture's own opacity, from 0 to 1
"background_opacity": 0.3, // the backdrop color over the background, from 0 to 1
"background_in_world": false,
"popup_sprite": "mymod:config/popup", // a nine-slice GUI sprite (or a .png texture path) for popup panels
"effects": ["mymod:snow"] // animated effects by id; [] for none
}
Every field is optional and overrides the mod's own theme; color names match ConfigColorScheme.Builder.
Players can scale both opacities for every mod in CoolCatLib's client config.
Effects are animations drawn behind the panels, over the whole screen, or over each widget, registered by id on the
client (ConfigEffects.register); every theme uses STARFALL unless it names its own.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow the background texture fills the screen.static final classstatic enumDark or light: each player's choice for every mod's config screens. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigThemeCoolCatLib's own look: see-through to the title panorama or the world, in CoolCatLib's logo colors.static final net.minecraft.resources.ResourceLocationThe built-in effect: soft glows in the accent and small faint stars falling, shifting with the mouse. -
Method Summary
Modifier and TypeMethodDescriptionintaccent()The dark mode's accent color, ARGB.@Nullable net.minecraft.resources.ResourceLocationThe background texture's full path, or null for the see-through background.booleanWhether the texture is drawn in a world too, instead of the blurred world.floatThe opacity of the scheme's backdrop color drawn over the background (the texture, or the blurred panorama or world), from 0 (not drawn) to 1 (hides it completely).static ConfigTheme.Builderbuilder()colors()The colors in dark mode.colors(ConfigTheme.Mode mode) The colors in a mode; players switch modes with the button in the config screens' top bar.List<net.minecraft.resources.ResourceLocation>effects()The effects drawn, by id, in order (STARFALLby default; empty for none).static ConfigThemeThe mod's theme, orDEFAULT; a resource pack'sconfig_theme.jsonis applied on top when drawn.@Nullable net.minecraft.resources.ResourceLocationicon()The icon beside the title in the top bar, or null for the mod's own icon (its logo on Forge).The colors in light mode: the ones set, or the light scheme in the dark scheme's accent.mode()@Nullable net.minecraft.resources.ResourceLocationThe GUI sprite popups (category popups, confirmations, the color picker) draw as their panel, or null for the scheme's flat panel.static voidsetForMod(String modId, ConfigTheme theme) The theme of every screen of a mod's configs that don't set their own.floatThe background texture's own opacity, from 0 to 1.inttileSize()The size one tile is drawn at, forConfigTheme.BackgroundMode.TILE; 0 for the texture's own size.
-
Field Details
-
STARFALL
public static final net.minecraft.resources.ResourceLocation STARFALLThe built-in effect: soft glows in the accent and small faint stars falling, shifting with the mouse. -
DEFAULT
CoolCatLib's own look: see-through to the title panorama or the world, in CoolCatLib's logo colors.
-
-
Method Details
-
builder
-
setForMod
The theme of every screen of a mod's configs that don't set their own. -
forMod
The mod's theme, orDEFAULT; a resource pack'sconfig_theme.jsonis applied on top when drawn. -
colors
The colors in dark mode. -
lightColors
The colors in light mode: the ones set, or the light scheme in the dark scheme's accent. -
colors
The colors in a mode; players switch modes with the button in the config screens' top bar. -
accent
public int accent()The dark mode's accent color, ARGB. -
icon
@Nullable public @Nullable net.minecraft.resources.ResourceLocation icon()The icon beside the title in the top bar, or null for the mod's own icon (its logo on Forge). -
background
@Nullable public @Nullable net.minecraft.resources.ResourceLocation background()The background texture's full path, or null for the see-through background. -
mode
-
tileSize
public int tileSize()The size one tile is drawn at, forConfigTheme.BackgroundMode.TILE; 0 for the texture's own size. -
backgroundOpacity
public float backgroundOpacity()The opacity of the scheme's backdrop color drawn over the background (the texture, or the blurred panorama or world), from 0 (not drawn) to 1 (hides it completely). It keeps the panels readable over busy backgrounds. -
textureOpacity
public float textureOpacity()The background texture's own opacity, from 0 to 1. Below 1 the blurred panorama, or the world, shows through it. -
backgroundInWorld
public boolean backgroundInWorld()Whether the texture is drawn in a world too, instead of the blurred world. -
popupSprite
@Nullable public @Nullable net.minecraft.resources.ResourceLocation popupSprite()The GUI sprite popups (category popups, confirmations, the color picker) draw as their panel, or null for the scheme's flat panel. It should be a nine-slice sprite; the title is drawn 12 pixels from its top-left corner and content starts 30 pixels down, so its top border can hold a title bar. A sprite id stands for the texturetextures/gui/sprites/<path>.png(1.20.1 has no GUI sprite atlas: its nine-slice borders are read from that texture's.mcmeta); a path ending in.pngis used as the texture itself. -
effects
The effects drawn, by id, in order (STARFALLby default; empty for none). -
toBuilder
-