Made custom command line arguments respect placeholders like %FPS%
This commit is contained in:
@@ -451,7 +451,7 @@ public class GuiRenderSettings extends GuiScreen {
|
||||
options.setRenderer(renderer);
|
||||
|
||||
if(ffmpegArguments.getText().trim().length() > 0) {
|
||||
options.setCommandLineArguments(ffmpegArguments.getText());
|
||||
options.setExportCommandArgs(ffmpegArguments.getText());
|
||||
}
|
||||
|
||||
ReplayHandler.startPath(options);
|
||||
|
||||
@@ -2,10 +2,12 @@ package eu.crushedpixel.replaymod.registry;
|
||||
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import eu.crushedpixel.replaymod.events.ReplayExitEvent;
|
||||
import eu.crushedpixel.replaymod.gui.GuiReplaySaving;
|
||||
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
@@ -27,6 +29,10 @@ public class ReplayFileAppender extends Thread {
|
||||
public void startNewReplayFileWriting() {
|
||||
newReplayFileWriting = true;
|
||||
|
||||
openGuiSavingScreen();
|
||||
}
|
||||
|
||||
private void openGuiSavingScreen() {
|
||||
if(!FMLClientHandler.instance().isGUIOpen(GuiReplaySaving.class)) {
|
||||
Minecraft.getMinecraft().addScheduledTask(new Runnable() {
|
||||
@Override
|
||||
@@ -77,6 +83,13 @@ public class ReplayFileAppender extends Thread {
|
||||
listeners.add(gui);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onReplayExit(ReplayExitEvent event) {
|
||||
if(!filesToRewrite.isEmpty()) {
|
||||
openGuiSavingScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
while(!Thread.interrupted() || !filesToRewrite.isEmpty()) {
|
||||
|
||||
@@ -11,7 +11,6 @@ public final class RenderOptions {
|
||||
private FrameRenderer renderer;
|
||||
private String bitrate = "10M";
|
||||
private int fps = 30;
|
||||
private String commandLineArguments = null;
|
||||
|
||||
// Advanced
|
||||
private boolean waitForChunks = true;
|
||||
|
||||
@@ -59,18 +59,12 @@ public class VideoWriter {
|
||||
File folder = ReplayFileIO.getRenderFolder();
|
||||
String fileName = FILE_FORMAT.format(Calendar.getInstance().getTime());
|
||||
|
||||
final String args;
|
||||
|
||||
if(options.getCommandLineArguments() != null) {
|
||||
args = options.getCommandLineArguments();
|
||||
} else {
|
||||
args = options.getExportCommandArgs()
|
||||
final String args = options.getExportCommandArgs()
|
||||
.replace("%WIDTH%", String.valueOf(options.getWidth()))
|
||||
.replace("%HEIGHT%", String.valueOf(options.getHeight()))
|
||||
.replace("%FPS%", String.valueOf(options.getFps()))
|
||||
.replace("%FILENAME%", fileName)
|
||||
.replace("%BITRATE%", options.getBitrate());
|
||||
}
|
||||
|
||||
List<String> command = new ArrayList<String>();
|
||||
command.add(options.getExportCommand());
|
||||
|
||||
Reference in New Issue
Block a user