From 74cc6b9eb4c3a53c546ba1b3ec0ee6ba78041ba6 Mon Sep 17 00:00:00 2001 From: Dietrich Friday Date: Wed, 22 Nov 2023 09:36:45 +0900 Subject: [PATCH] Arrow render fixes (#141) * Raise alpha values on arrows for better visibility * Fix hover test for drawing arrows. Width and Height of quest icon were not accounted for. Bad smell: Used hard-coded width and height of quest bounding box * Broke conditinal across lines for readability Followed Google's Java Style Guide; unsure if that's apropos for this project. Real coders, apparently, never soft-wrap... or so I've been told. ^^ --- .../heracles/client/screens/quests/QuestsWidget.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/earth/terrarium/heracles/client/screens/quests/QuestsWidget.java b/common/src/main/java/earth/terrarium/heracles/client/screens/quests/QuestsWidget.java index c7ff6ba2..065c0ac4 100644 --- a/common/src/main/java/earth/terrarium/heracles/client/screens/quests/QuestsWidget.java +++ b/common/src/main/java/earth/terrarium/heracles/client/screens/quests/QuestsWidget.java @@ -214,9 +214,13 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float partialTi for (ClientQuests.QuestEntry entry : this.entries) { var position = entry.value().display().position(this.group); - boolean isHovered = isMouseOver(mouseX, mouseY) && mouseX >= x + offset.x() + position.x() && mouseX <= x + offset.x() + position.x() && mouseY >= y + offset.y() + position.y() && mouseY <= y + offset.y() + position.y(); + boolean isHovered = isMouseOver(mouseX, mouseY) && + mouseX >= x + offset.x() + position.x() && + mouseX <= x + offset.x() + position.x() + 32 && + mouseY >= y + offset.y() + position.y() && + mouseY <= y + offset.y() + position.y() + 32; - RenderSystem.setShaderColor(0.9F, 0.9F, 0.9F, isHovered ? 0.45f : 0.25F); + RenderSystem.setShaderColor(0.9F, 0.9F, 0.9F, isHovered ? 0.8f : 0.4F); for (ClientQuests.QuestEntry child : entry.children()) { if (!child.value().display().groups().containsKey(this.group)) continue;