Skip to content

Commit

Permalink
Arrow render fixes (#141)
Browse files Browse the repository at this point in the history
* 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. ^^
  • Loading branch information
SubordinalBlue authored Nov 22, 2023
1 parent a02f4aa commit 74cc6b9
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 74cc6b9

Please sign in to comment.