From 742f87a08fe87de778f006d90bc128b735f4494d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 7 Jun 2025 21:11:14 +0200 Subject: support opening setup menu from settings --- client/menu/settings/button_setting.gd | 30 ++++++++++++++++++++++++++++++ client/menu/settings/button_setting.gd.uid | 1 + 2 files changed, 31 insertions(+) create mode 100644 client/menu/settings/button_setting.gd create mode 100644 client/menu/settings/button_setting.gd.uid (limited to 'client/menu/settings') 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 . +# +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 -- cgit v1.2.3-70-g09d2