Refactor: reorganize scripts with domain-driven design structure

Move all C# scripts from flat structure to organized folders:
- Core/ for game logic (Game, GameState, GameSettings)
- UI/Menus/ and UI/Dialogs/ for user interface
- Systems/ for reusable systems (Save, Localization)
- Data/ for data models and configuration
- Added framework for future: Gameplay/, Story/, Modding/

Update all .tscn scene files to reference new script paths.
Fix timing issue in AdvancedSaveDialog focus handling.
This commit is contained in:
Björn Blomberg
2025-10-17 14:50:40 +02:00
parent 74062a37d6
commit ed4ce28921
41 changed files with 173 additions and 8 deletions

37
scripts/Core/GameState.cs Normal file
View File

@@ -0,0 +1,37 @@
using Godot;
namespace TheGame
{
public static class GameState
{
public static float LoadedGameTime = -1;
public static GameSeed CurrentGameSeed = null;
public static SaveInstance LoadedInstance = null;
public static bool HasUnsavedProgress = false;
public static float LastSavedGameTime = 0;
public static void MarkProgressAsSaved(float gameTime)
{
LastSavedGameTime = gameTime;
HasUnsavedProgress = false;
}
public static void CheckUnsavedProgress(float currentGameTime)
{
// Om speltiden har ökat sedan senaste sparningen, markera som osparad
if (currentGameTime > LastSavedGameTime + 1.0f) // 1 sekund tolerans
{
HasUnsavedProgress = true;
}
}
public static void ResetGameState()
{
LoadedGameTime = -1;
CurrentGameSeed = null;
LoadedInstance = null;
HasUnsavedProgress = false;
LastSavedGameTime = 0;
}
}
}