Remove lots of old code
Add some additional config settings Update jGui and ReplayStudio
This commit is contained in:
@@ -2,12 +2,12 @@ package com.replaymod.replay.gui.overlay;
|
||||
|
||||
import com.replaymod.core.ReplayMod;
|
||||
import com.replaymod.replay.ReplayHandler;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import de.johni0702.minecraft.gui.GuiRenderer;
|
||||
import de.johni0702.minecraft.gui.RenderInfo;
|
||||
import de.johni0702.minecraft.gui.element.advanced.AbstractGuiTimeline;
|
||||
import de.johni0702.minecraft.gui.function.Draggable;
|
||||
import com.replaymod.replaystudio.data.Marker;
|
||||
import eu.crushedpixel.replaymod.holders.AdvancedPosition;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import org.lwjgl.util.Point;
|
||||
@@ -126,9 +126,9 @@ public class GuiMarkerTimeline extends AbstractGuiTimeline<GuiMarkerTimeline> im
|
||||
lastClickTime = now;
|
||||
} else if (button == 1) { // Right click
|
||||
selectedMarker = null;
|
||||
replayHandler.setTargetPosition(new AdvancedPosition(
|
||||
replayHandler.setTargetPosition(new Location(
|
||||
marker.getX(), marker.getY(), marker.getZ(),
|
||||
marker.getPitch(), marker.getYaw(), marker.getRoll()
|
||||
marker.getPitch(), marker.getYaw()
|
||||
));
|
||||
replayHandler.doJump(marker.getTime(), false);
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@ import com.replaymod.replaystudio.replay.ReplayFile;
|
||||
import com.replaymod.replaystudio.replay.ReplayMetaData;
|
||||
import com.replaymod.replaystudio.replay.ZipReplayFile;
|
||||
import com.replaymod.replaystudio.studio.ReplayStudio;
|
||||
import eu.crushedpixel.replaymod.registry.ResourceHelper;
|
||||
import eu.crushedpixel.replaymod.utils.DurationUtils;
|
||||
import eu.crushedpixel.replaymod.utils.ReplayFileIO;
|
||||
import com.replaymod.core.utils.Utils;
|
||||
import net.minecraft.client.gui.GuiErrorScreen;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.Util;
|
||||
@@ -162,11 +160,9 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
popup.getYesButton().onClick();
|
||||
}
|
||||
}
|
||||
}).onTextChanged(new Consumer<String>() {
|
||||
@Override
|
||||
public void consume(String obj) {
|
||||
popup.getYesButton().setEnabled(!nameField.getText().isEmpty());
|
||||
}
|
||||
}).onTextChanged(obj -> {
|
||||
popup.getYesButton().setEnabled(!nameField.getText().isEmpty()
|
||||
&& !new File(file.getParentFile(), nameField.getText() + ".mcpr").exists());
|
||||
});
|
||||
Futures.addCallback(popup.getFuture(), new FutureCallback<Boolean>() {
|
||||
@Override
|
||||
@@ -176,11 +172,9 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
String name = nameField.getText().trim().replace("[^a-zA-Z0-9\\.\\- ]", "_");
|
||||
// This file is what they want
|
||||
File targetFile = new File(file.getParentFile(), name + ".mcpr");
|
||||
// But if it's already used, this is what they get
|
||||
File renamed = ReplayFileIO.getNextFreeFile(targetFile);
|
||||
try {
|
||||
// Finally, try to move it
|
||||
FileUtils.moveFile(file, renamed);
|
||||
FileUtils.moveFile(file, targetFile);
|
||||
} catch (IOException e) {
|
||||
// We failed (might also be their OS)
|
||||
e.printStackTrace();
|
||||
@@ -268,7 +262,7 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
});
|
||||
}
|
||||
|
||||
private final GuiImage defaultThumbnail = new GuiImage().setTexture(ResourceHelper.getDefaultThumbnail());
|
||||
private final GuiImage defaultThumbnail = new GuiImage().setTexture(Utils.DEFAULT_THUMBNAIL);
|
||||
public class GuiReplayEntry extends AbstractGuiContainer<GuiReplayEntry> implements Comparable<GuiReplayEntry> {
|
||||
public final File file;
|
||||
public final GuiLabel name = new GuiLabel();
|
||||
@@ -311,7 +305,7 @@ public class GuiReplayViewer extends GuiScreen {
|
||||
} else {
|
||||
thumbnail = new GuiImage(this).setTexture(thumbImage).setSize(30 * 16 / 9, 30);
|
||||
}
|
||||
duration.setText(DurationUtils.convertSecondsToShortString(metaData.getDuration() / 1000));
|
||||
duration.setText(Utils.convertSecondsToShortString(metaData.getDuration() / 1000));
|
||||
addElements(null, durationPanel);
|
||||
|
||||
setLayout(new CustomLayout<GuiReplayEntry>() {
|
||||
|
||||
Reference in New Issue
Block a user