Markers are now subclasses of Keyframe

Markers can now be moved and jumped to on the Replay Timeline
This commit is contained in:
CrushedPixel
2015-06-09 22:55:20 +02:00
parent d30ef19c89
commit b2ad52d5b6
13 changed files with 133 additions and 99 deletions

View File

@@ -5,7 +5,7 @@ import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import eu.crushedpixel.replaymod.holders.KeyframeSet;
import eu.crushedpixel.replaymod.holders.Marker;
import eu.crushedpixel.replaymod.holders.MarkerKeyframe;
import eu.crushedpixel.replaymod.holders.PlayerVisibility;
import eu.crushedpixel.replaymod.recording.ReplayMetaData;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
@@ -129,17 +129,17 @@ public class ReplayFile extends ZipFile {
return getEntry(ENTRY_MARKERS);
}
public Supplier<Marker[]> markers() {
return new Supplier<Marker[]>() {
public Supplier<MarkerKeyframe[]> markers() {
return new Supplier<MarkerKeyframe[]>() {
@Override
public Marker[] get() {
public MarkerKeyframe[] get() {
try {
ZipArchiveEntry entry = markersEntry();
if (entry == null) {
return null;
}
BufferedReader reader = new BufferedReader(new InputStreamReader(getInputStream(entry)));
return new Gson().fromJson(reader, Marker[].class);
return new Gson().fromJson(reader, MarkerKeyframe[].class);
} catch (IOException e) {
throw new RuntimeException(e);
}