mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Dev settings for using ScriptCore as either dll or csproj
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user