From 66567c3834f7660ea569abbeabad8db60ab8023e Mon Sep 17 00:00:00 2001
From: CrushedPixel <crushedpixelmaps@gmail.com>
Date: Mon, 29 Jun 2015 13:44:18 +0200
Subject: [PATCH] Requires at least two Position one Time Keyframe for Camera
 Paths/Rendering | https://trello.com/c/qJZSno6o/

---
 .../eu/crushedpixel/replaymod/gui/GuiKeyframeRepository.java  | 4 ++--
 .../crushedpixel/replaymod/gui/overlay/GuiReplayOverlay.java  | 4 ++--
 .../java/eu/crushedpixel/replaymod/replay/ReplayProcess.java  | 4 ++--
 src/main/resources/assets/replaymod/lang/en_US.lang           | 2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/GuiKeyframeRepository.java b/src/main/java/eu/crushedpixel/replaymod/gui/GuiKeyframeRepository.java
index e183bbd2..07dfcc43 100644
--- a/src/main/java/eu/crushedpixel/replaymod/gui/GuiKeyframeRepository.java
+++ b/src/main/java/eu/crushedpixel/replaymod/gui/GuiKeyframeRepository.java
@@ -140,8 +140,8 @@ public class GuiKeyframeRepository extends GuiScreen implements GuiReplayOverlay
 
                 Keyframe[] keyframes = kfs.toArray(new Keyframe[ReplayHandler.getKeyframes().size()]);
                 KeyframeSet newSet = new KeyframeSet(I18n.format("replaymod.gui.keyframerepository.preset.defaultname"), keyframes);
-                if(newSet.getPositionKeyframeCount() < 2 && newSet.getTimeKeyframeCount() < 2) {
-                    message = I18n.format("replaymod.chat.notenoughkeyframes");
+                if(newSet.getPositionKeyframeCount() < 2 || newSet.getTimeKeyframeCount() < 1) {
+                    message = I18n.format("replaymod.chat.morekeyframes");
                     break;
                 } else if(keyframeSetList.getCopyOfElements().contains(newSet)) {
                     message = I18n.format("replaymod.gui.keyframerepository.duplicate");
diff --git a/src/main/java/eu/crushedpixel/replaymod/gui/overlay/GuiReplayOverlay.java b/src/main/java/eu/crushedpixel/replaymod/gui/overlay/GuiReplayOverlay.java
index a26a51d7..0b53f234 100755
--- a/src/main/java/eu/crushedpixel/replaymod/gui/overlay/GuiReplayOverlay.java
+++ b/src/main/java/eu/crushedpixel/replaymod/gui/overlay/GuiReplayOverlay.java
@@ -98,8 +98,8 @@ public class GuiReplayOverlay extends Gui {
         @Override
         public void run() {
             //if not enough keyframes, abort and leave chat message
-            if(ReplayHandler.getPosKeyframeCount() < 2 && ReplayHandler.getTimeKeyframeCount() < 2) {
-                ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.notenoughkeyframes", ChatMessageHandler.ChatMessageType.WARNING);
+            if(ReplayHandler.getPosKeyframeCount() < 2 || ReplayHandler.getTimeKeyframeCount() < 1) {
+                ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.morekeyframes", ChatMessageHandler.ChatMessageType.WARNING);
             } else {
                 mc.displayGuiScreen(new GuiRenderSettings());
             }
diff --git a/src/main/java/eu/crushedpixel/replaymod/replay/ReplayProcess.java b/src/main/java/eu/crushedpixel/replaymod/replay/ReplayProcess.java
index b7218524..93186e95 100755
--- a/src/main/java/eu/crushedpixel/replaymod/replay/ReplayProcess.java
+++ b/src/main/java/eu/crushedpixel/replaymod/replay/ReplayProcess.java
@@ -88,8 +88,8 @@ public class ReplayProcess {
         ReplayMod.chatMessageHandler.initialize();
 
         //if not enough keyframes, abort and leave chat message
-        if(ReplayHandler.getPosKeyframeCount() < 2 && ReplayHandler.getTimeKeyframeCount() < 2) {
-            ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.notenoughkeyframes", ChatMessageType.WARNING);
+        if(ReplayHandler.getPosKeyframeCount() < 2 || ReplayHandler.getTimeKeyframeCount() < 1) {
+            ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.morekeyframes", ChatMessageType.WARNING);
             return;
         }
 
diff --git a/src/main/resources/assets/replaymod/lang/en_US.lang b/src/main/resources/assets/replaymod/lang/en_US.lang
index 6cc74764..bf5ae93d 100644
--- a/src/main/resources/assets/replaymod/lang/en_US.lang
+++ b/src/main/resources/assets/replaymod/lang/en_US.lang
@@ -41,7 +41,7 @@ replaymod.chat.failedthumb=Thumbnail could not be saved
 replaymod.chat.addedmarker=Event Marker has been added
 
 #Chat messages displayed in Replay Viewer
-replaymod.chat.notenoughkeyframes=At least 2 position or time keyframes required
+replaymod.chat.morekeyframes=At least 2 position keyframes and 1 time keyframe required
 replaymod.chat.pathstarted=Camera Path started
 replaymod.chat.pathfinished=Camera Path finished
 replaymod.chat.pathinterrupted=Camera Path canceled
