# Undercooked - a game about cooking # Copyright 2024 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 . # extends Control @onready var options: VBoxContainer = $outer_gap/panel/inner_gap/options @onready var menu_manager: MenuManager = get_parent() var settings: Dictionary func _on_back_pressed(): for k in settings.keys(): Global.settings[k]["value"] = settings[k].get_value() Global.save_settings() menu_manager.go_back() func _ready(): for k in Global.settings.keys(): var v = Global.settings[k] var row: SettingsRow = preload("res://menu/settings_row.tscn").instantiate() row.setup(v["description"], v["value"]) options.add_child(row) settings[k] = row