Page 1 of 1

[2.0.69] Revisit label prototypes for parent hovered color (core)

Posted: Wed Oct 22, 2025 7:32 am
by TBC_x
I'm implementing custom inventory GUI and the inherited style of count_label sets parent_hovered_font_color to black (also game_controller_hovered_font_color), which turns my item counts black. That attribute is inherited by every single label style

parent_hovered_font_color beats hovered_font_color

The only workaround is to split the tree up
from:

Code: Select all

button (inventory_slot)
├── sprite
├── request_count (count_label)
└── item_count (count_label)
to:

Code: Select all

container
├── button (inventory_slot)
│   └── sprite
└── count_container
    ├── request_count (count_label)
    └── item_count (count_label)
But this solution is off by a pixel on certain UI scales and unnecessarily complex to implement
I would add a custom label prototype, but I'm doing this for a scenario
inventory-item.png
inventory-item.png (4.62 KiB) Viewed 241 times
The gui above:

Code: Select all

container
├── button (inventory_slot)
│   ├── sprite
│   └── fake_count (count_label)
└── count_container
    ├── request_count (count_label)
    └── item_count (count_label)

Re: [2.0.69] Revisit label prototypes for parent hovered color (core)

Posted: Wed Oct 22, 2025 12:27 pm
by Klonan
I guess this request can boil down to:

Expose a LuaStyle::parent_hovered_font_color which is similar to the already existing LuaStyle::font_color

Also maybe a shot in the dark, have you tried putting the count inside a rich text tag that sets the color you want? I think think it might make it immune to the parent hovered font color

Re: [2.0.69] Revisit label prototypes for parent hovered color (core)

Posted: Wed Oct 22, 2025 6:59 pm
by TBC_x
Rich text is an acceptable workaround, that actually works