Client HUD/Renderer: fix dead laser visibility, radar orientation, Garage grow direction, chyron churn, and NativeLibraries

This commit is contained in:
Meta Vens 2026-12-04 14:16:05 +01:00
commit 3cb60447ff
3 changed files with 82 additions and 28 deletions

View file

@ -25,11 +25,29 @@ internal static class NativeLibraries
private static IntPtr Resolve(string name, Assembly assembly, DllImportSearchPath? searchPath)
{
if (name != Library) return IntPtr.Zero;
string dir = OS.HasFeature("template")
? Path.Combine(Path.GetDirectoryName(OS.GetExecutablePath())!, $"data_RustToDust.Client_{Platform()}_{Arch()}")
: ProjectSettings.GlobalizePath("res://.godot/mono/temp/bin/Debug");
string path = Path.Combine(dir, FileName());
return File.Exists(path) && NativeLibrary.TryLoad(path, out var handle) ? handle : IntPtr.Zero;
string fileName = FileName();
if (OS.HasFeature("template"))
{
string exportPath = Path.Combine(
Path.GetDirectoryName(OS.GetExecutablePath())!,
$"data_RustToDust.Client_{Platform()}_{Arch()}",
fileName);
return File.Exists(exportPath) && NativeLibrary.TryLoad(exportPath, out var exportHandle)
? exportHandle
: IntPtr.Zero;
}
string debugPath = Path.Combine(ProjectSettings.GlobalizePath("res://.godot/mono/temp/bin/Debug"), fileName);
if (File.Exists(debugPath) && NativeLibrary.TryLoad(debugPath, out var debugHandle))
{
return debugHandle;
}
string releasePath = Path.Combine(ProjectSettings.GlobalizePath("res://.godot/mono/temp/bin/Release"), fileName);
return File.Exists(releasePath) && NativeLibrary.TryLoad(releasePath, out var releaseHandle)
? releaseHandle
: IntPtr.Zero;
}
private static string FileName() =>