Implement replay folders & sorting

This commit is contained in:
Moulberry committed 2024-11-17 02:18:26 +08:00
1 parent 44794e4edd
commit 1a17640856
21 files changed
+1088 -565

No files matched your search

@@ -2,9 +2,8 @@ package com.moulberry.flashback.editor.ui.windows;
import com.moulberry.flashback.Flashback;
import com.moulberry.flashback.configuration.FlashbackConfig;
import com.moulberry.flashback.exporting.AsyncFileDialogs;
import com.moulberry.flashback.exporting.ExportJobQueue;
import com.moulberry.flashback.screen.SelectReplayScreen;
import com.moulberry.flashback.screen.select_replay.SelectReplayScreen;
import imgui.ImGui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.TitleScreen;
@@ -73,7 +72,7 @@ public class MainMenuBar {
minecraft.level.disconnect();
}
minecraft.disconnect();
minecraft.setScreen(new SelectReplayScreen(new TitleScreen()));
minecraft.setScreen(new SelectReplayScreen(new TitleScreen(), Flashback.getReplayFolder()));
}
ImGui.endMenu();
}
@@ -105,7 +104,7 @@ public class MainMenuBar {
} else {
openedWindows.add(windowName);
}
Flashback.getConfig().saveToDefaultFolder();
Flashback.getConfig().delayedSaveToDefaultFolder();
}
}
@@ -54,39 +54,39 @@ public class MovementWindow {
boolean flightCameraDirection = direction[0] == 1;
if (config.flightCameraDirection != flightCameraDirection) {
config.flightCameraDirection = flightCameraDirection;
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
float[] momentum = new float[]{config.flightMomentum};
ImGui.sliderFloat("Momentum", momentum, 0.0f, 1.0f);
if (config.flightMomentum != momentum[0]) {
config.flightMomentum = momentum[0];
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
if (ImGui.checkbox("Lock X", config.flightLockX)) {
config.flightLockX = !config.flightLockX;
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
ImGui.sameLine();
if (ImGui.checkbox("Lock Y", config.flightLockY)) {
config.flightLockY = !config.flightLockY;
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
ImGui.sameLine();
if (ImGui.checkbox("Lock Z", config.flightLockZ)) {
config.flightLockZ = !config.flightLockZ;
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
if (ImGui.checkbox("Lock Yaw", config.flightLockYaw)) {
config.flightLockYaw = !config.flightLockYaw;
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
ImGui.sameLine();
if (ImGui.checkbox("Lock Pitch", config.flightLockPitch)) {
config.flightLockPitch = !config.flightLockPitch;
config.saveToDefaultFolder();
config.delayedSaveToDefaultFolder();
}
}
ImGui.end();
@@ -1,6 +1,7 @@
package com.moulberry.flashback.editor.ui.windows;
import com.moulberry.flashback.Flashback;
import com.moulberry.flashback.configuration.FlashbackConfig;
import com.moulberry.flashback.editor.ui.WindowOpenState;
import imgui.type.ImBoolean;
@@ -22,7 +23,8 @@ public enum WindowType {
}
public static void renderAll() {
Set<String> openWindows = Flashback.getConfig().openedWindows;
FlashbackConfig config = Flashback.getConfig();
Set<String> openWindows = config.openedWindows;
for (WindowType windowType : values()) {
if (openWindows.contains(windowType.windowId)) {
@@ -33,6 +35,7 @@ public enum WindowType {
if (!windowType.open.get()) {
openWindows.remove(windowType.windowId);
config.delayedSaveToDefaultFolder();
}
windowType.openState = WindowOpenState.OPEN;