make resources global classes

godot-4.2
John Montagu, the 4th Earl of Sandvich 2023-12-13 18:25:32 -08:00
parent 6f03295d8e
commit c1d66f15e0
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
5 changed files with 12 additions and 8 deletions

View File

@ -9,6 +9,7 @@ public enum InputMethod
MouseCentered,
}
[GlobalClass]
public partial class GameSettings : Resource
{
[Export]

View File

@ -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()

View File

@ -3,10 +3,11 @@ using Godot.Collections;
namespace SupaLidlGame.State.Global;
[GlobalClass]
public partial class MapState : Resource
{
[Export]
private Dictionary<string, Variant> _state = new();
private Dictionary<string, Variant> _state;
[Signal]
public delegate void MapStateChangedEventHandler(string key, Variant value);

View File

@ -3,6 +3,7 @@ using Godot.Collections;
namespace SupaLidlGame.State.Global;
[GlobalClass]
public partial class Progression : Resource
{
public Dictionary<string, bool> BossStatus { get; set; }

View File

@ -2,6 +2,7 @@ using Godot;
namespace SupaLidlGame.State.Global;
[GlobalClass]
public partial class Stats : Resource
{
[Export]