feat: edit entries
This commit is contained in:
parent
8e215a6962
commit
3d87fd8fcb
30 changed files with 519 additions and 6 deletions
38
src/UI/done_box.gd
Normal file
38
src/UI/done_box.gd
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
extends HBoxContainer
|
||||
|
||||
@export var edit_menu: PackedScene
|
||||
@export var options_menu: MenuButton
|
||||
|
||||
@export var entry_text_box: RichTextLabel
|
||||
|
||||
var instantiated_menu
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
options_menu.get_popup().id_pressed.connect(_on_index_pressed)
|
||||
|
||||
SignalBus.edit_window_text_saved.connect(on_edit_window_text_save)
|
||||
SignalBus.edit_window_closed.connect(on_edit_window_closed)
|
||||
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
func _on_index_pressed(index:int) -> void:
|
||||
print(index)
|
||||
if index == 0:
|
||||
instantiated_menu = edit_menu.instantiate()
|
||||
add_child(instantiated_menu)
|
||||
SignalBus.edit_window_requested.emit(entry_text_box.text)
|
||||
if index == 1:
|
||||
queue_free()
|
||||
|
||||
|
||||
func on_edit_window_text_save(text: String) -> void:
|
||||
entry_text_box.text = text
|
||||
|
||||
func on_edit_window_closed() -> void:
|
||||
instantiated_menu.queue_free()
|
||||
Loading…
Add table
Add a link
Reference in a new issue