From 06baf4555dc1c7a64bed7d059fbe34c99e9638fb Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 6 Sep 2024 23:43:42 +0200 Subject: refactor settings again (part 1) --- client/menu/settings/input/input_value_node.gd | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'client/menu/settings/input/input_value_node.gd') diff --git a/client/menu/settings/input/input_value_node.gd b/client/menu/settings/input/input_value_node.gd index 125a946b..9f89416b 100644 --- a/client/menu/settings/input/input_value_node.gd +++ b/client/menu/settings/input/input_value_node.gd @@ -1,5 +1,6 @@ # Hurry Curry! - a game about cooking # Copyright 2024 tpart +# Copyright 2024 metamuffin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by @@ -19,6 +20,8 @@ class_name InputValueNode var value: Array[InputEvent] = [] var listening := false +signal changed() + @onready var actions_container: VBoxContainer = $ActionsContainer @onready var add_button: Button = $Add @onready var add_text = add_button.text @@ -55,6 +58,7 @@ func update(fix_focus: bool = false): func erase_event(e: InputEvent): value.erase(e) update(true) + changed.emit() func _input(e: InputEvent): if listening: @@ -66,6 +70,7 @@ func _input(e: InputEvent): value.append(e) _on_add_pressed() update() + changed.emit() func events_equal(e1: InputEvent, e2: InputEvent) -> bool: if e1 is InputEventKey and e2 is InputEventKey: -- cgit v1.2.3-70-g09d2