Removed the name edit dialog from the DataList.

This commit is contained in:
Relintai 2022-08-05 21:54:08 +02:00
parent 4f2a13f1d4
commit 30be9d8e81
2 changed files with 0 additions and 55 deletions

View File

@ -12,8 +12,6 @@ var _plugin : EditorPlugin = null
var _undo_redo : UndoRedo = null
func _init():
#connect("item_activated", self, "on_item_activated")
if !is_connected("item_edited", self, "on_item_edited"):
connect("item_edited", self, "on_item_edited")
@ -124,17 +122,6 @@ func add_button_pressed() -> void:
func name_dialog_ok_pressed() -> void:
add_item($NameDialog/VBoxContainer/LineEdit.text)
func name_edit_dialog_ok_pressed() -> void:
if name_edited_resource:
name_edited_resource.resource_name = $NameEditDialog/VBoxContainer/LineEdit.text
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()
@ -179,20 +166,6 @@ func on_resource_changed() -> void:
call_deferred("refresh")
func on_item_activated() -> void:
var item : TreeItem = get_selected()
if !item:
return
name_edited_resource = item.get_meta("res")
if !name_edited_resource:
return
$NameEditDialog/VBoxContainer/LineEdit.text = name_edited_resource.resource_name
$NameEditDialog.popup_centered()
func on_item_edited() -> void:
var item : TreeItem = get_edited()

View File

@ -54,32 +54,4 @@ margin_top = 245.0
margin_right = 313.0
margin_bottom = 269.0
[node name="NameEditDialog" type="ConfirmationDialog" parent="."]
margin_right = 223.0
margin_bottom = 82.0
window_title = "Name"
resizable = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="NameEditDialog"]
margin_left = 8.0
margin_top = 8.0
margin_right = 215.0
margin_bottom = 50.0
[node name="Label" type="Label" parent="NameEditDialog/VBoxContainer"]
margin_right = 207.0
margin_bottom = 14.0
text = "Name"
[node name="LineEdit" type="LineEdit" parent="NameEditDialog/VBoxContainer"]
margin_top = 18.0
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"]