Added Callback before clearing Keyframes | https://trello.com/c/ZzOk0ju1/
This commit is contained in:
@@ -185,7 +185,7 @@ public class KeyInputHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getKeyDescription().equals(KeybindRegistry.KEY_CLEAR_KEYFRAMES) && (kb.isPressed() || kb.getKeyCode() == keyCode)) {
|
if(kb.getKeyDescription().equals(KeybindRegistry.KEY_CLEAR_KEYFRAMES) && (kb.isPressed() || kb.getKeyCode() == keyCode)) {
|
||||||
ReplayHandler.resetKeyframes(false);
|
ReplayHandler.resetKeyframes(false, ReplayMod.replaySettings.showClearKeyframesCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(kb.getKeyDescription().equals(KeybindRegistry.KEY_SYNC_TIMELINE) && (kb.isPressed() || kb.getKeyCode() == keyCode)) {
|
if(kb.getKeyDescription().equals(KeybindRegistry.KEY_SYNC_TIMELINE) && (kb.isPressed() || kb.getKeyCode() == keyCode)) {
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ import eu.crushedpixel.replaymod.utils.ReplayFile;
|
|||||||
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
|
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiYesNo;
|
||||||
|
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||||
import net.minecraft.client.network.NetHandlerPlayClient;
|
import net.minecraft.client.network.NetHandlerPlayClient;
|
||||||
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.crash.CrashReport;
|
import net.minecraft.crash.CrashReport;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Bootstrap;
|
import net.minecraft.init.Bootstrap;
|
||||||
@@ -452,7 +455,24 @@ public class ReplayHandler {
|
|||||||
return new ArrayList<Keyframe>(keyframes);
|
return new ArrayList<Keyframe>(keyframes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void resetKeyframes(boolean resetMarkers) {
|
public static void resetKeyframes(final boolean resetMarkers, boolean callback) {
|
||||||
|
if(!callback) {
|
||||||
|
resetKeyframes(resetMarkers);
|
||||||
|
} else {
|
||||||
|
mc.displayGuiScreen(new GuiYesNo(new GuiYesNoCallback() {
|
||||||
|
@Override
|
||||||
|
public void confirmClicked(boolean result, int id) {
|
||||||
|
if(result) {
|
||||||
|
resetKeyframes(resetMarkers);
|
||||||
|
}
|
||||||
|
|
||||||
|
mc.displayGuiScreen(null);
|
||||||
|
}
|
||||||
|
}, I18n.format("replaymod.gui.clearcallback.title"), I18n.format("replaymod.gui.clearcallback.message"), 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void resetKeyframes(boolean resetMarkers) {
|
||||||
MarkerKeyframe[] markers = getMarkers();
|
MarkerKeyframe[] markers = getMarkers();
|
||||||
keyframes = new ArrayList<Keyframe>();
|
keyframes = new ArrayList<Keyframe>();
|
||||||
|
|
||||||
|
|||||||
@@ -336,4 +336,8 @@ replaymod.gui.ingame.menu.pausepath=Pause Camera Path
|
|||||||
replaymod.gui.ingame.menu.zoomin=Zoom in
|
replaymod.gui.ingame.menu.zoomin=Zoom in
|
||||||
replaymod.gui.ingame.menu.zoomout=Zoom out
|
replaymod.gui.ingame.menu.zoomout=Zoom out
|
||||||
|
|
||||||
replaymod.gui.ingame.unnamedmarker=Unnamed Event Marker
|
replaymod.gui.ingame.unnamedmarker=Unnamed Event Marker
|
||||||
|
|
||||||
|
#Clear Keyframe Callback
|
||||||
|
replaymod.gui.clearcallback.title=Clear all Keyframes?
|
||||||
|
replaymod.gui.clearcallback.message=This Callback can be disabled in the Replay Settings.
|
||||||
Reference in New Issue
Block a user