Marker Keyframes are now being saved in a KeyframeList in the ReplayHandler

Made MarkerKeyframes names editable in GuiEditKeyframe
Shows "Unnamed Marker" if Marker name is empty
This commit is contained in:
CrushedPixel
2015-07-13 01:21:48 +02:00
parent f55f169d01
commit 66c595eb04
5 changed files with 66 additions and 33 deletions

View File

@@ -1,6 +1,7 @@
package eu.crushedpixel.replaymod.gui.elements.timelines;
import eu.crushedpixel.replaymod.ReplayMod;
import eu.crushedpixel.replaymod.gui.GuiEditKeyframe;
import eu.crushedpixel.replaymod.holders.Keyframe;
import eu.crushedpixel.replaymod.holders.Marker;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
@@ -51,7 +52,7 @@ public class GuiMarkerTimeline extends GuiTimeline {
long currentTime = System.currentTimeMillis();
if(closest != null) {
if(currentTime - clickTime < 500) { // if double clicked then open GUI instead
//TODO: Make Marker Name editable
mc.displayGuiScreen(new GuiEditKeyframe(closest));
this.clickedKeyFrame = null;
} else {
this.clickedKeyFrame = closest;
@@ -155,7 +156,7 @@ public class GuiMarkerTimeline extends GuiTimeline {
if(MouseUtils.isMouseWithinBounds(keyframeX - 2, this.positionY + BORDER_TOP + 10 + 1, 5, 5)) {
Point mouse = MouseUtils.getMousePos();
String markerName = marker.getValue().getName();
if(markerName == null) markerName = I18n.format("replaymod.gui.ingame.unnamedmarker");
if(markerName == null || markerName.isEmpty()) markerName = I18n.format("replaymod.gui.ingame.unnamedmarker");
ReplayMod.tooltipRenderer.drawTooltip(mouse.getX(), mouse.getY(), markerName, null, Color.WHITE);
drawn = true;