namespace Pong.Scripts.Managers.UI.Menus;
public partial class Settings : BaseMenu
{
private SettingsManager _settings;
private SpinBox _scale;
private OptionButton _vSync;
private Button _saveButton;
private bool _scaleModified;
private bool _vSyncModified;
public override void _EnterTree()
{
base._EnterTree();
GetNodes();
_scale.Value = _settings.SettingsData.Scale;
_vSync.Selected = _settings.SettingsData.VSync;
}
private void OnBackButtonPressed()
{
GetTree().ChangeSceneToFile("res://Scenes/UI/Menus/MainMenu.tscn");
}
///
/// get references to the nodes required for the settings menu to function and bind to events.
///
private void GetNodes()
{
using var mainContainer = GetNode("ScrollContainer/InternalMainContainer");
_settings = GetNode("/root/SettingsManager");
_scale = mainContainer.GetNode("ScaleContainer/Scale");
_vSync = mainContainer.GetNode("VSyncContainer/VSyncOptions");
_saveButton = GetNode