diff options
Diffstat (limited to 'client/menu/settings')
32 files changed, 0 insertions, 795 deletions
diff --git a/client/menu/settings/button_setting.gd b/client/menu/settings/button_setting.gd deleted file mode 100644 index fff8c184..00000000 --- a/client/menu/settings/button_setting.gd +++ /dev/null @@ -1,30 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 deleted file mode 100644 index cf0a8d95..00000000 --- a/client/menu/settings/button_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dku75bw31ux1k diff --git a/client/menu/settings/dropdown_setting.gd b/client/menu/settings/dropdown_setting.gd deleted file mode 100644 index 514df666..00000000 --- a/client/menu/settings/dropdown_setting.gd +++ /dev/null @@ -1,36 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 DropdownSetting -extends GameSetting - -var options: Array - -func _init(new_id: String, new_default, new_options: Array): - super(new_id, new_default) - options = new_options - -func create_row(): - var row = super() - row.value_node = OptionButton.new() - row.value_node.clip_text = true - for i in options: row.value_node.add_item(tr(nskey + "." + i)) - Settings.hook_changed_init(key, true, - func(value): - if is_instance_valid(row): - row.value_node.select(options.find(value)) - ) - row.value_node.item_selected.connect(func(item): Global.set_setting(key, options[item])) - return row diff --git a/client/menu/settings/dropdown_setting.gd.uid b/client/menu/settings/dropdown_setting.gd.uid deleted file mode 100644 index 409bf3ab..00000000 --- a/client/menu/settings/dropdown_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cjqswo4mwbvon diff --git a/client/menu/settings/game_setting.gd b/client/menu/settings/game_setting.gd deleted file mode 100644 index 4c8e561a..00000000 --- a/client/menu/settings/game_setting.gd +++ /dev/null @@ -1,46 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 GameSetting -extends Object - -var default -var key: String -var nskey: String - -func _init(new_id: String, new_default = null): - default = new_default - key = new_id - -func set_parent(parent: GameSetting): - if parent != null: key = parent.key + "." + key - nskey = "c.settings." + key - -func create_row(): - var row = preload("res://menu/settings/settings_row.tscn").instantiate() - row.description = tr(nskey) - row.reset.connect(func(): Global.set_setting(key, default)) - return row - -func check(): - if default != null: - if not key in Global.settings: - Global.set_setting_unchecked(key, default) - if typeof(default) != typeof(Global.settings[key]): - Global.set_setting_unchecked(key, default) - -func changed_keys(): - if Global.get_setting(key) != default: return [key] - else: return [] diff --git a/client/menu/settings/game_setting.gd.uid b/client/menu/settings/game_setting.gd.uid deleted file mode 100644 index 99d79bee..00000000 --- a/client/menu/settings/game_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cyy8l32i44l63 diff --git a/client/menu/settings/input/input_manager.gd b/client/menu/settings/input/input_manager.gd deleted file mode 100644 index e3158a03..00000000 --- a/client/menu/settings/input/input_manager.gd +++ /dev/null @@ -1,101 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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/>. -# -extends Node - -enum EventType { - KEYBOARD, - JOYPAD, - TOUCH, - OTHER -} - -var default_input_map = {} -var input_map: Dictionary - -func _init(): - default_input_map = get_input_map() - input_map = default_input_map.duplicate(true) - -func get_input_map() -> Dictionary: - var actions = InputMap.get_actions().filter(func isBuiltIn(k: String): return !k.begins_with("ui_")) - var kb = {} - for a in actions: - var input_events: Array[InputEvent] = InputMap.action_get_events(a).duplicate(true) - kb[a] = input_events - return kb - -func get_events(action_name: String) -> Array: - if not input_map.has(action_name): - push_error("Tried to get action %s in input map which does not exist" % action_name) - return [] - return input_map[action_name] - -func settings() -> Array: - var entries := [] - for k in input_map.keys(): entries.append(InputSetting.new(k)) - return entries - -func change_input_map_action(action_name: String, events: Array, save: bool = true): - if !InputMap.has_action(action_name): - push_error("Action %s does not exist" % action_name, false) - return - # Erase previous keybindings - InputMap.action_erase_events(action_name) - # Add new keybindings - for e in events: - InputMap.action_add_event(action_name, e) - - if save: - # Update input map dictionary - input_map = get_input_map() - # Save settings - Global.set_setting("input_map", input_map.duplicate(true)) - -func apply_input_map(new_input_map: Dictionary): - # Load into input map dictionary - for k in new_input_map.keys(): - input_map[k] = [] - for a in new_input_map[k]: - input_map[k].append(a) - - # Apply keybindings - for k in input_map.keys(): - change_input_map_action(k, input_map[k], false) - -func reset_input_map(): - Global.set_setting("input_map", default_input_map.duplicate()) - apply_input_map(Global.get_setting("input_map")) - -func get_event_type(input_event: InputEvent) -> EventType: - if input_event is InputEventKey or input_event is InputEventMouseButton: - return EventType.KEYBOARD - elif input_event is InputEventJoypadButton or input_event is InputEventJoypadMotion: - return EventType.JOYPAD - elif input_event is InputEventScreenTouch or input_event is InputEventScreenDrag: - return EventType.TOUCH - return EventType.OTHER - -func display_input_event(input_event: InputEvent) -> String: - if input_event is InputEventKey: - return tr("c.settings.input.keyboard").format([OS.get_keycode_string(input_event.physical_keycode)]) - elif input_event is InputEventMouseButton: - return tr("c.settings.input.mouse_button").format([input_event.button_index]) - elif input_event is InputEventJoypadButton: - return tr("c.settings.input.joypad").format([input_event.button_index]) - elif input_event is InputEventJoypadMotion: - return tr("c.settings.input.joypad_axis").format([input_event.axis]) - else: - return tr("c.settings.input.other_event") diff --git a/client/menu/settings/input/input_manager.gd.uid b/client/menu/settings/input/input_manager.gd.uid deleted file mode 100644 index 678c2192..00000000 --- a/client/menu/settings/input/input_manager.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://bfu78iwybbu2s diff --git a/client/menu/settings/input/input_setting.gd b/client/menu/settings/input/input_setting.gd deleted file mode 100644 index 72e1aa81..00000000 --- a/client/menu/settings/input/input_setting.gd +++ /dev/null @@ -1,39 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 InputSetting -extends GameSetting - -const INPUT_VALUE_NODE_SCENE = preload("res://menu/settings/input/input_value_node.tscn") - -func _init(new_id: String): - super(new_id) - default = InputManager.default_input_map[new_id] - -func create_row(): - var row = super() - row.value_node = INPUT_VALUE_NODE_SCENE.instantiate() - Settings.hook_changed_init(key, true, - func(value): - if is_instance_valid(row): - row.value_node.value = value - ) - row.value_node.changed.connect(func(): Global.set_setting(key, row.value_node.value)) - return row - -func changed_keys(): - return [key] - # if Global.array_eq(Global.get_setting(key), default): return [key] - # else: return [] diff --git a/client/menu/settings/input/input_setting.gd.uid b/client/menu/settings/input/input_setting.gd.uid deleted file mode 100644 index 7866fc2f..00000000 --- a/client/menu/settings/input/input_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://d2xwn2u4ycpe8 diff --git a/client/menu/settings/input/input_value_node.gd b/client/menu/settings/input/input_value_node.gd deleted file mode 100644 index 7c718e25..00000000 --- a/client/menu/settings/input/input_value_node.gd +++ /dev/null @@ -1,74 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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/>. -# -extends VBoxContainer -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 - -func _ready(): - update() - -func update(fix_focus: bool = false): - for c in actions_container.get_children(): - c.queue_free() - - for e: InputEvent in value: - var description: String = InputManager.display_input_event(e) - var button := Button.new() - - button.text = description - button.pressed.connect(erase_event.bind(e)) - actions_container.add_child(button) - - if fix_focus: - add_button.grab_focus() - -func erase_event(e: InputEvent): - value.erase(e) - update(true) - changed.emit() - -func _input(e: InputEvent): - if listening: - if e is InputEventKey or e is InputEventMouseButton or e is InputEventJoypadButton or e is InputEventJoypadMotion: - # Check if key was already added - for e2 in value: - if events_equal(e, e2): return - - 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: - return e1.physical_keycode == e2.physical_keycode - if (e1 is InputEventMouseButton and e2 is InputEventMouseButton) or (e1 is InputEventJoypadButton and e2 is InputEventJoypadButton): - return e1.button_index == e2.button_index - if e1 is InputEventJoypadMotion and e2 is InputEventJoypadMotion: - return e1.axis == e2.axis - return false - -func _on_add_pressed() -> void: - listening = not listening - add_button.text = tr("c.settings.input.press_any_key") if listening else add_text diff --git a/client/menu/settings/input/input_value_node.gd.uid b/client/menu/settings/input/input_value_node.gd.uid deleted file mode 100644 index 3669b991..00000000 --- a/client/menu/settings/input/input_value_node.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://ckb78voiq05e3 diff --git a/client/menu/settings/input/input_value_node.tscn b/client/menu/settings/input/input_value_node.tscn deleted file mode 100644 index c5ddc56f..00000000 --- a/client/menu/settings/input/input_value_node.tscn +++ /dev/null @@ -1,24 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://c6r0nv5daq7wc"] - -[ext_resource type="Script" uid="uid://ckb78voiq05e3" path="res://menu/settings/input/input_value_node.gd" id="1_snxax"] -[ext_resource type="Texture2D" uid="uid://cnfjbowd2i02r" path="res://menu/icons/plus.svg" id="2_3vlvc"] - -[node name="InputValueNode" type="VBoxContainer"] -offset_right = 128.0 -offset_bottom = 31.0 -theme_override_constants/separation = 0 -script = ExtResource("1_snxax") - -[node name="ActionsContainer" type="VBoxContainer" parent="."] -layout_mode = 2 -theme_override_constants/separation = 0 - -[node name="Add" type="Button" parent="."] -custom_minimum_size = Vector2(128, 0) -layout_mode = 2 -size_flags_vertical = 3 -text = "c.settings.input.add" -icon = ExtResource("2_3vlvc") -expand_icon = true - -[connection signal="pressed" from="Add" to="." method="_on_add_pressed"] diff --git a/client/menu/settings/number_setting.gd b/client/menu/settings/number_setting.gd deleted file mode 100644 index 5fa5a115..00000000 --- a/client/menu/settings/number_setting.gd +++ /dev/null @@ -1,41 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 NumberSetting -extends GameSetting - -var placeholder: String -var min_value: int -var max_value: int - -func _init(new_id: String, new_default: int, new_min_value: int, new_max_value: int): - super(new_id, new_default) - min_value = new_min_value - max_value = new_max_value - -func create_row(): - var row = super() - var input := SpinBox.new() - input.min_value = min_value - input.max_value = max_value - - input.value_changed.connect(func(value): Global.set_setting(key, value as int)) - Settings.hook_changed_init(key, true, - func(v): - if is_instance_valid(input): - input.value = v - ) - row.value_node = input - return row diff --git a/client/menu/settings/number_setting.gd.uid b/client/menu/settings/number_setting.gd.uid deleted file mode 100644 index 4301c642..00000000 --- a/client/menu/settings/number_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://babmw2ohuhmuk diff --git a/client/menu/settings/path_setting.gd b/client/menu/settings/path_setting.gd deleted file mode 100644 index b09ccccd..00000000 --- a/client/menu/settings/path_setting.gd +++ /dev/null @@ -1,64 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 PathSetting -extends TextSetting - -var select_file_icon: Texture2D = preload("res://menu/icons/select_file.svg") -var select_dir_icon: Texture2D = preload("res://menu/icons/select_directory.svg") - -var access: FileDialog.Access -var file_mode: FileDialog.FileMode - -func _init(new_id: String, - new_default: String, - new_file_mode: FileDialog.FileMode, - new_placeholder: String = "", - new_access: FileDialog.Access = FileDialog.Access.ACCESS_FILESYSTEM -): - super(new_id, new_default) - placeholder = new_placeholder - access = new_access - file_mode = new_file_mode - -func create_row(): - var row = super () - var input: LineEdit = row.value_node; - input.size_flags_horizontal = Control.SIZE_EXPAND_FILL - row.value_node = HBoxContainer.new() - row.value_node.add_child(input) - var button := Button.new() - button.icon = select_file_icon if file_mode == FileDialog.FileMode.FILE_MODE_OPEN_FILE else select_dir_icon - row.value_node.add_child(button) - button.pressed.connect(func(): - var d := FileDialog.new() - Global.focused_menu.add_child(d) - d.move_to_center() - d.use_native_dialog = true - d.borderless = true - d.dir_selected.connect(_selected.bind(input)) - d.file_selected.connect(_selected.bind(input)) - d.file_mode = file_mode - d.access = access - d.show() - # this feels wrong - d.canceled.connect(d.queue_free) - d.confirmed.connect(d.queue_free) - ) - return row - -func _selected(path: String, input: LineEdit): - input.text = path - input.text_changed.emit(path) diff --git a/client/menu/settings/path_setting.gd.uid b/client/menu/settings/path_setting.gd.uid deleted file mode 100644 index a524b17c..00000000 --- a/client/menu/settings/path_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cj5jf7t771j5b diff --git a/client/menu/settings/preset_row.gd b/client/menu/settings/preset_row.gd deleted file mode 100644 index f3c46a26..00000000 --- a/client/menu/settings/preset_row.gd +++ /dev/null @@ -1,46 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 PresetRow -extends GameSetting - -var options: Dictionary -var arr: Array[Button] - -func _init(id: String, options_: Dictionary): - super(id) - options = options_ - -var prefix = "" -func set_parent(parent): - super(parent) - if parent != null: prefix = parent.key - -func apply(preset_name: String): - var preset = options[preset_name] - for i in preset.keys(): - Global.set_setting(prefix + "." + i, preset[i]) - -func create_row(): - var row = super() - row.value_node = HBoxContainer.new() - for i in options.keys(): - var button := Button.new() - button.pressed.connect(apply.bind(i)) - button.text = tr(nskey + "." + i) - row.value_node.add_child(button) - return row - -func changed_keys(): return [] diff --git a/client/menu/settings/preset_row.gd.uid b/client/menu/settings/preset_row.gd.uid deleted file mode 100644 index 51605058..00000000 --- a/client/menu/settings/preset_row.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dawqyyllgis0b diff --git a/client/menu/settings/range_setting.gd b/client/menu/settings/range_setting.gd deleted file mode 100644 index b8d392a4..00000000 --- a/client/menu/settings/range_setting.gd +++ /dev/null @@ -1,44 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 RangeSetting -extends GameSetting - -var min_value: float -var max_value: float -var tick_count -var smooth: bool - -func _init(new_id: String, new_default: float, new_min_value: float, new_max_value: float, new_smooth: bool = true, new_tick_count = null): - super(new_id, new_default) - min_value = new_min_value - max_value = new_max_value - tick_count = new_tick_count - smooth = new_smooth - -func create_row(): - var row = super() - row.value_node = HSlider.new() - row.value_node.min_value = min_value - row.value_node.max_value = max_value - row.value_node.tick_count = abs(max_value - min_value) if tick_count == null else tick_count - row.value_node.step = 0 if smooth else (1 if tick_count == null else abs(max_value - min_value) / (tick_count - 1)) - Settings.hook_changed_init(key, true, - func(value): - if is_instance_valid(row): - row.value_node.value = value - ) - row.value_node.value_changed.connect(func(value): Global.set_setting(key, value)) - return row diff --git a/client/menu/settings/range_setting.gd.uid b/client/menu/settings/range_setting.gd.uid deleted file mode 100644 index a4ca49a2..00000000 --- a/client/menu/settings/range_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://civr7cckqfndj diff --git a/client/menu/settings/settings_category.gd b/client/menu/settings/settings_category.gd deleted file mode 100644 index bf85abd9..00000000 --- a/client/menu/settings/settings_category.gd +++ /dev/null @@ -1,49 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 SettingsCategory -extends GameSetting - -var settings: Array # Dictionary[String, GameSetting] - -func _init(new_id: String, new_settings: Array): - super(new_id) - settings = new_settings - -func set_parent(parent: GameSetting): - super(parent) - for c in settings: - c.set_parent(self) - -func create_row(): - var row = ScrollContainerCustom.new() - var options = VBoxContainer.new() - row.name = tr(nskey) - row.size_flags_horizontal = Control.SIZE_EXPAND_FILL - options.size_flags_horizontal = Control.SIZE_EXPAND_FILL - row.add_child(options) - - for r in settings: options.add_child(r.create_row()) - return row - -func check(): - for c in settings: - c.check() - -func changed_keys(): - var changed = [] - for c in settings: - changed.append_array(c.changed_keys()) - return changed diff --git a/client/menu/settings/settings_category.gd.uid b/client/menu/settings/settings_category.gd.uid deleted file mode 100644 index 421ce213..00000000 --- a/client/menu/settings/settings_category.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b8s3cqb01w3wh diff --git a/client/menu/settings/settings_root.gd b/client/menu/settings/settings_root.gd deleted file mode 100644 index a9a024d8..00000000 --- a/client/menu/settings/settings_root.gd +++ /dev/null @@ -1,40 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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/>. -# -extends GameSetting -class_name SettingsRoot - -var children: Array -func _init(new_children: Array): - super("root") - children = new_children - for c in children: - c.set_parent(null) - -func create_row(): - var row = TabContainer.new() - row.size_flags_vertical = Control.SIZE_EXPAND_FILL - for r in children: row.add_child(r.create_row()) - return row - -func check(): - for c in children: - c.check() - -func changed_keys(): - var changed = [] - for c in children: - changed.append_array(c.changed_keys()) - return changed diff --git a/client/menu/settings/settings_root.gd.uid b/client/menu/settings/settings_root.gd.uid deleted file mode 100644 index 95a46d5e..00000000 --- a/client/menu/settings/settings_root.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://jonib2ixqsp7 diff --git a/client/menu/settings/settings_row.gd b/client/menu/settings/settings_row.gd deleted file mode 100644 index d88d49c1..00000000 --- a/client/menu/settings/settings_row.gd +++ /dev/null @@ -1,37 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 SettingsRow -extends PanelContainer - -signal reset() - -@onready var value_parent = $HBoxContainer/BoxContainer -@onready var label = $HBoxContainer/Label -@onready var reset_button = $HBoxContainer/Reset - -var value_node: Node -var description = "No value was given to the row" - -func _ready(): - if value_node != null: - var c: Control = value_node - c.size_flags_vertical = Control.SIZE_EXPAND_FILL - c.size_flags_horizontal = Control.SIZE_EXPAND_FILL - label.text = description - value_parent.add_child(c) - -func _on_reset_pressed(): - reset.emit() diff --git a/client/menu/settings/settings_row.gd.uid b/client/menu/settings/settings_row.gd.uid deleted file mode 100644 index a6dea492..00000000 --- a/client/menu/settings/settings_row.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b3m1f76o5qo68 diff --git a/client/menu/settings/settings_row.tscn b/client/menu/settings/settings_row.tscn deleted file mode 100644 index 1d194426..00000000 --- a/client/menu/settings/settings_row.tscn +++ /dev/null @@ -1,40 +0,0 @@ -[gd_scene load_steps=7 format=3 uid="uid://o5e5vpem8w0k"] - -[ext_resource type="Theme" uid="uid://b0qmvo504e457" path="res://menu/theme/theme/theme.tres" id="1_iij3k"] -[ext_resource type="Script" uid="uid://b3m1f76o5qo68" path="res://menu/settings/settings_row.gd" id="2_l8i7p"] -[ext_resource type="FontFile" uid="uid://5ixo6b3bd3km" path="res://menu/theme/fonts/font-josefin-sans.woff2" id="3_7k5da"] -[ext_resource type="Texture2D" uid="uid://cucnmy0j5n8l8" path="res://menu/icons/reset.svg" id="4_bj3dr"] - -[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_pk3rs"] -content_margin_left = 16.0 - -[sub_resource type="FontVariation" id="FontVariation_o6i7s"] -base_font = ExtResource("3_7k5da") - -[node name="SettingsRow" type="PanelContainer"] -offset_right = 105.0 -offset_bottom = 23.0 -size_flags_horizontal = 3 -theme = ExtResource("1_iij3k") -script = ExtResource("2_l8i7p") - -[node name="HBoxContainer" type="HBoxContainer" parent="."] -layout_mode = 2 - -[node name="Label" type="Label" parent="HBoxContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -theme_override_styles/normal = SubResource("StyleBoxEmpty_pk3rs") - -[node name="BoxContainer" type="BoxContainer" parent="HBoxContainer"] -custom_minimum_size = Vector2(300, 50) -layout_mode = 2 -alignment = 2 - -[node name="Reset" type="Button" parent="HBoxContainer"] -layout_mode = 2 -theme_override_fonts/font = SubResource("FontVariation_o6i7s") -theme_override_font_sizes/font_size = 24 -icon = ExtResource("4_bj3dr") - -[connection signal="pressed" from="HBoxContainer/Reset" to="." method="_on_reset_pressed"] diff --git a/client/menu/settings/text_setting.gd b/client/menu/settings/text_setting.gd deleted file mode 100644 index 8e2b6bec..00000000 --- a/client/menu/settings/text_setting.gd +++ /dev/null @@ -1,38 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 TextSetting -extends GameSetting - -var placeholder: String - -func _init(new_id: String, new_default: String, new_placeholder: String = ""): - super(new_id, new_default) - placeholder = new_placeholder - -func create_row(): - var row = super() - var input := LineEdit.new() - input.placeholder_text = placeholder - input.text_changed.connect(func(text): Global.set_setting(key, text)) - Settings.hook_changed_init(key, true, - func(text): - if is_instance_valid(input): - var pos = input.caret_column - input.text = text - input.caret_column = pos - ) - row.value_node = input - return row diff --git a/client/menu/settings/text_setting.gd.uid b/client/menu/settings/text_setting.gd.uid deleted file mode 100644 index 58ac5abe..00000000 --- a/client/menu/settings/text_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://3rgucgbbt135 diff --git a/client/menu/settings/toggle_setting.gd b/client/menu/settings/toggle_setting.gd deleted file mode 100644 index abcb7f4a..00000000 --- a/client/menu/settings/toggle_setting.gd +++ /dev/null @@ -1,31 +0,0 @@ -# Hurry Curry! - a game about cooking -# Copyright (C) 2025 Hurry Curry! contributors -# -# 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 ToggleSetting -extends GameSetting - -func _init(new_id: String, new_default: bool): - super(new_id, new_default) - -func create_row(): - var row = super() - row.value_node = CheckButton.new() - row.value_node.pressed.connect(func(): Global.set_setting(key, row.value_node.button_pressed)) - Settings.hook_changed_init(key, true, - func(value): - if is_instance_valid(row): - row.value_node.button_pressed = value - ) - return row diff --git a/client/menu/settings/toggle_setting.gd.uid b/client/menu/settings/toggle_setting.gd.uid deleted file mode 100644 index 1d2ca55b..00000000 --- a/client/menu/settings/toggle_setting.gd.uid +++ /dev/null @@ -1 +0,0 @@ -uid://cojnv8bmv6aw5 |