From c3a51582c4d7e7960fb3cbf87d6804ce97e52d84 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 22 Jan 2022 00:22:01 +0100 Subject: [PATCH] Don't let world editor's property list's refresh get called muliple times in a frame. --- game/addons/world_generator/ui/ResourcePropertyList.gd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/game/addons/world_generator/ui/ResourcePropertyList.gd b/game/addons/world_generator/ui/ResourcePropertyList.gd index 9e666f76..6d6dbbcf 100644 --- a/game/addons/world_generator/ui/ResourcePropertyList.gd +++ b/game/addons/world_generator/ui/ResourcePropertyList.gd @@ -7,6 +7,7 @@ var _edited_resource : WorldGenBaseResource = null var properties : Array = Array() var _ignore_changed_evend : bool = false +var _refresh_queued : bool = false var _plugin : EditorPlugin = null var _undo_redo : UndoRedo = null @@ -460,6 +461,8 @@ func refresh() -> void: $MainContainer/HBoxContainer/ClassLE.text = cls_str $MainContainer/HBoxContainer2/ScriptLE.text = script_str + + _refresh_queued = false func edit_resource(wgw) -> void: if _edited_resource: @@ -476,5 +479,9 @@ func edit_resource(wgw) -> void: func on_edited_resource_changed() -> void: if _ignore_changed_evend: return + + if _refresh_queued: + return + _refresh_queued = true call_deferred("refresh")