mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-11-13 20:47:19 +01:00
Added a new request_item_edit signal to the DataList.
This commit is contained in:
parent
e68b2733de
commit
e675512362
@ -11,10 +11,15 @@ var _ignore_changed_event : bool = false
|
||||
var _plugin : EditorPlugin = null
|
||||
var _undo_redo : UndoRedo = null
|
||||
|
||||
signal request_item_edit(world_gen_base_reosurce)
|
||||
|
||||
func _init():
|
||||
if !is_connected("item_edited", self, "on_item_edited"):
|
||||
connect("item_edited", self, "on_item_edited")
|
||||
|
||||
if !is_connected("button_pressed", self, "on_tree_button_pressed"):
|
||||
connect("button_pressed", self, "on_tree_button_pressed")
|
||||
|
||||
func set_plugin(plugin : EditorPlugin) -> void:
|
||||
_plugin = plugin
|
||||
_undo_redo = _plugin.get_undo_redo()
|
||||
@ -166,6 +171,14 @@ func on_resource_changed() -> void:
|
||||
|
||||
call_deferred("refresh")
|
||||
|
||||
func on_tree_button_pressed(item: TreeItem, column: int, id: int) -> void:
|
||||
var resource : WorldGenBaseResource = item.get_meta("res")
|
||||
|
||||
if !resource:
|
||||
return
|
||||
|
||||
emit_signal("request_item_edit", resource)
|
||||
|
||||
func on_item_edited() -> void:
|
||||
var item : TreeItem = get_edited()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user