mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
ScriptGlue: Added Log.Exception
- Also pushed missing List Editor fix
This commit is contained in:
@@ -806,21 +806,22 @@ static class ScriptEngine
|
||||
return scriptClass;
|
||||
}
|
||||
|
||||
internal static void HandleMonoException(MonoException* exception, ScriptInstance sourceInstance = null)
|
||||
|
||||
internal static void HandleMonoException(MonoException* exception, UUID entityId)
|
||||
{
|
||||
MonoExceptionHelper wrappedException = new MonoExceptionHelper(exception);
|
||||
|
||||
String entityInfo = scope .();
|
||||
|
||||
if (sourceInstance != null)
|
||||
if (entityId != .Zero)
|
||||
{
|
||||
wrappedException.Instance = sourceInstance.EntityId;
|
||||
wrappedException.Instance = entityId;
|
||||
|
||||
Result<Entity> sourceEntity = Context.GetEntityByID(sourceInstance.EntityId);
|
||||
Result<Entity> sourceEntity = Context.GetEntityByID(entityId);
|
||||
|
||||
if (sourceEntity case .Ok(let e))
|
||||
{
|
||||
entityInfo.AppendF($" ({e.Name} | {sourceInstance.EntityId})");
|
||||
entityInfo.AppendF($" ({e.Name} | {entityId})");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,6 +830,11 @@ static class ScriptEngine
|
||||
wrappedException.ReleaseRef();
|
||||
}
|
||||
|
||||
internal static void HandleMonoException(MonoException* exception, ScriptInstance sourceInstance = null)
|
||||
{
|
||||
HandleMonoException(exception, sourceInstance?.EntityId ?? .Zero);
|
||||
}
|
||||
|
||||
public static void ShowScriptEditor(Entity entity, ScriptComponent* scriptComponent)
|
||||
{
|
||||
if (scriptComponent.Instance == null)
|
||||
|
||||
Reference in New Issue
Block a user