Styles & Definitions
Tooltip Styles
Style files simply combine elements to define the visual appearance of a tooltip.
{
"panel": "obscure_tooltips:default",
"frame": "obscure_tooltips:default",
"slot": "obscure_tooltips:default",
"icon": "obscure_tooltips:default",
"effects": []
}
Note that all fields except
effectsare optional. Theeffectsarray must always be included, even if it is empty.
Tooltip Definitions
Definition files determine which items a style should apply to, based on the specified filter. In the example below, the style located at assets/obscure_tooltips/tooltips/style/default.json will be applied to all items:
{
"priority": 0,
"style": "obscure_tooltips:default",
"filter": {
"type": "obscure_tooltips:always"
}
}
The priority field is used in the style merging system.
Style Merging (Fallback)
A key feature of Obscure Tooltips is the style merging system. When an item matches multiple Definition files, the styles from these definitions are combined according to the following rules:
- The style with the highest priority becomes the base.
- Any empty fields (i.e., Optional elements not defined) in this base style are filled in from the next style in priority. This process continues through all matching styles, in order of priority.
- The effect lists from all styles are merged together.
Why is this useful?
Suppose you create a default.json definition with minimal priority, fill in all style elements (panel, frame, slots, icons, etc.), and set its filter to obscure_tooltips:always. This style will apply to all items by default.
Next, you create an enchanted.json definition for enchanted items, assign a style with a fancy frame and glow effects, but leave other elements (like the panel) empty. You set a higher priority and a filter for enchanted items only.
Now:
- All items will use
default.jsonas their base style. - Enchanted items will override the base frame and gain the additional glow effect from
enchanted.json. - Any undefined style fields in
enchanted.jsonwill fall back to the corresponding fields indefault.json.
This system allows you to layer styles, avoid repetition, and easily create complex tooltip designs that automatically adapt to different item types.