diff options
author | metamuffin <metamuffin@disroot.org> | 2025-06-07 21:11:14 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-06-07 21:11:14 +0200 |
commit | 742f87a08fe87de778f006d90bc128b735f4494d (patch) | |
tree | e178941c23e747d264a41fa26505d82a0752cbe3 /client/menu/settings/button_setting.gd | |
parent | d28b35355c854b37adfbe7ee0410b98a3c18512b (diff) | |
download | hurrycurry-742f87a08fe87de778f006d90bc128b735f4494d.tar hurrycurry-742f87a08fe87de778f006d90bc128b735f4494d.tar.bz2 hurrycurry-742f87a08fe87de778f006d90bc128b735f4494d.tar.zst |
support opening setup menu from settings
Diffstat (limited to 'client/menu/settings/button_setting.gd')
-rw-r--r-- | client/menu/settings/button_setting.gd | 30 |
1 files changed, 30 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 |