From 0cbee3cdb91b9b6c419f85e71fcc93eaba748200 Mon Sep 17 00:00:00 2001 From: Kam Date: Sun, 16 Mar 2025 04:10:33 -0400 Subject: [PATCH] =?UTF-8?q?This=20the=20best=20i=20can=20make=20it=20for?= =?UTF-8?q?=20now=20=F0=9F=8E=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../npcs/client/gui/GuiMagicCycleMap.java | 1 + .../npcs/client/gui/util/GuiDiagram.java | 19 ++++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/src/main/java/noppes/npcs/client/gui/GuiMagicCycleMap.java b/src/main/java/noppes/npcs/client/gui/GuiMagicCycleMap.java index 814157302..006b30000 100644 --- a/src/main/java/noppes/npcs/client/gui/GuiMagicCycleMap.java +++ b/src/main/java/noppes/npcs/client/gui/GuiMagicCycleMap.java @@ -54,6 +54,7 @@ public class GuiMagicCycleMap extends GuiDiagram { // Use the cycle's layout if set; otherwise default to CIRCULAR_MANUAL. setLayout(cycle.layout != null ? cycle.layout : EnumDiagramLayout.CIRCULAR_MANUAL); + setLayout(EnumDiagramLayout.CIRCULAR_MANUAL); setCurvedArrows(true); setCurveAngle(-20); invalidateCache(); diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiDiagram.java b/src/main/java/noppes/npcs/client/gui/util/GuiDiagram.java index 03a49df18..69a9a264a 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiDiagram.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiDiagram.java @@ -20,11 +20,6 @@ import java.util.*; * This revised version ensures that non‑Chart layouts use the full diagram bounds for positioning * and that curved arrow drawing selects the best control point (using both curveAngle and its negative) * to avoid icons. - * - * Changes for separate two‑way connections (when allowTwoWay is false): - * - When a reverse connection is found, the line is drawn with a slight perpendicular offset. - * - The hit detection uses the same offset endpoints. - * - Arrow head placement is adjusted to match the offset. */ public abstract class GuiDiagram extends Gui { @@ -658,10 +653,8 @@ public abstract class GuiDiagram extends Gui { */ protected void drawConnectionLine(int x1, int y1, int x2, int y2, DiagramConnection conn, boolean dim) { DiagramConnection reverse = getConnectionByIds(conn.idTo, conn.idFrom); - if (allowTwoWay && reverse != null) { - DiagramIcon iconFrom = getIconById(conn.idFrom); - DiagramIcon iconTo = getIconById(conn.idTo); - if (iconFrom != null && iconTo != null && iconFrom.index > iconTo.index) { + if (!allowTwoWay && reverse != null) { + if (x1 > x2 || (x1 == x2 && y1 > y2)) { return; } } @@ -853,12 +846,8 @@ public abstract class GuiDiagram extends Gui { // Fixed drawArrowHead: protected void drawArrowHead(int x1, int y1, int x2, int y2, DiagramConnection conn, boolean dim) { DiagramConnection reverse = getConnectionByIds(conn.idFrom, conn.idTo); - // For merging two-way connections (when allowTwoWay is true), - // decide which arrow head to draw using the associated icon's index. - if (allowTwoWay && reverse != null) { - DiagramIcon iconFrom = getIconById(conn.idFrom); - DiagramIcon iconTo = getIconById(conn.idTo); - if (iconFrom != null && iconTo != null && iconFrom.index > iconTo.index) { + if (!allowTwoWay && reverse != null) { + if (x1 > x2 || (x1 == x2 && y1 > y2)) { return; } }