Compatibility for in memory scripts that used GameMain.LuaCs

This commit is contained in:
Evil Factory
2026-02-28 16:13:07 -03:00
parent 8e8b8eb8aa
commit de73a18637

View File

@@ -560,9 +560,12 @@ public class PluginManagementService : IAssemblyManagementService
compileWithInternalName = resourceInfo.UseInternalAccessName;
CancellationToken token = CancellationToken.None;
string sourceCode = loadRes.Value;
sourceCode = DoSourceCodeTextCompatibilityPass(sourceCode);
syntaxTreesBuilder.Add(SyntaxFactory.ParseSyntaxTree(
text: loadRes.Value,
text: sourceCode,
options: ScriptParseOptions,
path: null,
encoding: Encoding.Default,
@@ -613,6 +616,11 @@ public class PluginManagementService : IAssemblyManagementService
}
}
private string DoSourceCodeTextCompatibilityPass(string sourceCode)
{
return sourceCode.Replace("GameMain.LuaCs", "LuaCsSetup.Instance");
}
private IntPtr OnAssemblyLoaderResolvingUnmanaged(Assembly arg1, string arg2)
{
// TODO: Implement extern assembly lookup for Native/Unmanaged Assemblies.