Add core game components including ConfigFileHandler, GameManager, SaveSystem, and UIManager

This commit is contained in:
2025-08-10 01:35:35 +02:00
parent 8467f67090
commit 4098d192af
31 changed files with 1347 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
using Godot;
namespace Mr.BrickAdventures.Autoloads;
public partial class ConfigFileHandler : Node
{
private ConfigFile _settingsConfig = new();
private const string SettingsPath = "user://settings.ini";
public override void _Ready()
{
if (!FileAccess.FileExists(SettingsPath))
{
var err = _settingsConfig.Save(SettingsPath);
if (err != Error.Ok)
GD.PushError($"Failed to create settings file at {SettingsPath}: {err}");
}
else
{
var err = _settingsConfig.Load(SettingsPath);
if (err != Error.Ok)
GD.PushError($"Failed to load settings file at {SettingsPath}: {err}");
}
}
}