Now the wortld generator addon's datalist popup will focus the line edit for changing the resource's name. Also it will accept enter as ok.

This commit is contained in:
Relintai 2022-08-05 19:55:58 +02:00
parent 7c861eda5d
commit b101213d84
3 changed files with 8 additions and 1 deletions

View File

@ -13,7 +13,7 @@ var _undo_redo : UndoRedo = null
func _init():
connect("item_activated", self, "on_item_activated")
func set_plugin(plugin : EditorPlugin) -> void:
_plugin = plugin
_undo_redo = _plugin.get_undo_redo()
@ -115,6 +115,10 @@ func name_edit_dialog_ok_pressed() -> void:
name_edited_resource.emit_changed()
name_edited_resource = null
on_resource_changed()
func name_edit_dialog_line_edit_text_entered(var s : String) -> void:
$NameEditDialog.hide()
name_edit_dialog_ok_pressed()
func delete_button_pressed() -> void:
var item : TreeItem = get_selected()

View File

@ -81,4 +81,6 @@ margin_right = 207.0
margin_bottom = 42.0
[connection signal="confirmed" from="NameDialog" to="." method="name_dialog_ok_pressed"]
[connection signal="about_to_show" from="NameEditDialog" to="NameEditDialog/VBoxContainer/LineEdit" method="grab_focus" flags=3]
[connection signal="confirmed" from="NameEditDialog" to="." method="name_edit_dialog_ok_pressed"]
[connection signal="text_entered" from="NameEditDialog/VBoxContainer/LineEdit" to="." method="name_edit_dialog_line_edit_text_entered"]

View File

@ -398,6 +398,7 @@ zone_bevel = 0.3
zone_base = 0.0
[sub_resource type="Resource" id=21]
resource_name = "C"
script = ExtResource( 3 )
rect = Rect2( 241, 247, 40, 25 )
min_size = Vector2i( 1, 1 )