mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Save game on level start if enabled
This commit is contained in:
parent
065791e8ef
commit
3d4ed2a1fd
2 changed files with 7 additions and 2 deletions
|
|
@ -69,6 +69,11 @@ public partial class GameManager : Node2D
|
|||
{
|
||||
Instance = this;
|
||||
|
||||
if (GlobalState.Instance.SessionSettings.AllowSaving)
|
||||
{
|
||||
GlobalState.Instance.SaveGame();
|
||||
}
|
||||
|
||||
_hud = GetNodeOrNull<Hud>("HUD");
|
||||
if (_hud == null) GD.Print("No HUD in scene.");
|
||||
|
||||
|
|
@ -189,10 +194,8 @@ public partial class GameManager : Node2D
|
|||
_player.Owner = this;
|
||||
}
|
||||
|
||||
|
||||
_player.Transform = this.GlobalTransform;
|
||||
|
||||
|
||||
_player.GlobalPosition = GetStartPosition();
|
||||
|
||||
LastCheckpointPosition = _player.GlobalPosition;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ public class SessionSettings
|
|||
public bool SkipDialogues { get; set; } = false;
|
||||
public bool GodMode { get; set; } = false;
|
||||
|
||||
public bool AllowSaving { get; set; } = false;
|
||||
|
||||
public Godot.Collections.Dictionary<string, int> Items { get; set; } = new();
|
||||
|
||||
public int LevelNumber { get; set; } = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue