diff --git a/ClearDialogue/.classpath b/ClearDialogue/.classpath index 546796d..3c21705 100644 --- a/ClearDialogue/.classpath +++ b/ClearDialogue/.classpath @@ -11,8 +11,9 @@ - + + diff --git a/ClearDialogueIDE/.classpath b/ClearDialogueIDE/.classpath index c372b7e..8346a1b 100644 --- a/ClearDialogueIDE/.classpath +++ b/ClearDialogueIDE/.classpath @@ -1,8 +1,9 @@ - + + diff --git a/ClearDialogueIDE/src/nokori/clear_dialogue/ui/ClearDialogueIDECore.java b/ClearDialogueIDE/src/nokori/clear_dialogue/ui/ClearDialogueIDECore.java index 681245f..42164d4 100644 --- a/ClearDialogueIDE/src/nokori/clear_dialogue/ui/ClearDialogueIDECore.java +++ b/ClearDialogueIDE/src/nokori/clear_dialogue/ui/ClearDialogueIDECore.java @@ -64,6 +64,9 @@ public Window createWindow(WindowManager windowManager) throws GLFWException { if (WindowMemory.maximized) { window.maximize(); } + } else { + WindowMemory.init(window); + WindowMemory.save(); } //Window position memory diff --git a/ClearDialogueIDE/src/nokori/clear_dialogue/ui/util/WindowMemory.java b/ClearDialogueIDE/src/nokori/clear_dialogue/ui/util/WindowMemory.java index 114c5a9..5a46bf3 100644 --- a/ClearDialogueIDE/src/nokori/clear_dialogue/ui/util/WindowMemory.java +++ b/ClearDialogueIDE/src/nokori/clear_dialogue/ui/util/WindowMemory.java @@ -7,6 +7,8 @@ import java.io.OutputStream; import java.util.Properties; +import nokori.clear.windows.Window; + public class WindowMemory { public static final int CURRENT_VERSION = 1; @@ -15,6 +17,19 @@ public class WindowMemory { public static int x, y, width, height; public static boolean maximized; + /** + * Initializes WindowMemory by using the given window as a base. + * + * @param window + */ + public static void init(Window window) { + x = window.getX(); + y = window.getY(); + width = window.getWidth(); + height = window.getHeight(); + maximized = window.isMaximized(); + } + /** * Loads the WindowMemory and synchronizes this class with it */