If rendering crashes while initializing, an Error Screen telling the user to install ffmpeg is displayed | https://trello.com/c/EDDIqP0V/

This commit is contained in:
CrushedPixel
2015-06-29 22:44:10 +02:00
parent 3de7394a0c
commit 5e8bfcbc63
2 changed files with 16 additions and 3 deletions

View File

@@ -14,6 +14,8 @@ import eu.crushedpixel.replaymod.timer.EnchantmentTimer;
import eu.crushedpixel.replaymod.timer.ReplayTimer;
import eu.crushedpixel.replaymod.video.VideoRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiErrorScreen;
import net.minecraft.client.resources.I18n;
import java.io.IOException;
@@ -98,13 +100,20 @@ public class ReplayProcess {
ReplayMod.chatMessageHandler.addLocalizedChatMessage("replaymod.chat.pathstarted", ChatMessageType.INFORMATION);
mc.timer.timerSpeed = 1;
} else {
boolean success = false;
try {
isVideoRecording = true;
boolean success = new VideoRenderer(renderOptions).renderVideo();
isVideoRecording = false;
stopReplayProcess(success);
VideoRenderer videoRenderer = new VideoRenderer(renderOptions);
success = videoRenderer.renderVideo();
} catch (IOException e) {
e.printStackTrace();
GuiErrorScreen errorScreen = new GuiErrorScreen(I18n.format("replaymod.gui.rendering.error.title"),
I18n.format("replaymod.gui.rendering.error.message"));
mc.displayGuiScreen(errorScreen);
} finally {
isVideoRecording = false;
stopReplayProcess(success);
}
}
}

View File

@@ -303,6 +303,10 @@ replaymod.gui.rendering.progress=Frames rendered: %1$d / %2$d
replaymod.gui.rendering.timetaken=Render Time
replaymod.gui.rendering.timeleft=Time Left
#Render Errors
replaymod.gui.rendering.error.title=Rendering Failed
replaymod.gui.rendering.error.message=To render a video, you need to have ffmpeg installed. http://ffmpeg.org
#Ingame Menu
replaymod.gui.ingame.menu.addposkeyframe=Add Position Keyframe
replaymod.gui.ingame.menu.removeposkeyframe=Remove Position Keyframe