a few fixes #1
@ -52,6 +52,7 @@ public class Registry {
|
||||
Map<UUID, Collectable> collectables = new LinkedHashMap<>();
|
||||
Set<UUID> completed = new HashSet<>();
|
||||
Object syncObj = new Object();
|
||||
boolean bulkOperationActive = false;
|
||||
|
||||
public void load() {
|
||||
parseRegistry("/assets/data/medals.json", CollectableType.MEDAL);
|
||||
@ -202,12 +203,20 @@ public class Registry {
|
||||
|
||||
public void markComplete(UUID id) {
|
||||
completed.add(id);
|
||||
save();
|
||||
if (bulkOperationActive) save();
|
||||
}
|
||||
|
||||
public void unmarkComplete(UUID id) {
|
||||
completed.remove(id);
|
||||
save();
|
||||
if (bulkOperationActive) save();
|
||||
}
|
||||
|
||||
public void setBulkOperation(boolean bulk) {
|
||||
bulkOperationActive = bulk;
|
||||
|
||||
if (!bulk) {
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCompleted(UUID id) {
|
||||
|
@ -345,7 +345,9 @@ public class MapPanel extends JPanel {
|
||||
}
|
||||
|
||||
public void setCompletionState(boolean value) {
|
||||
Registry.INSTANCE.setBulkOperation(true);
|
||||
visibleMarkers.forEach(T -> T.setCompletion(value));
|
||||
Registry.INSTANCE.setBulkOperation(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user