8170b700b2
Features: Sacrifice-Node, Maintain-Node, Options for screen type, lightcolor and soundvolume, tied in sound effects, game pause when menu is open, visibly open up gate when opening it.
39 lines
648 B
C#
39 lines
648 B
C#
using Godot;
|
|
|
|
public partial class MainMenu : Control
|
|
{
|
|
[Export] private PanelContainer options;
|
|
|
|
public override void _Ready()
|
|
{
|
|
UIStyle.Apply(this);
|
|
}
|
|
|
|
public void OnPlayPressed()
|
|
{
|
|
GameData.loadSaveOnStart = false;
|
|
GetTree().ChangeSceneToFile("res://Scenes/WorldSetup.tscn");
|
|
}
|
|
|
|
public void OnLoadPressed()
|
|
{
|
|
if (!SaveGameManager.SaveExists()) return;
|
|
|
|
GameData.loadSaveOnStart = true;
|
|
GameData.showTutorial = false;
|
|
GetTree().ChangeSceneToFile("res://Scenes/Game.tscn");
|
|
}
|
|
|
|
public void OnQuitPressed()
|
|
{
|
|
GetTree().Quit();
|
|
}
|
|
|
|
public void OnOptionsPressed()
|
|
{
|
|
if (options == null) return;
|
|
|
|
options.Show();
|
|
}
|
|
}
|