Dev settings for using ScriptCore as either dll or csproj

This commit is contained in:
Simon Lübeß
2025-08-09 23:40:31 +02:00
parent d002dfe25e
commit b94b2afc55
9 changed files with 88 additions and 22 deletions
+3
View File
@@ -84,6 +84,9 @@ namespace GlitchyEngine
#endif
GlitchyEngine.Settings.Load();
Settings.OnApplySettings.Add(new (s, e) => {
OnEvent(scope SettingsAppliedEvent());
});
Settings.Apply();
}
@@ -129,4 +129,24 @@ namespace GlitchyEngine.Events
strBuffer.AppendF("WindowDeactivatedEvent");
}
}
public class SettingsAppliedEvent : Event, IEvent
{
public override EventType EventType => .SettingsApplied;
public override StringView Name => "SettingsApplied";
public override EventCategory Category => .Application;
public static EventType StaticType => .SettingsApplied;
public this()
{
}
public override void ToString(String strBuffer)
{
strBuffer.AppendF("SettingsAppliedEvent");
}
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ namespace GlitchyEngine.Events
{
None = 0,
WindowClose, WindowResize, WindowFocus, WindowLostFocus, WindowMoved, WindowActivated, WindowDeactivated,
AppTick, AppUpdate, AppRender,
AppTick, AppUpdate, AppRender, SettingsApplied,
KeyPressed, KeyReleased, KeyTyped,
MouseButtonPressed, MouseButtonReleased, MouseMoved, MouseScrolled
}
@@ -35,6 +35,13 @@ extension Path
path.Remove(0, 1);
}
public static void ToActualPath(String path)
{
String tmp = scope .(path);
path.Clear();
Path.GetActualPathName(tmp, path);
}
// Compared to the original Combine, this one makes sure we don't add multiple seperators. Also makes sure, the path contains only the main Separator char.
new public static void Combine(String target, params StringView[] components)
{
@@ -83,6 +83,8 @@ class EngineClasses
static class ScriptEngine
{
// TODO: Maybe make it possible to set the path to ScriptCore just like for the script project?
// This would probably require a separate small project that just handles the script-engine interface.
public const String ScriptCorePath = "Resources/Scripts/ScriptCore.dll";
private static Scene s_Context ~ _?.ReleaseRef();