session settings

This commit is contained in:
Maddo 2025-02-27 08:37:55 +01:00
commit 62aae84e8f
9 changed files with 37 additions and 1 deletions

View file

@ -48,4 +48,5 @@ theme = ExtResource("2_wqb8e")
theme_override_font_sizes/font_size = 10 theme_override_font_sizes/font_size = 10
text = "Back" text = "Back"
[connection signal="toggled" from="HBoxContainer/CheckBox" to="." method="_on_check_box_toggled"]
[connection signal="pressed" from="ScrollContainer/Level Select/BackButton" to="." method="_on_back_button_pressed"] [connection signal="pressed" from="ScrollContainer/Level Select/BackButton" to="." method="_on_back_button_pressed"]

View file

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

View file

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

View file

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

View file

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using Cirno.Scripts; using Cirno.Scripts;
using Cirno.Scripts.Resources; using Cirno.Scripts.Resources;
using Godot.Collections; using Godot.Collections;
using Cirno.Scripts.Utils;
public partial class GameManager : Node2D public partial class GameManager : Node2D
{ {
@ -99,7 +100,10 @@ public partial class GameManager : Node2D
MapStartData = mapStartData; MapStartData = mapStartData;
StartingEquipment.AddRange(mapStartData.StartingEquipment); StartingEquipment.AddRange(mapStartData.StartingEquipment);
}
public void ApplySessionState(SessionSettings settings)
{
} }

View file

@ -1,5 +1,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Cirno.Scripts.Resources; using Cirno.Scripts.Resources;
using Cirno.Scripts.Utils;
using Godot; using Godot;
using GTweens.Builders; using GTweens.Builders;
using GTweensGodot.Extensions; using GTweensGodot.Extensions;
@ -12,6 +13,8 @@ public partial class GlobalState : Node
private ColorRect _fader { get; set; } private ColorRect _fader { get; set; }
public SessionSettings SessionSettings { get; set; }
public override void _Ready() public override void _Ready()
{ {
Instance = this; Instance = this;
@ -80,6 +83,10 @@ public partial class GlobalState : Node
// Call deferred if it gives issues // Call deferred if it gives issues
DeferredAddStartDataToGameManager(startData); DeferredAddStartDataToGameManager(startData);
} }
if (GameManager.Instance is not null) {
GameManager.Instance.ApplySessionState(SessionSettings);
}
FadeIn(); FadeIn();
} }

View file

@ -52,6 +52,11 @@ public partial class DebugMenu : MenuBase
EmitSignal(SignalName.MenuClosed); EmitSignal(SignalName.MenuClosed);
} }
private void _on_check_box_toggled(bool state)
{
GlobalState.Instance.SessionSettings.SkipDialogues = state;
}
// Called every frame. 'delta' is the elapsed time since the previous frame. // Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta) public override void _Process(double delta)
{ {

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Cirno.Scripts.Utils;
public class SessionSettings
{
public bool SkipDialogues { get; set; } = false;
public bool GodMode { get; set; } = false;
public Dictionary<string,int> Items {get;set;} = new();
public float Health {get;set;}
public float Shield {get;set;}
}

View file

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