YetAnotherConfigLib

YetAnotherConfigLib

13M Downloads

Current category button does not appear as "selected"

Qendolin opened this issue ยท 1 comments

commented

What should happen?

When selecting a category the button should appear as selected (have a white outline).

What actually happens

The category buttons work like any other button, making it hard to tell wich category is currently selected.

Solution

I think the problem is this function:

@Override
protected int getTextureY() {
int i = 1;
if (!this.active) {
i = 0;
} else if (this.isHoveredOrFocused() || isCurrentCategory()) {
i = 2;
}
return 46 + i * 20;
}

It doesn't get called, (or I just couldn't get the debugger to stop there). This is probably because getTextureY is declared as private in PressableWidget (yarn mappings). This might have changed in a recent Minecraft version.

Environment

Minecraft Fabric 1.19.4
YACL 2.5.1+1.19.4

commented

Thank you for taking the time to debug this. YACL 3.x will no longer have this problem. So I'll close as won't fix.