Don't let world editor's property list's refresh get called muliple times in a frame.

This commit is contained in:
Relintai 2022-01-22 00:22:01 +01:00
parent 42c91d88d9
commit c3a51582c4

View File

@ -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
@ -461,6 +462,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:
_edited_resource.disconnect("changed", self, "on_edited_resource_changed")
@ -477,4 +480,8 @@ func on_edited_resource_changed() -> void:
if _ignore_changed_evend:
return
if _refresh_queued:
return
_refresh_queued = true
call_deferred("refresh")