Add save and loader classes and some QoL improvements

This commit is contained in:
Stone_Red
2023-07-29 23:38:48 +02:00
parent 61a0166599
commit 6d0ca85b7f
33 changed files with 875 additions and 153 deletions
@@ -58,6 +58,9 @@ internal abstract class SrlsScreen
public event EventHandler<GameScreenWrapperEventArgs>? OnDraw;
private bool initialized;
private bool loadedContent;
public GameScreenWrapper(Game game) : base(game)
{
}
@@ -69,12 +72,20 @@ internal abstract class SrlsScreen
public override void Initialize()
{
OnInitialize?.Invoke(this, EventArgs.Empty);
if (!initialized)
{
initialized = true;
OnInitialize?.Invoke(this, EventArgs.Empty);
}
}
public override void LoadContent()
{
OnLoadContent?.Invoke(this, EventArgs.Empty);
if (!loadedContent)
{
loadedContent = true;
OnLoadContent?.Invoke(this, EventArgs.Empty);
}
}
public override void UnloadContent()