You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
996 B
34 lines
996 B
namespace CMSGame
|
|
{
|
|
public partial class VideoSettingsMenu : Control
|
|
{
|
|
public VideoSettings? Settings;
|
|
|
|
public CheckButton? FullScreenCheckButton;
|
|
|
|
public override void _Ready()
|
|
{
|
|
Settings = this.GetAutoloadNode<GameSettingsNode>(nameof(GameSettingsNode)).VideoSettings;
|
|
|
|
this.GetUniqueNode(ref FullScreenCheckButton, nameof(FullScreenCheckButton));
|
|
|
|
FullScreenCheckButton!.Toggled += FullScreenCheckButton_Toggled;
|
|
|
|
FullScreenCheckButton.ButtonPressed = Settings.UseFullScreen;
|
|
}
|
|
|
|
private void FullScreenCheckButton_Toggled(bool buttonPressed)
|
|
{
|
|
Settings!.UseFullScreen = buttonPressed;
|
|
if (buttonPressed)
|
|
{
|
|
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Fullscreen);
|
|
}
|
|
else
|
|
{
|
|
DisplayServer.WindowSetMode(DisplayServer.WindowMode.Windowed);
|
|
}
|
|
}
|
|
}
|
|
}
|