diff options
| author | dam <dam@gudinoff> | 2022-03-28 16:26:50 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-03-28 16:26:50 +0000 |
| commit | 9083809865719e443b8c85af0f4a517e7b2742e1 (patch) | |
| tree | 2750503a08ccc93c3108f7335f6251e107f0203b /option_set | |
| parent | a34abdedf2feebcd17e402d9ed650a7cd17cbfe9 (diff) | |
| download | surgery-log-9083809865719e443b8c85af0f4a517e7b2742e1.tar.zst surgery-log-9083809865719e443b8c85af0f4a517e7b2742e1.zip | |
Add title on popup control and use it to display the option sets placeholder texts.
Diffstat (limited to 'option_set')
| -rw-r--r-- | option_set/option_set.gd | 6 | ||||
| -rw-r--r-- | option_set/option_set_list.gd | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/option_set/option_set.gd b/option_set/option_set.gd index 040566a..2ac1475 100644 --- a/option_set/option_set.gd +++ b/option_set/option_set.gd @@ -1,6 +1,8 @@ extends Control class_name OptionSet +export var placeholder: String + var text: String setget set_text, get_text func set_text(var value: String): @@ -19,7 +21,7 @@ onready var options := get_node("/root/main/option_set_list") as OptionSetList func _ready(): assert(popup != null, "OptionSet failed to get 'popup' node.") - + input.placeholder_text = placeholder input.connect("focus_entered", input, "set", ["caret_position", input.max_length]) input.connect("focus_exited", input, "deselect") @@ -34,7 +36,7 @@ func show_options(options_array: Array): else: options.unselect() options.connect("item_selected", self, "option_selected", [], CONNECT_ONESHOT) - popup.popup_control(options) + popup.popup_control(input.placeholder_text, options) # popup.connect("item_selected", self, "option_selected", [], CONNECT_ONESHOT) # popup.clear_items() # popup_opt.visible = true diff --git a/option_set/option_set_list.gd b/option_set/option_set_list.gd index 6efd068..5ebe5bf 100644 --- a/option_set/option_set_list.gd +++ b/option_set/option_set_list.gd @@ -116,6 +116,7 @@ func remove_items(indices: Array): func clear_items(): items.clear() + v_scroll_bar.value = 0.0 is_dirty = true |
