mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-01-09 00:59:44 +03:00
[FEATURE] Возможность слежения за OptionalFile
This commit is contained in:
parent
1ae7c80c72
commit
459f305f13
2 changed files with 4 additions and 1 deletions
|
@ -256,6 +256,7 @@ public void markOptional(OptionalFile file) {
|
||||||
|
|
||||||
if (file.mark) return;
|
if (file.mark) return;
|
||||||
file.mark = true;
|
file.mark = true;
|
||||||
|
file.notifyObservers(true);
|
||||||
if (file.dependencies != null) {
|
if (file.dependencies != null) {
|
||||||
for (OptionalFile dep : file.dependencies) {
|
for (OptionalFile dep : file.dependencies) {
|
||||||
if (dep.dependenciesCount == null) dep.dependenciesCount = new HashSet<>();
|
if (dep.dependenciesCount == null) dep.dependenciesCount = new HashSet<>();
|
||||||
|
@ -283,6 +284,7 @@ public void unmarkOptional(String name, OptionalType type) {
|
||||||
public void unmarkOptional(OptionalFile file) {
|
public void unmarkOptional(OptionalFile file) {
|
||||||
if (!file.mark) return;
|
if (!file.mark) return;
|
||||||
file.mark = false;
|
file.mark = false;
|
||||||
|
file.notifyObservers(false);
|
||||||
if (file.dependenciesCount != null) {
|
if (file.dependenciesCount != null) {
|
||||||
for (OptionalFile f : file.dependenciesCount) {
|
for (OptionalFile f : file.dependenciesCount) {
|
||||||
if (f.isPreset) continue;
|
if (f.isPreset) continue;
|
||||||
|
|
|
@ -7,9 +7,10 @@
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Observable;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class OptionalFile {
|
public class OptionalFile extends Observable {
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
public String[] list;
|
public String[] list;
|
||||||
@LauncherNetworkAPI
|
@LauncherNetworkAPI
|
||||||
|
|
Loading…
Reference in a new issue