Add autoload engine context

This commit is contained in:
Jarrod Doyle 2024-09-05 17:31:31 +01:00
parent d3dd40eec3
commit ef2f87af20
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 25 additions and 0 deletions

View File

@ -15,6 +15,10 @@ run/main_scene="res://project/scenes/main.tscn"
config/features=PackedStringArray("4.3", "C#", "Forward Plus") config/features=PackedStringArray("4.3", "C#", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[autoload]
Context="*res://project/code/TMV/Context.cs"
[dotnet] [dotnet]
project/assembly_name="Thief Mission Viewer" project/assembly_name="Thief Mission Viewer"

View File

@ -0,0 +1,21 @@
using Godot;
using KeepersCompound.LGS;
namespace KeepersCompound.TMV;
public partial class Context : Node
{
public static Context Instance { get; private set; }
public ResourcePathManager PathManager { get; private set; }
public ModelLoader ModelLoader { get; private set; }
public override void _Ready()
{
var extractPath = ProjectSettings.GlobalizePath($"user://extracted/tmp");
PathManager = new ResourcePathManager(extractPath);
ModelLoader = new ModelLoader(PathManager);
Instance = this;
}
}