Skip to content

Commit

Permalink
Improved Confirmation Dialog (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrawlingst authored Feb 18, 2024
1 parent 3c00f42 commit 0623267
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions addons/pandora/ui/components/entity_tree/entity_tree.gd
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func _search_item_recursive(item: TreeItem, text: String) -> bool:


func queue_delete(entity_id:String) -> void:
confirm("Confirmation Needed", "Are you sure you want to delete?", func():
var item = entity_items[entity_id]
var entity = item.get_metadata(0) as PandoraEntity
var item = entity_items[entity_id]
var entity = item.get_metadata(0) as PandoraEntity
confirm("Confirmation Needed", "Are you sure you want to delete '%s'?" % entity.get_entity_name(), func():
entity_deletion_issued.emit(entity)
if item.get_parent() != null:
item.get_parent().remove_child(item)
Expand Down
3 changes: 2 additions & 1 deletion addons/pandora/ui/components/entity_tree/entity_tree.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ layout_mode = 1

[node name="ConfirmationDialog" type="ConfirmationDialog" parent="."]
initial_position = 2
dialog_text = "Are you sure you want to delete?"
size = Vector2i(303, 80)
dialog_text = "Are you sure you want to delete '%s'?"

0 comments on commit 0623267

Please sign in to comment.