Fix jumping to marker position when time already matches
This commit is contained in:
@@ -519,10 +519,6 @@ public class ReplayHandler {
|
|||||||
return spectating;
|
return spectating;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTargetPosition(Location pos) {
|
|
||||||
targetCameraPosition = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void moveCameraToTargetPosition() {
|
public void moveCameraToTargetPosition() {
|
||||||
CameraEntity cam = getCameraEntity();
|
CameraEntity cam = getCameraEntity();
|
||||||
if (cam != null && targetCameraPosition != null) {
|
if (cam != null && targetCameraPosition != null) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.replaymod.core.ReplayMod;
|
|||||||
import com.replaymod.core.versions.MCVer.Keyboard;
|
import com.replaymod.core.versions.MCVer.Keyboard;
|
||||||
import com.replaymod.replay.ReplayHandler;
|
import com.replaymod.replay.ReplayHandler;
|
||||||
import com.replaymod.replay.ReplayModReplay;
|
import com.replaymod.replay.ReplayModReplay;
|
||||||
|
import com.replaymod.replay.camera.CameraEntity;
|
||||||
import com.replaymod.replaystudio.data.Marker;
|
import com.replaymod.replaystudio.data.Marker;
|
||||||
import com.replaymod.replaystudio.util.Location;
|
import com.replaymod.replaystudio.util.Location;
|
||||||
import de.johni0702.minecraft.gui.GuiRenderer;
|
import de.johni0702.minecraft.gui.GuiRenderer;
|
||||||
@@ -168,11 +169,14 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
|
|||||||
} else if (button == 1) { // Right click
|
} else if (button == 1) { // Right click
|
||||||
selectedMarker = null;
|
selectedMarker = null;
|
||||||
if (replayHandler != null) {
|
if (replayHandler != null) {
|
||||||
replayHandler.setTargetPosition(new Location(
|
CameraEntity cameraEntity = replayHandler.getCameraEntity();
|
||||||
marker.getX(), marker.getY(), marker.getZ(),
|
if (cameraEntity != null) {
|
||||||
marker.getPitch(), marker.getYaw()
|
cameraEntity.setCameraPosRot(new Location(
|
||||||
));
|
marker.getX(), marker.getY(), marker.getZ(),
|
||||||
replayHandler.doJump(marker.getTime(), false);
|
marker.getPitch(), marker.getYaw()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
replayHandler.doJump(marker.getTime(), true);
|
||||||
} else {
|
} else {
|
||||||
setCursorPosition(marker.getTime());
|
setCursorPosition(marker.getTime());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user