Difficulty Selection

This commit is contained in:
Marco 2025-04-08 15:02:41 +02:00
commit a2319b3b88
21 changed files with 188 additions and 55 deletions

View file

@ -7,7 +7,6 @@ using DebugMapSelectData = Cirno.Scripts.Resources.DebugMenu.DebugMapSelectData;
public partial class DebugMenu : MenuBase
{
[Export]
public Theme ButtonTheme { get; private set; }

View file

@ -0,0 +1,39 @@
using Cirno.Scripts.Enums;
using Cirno.Scripts.Resources;
using Godot;
namespace Cirno.Scripts.UI;
public partial class DifficultyMenu : MenuBase
{
[Export] public MapResource StartMap { get; private set; }
private void StartEasy()
{
StartGame(DifficultyLevel.Easy);
}
private void StartNormal()
{
StartGame(DifficultyLevel.Normal);
}
private void StartHard()
{
StartGame(DifficultyLevel.Hard);
}
private void StartLunatic()
{
StartGame(DifficultyLevel.Lunatic);
}
public void StartGame(DifficultyLevel difficultyLevel)
{
if (StartMap is null) return;
GlobalState.Session.NewSession();
GlobalState.Session.AllowSaving = true;
GlobalState.Session.Difficulty = difficultyLevel;
GlobalState.Instance.GotoScene(StartMap);
}
}

View file

@ -0,0 +1 @@
uid://bst70cv5631js