Spectator Keyframe segments using Shoulder Camera are rendered in a different color on the timeline

This commit is contained in:
CrushedPixel
2015-09-06 16:47:38 +02:00
parent ad9806ed24
commit eeded7a7fd
2 changed files with 18 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import eu.crushedpixel.replaymod.gui.GuiEditKeyframe;
import eu.crushedpixel.replaymod.holders.*;
import eu.crushedpixel.replaymod.replay.ReplayHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import java.util.ListIterator;
@@ -158,8 +159,12 @@ public class GuiKeyframeTimeline extends GuiTimeline {
int keyframeX = getKeyframeX(kf.getRealTimestamp(), leftTime, bodyWidth, segmentLength);
int nextX = getKeyframeX(nextSpectatorKeyframeRealTime, leftTime, bodyWidth, segmentLength);
drawGradientRect(Math.max(keyframeX + 2, positionX+BORDER_LEFT), positionY + BORDER_TOP + 1, Math.min(nextX - 2, positionX+width-BORDER_RIGHT+1),
positionY + BORDER_TOP + 4, 0xFF0080FF, 0xFF0080FF);
int color = ((SpectatorData)kf.getValue()).getSpectatingMethod().getColor();
drawRect(Math.max(keyframeX + 2, positionX+BORDER_LEFT), positionY + BORDER_TOP + 1, Math.min(nextX - 2, positionX+width-BORDER_RIGHT+1),
positionY + BORDER_TOP + 4, color);
GlStateManager.color(1, 1, 1, 1);
}
}
}

View File

@@ -84,6 +84,16 @@ public class SpectatorData extends AdvancedPosition {
}
public enum SpectatingMethod {
FIRST_PERSON, SHOULDER_CAM
FIRST_PERSON(0xFF0080FF), SHOULDER_CAM(0xFFFF8000);
private int color;
public int getColor() {
return color;
}
SpectatingMethod(int color) {
this.color = color;
}
}
}