diff --git a/addons/material_maker/main_window.gd b/addons/material_maker/main_window.gd index 59502bb..1d9855a 100644 --- a/addons/material_maker/main_window.gd +++ b/addons/material_maker/main_window.gd @@ -59,17 +59,19 @@ 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 config_cache.has_section_key("window", "screen"): - OS.current_screen = config_cache.get_value("window", "screen") - if config_cache.has_section_key("window", "maximized"): - OS.window_maximized = config_cache.get_value("window", "maximized") - - if !OS.window_maximized: - if config_cache.has_section_key("window", "position"): - OS.window_position = config_cache.get_value("window", "position") - if config_cache.has_section_key("window", "size"): - OS.window_size = config_cache.get_value("window", "size") + 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"): + OS.window_maximized = config_cache.get_value("window", "maximized") + + if !OS.window_maximized: + if config_cache.has_section_key("window", "position"): + OS.window_position = config_cache.get_value("window", "position") + if config_cache.has_section_key("window", "size"): + OS.window_size = config_cache.get_value("window", "size") if OS.get_name() == "OSX": is_mac = true @@ -515,8 +517,9 @@ 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 - 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) - config_cache.set_value("window", "size", OS.window_size) - config_cache.save("user://cache.ini") + 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) + config_cache.set_value("window", "size", OS.window_size) + config_cache.save("user://cache.ini")