Compare commits
No commits in common. "f7f5b1dc74c5bffcbdf53ac2b1ca9645ff25975f" and "c0098fa92beb4a71639e8afe3f909ff568c546ee" have entirely different histories.
f7f5b1dc74
...
c0098fa92b
4
.gitignore
vendored
4
.gitignore
vendored
@ -9,6 +9,4 @@ build
|
|||||||
/data
|
/data
|
||||||
/backup
|
/backup
|
||||||
/output
|
/output
|
||||||
*.zip
|
*.zip
|
||||||
|
|
||||||
.idea
|
|
11
build.gradle
11
build.gradle
@ -4,8 +4,6 @@ plugins {
|
|||||||
|
|
||||||
archivesBaseName = "Mario Kart World Tracker"
|
archivesBaseName = "Mario Kart World Tracker"
|
||||||
version = '1.0.1'
|
version = '1.0.1'
|
||||||
var mainClassName = 'speiger.src.ui.MapPanel'
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
@ -15,7 +13,7 @@ sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = co
|
|||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes "Main-Class": mainClassName
|
attributes "Main-Class": 'speiger.src.ui.MapPanel'
|
||||||
}
|
}
|
||||||
from {
|
from {
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
@ -29,7 +27,7 @@ task baseJar(type: Jar) {
|
|||||||
exclude('assets/images/images.zip')
|
exclude('assets/images/images.zip')
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
manifest {
|
manifest {
|
||||||
attributes "Main-Class": mainClassName
|
attributes "Main-Class": 'speiger.src.ui.MapPanel'
|
||||||
}
|
}
|
||||||
from {
|
from {
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
@ -37,11 +35,6 @@ task baseJar(type: Jar) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task run(type: JavaExec) {
|
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
|
||||||
mainClass.set(mainClassName)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.google.code.gson:gson:2.8.6'
|
implementation 'com.google.code.gson:gson:2.8.6'
|
||||||
|
@ -52,7 +52,6 @@ public class Registry {
|
|||||||
Map<UUID, Collectable> collectables = new LinkedHashMap<>();
|
Map<UUID, Collectable> collectables = new LinkedHashMap<>();
|
||||||
Set<UUID> completed = new HashSet<>();
|
Set<UUID> completed = new HashSet<>();
|
||||||
Object syncObj = new Object();
|
Object syncObj = new Object();
|
||||||
boolean bulkOperationActive = false;
|
|
||||||
|
|
||||||
public void load() {
|
public void load() {
|
||||||
parseRegistry("/assets/data/medals.json", CollectableType.MEDAL);
|
parseRegistry("/assets/data/medals.json", CollectableType.MEDAL);
|
||||||
@ -203,22 +202,14 @@ public class Registry {
|
|||||||
|
|
||||||
public void markComplete(UUID id) {
|
public void markComplete(UUID id) {
|
||||||
completed.add(id);
|
completed.add(id);
|
||||||
if (bulkOperationActive) save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unmarkComplete(UUID id) {
|
public void unmarkComplete(UUID id) {
|
||||||
completed.remove(id);
|
completed.remove(id);
|
||||||
if (bulkOperationActive) save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBulkOperation(boolean bulk) {
|
|
||||||
bulkOperationActive = bulk;
|
|
||||||
|
|
||||||
if (!bulk) {
|
|
||||||
save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCompleted(UUID id) {
|
public boolean isCompleted(UUID id) {
|
||||||
return completed.contains(id);
|
return completed.contains(id);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ public class MapPanel extends JPanel {
|
|||||||
panel.setCompletionState(true);
|
panel.setCompletionState(true);
|
||||||
}, null));
|
}, null));
|
||||||
bulk.add(item("Uncomplete Visible", T -> {
|
bulk.add(item("Uncomplete Visible", T -> {
|
||||||
panel.setCompletionState(false);
|
panel.setCompletionState(false);
|
||||||
}, null));
|
}, null));
|
||||||
bar.add(bulk);
|
bar.add(bulk);
|
||||||
JMenu fuckups = new JMenu("I Fucked up");
|
JMenu fuckups = new JMenu("I Fucked up");
|
||||||
@ -345,11 +345,7 @@ public class MapPanel extends JPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setCompletionState(boolean value) {
|
public void setCompletionState(boolean value) {
|
||||||
Registry.INSTANCE.setBulkOperation(true);
|
|
||||||
visibleMarkers.forEach(T -> T.setCompletion(value));
|
visibleMarkers.forEach(T -> T.setCompletion(value));
|
||||||
Registry.INSTANCE.setBulkOperation(false);
|
|
||||||
EventQueue.invokeLater(this::repaint);
|
|
||||||
if(progressUpdate != null) progressUpdate.run();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user