Re-work Replay Editor UI

This commit is contained in:
Jonas Herzig
2019-03-12 19:44:09 +01:00
parent eb6e7b79d0
commit 51c073012e
13 changed files with 396 additions and 98 deletions

View File

@@ -112,7 +112,7 @@ public class ReplayHandler {
*/
private boolean suppressCameraMovements;
private final List<Marker> markers;
private Set<Marker> markers;
private final GuiReplayOverlay overlay;
@@ -135,7 +135,7 @@ public class ReplayHandler {
FML_BUS.post(new ReplayOpenEvent.Pre(this));
markers = new ArrayList<>(replayFile.getMarkers().or(Collections.emptySet()));
markers = replayFile.getMarkers().or(Collections.emptySet());
fullReplaySender = new FullReplaySender(this, replayFile, false);
//#if MC>=10904
@@ -432,26 +432,6 @@ public class ReplayHandler {
this.suppressCameraMovements = suppressCameraMovements;
}
/**
* Returns all markers.
* When changed, {@link #saveMarkers()} should be called to save the changes.
* @return Collection of markers in no particular order
*/
public Collection<Marker> getMarkers() {
return markers;
}
/**
* Saves all markers.
*/
public void saveMarkers() {
try {
replayFile.writeMarkers(new HashSet<>(markers));
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* Spectate the specified entity.
* When the entity is {@code null} or the camera entity, the camera becomes the view entity.