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 | |
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')
-rw-r--r-- | client/menu/menu.gd | 1 | ||||
-rw-r--r-- | client/menu/settings/button_setting.gd | 30 | ||||
-rw-r--r-- | client/menu/settings/button_setting.gd.uid | 1 | ||||
-rw-r--r-- | client/menu/setup.gd | 2 |
4 files changed, 34 insertions, 0 deletions
diff --git a/client/menu/menu.gd b/client/menu/menu.gd index 2e63a1fe..774c6c58 100644 --- a/client/menu/menu.gd +++ b/client/menu/menu.gd @@ -34,6 +34,7 @@ var open_since = 0 func _ready(): open_since = Time.get_ticks_msec() + Global.focused_menu = self focus_first(self) connect_button_sounds(self) update_parent_menu(self.get_parent()) 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 diff --git a/client/menu/setup.gd b/client/menu/setup.gd index f38f0bf7..b42000a0 100644 --- a/client/menu/setup.gd +++ b/client/menu/setup.gd @@ -46,6 +46,8 @@ func _ready(): # Enable msaa 2D for this scene Global.get_viewport().msaa_2d = Viewport.MSAA_4X + if Global.profile.username != "": username.text = Global.profile.username + super() func _character_selected(style: Dictionary): |