From c1d66f15e060ba82f05ac98f325ea46a6dcbdfd2 Mon Sep 17 00:00:00 2001 From: HumanoidSandvichDispenser Date: Wed, 13 Dec 2023 18:25:32 -0800 Subject: [PATCH] make resources global classes --- State/Global/GameSettings.cs | 1 + State/Global/GlobalState.cs | 14 +++++++------- State/Global/MapState.cs | 3 ++- State/Global/Progression.cs | 1 + State/Global/Stats.cs | 1 + 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/State/Global/GameSettings.cs b/State/Global/GameSettings.cs index baf8174..39442fa 100644 --- a/State/Global/GameSettings.cs +++ b/State/Global/GameSettings.cs @@ -9,6 +9,7 @@ public enum InputMethod MouseCentered, } +[GlobalClass] public partial class GameSettings : Resource { [Export] diff --git a/State/Global/GlobalState.cs b/State/Global/GlobalState.cs index 54bd45a..a4fe117 100644 --- a/State/Global/GlobalState.cs +++ b/State/Global/GlobalState.cs @@ -36,13 +36,13 @@ public partial class GlobalState : Node public override void _Notification(int what) { - if (what == NotificationWMCloseRequest) - { - // TODO: quit prompt - GetTree().Root - .PropagateNotification((int)NotificationWMCloseRequest); - SaveSettings(); - } + //if (what == NotificationWMCloseRequest) + //{ + // // TODO: quit prompt + // GetTree().Root + // .PropagateNotification((int)NotificationWMCloseRequest); + // SaveSettings(); + //} } private void LoadSettings() diff --git a/State/Global/MapState.cs b/State/Global/MapState.cs index 80f2d8c..4c3824b 100644 --- a/State/Global/MapState.cs +++ b/State/Global/MapState.cs @@ -3,10 +3,11 @@ using Godot.Collections; namespace SupaLidlGame.State.Global; +[GlobalClass] public partial class MapState : Resource { [Export] - private Dictionary _state = new(); + private Dictionary _state; [Signal] public delegate void MapStateChangedEventHandler(string key, Variant value); diff --git a/State/Global/Progression.cs b/State/Global/Progression.cs index 7df34b1..9f31019 100644 --- a/State/Global/Progression.cs +++ b/State/Global/Progression.cs @@ -3,6 +3,7 @@ using Godot.Collections; namespace SupaLidlGame.State.Global; +[GlobalClass] public partial class Progression : Resource { public Dictionary BossStatus { get; set; } diff --git a/State/Global/Stats.cs b/State/Global/Stats.cs index b63a3e5..a78c222 100644 --- a/State/Global/Stats.cs +++ b/State/Global/Stats.cs @@ -2,6 +2,7 @@ using Godot; namespace SupaLidlGame.State.Global; +[GlobalClass] public partial class Stats : Resource { [Export]