Theme.json
theme.json defines the visual theme for a book. It is placed in /data/<mod_id>/modonomicon/books/<book_id>/theme.json.
If this file is missing, Modonomicon uses the default theme.
Attributes
id (Identifier, optional)
Default value: modonomicon:default.
This is the theme id. It controls where themed sprite files are looked up.
For a theme id like yourmod:eldritch, Modonomicon looks for theme files in:
/assets/yourmod/textures/gui/sprites/modonomicon/themes/eldritch/
If the id path contains folders, those folders are preserved.
type (Identifier, optional)
Default value: modonomicon:default.
This is the theme type (or theme class id). It selects the Java theme implementation from the theme registry.
Use modonomicon:default for normal sprite-based custom themes.
See below Advanced: Custom theme types for using custom theme types.
layout (JSON Object, optional)
Controls layout offsets and icon scale.
book_text_offset_x (Integer, optional)
Default value: 0.
Adds a left text offset.
book_text_offset_y (Integer, optional)
Default value: 0.
Adds a top text offset.
book_text_offset_width (Integer, optional)
Default value: 0.
Adjusts available text width.
Negative values reduce width.
book_text_offset_height (Integer, optional)
Default value: 0.
Adjusts available text height.
Negative values reduce height.
index_text_offset_x (Integer, optional)
Default value: 0.
Adds a left index screen text offset.
index_text_offset_y (Integer, optional)
Default value: 0.
Adds a top index screen text offset.
index_text_offset_width (Integer, optional)
Default value: 0.
Adjusts available index screen text width.
Negative values reduce width.
index_text_offset_height (Integer, optional)
Default value: 0.
Adjusts available index screen text height.
Negative values reduce height.
category_button_x_offset (Integer, optional)
Default value: 0.
Moves category buttons horizontally.
category_button_y_offset (Integer, optional)
Default value: 0.
Moves category buttons vertically.
search_button_x_offset (Integer, optional)
Default value: 0.
Moves the search button horizontally.
search_button_y_offset (Integer, optional)
Default value: 0.
Moves the search button vertically.
read_all_button_y_offset (Integer, optional)
Default value: 0.
Moves the read-all button vertically.
category_button_icon_scale (Float, optional)
Default value: 1.0.
Scales category icons.
content (JSON Object, optional)
Controls theme content sprites.
default_category_button_sprite (Sprite JSON Object, optional)
Overrides the default sprite used for category buttons when a category does not provide its own category_button_sprite.
The sprite JSON object uses the normal sprite structure:
sprite(Identifier, mandatory)width(Integer, optional)height(Integer, optional)
marker_indicator (Sprite JSON Object, optional)
Overrides the default marker indicator sprite: the small attention dot shown on entries with an unfulfilled marker_condition.
If omitted, the built-in orange dot (content/indicators/book/marker_indicator.png of the default theme) is used.
Uses the same sprite structure as default_category_button_sprite above.
Custom themes can also override the file content/indicators/book/marker_indicator.png under their theme folder instead.
Datagen: BookThemeContentModel#withMarkerIndicator(...).
Entry tab and tab page sprites
The entry tab sprites are not set in theme.json. Custom themes override them by providing the texture with the same relative path under their theme folder, the same way as the marker indicator. Any part that is missing falls back to the default theme.
| Relative path (default theme) | Size | Used for |
|---|---|---|
content/buttons/entry_tab/entry_tab_right.png | 32x18 | Entry tab on the right edge |
content/buttons/entry_tab/entry_tab_left.png | 32x18 | Entry tab on the left edge |
content/buttons/entry_tab/entry_tab_right_active.png | 32x18 | Right entry tab while its tab page is open |
content/buttons/entry_tab/entry_tab_left_active.png | 32x18 | Left entry tab while its tab page is open |
content/backgrounds/book/tab_page_background.png | 145x178 | Background of the tab page shown over the book |
content/buttons/entry_tab/tab_close_button_normal.png and tab_close_button_hover.png | 12x12 | Close button of the tab page |
See Partial overrides are supported for how overrides work.
palette (JSON Object, optional)
Controls theme colors.
default_title_color (Integer, optional)
Default value: -16777216.
The default title color used by the active theme.
default_text_color (Integer, optional)
Default value: -16777216.
The default text color used by the active theme.
tab_overlay_dim_color (Integer, optional)
Default value: 1610612736 (0x60000000).
The color (ARGB) that dims the book while an entry tab page is shown over it. Use an alpha of 0 to disable the dimming.
Datagen: BookThemePaletteModel#withTabOverlayDimColor(...).
These are Java integer color values. Generated JSON commonly uses signed decimal values such as -16777216 for black.
node (JSON Object, optional)
Controls how node-screen entry connections are rendered.
connection_renderer (String, optional)
Default value: "sprite".
Selects which renderer should be used for node-screen connections.
Valid values:
sprite— the default routed sprite-based connection rendererdirect— the direct line renderer
direct_connections (JSON Object, optional)
Configures the direct line renderer.
width (Float, optional)
Default value: 2.25.
Sets the line width used by direct connections.
opacity (Float, optional)
Default value: 1.0.
Multiplies the alpha of direct connections after their state color is chosen.
brightness (Float, optional)
Default value: 1.75.
Multiplies the RGB intensity of direct connections to improve visibility on darker backgrounds.
oscillation (Boolean, optional)
Default value: true.
Enables the animated offset effect for unsettled direct connections.
oscillation_amplitude (Float, optional)
Default value: 5.0.
Controls the peak pixel offset used by the animated offset effect.