fix: renaming a collection only renames selected one
This commit is contained in:
parent
15b56ef048
commit
cf7669fadc
9 changed files with 51 additions and 30 deletions
|
|
@ -10,19 +10,17 @@ var instantiated_menu
|
|||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
SignalBus.edit_window_text_saved.connect(_on_edit_window_text_saved)
|
||||
SignalBus.on_window_closed.connect(_on_window_closed)
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
var text: String = "Collection %d" % container_box.container_id
|
||||
button_index = container_box.container_id
|
||||
var text: String = "Collection %d" % button_index
|
||||
button.text = text
|
||||
|
||||
|
||||
## Request to change to a panel with the ID - 1 of the button. [br]
|
||||
## Buttons are 1-indexed, while [member UIManager.panel_array] is 0-index
|
||||
func _on_button_pressed() -> void:
|
||||
SignalBus.on_panel_requested.emit(button_index-1)
|
||||
SignalBus.on_panel_requested.emit(button_index)
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
|
|
@ -43,12 +41,8 @@ func _on_popup_menu_index_pressed(index: int) -> void:
|
|||
if index == 0:
|
||||
instantiated_menu = edit_collection_name_window.instantiate()
|
||||
add_child(instantiated_menu)
|
||||
SignalBus.edit_window_requested.emit(instantiated_menu, button.text)
|
||||
SignalBus.edit_window_requested.emit(instantiated_menu, button.text, button_index)
|
||||
|
||||
func _on_edit_window_text_saved(window: Window, text: String) -> void:
|
||||
if not is_instance_of(window, EditCollectionNameWindow):
|
||||
return
|
||||
button.text = text
|
||||
|
||||
func _on_window_closed(window: Window) -> void:
|
||||
if not is_instance_of(window, EditCollectionNameWindow):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue