uuksu / RPGMakerDecrypter

Tool for extracting RPG Maker XP, VX and VX Ace encrypted archives.
MIT License
197 stars 42 forks source link

Add GTK UI for Linux #4

Closed tyrone-sudeium closed 1 year ago

tyrone-sudeium commented 1 year ago

Much bigger PR this time. This one ports the existing GUI to GTK, primarily for Linux usage (though theoretically GtkSharp works fine on macOS and Windows too). I've deliberately mimicked the existing WinForms UI as much as possible, so that even if you're not terribly familiar with GTK or GtkSharp, it'll map largely 1:1 with the existing UI so small tweaks should be fairly predictable.

image

Not in scope for this PR is deployments. Deployments in Linux, in general, are a bit of a garbage fire challenging. Right now dotnet's "self contained" build option just doesn't produce a terribly self contained binary when GtkSharp is involved, plus it assumes the host system already has GTK3 (and who knows how many other dependencies) installed. Probably the least annoying way to deploy would be to try to produce either a Flatpak or an AppImage (or both), though this sounds complicated and I haven't looked into it yet. For now, I'd say this GTK-based Linux UI is "experimental" and anyone on the bleeding edge enough to want to try it should build it from source :wink:

If you'd prefer not to have a giant blob of GTK code in your repo that you probably don't understand, just let me know and close the PR and I'll refactor it so that all of this lives in my own repo, using yours as a submodule instead :smile:

uuksu commented 1 year ago

Hey again!

This is a very nice idea! It's sad that Microsoft will never ever officially support Forms applications on the Linux and macOS. As the situation is what it is, I see no other way to provide UI than to try one of the alternative UI-frameworks. GTK is not a bad option.

It's not optimal that there is now two implementations of the same application, but as the development of the application is not very active, I really don't see a problem of maintaining both of them in the same repo. Most of the logic is anyways in a shared library so that the CLI and Forms GUI can both benefit from it so why not add one more option on the interface department. Most optimal solution would be at some point to port the whole interface to use for example Avalonia. This way the same implementation could work nicely on all platforms.

It's very true what you said about Linux deployments. I'm a Linux user myself and have used Flatpacks and AppImages from time to time but I don't have an experience of creating the application packages. This does not mean it might not be possible to later take a look of these and learn something new! For the fun I took your code, made a self-contained deployment out of it and it seems to run nicely on my Windows and Manjaro machines (so at least on my machine the depedencies are satisfied).

I reviewed your code and really see no reason to not include your code to my repo. You have very closely followed same kind of conventions that I use and code is easy to understand. Very good job! 😀

I'll merge this right away. Like you said, let's leave it for now as a experiental frontend that someone can use who knows how to use it.