From ed5381969b9e1935cb27f7039aa4e83539bdf404 Mon Sep 17 00:00:00 2001 From: Toomas Romer Date: Sun, 27 May 2018 16:19:42 +0300 Subject: [PATCH] Sometimes the "L" prop is part of the game node rather than the first move. --- src/main/java/com/toomasr/sgf4j/gui/MainUI.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/toomasr/sgf4j/gui/MainUI.java b/src/main/java/com/toomasr/sgf4j/gui/MainUI.java index 61c6049..d189034 100644 --- a/src/main/java/com/toomasr/sgf4j/gui/MainUI.java +++ b/src/main/java/com/toomasr/sgf4j/gui/MainUI.java @@ -782,6 +782,10 @@ private void showMarkersForMove(GameNode move) { // the L property is actually not used in FF3 and FF4 // but I own many SGFs that still have it String markerProp = move.getProperty("L"); + // the L property is sometimes attached to the game instead part instead + if (markerProp == null && move.getParentNode() == null && game.getProperty("L") != null) { + markerProp = game.getProperty("L"); + } if (markerProp != null) { int alphaIdx = 0; String[] markers = markerProp.split("\\]\\["); @@ -804,7 +808,10 @@ private void removeMarkersForNode(GameNode node) { // the L property is actually not used in FF3 and FF4 // but I own many SGFs that still have it String markerProp = node.getProperty("L"); - + // the L property is sometimes attached to the game instead part instead + if (markerProp == null && node.getParentNode() == null && game.getProperty("L") != null) { + markerProp = game.getProperty("L"); + } if (markerProp != null) { String[] markers = markerProp.split("\\]\\["); for (int i = 0; i < markers.length; i++) {