From 459f305f13cd5b8fccaa6077c1a1a5cbf9a804ba Mon Sep 17 00:00:00 2001 From: Gravit Date: Sat, 4 Jan 2020 22:01:32 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=D0=92=D0=BE=D0=B7=D0=BC=D0=BE?= =?UTF-8?q?=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D1=81=D0=BB=D0=B5=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0=20OptionalFile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/pro/gravit/launcher/profiles/ClientProfile.java | 2 ++ .../pro/gravit/launcher/profiles/optional/OptionalFile.java | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java index d60a77f4..2f3b7b6b 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java @@ -256,6 +256,7 @@ public void markOptional(OptionalFile file) { if (file.mark) return; file.mark = true; + file.notifyObservers(true); if (file.dependencies != null) { for (OptionalFile dep : file.dependencies) { if (dep.dependenciesCount == null) dep.dependenciesCount = new HashSet<>(); @@ -283,6 +284,7 @@ public void unmarkOptional(String name, OptionalType type) { public void unmarkOptional(OptionalFile file) { if (!file.mark) return; file.mark = false; + file.notifyObservers(false); if (file.dependenciesCount != null) { for (OptionalFile f : file.dependenciesCount) { if (f.isPreset) continue; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java index 43d5f22a..237deb22 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java @@ -7,9 +7,10 @@ import java.io.IOException; import java.util.Objects; +import java.util.Observable; import java.util.Set; -public class OptionalFile { +public class OptionalFile extends Observable { @LauncherNetworkAPI public String[] list; @LauncherNetworkAPI