mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 22:16:01 +00:00
0.6.0
This commit is contained in:
1 parent
d589647c36
commit
7f1d199704
20 files changed
+461
-94
No files matched your search
@@ -692,23 +692,24 @@ public class ReplayUI {
|
||||
|
||||
if (Minecraft.getInstance().screen != null) {
|
||||
ImGui.captureMouseFromApp(false);
|
||||
}
|
||||
boolean isMovingCamera = isMovingCamera();
|
||||
if (isFrameFocused || isMovingCamera) {
|
||||
LocalPlayer player = Minecraft.getInstance().player;
|
||||
if (player != null) {
|
||||
int wheelY = (int) Math.signum(ImGui.getIO().getMouseWheel());
|
||||
if (wheelY != 0) {
|
||||
final float defaultFlyingSpeed = 0.05f;
|
||||
float flyingSpeed = Mth.clamp(player.getAbilities().getFlyingSpeed() + (float)wheelY * defaultFlyingSpeed / 10f,
|
||||
} else {
|
||||
boolean isMovingCamera = isMovingCamera();
|
||||
if (isFrameFocused || isMovingCamera) {
|
||||
LocalPlayer player = Minecraft.getInstance().player;
|
||||
if (player != null) {
|
||||
int wheelY = (int) Math.signum(ImGui.getIO().getMouseWheel());
|
||||
if (wheelY != 0) {
|
||||
final float defaultFlyingSpeed = 0.05f;
|
||||
float flyingSpeed = Mth.clamp(player.getAbilities().getFlyingSpeed() + (float)wheelY * defaultFlyingSpeed / 10f,
|
||||
defaultFlyingSpeed / 10f, defaultFlyingSpeed * 10.0f);
|
||||
setInfoOverlay(String.format("Flying Speed: %.1f", flyingSpeed / defaultFlyingSpeed));
|
||||
player.getAbilities().setFlyingSpeed(flyingSpeed);
|
||||
setInfoOverlay(String.format("Flying Speed: %.1f", flyingSpeed / defaultFlyingSpeed));
|
||||
player.getAbilities().setFlyingSpeed(flyingSpeed);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isMovingCamera && ImGui.getIO().getWantCaptureMouse() && !popupOpenLastFrame && !ImGui.isPopupOpen("", ImGuiPopupFlags.AnyPopup)) {
|
||||
fireCancelNavInput |= handleBasicInputs();
|
||||
if (!isMovingCamera && ImGui.getIO().getWantCaptureMouse() && !popupOpenLastFrame && !ImGui.isPopupOpen("", ImGuiPopupFlags.AnyPopup)) {
|
||||
fireCancelNavInput |= handleBasicInputs();
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class StartExportWindow {
|
||||
|
||||
@@ -284,6 +285,10 @@ public class StartExportWindow {
|
||||
|
||||
container = ImGuiHelper.enumCombo("Container", container, containers);
|
||||
|
||||
if (container == VideoContainer.PNG_SEQUENCE) {
|
||||
return;
|
||||
}
|
||||
|
||||
VideoCodec[] codecs = container.getSupportedVideoCodecs(transparentBackground);
|
||||
|
||||
if (codecs.length == 0) {
|
||||
@@ -334,8 +339,6 @@ public class StartExportWindow {
|
||||
numBitrate = stringToBitrate(ImGuiHelper.getString(bitrate));
|
||||
}
|
||||
|
||||
String encoder = videoCodec.getEncoders()[selectedVideoEncoder[0]];
|
||||
|
||||
if (defaultExportPath == null || !Files.exists(defaultExportPath)) {
|
||||
defaultExportPath = FabricLoader.getInstance().getGameDir();
|
||||
}
|
||||
@@ -355,9 +358,7 @@ public class StartExportWindow {
|
||||
defaultName = "output." + container.extension();
|
||||
}
|
||||
|
||||
String defaultExportPathString = defaultExportPath.toString();
|
||||
return AsyncFileDialogs.saveFileDialog(defaultExportPathString, defaultName,
|
||||
container.extension(), container.extension()).thenApply(pathStr -> {
|
||||
Function<String, ExportSettings> callback = pathStr -> {
|
||||
if (pathStr != null) {
|
||||
int start = Math.max(0, startEndTick[0]);
|
||||
int end = Math.max(start, startEndTick[1]);
|
||||
@@ -380,19 +381,43 @@ public class StartExportWindow {
|
||||
}
|
||||
|
||||
boolean transparent = transparentBackground && !editorState.replayVisuals.renderSky;
|
||||
String encoder = videoCodec.getEncoders()[selectedVideoEncoder[0]];
|
||||
|
||||
VideoCodec useVideoCodec = videoCodec;
|
||||
AudioCodec useAudioCodec = audioCodec;
|
||||
boolean shouldRecordAudio = recordAudio;
|
||||
|
||||
if (container == VideoContainer.PNG_SEQUENCE) {
|
||||
useVideoCodec = null;
|
||||
encoder = null;
|
||||
shouldRecordAudio = false;
|
||||
}
|
||||
|
||||
if (!shouldRecordAudio) {
|
||||
useAudioCodec = null;
|
||||
}
|
||||
|
||||
Path path = Path.of(pathStr);
|
||||
defaultExportPath = path.getParent();
|
||||
return new ExportSettings(name, editorState.copy(),
|
||||
player.position(), player.getYRot(), player.getXRot(),
|
||||
resolution[0], resolution[1], start, end,
|
||||
Math.max(1, framerate[0]), resetRng, container, videoCodec, encoder, numBitrate, transparent, ssaa,
|
||||
recordAudio, stereoAudio, audioCodec,
|
||||
Math.max(1, framerate[0]), resetRng, container, useVideoCodec, encoder, numBitrate, transparent, ssaa,
|
||||
shouldRecordAudio, stereoAudio, useAudioCodec,
|
||||
path);
|
||||
}
|
||||
|
||||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
String defaultExportPathString = defaultExportPath.toString();
|
||||
if (container == VideoContainer.PNG_SEQUENCE) {
|
||||
return AsyncFileDialogs.openFolderDialog(defaultExportPathString).thenApply(callback);
|
||||
} else {
|
||||
return AsyncFileDialogs.saveFileDialog(defaultExportPathString, defaultName,
|
||||
container.extension(), container.extension()).thenApply(callback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static int stringToBitrate(String string) {
|
||||
|
||||
@@ -282,10 +282,9 @@ public class TimelineWindow {
|
||||
|
||||
// render markers
|
||||
{
|
||||
|
||||
for (int tick = minTicks; tick <= minTicks + availableTicks; tick++) {
|
||||
for (int tick = minTicks-10; tick <= minTicks + availableTicks + 10; tick++) {
|
||||
Map.Entry<Integer, ReplayMarker> markerEntry = metadata.replayMarkers.ceilingEntry(tick);
|
||||
if (markerEntry == null || markerEntry.getKey() > minTicks + availableTicks) {
|
||||
if (markerEntry == null || markerEntry.getKey() > minTicks + availableTicks + 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1270,9 +1269,9 @@ public class TimelineWindow {
|
||||
}
|
||||
}
|
||||
|
||||
for (int tick = minTicks; tick <= minTicks + availableTicks; tick++) {
|
||||
for (int tick = minTicks - 10; tick <= minTicks + availableTicks + 10; tick++) {
|
||||
var entry = keyframeTimes.ceilingEntry(tick);
|
||||
if (entry == null || entry.getKey() > minTicks + availableTicks) {
|
||||
if (entry == null || entry.getKey() > minTicks + availableTicks + 10) {
|
||||
break;
|
||||
}
|
||||
tick = entry.getKey();
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.moulberry.flashback.editor.ui.ImGuiHelper;
|
||||
import imgui.ImGui;
|
||||
import imgui.flag.ImGuiColorEditFlags;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -128,6 +129,28 @@ public class VisualsWindow {
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui.checkbox("Override Fog Colour", visuals.overrideFogColour)) {
|
||||
visuals.overrideFogColour = !visuals.overrideFogColour;
|
||||
if (visuals.overrideFogColour) {
|
||||
visuals.fogColour[0] = FogRenderer.fogRed;
|
||||
visuals.fogColour[1] = FogRenderer.fogGreen;
|
||||
visuals.fogColour[2] = FogRenderer.fogBlue;
|
||||
}
|
||||
editorState.markDirty();
|
||||
}
|
||||
if (visuals.overrideFogColour) {
|
||||
if (ImGui.colorButton("Fog Colour", visuals.fogColour)) {
|
||||
ImGui.openPopup("##EditFogColour");
|
||||
}
|
||||
ImGui.sameLine();
|
||||
ImGui.text("Fog Colour");
|
||||
|
||||
if (ImGui.beginPopup("##EditFogColour")) {
|
||||
ImGui.colorPicker3("Fog Colour", visuals.fogColour);
|
||||
ImGui.endPopup();
|
||||
}
|
||||
}
|
||||
|
||||
// FOV
|
||||
if (ImGui.checkbox("Override FOV", visuals.overrideFov)) {
|
||||
visuals.overrideFov = !visuals.overrideFov;
|
||||
|
||||
Reference in new issue
Block a user