Split replay folder and file management into their own classes

This commit is contained in:
Jonas Herzig
2021-11-28 14:50:39 +01:00
parent ce5886a427
commit 31817bcf11
12 changed files with 245 additions and 204 deletions

View File

@@ -60,7 +60,7 @@ public class GuiEditReplay extends AbstractGuiPopup<GuiEditReplay> {
super(container);
this.inputPath = inputPath;
try (ReplayFile replayFile = ReplayMod.instance.openReplay(inputPath)) {
try (ReplayFile replayFile = ReplayMod.instance.files.open(inputPath)) {
markers = replayFile.getMarkers().or(HashSet::new);
timeline = new EditTimeline(new HashSet<>(markers), markers -> this.markers = markers);
timeline.setSize(300, 20)
@@ -147,7 +147,7 @@ public class GuiEditReplay extends AbstractGuiPopup<GuiEditReplay> {
ProgressPopup progressPopup = new ProgressPopup(this);
new Thread(() -> {
try (ReplayFile replayFile = ReplayMod.instance.openReplay(inputPath)) {
try (ReplayFile replayFile = ReplayMod.instance.files.open(inputPath)) {
replayFile.writeMarkers(markers);
replayFile.save();
} catch (IOException e) {