Selected markers now deselect themselves immediately, and can't be selected at all if part of a multi-selection.

This commit is contained in:
Jamie Greunbaum 2024-06-06 16:09:41 -04:00
parent 524948c800
commit 941ea98a35

View File

@ -141,8 +141,13 @@ func __marker_root_exists(scene_path:String) -> bool:
return __bugbot_marker_containers.has(scene_path) and is_instance_valid(__bugbot_marker_containers[scene_path]) return __bugbot_marker_containers.has(scene_path) and is_instance_valid(__bugbot_marker_containers[scene_path])
func __on_marker_selection_changed() -> void: func __on_marker_selection_changed() -> void:
var selected : Array = get_editor_interface().get_selection().get_selected_nodes() var selection : EditorSelection = get_editor_interface().get_selection()
if selected.size() == 1: var selected : Array = selection.get_selected_nodes()
if selected.size() > 1:
for node:Node in selected:
if node is BugMarker:
selection.remove_node(node)
elif selected.size() == 1:
var selected_marker : Node = selected[0] var selected_marker : Node = selected[0]
if selected_marker is BugMarker: if selected_marker is BugMarker:
var bug_popup : ConfirmationDialog = ConfirmationDialog.new() var bug_popup : ConfirmationDialog = ConfirmationDialog.new()
@ -151,13 +156,10 @@ func __on_marker_selection_changed() -> void:
bug_popup.ok_button_text = &"Open In Browser" bug_popup.ok_button_text = &"Open In Browser"
bug_popup.get_ok_button().pressed.connect(__marker_selection_open_bug_page.bind(bug_info, selected_marker)) bug_popup.get_ok_button().pressed.connect(__marker_selection_open_bug_page.bind(bug_info, selected_marker))
bug_popup.cancel_button_text = &"Cancel" bug_popup.cancel_button_text = &"Cancel"
bug_popup.get_cancel_button().pressed.connect(__marker_selection_cancelled.bind(selected_marker))
bug_popup.popup_exclusive_centered(selected_marker) bug_popup.popup_exclusive_centered(selected_marker)
selection.remove_node(selected_marker)
func __marker_selection_open_bug_page(bug_data:BugbotBugData, selected_marker:Node): func __marker_selection_open_bug_page(bug_data:BugbotBugData, selected_marker:Node):
get_editor_interface().get_selection().remove_node(selected_marker)
OS.shell_open(__editor_server_api._get_bug_url(bug_data)) OS.shell_open(__editor_server_api._get_bug_url(bug_data))
func __marker_selection_cancelled(selected_marker:Node):
get_editor_interface().get_selection().remove_node(selected_marker)
func __on_editor_tab_switched(new_scene:Node) -> void: func __on_editor_tab_switched(new_scene:Node) -> void: