|
@@ -3,11 +3,13 @@ package xyz.tbvns.ui.MenuBarTabs;
|
|
import imgui.ImGui;
|
|
import imgui.ImGui;
|
|
import xyz.tbvns.DataManager;
|
|
import xyz.tbvns.DataManager;
|
|
import xyz.tbvns.Decoder;
|
|
import xyz.tbvns.Decoder;
|
|
|
|
+import xyz.tbvns.GeometryDash.GeometryDashProcess;
|
|
import xyz.tbvns.GeometryDash.Render;
|
|
import xyz.tbvns.GeometryDash.Render;
|
|
import xyz.tbvns.LevelInfo;
|
|
import xyz.tbvns.LevelInfo;
|
|
import xyz.tbvns.Main;
|
|
import xyz.tbvns.Main;
|
|
import xyz.tbvns.ui.MenuBarTab;
|
|
import xyz.tbvns.ui.MenuBarTab;
|
|
import xyz.tbvns.ui.UIManager;
|
|
import xyz.tbvns.ui.UIManager;
|
|
|
|
+import xyz.tbvns.ui.Windows.GDRunningErrorWindow;
|
|
import xyz.tbvns.ui.Windows.LevelSelector;
|
|
import xyz.tbvns.ui.Windows.LevelSelector;
|
|
|
|
|
|
public class SaveMenu implements MenuBarTab {
|
|
public class SaveMenu implements MenuBarTab {
|
|
@@ -16,9 +18,13 @@ public class SaveMenu implements MenuBarTab {
|
|
if (ImGui.beginMenu("Files")) {
|
|
if (ImGui.beginMenu("Files")) {
|
|
if (ImGui.menuItem("Save", "CTRL S")) {
|
|
if (ImGui.menuItem("Save", "CTRL S")) {
|
|
try {
|
|
try {
|
|
- LevelInfo.setLevelString(new Render().fullRender(24));
|
|
|
|
- LevelInfo.getLevel().setEncodedLevelString(Decoder.encodeLevel(LevelInfo.getLevelString()));
|
|
|
|
- DataManager.saveLevel(LevelInfo.getLevel());
|
|
|
|
|
|
+ if (!GeometryDashProcess.isRunning()) {
|
|
|
|
+ LevelInfo.setLevelString(new Render().fullRender(24));
|
|
|
|
+ LevelInfo.getLevel().setEncodedLevelString(Decoder.encodeLevel(LevelInfo.getLevelString()));
|
|
|
|
+ DataManager.saveLevel(LevelInfo.getLevel());
|
|
|
|
+ } else {
|
|
|
|
+ UIManager.getActiveUI().put(GDRunningErrorWindow.class, true);
|
|
|
|
+ }
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|