aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
diff options
context:
space:
mode:
authorLinnea Gräf <roman.graef@gmail.com>2023-11-02 15:28:49 +0100
committerGitHub <noreply@github.com>2023-11-02 15:28:49 +0100
commit2a6d3a96d40ca425e661737fb4fc467b2040437b (patch)
treebb89ff8177ebb3abdc2a047f16b9671bc18cacd8 /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
parente1c24ecc30132fc98aa9cf33b928232b2efabcd8 (diff)
downloadnotenoughupdates-2a6d3a96d40ca425e661737fb4fc467b2040437b.tar.gz
notenoughupdates-2a6d3a96d40ca425e661737fb4fc467b2040437b.tar.bz2
notenoughupdates-2a6d3a96d40ca425e661737fb4fc467b2040437b.zip
Add custom TODOs (#870)
Co-authored-by: Lulonaut <lulonaut@lulonaut.tech>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
index 82708669..ad0000d4 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java
@@ -23,6 +23,7 @@ import com.google.common.reflect.TypeToken;
import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe;
+import io.github.moulberry.notenoughupdates.events.SidebarChangeEvent;
import io.github.moulberry.notenoughupdates.miscfeatures.CookieWarning;
import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent;
import io.github.moulberry.notenoughupdates.miscgui.minionhelper.MinionHelperManager;
@@ -310,6 +311,7 @@ public class SBInfo {
public ArrayList<String> completedQuests = new ArrayList<>();
private static final Pattern SKILL_LEVEL_PATTERN = Pattern.compile("([^0-9:]+) (\\d{1,2})");
+ private static List<String> lastLines = new ArrayList<>();
public void tick() {
@@ -364,6 +366,11 @@ public class SBInfo {
try {
List<String> lines = SidebarUtil.readSidebarLines(true, false);
+
+ if (lines.equals(lastLines)) return;
+ new SidebarChangeEvent(lines, lastLines).post();
+ lastLines = lines;
+
boolean tempIsInDungeon = false;
for (String line : lines) {
if (line.contains("Cleared:") && line.contains("%")) {