mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 11:57:29 +00:00
Split Hover Text by New Lines
This commit is contained in:
1 parent
49757c7cb5
commit
96496a40e2
1 file changed
+10
-2
@@ -136,12 +136,20 @@ public abstract class GuiDiagram extends Gui {
|
||||
String nameFrom = iconFrom != null ? getIconName(iconFrom) : "Unknown";
|
||||
String nameTo = iconTo != null ? getIconName(iconTo) : "Unknown";
|
||||
tooltip.add(nameFrom + " > " + nameTo + ":");
|
||||
tooltip.add(conn.hoverText);
|
||||
// Split Hover Text by newlines
|
||||
if (conn.hoverText != null && !conn.hoverText.isEmpty()) {
|
||||
String[] lines = conn.hoverText.split("\n");
|
||||
tooltip.addAll(Arrays.asList(lines));
|
||||
}
|
||||
if (allowTwoWay) {
|
||||
DiagramConnection reverse = getConnectionByIds(conn.idTo, conn.idFrom);
|
||||
if (reverse != null) {
|
||||
tooltip.add(nameTo + " > " + nameFrom + ":");
|
||||
tooltip.add(reverse.hoverText);
|
||||
// Split Hover Text by newlines
|
||||
if (reverse.hoverText != null && !reverse.hoverText.isEmpty()) {
|
||||
String[] lines = reverse.hoverText.split("\n");
|
||||
tooltip.addAll(Arrays.asList(lines));
|
||||
}
|
||||
}
|
||||
}
|
||||
return tooltip;
|
||||
|
||||
Reference in new issue
Block a user