[config-ui-tiny] highlight hovered entry
This commit is contained in:
parent
2a7ad29431
commit
2607253458
|
@ -65,6 +65,12 @@ public class EntryListWidget extends ElementListWidget<EntryListWidget.ConfigEnt
|
|||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public abstract static class ConfigEntry extends Entry<ConfigEntry> {
|
||||
@Override
|
||||
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
|
||||
if (hovered) {
|
||||
fill(matrices, x, y, x + entryWidth, y + entryHeight, 0x24FFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
|
@ -90,6 +96,7 @@ public class EntryListWidget extends ElementListWidget<EntryListWidget.ConfigEnt
|
|||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
|
||||
super.render(matrices, index, y, x, entryWidth, entryHeight, mouseX, mouseY, hovered, tickDelta);
|
||||
button.setY(y);
|
||||
button.render(matrices, mouseX, mouseY, tickDelta);
|
||||
}
|
||||
|
@ -112,6 +119,7 @@ public class EntryListWidget extends ElementListWidget<EntryListWidget.ConfigEnt
|
|||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
|
||||
super.render(matrices, index, y, x, entryWidth, entryHeight, mouseX, mouseY, hovered, tickDelta);
|
||||
button.setY(y);
|
||||
button.render(matrices, mouseX, mouseY, tickDelta);
|
||||
drawTextWithShadow(matrices,textRenderer, text,12,y+5,0xFFFFFF);
|
||||
|
@ -151,6 +159,7 @@ public class EntryListWidget extends ElementListWidget<EntryListWidget.ConfigEnt
|
|||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean hovered, float tickDelta) {
|
||||
super.render(matrices, index, y, x, entryWidth, entryHeight, mouseX, mouseY, hovered, tickDelta);
|
||||
drawTextWithShadow(matrices,textRenderer, text,12,y+5,0xFFFFFF);
|
||||
if (resetVisible.getAsBoolean()) {
|
||||
resetButton.setY(y);
|
||||
|
|
Loading…
Reference in New Issue