mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 14:38:50 +00:00
Remove unused position recording because it was bad
This commit is contained in:
1 parent
8f95f1b005
commit
959144e227
4 files changed
-107
No files matched your search
@@ -367,13 +367,6 @@ public class Flashback implements ModInitializer, ClientModInitializer {
|
||||
|
||||
AccurateEntityPositionHandler.tick();
|
||||
|
||||
if (Flashback.isInReplay() && !Flashback.isExporting()) {
|
||||
EditorState editorState = EditorStateManager.getCurrent();
|
||||
if (editorState != null) {
|
||||
editorState.recordCameraMovement();
|
||||
}
|
||||
}
|
||||
|
||||
// Fix for camera entity sometimes being incorrect when respawning
|
||||
Entity camera = Minecraft.getInstance().cameraEntity;
|
||||
LocalPlayer player = Minecraft.getInstance().player;
|
||||
|
||||
@@ -97,7 +97,6 @@ public class ReplayUI {
|
||||
|
||||
private static String infoOverlayText = null;
|
||||
private static long infoOverlayEndMillis = 0;
|
||||
public static boolean recordCameraMovement = false;
|
||||
|
||||
private static UUID selectedEntity = null;
|
||||
private static boolean openSelectedEntityPopup = false;
|
||||
@@ -656,9 +655,6 @@ public class ReplayUI {
|
||||
showText = infoOverlayText;
|
||||
showTextBorderColour = 0xFF00FFFF;
|
||||
}
|
||||
} else if (recordCameraMovement) {
|
||||
showText = "Recording Movement as Keyframes...";
|
||||
showTextBorderColour = 0xFF0000FF;
|
||||
}
|
||||
|
||||
if (showText != null) {
|
||||
|
||||
@@ -977,18 +977,6 @@ public class TimelineWindow {
|
||||
if (screen != null && screen.isPauseScreen()) {
|
||||
Minecraft.getInstance().setScreen(null);
|
||||
}
|
||||
|
||||
if (ReplayUI.recordCameraMovement) {
|
||||
editorState.recordingCameraMovementTrack = -1;
|
||||
|
||||
for (int i = 0; i < editorState.keyframeTracks.size(); i++) {
|
||||
KeyframeTrack keyframeTrack = editorState.keyframeTracks.get(i);
|
||||
if (keyframeTrack.enabled && keyframeTrack.keyframeType == CameraKeyframeType.INSTANCE) {
|
||||
editorState.recordingCameraMovementTrack = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1384,13 +1372,6 @@ public class TimelineWindow {
|
||||
}
|
||||
}
|
||||
|
||||
if (editorState.recordingCameraMovementTrack == trackIndex && editorState.recordingCameraMovementMinTick >= 0 && editorState.recordingCameraMovementMaxTick >= 0) {
|
||||
float fromX = x + replayTickToTimelineX(editorState.recordingCameraMovementMinTick);
|
||||
float toX = x + replayTickToTimelineX(editorState.recordingCameraMovementMaxTick);
|
||||
float topY = y + 2 + trackIndex * lineHeight;
|
||||
drawList.addRectFilled(fromX, topY, toX, topY + lineHeight, 0xFF4040FF);
|
||||
}
|
||||
|
||||
for (int tick = minTicks - 10; tick <= minTicks + availableTicks + 10; tick++) {
|
||||
var entry = keyframeTimes.ceilingEntry(tick);
|
||||
if (entry == null || entry.getKey() > minTicks + availableTicks + 10) {
|
||||
|
||||
@@ -50,83 +50,6 @@ public class EditorState {
|
||||
public Map<UUID, GameProfile> skinOverride = new HashMap<>();
|
||||
public Map<UUID, String> nameOverride = new HashMap<>();
|
||||
|
||||
public transient int recordingCameraMovementTrack = -1;
|
||||
public transient int recordingCameraMovementMinTick = -1;
|
||||
public transient int recordingCameraMovementMaxTick = -1;
|
||||
public transient Int2ObjectMap<CameraKeyframe> recordingCameraKeyframes = new Int2ObjectOpenHashMap<>();
|
||||
|
||||
public void recordCameraMovement() {
|
||||
if (recordingCameraMovementTrack < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ReplayUI.recordCameraMovement) {
|
||||
finishRecordingCameraMovement();
|
||||
return;
|
||||
}
|
||||
|
||||
ReplayServer replayServer = Flashback.getReplayServer();
|
||||
if (replayServer != null) {
|
||||
if (replayServer.replayPaused) {
|
||||
finishRecordingCameraMovement();
|
||||
return;
|
||||
}
|
||||
|
||||
Entity cameraEntity = Minecraft.getInstance().getCameraEntity();
|
||||
if (cameraEntity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int tick = replayServer.getReplayTick();
|
||||
if (recordingCameraMovementMaxTick >= 0) {
|
||||
int nextCapture = recordingCameraMovementMaxTick + 4;
|
||||
if (tick >= nextCapture) {
|
||||
tick = nextCapture;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
recordingCameraKeyframes.put(tick, new CameraKeyframe(Minecraft.getInstance().getCameraEntity()));
|
||||
|
||||
if (recordingCameraMovementMinTick < 0) {
|
||||
recordingCameraMovementMinTick = tick;
|
||||
}
|
||||
|
||||
recordingCameraMovementMinTick = Math.min(recordingCameraMovementMinTick, tick);
|
||||
recordingCameraMovementMaxTick = Math.max(recordingCameraMovementMaxTick, tick);
|
||||
}
|
||||
}
|
||||
|
||||
public void finishRecordingCameraMovement() {
|
||||
int trackIndex = recordingCameraMovementTrack;
|
||||
if (trackIndex >= 0 && trackIndex < this.keyframeTracks.size()) {
|
||||
List<EditorStateHistoryAction> undo = new ArrayList<>();
|
||||
List<EditorStateHistoryAction> redo = new ArrayList<>();
|
||||
|
||||
KeyframeTrack track = this.keyframeTracks.get(trackIndex);
|
||||
|
||||
for (Int2ObjectMap.Entry<CameraKeyframe> entry : recordingCameraKeyframes.int2ObjectEntrySet()) {
|
||||
int tick = entry.getIntKey();
|
||||
|
||||
Keyframe old = track.keyframesByTick.get(entry.getIntKey());
|
||||
if (old != null) {
|
||||
undo.add(new EditorStateHistoryAction.SetKeyframe(track.keyframeType, trackIndex, tick, old.copy()));
|
||||
} else {
|
||||
undo.add(new EditorStateHistoryAction.RemoveKeyframe(track.keyframeType, trackIndex, tick));
|
||||
}
|
||||
redo.add(new EditorStateHistoryAction.SetKeyframe(track.keyframeType, trackIndex, tick, entry.getValue()));
|
||||
}
|
||||
|
||||
this.push(new EditorStateHistoryEntry(undo, redo, "Record movement as keyframes"));
|
||||
}
|
||||
|
||||
recordingCameraMovementTrack = -1;
|
||||
recordingCameraMovementMinTick = -1;
|
||||
recordingCameraMovementMaxTick = -1;
|
||||
recordingCameraKeyframes.clear();
|
||||
}
|
||||
|
||||
public void setKeyframe(int trackIndex, int tick, Keyframe keyframe) {
|
||||
if (trackIndex >= this.keyframeTracks.size()) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user