diff options
Diffstat (limited to 'client/menu/settings')
-rw-r--r-- | client/menu/settings/button_setting.gd | 30 | ||||
-rw-r--r-- | client/menu/settings/button_setting.gd.uid | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/client/menu/settings/button_setting.gd b/client/menu/settings/button_setting.gd new file mode 100644 index 00000000..2f6cf7c1 --- /dev/null +++ b/client/menu/settings/button_setting.gd @@ -0,0 +1,30 @@ +# Hurry Curry! - a game about cooking +# Copyright 2025 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 +# the Free Software Foundation, version 3 of the License only. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. +# +class_name ButtonSetting +extends GameSetting + +var callback + +func _init(new_id: String, new_default, callback_): + callback = callback_ + super (new_id, new_default) + +func create_row(): + var row = super () + row.value_node = Button.new() + row.value_node.text = tr(nskey + ".button_label") + row.value_node.pressed.connect(callback) + return row diff --git a/client/menu/settings/button_setting.gd.uid b/client/menu/settings/button_setting.gd.uid new file mode 100644 index 00000000..cf0a8d95 --- /dev/null +++ b/client/menu/settings/button_setting.gd.uid @@ -0,0 +1 @@ +uid://dku75bw31ux1k |