[FEATURE] Возможность слежения за OptionalFile

This commit is contained in:
Gravit 2020-01-04 22:01:32 +07:00
parent 1ae7c80c72
commit 459f305f13
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 4 additions and 1 deletions

View file

@ -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;

View file

@ -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