Compare commits

..

No commits in common. "f7f5b1dc74c5bffcbdf53ac2b1ca9645ff25975f" and "c0098fa92beb4a71639e8afe3f909ff568c546ee" have entirely different histories.

4 changed files with 6 additions and 28 deletions

4
.gitignore vendored
View File

@ -9,6 +9,4 @@ build
/data
/backup
/output
*.zip
.idea
*.zip

View File

@ -4,8 +4,6 @@ plugins {
archivesBaseName = "Mario Kart World Tracker"
version = '1.0.1'
var mainClassName = 'speiger.src.ui.MapPanel'
repositories {
mavenCentral()
}
@ -15,7 +13,7 @@ sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = co
jar {
manifest {
attributes "Main-Class": mainClassName
attributes "Main-Class": 'speiger.src.ui.MapPanel'
}
from {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@ -29,7 +27,7 @@ task baseJar(type: Jar) {
exclude('assets/images/images.zip')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes "Main-Class": mainClassName
attributes "Main-Class": 'speiger.src.ui.MapPanel'
}
from {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
@ -37,11 +35,6 @@ task baseJar(type: Jar) {
}
}
task run(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
mainClass.set(mainClassName)
}
dependencies {
implementation 'com.google.code.gson:gson:2.8.6'

View File

@ -52,7 +52,6 @@ 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);
@ -203,22 +202,14 @@ public class Registry {
public void markComplete(UUID id) {
completed.add(id);
if (bulkOperationActive) save();
save();
}
public void unmarkComplete(UUID id) {
completed.remove(id);
if (bulkOperationActive) save();
save();
}
public void setBulkOperation(boolean bulk) {
bulkOperationActive = bulk;
if (!bulk) {
save();
}
}
public boolean isCompleted(UUID id) {
return completed.contains(id);
}

View File

@ -157,7 +157,7 @@ public class MapPanel extends JPanel {
panel.setCompletionState(true);
}, null));
bulk.add(item("Uncomplete Visible", T -> {
panel.setCompletionState(false);
panel.setCompletionState(false);
}, null));
bar.add(bulk);
JMenu fuckups = new JMenu("I Fucked up");
@ -345,11 +345,7 @@ public class MapPanel extends JPanel {
}
public void setCompletionState(boolean value) {
Registry.INSTANCE.setBulkOperation(true);
visibleMarkers.forEach(T -> T.setCompletion(value));
Registry.INSTANCE.setBulkOperation(false);
EventQueue.invokeLater(this::repaint);
if(progressUpdate != null) progressUpdate.run();
}
@Override