[config-ui-tiny] highlight hovered entry

This commit is contained in:
Johannes Frohnmeyer 2023-03-18 12:10:16 +01:00
parent 2a7ad29431
commit 2607253458
Signed by: Johannes
GPG Key ID: E76429612C2929F4
1 changed files with 9 additions and 0 deletions

View File

@ -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);