studio-minus / madness-interactive-reloaded

Moddable videogame based on Madness Combat
https://studiominus.nl/madness-interactive-reloaded.html
GNU General Public License v3.0
76 stars 14 forks source link

Open/save file dialogues crashes on Linux #367

Closed Technochips closed 1 week ago

Technochips commented 1 week ago

Describe the bug Assuming we've copied over the libnfd.so file, upon trying to import or export a character, the game crashes:

Unhandled exception occurred
System.EntryPointNotFoundException: Unable to find an entry point named 'NFD_Init' in shared library 'nfd'.
Stack trace

   at NativeFileDialogExtendedSharp.Native.NFD_Init()
   at NativeFileDialogExtendedSharp.Nfd.InitNfd()
   at NativeFileDialogExtendedSharp.Nfd.FileOpen(IEnumerable`1 filters, String defaultPath)
   at MIR.FileDialog.OpenFile(ValueTuple`2[] filters, String& path) in /home/technochips/madness-interactive-reloaded-pkg/src/madness-interactive-reloaded/src/MadnessInteractiveReloaded/Shared/FileDialog.cs:line 17
   at MIR.CharacterCreationSystem.DrawButtons(CharacterCreationComponent data, CharacterComponent character) in /home/technochips/madness-interactive-reloaded-pkg/src/madness-interactive-reloaded/src/MadnessInteractiveReloaded/Character creation/Systems/CharacterCreationSystem.cs:line 222
   at MIR.CharacterCreationSystem.Update() in /home/technochips/madness-interactive-reloaded-pkg/src/madness-interactive-reloaded/src/MadnessInteractiveReloaded/Character creation/Systems/CharacterCreationSystem.cs:line 55
   at Walgelijk.Game.Start() in C:\Projects\Walgelijk\Walgelijk\System\Game.cs:line 230
   at MIR.MadnessInteractiveReloaded..ctor() in /home/technochips/madness-interactive-reloaded-pkg/src/madness-interactive-reloaded/src/MadnessInteractiveReloaded/MadnessInteractiveReloaded.cs:line 218
   at MIR.Program.Main(String mode, String input, String output) in /home/technochips/madness-interactive-reloaded-pkg/src/madness-interactive-reloaded/src/MadnessInteractiveReloaded/Program.cs:line 49

Desktop (please complete the following information):

Additional context This is an issue with the NativeFileDialogExtendedSharp NuGet package, could be fixed by switching to NativeFileDialogSharp, see this: https://github.com/milleniumbug/NativeFileDialogSharp/issues/3

mestiez commented 1 week ago

that's annoying. the whole point of NFD is to be cross platform. i guess ill switch to the non extended variant.

Technochips commented 1 week ago

Welp, I found the actual source of the issue. I had successfully ported the game to use the other NuGet package, but then I fixed the current build by just manually compiling nativefiledialog-extended on my system instead of using the provided libnfd.so file. So that file's the problem.

I'll fix it on the AUR package by manually building the library, that tends to always be better than using pre-compiled blobs.