crownengine / crown

The flexible game engine.
https://www.crownengine.org
Other
2.1k stars 152 forks source link

tools: restore window state #152

Open dbartolini opened 1 year ago

dbartolini commented 1 year ago

https://developer.gnome.org/documentation/tutorials/save-state.html

Level Editor's main window creation: https://github.com/crownengine/crown/blob/3d505e0f8a0ea5a185e9d5550b439ba4d8f613fa/tools/level_editor/level_editor.vala#L767

SeanKuehl commented 9 months ago

Hey, been working on the code and have a question. Restore the window state to the size it was when it was left/focused away from? If so, when should the state be saved since the level editor window doesn't seem to be the one with the on_focus_out function? I'll commit my latest code to the pull request if needed for reference.

dbartolini commented 9 months ago

This is for saving/restoring window state across sessions, so you load the SJSON in LevelEditor.startup() and save in LevelEditor.shutdown(). It should be similar if not equal to _settings's management.