Disabled window position/size save/restore in tool mode

This commit is contained in:
RodZill4 2019-11-22 07:48:14 +01:00
parent 8650a5ae40
commit 2e06e9db9a

View File

@ -59,7 +59,9 @@ var is_mac = false
func _ready() -> void:
# Restore the window position/size if values are present in the configuration cache
config_cache.load("user://cache.ini")
if Engine.editor_hint:
set_process_input(false)
else:
if config_cache.has_section_key("window", "screen"):
OS.current_screen = config_cache.get_value("window", "screen")
if config_cache.has_section_key("window", "maximized"):
@ -515,6 +517,7 @@ func _on_Preview_show_background_preview(v) -> void:
func _exit_tree() -> void:
# Save the window position and size to remember it when restarting the application
if !Engine.editor_hint:
config_cache.set_value("window", "screen", OS.current_screen)
config_cache.set_value("window", "maximized", OS.window_maximized || OS.window_fullscreen)
config_cache.set_value("window", "position", OS.window_position)