Compatibility for in memory scripts that used GameMain.LuaCs
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user