Closed soliddanii closed 1 month ago
Is there a more direct way I could contact you? It seems a bit cumbersome to discuss these matters within a pull request, and the notification system isn't very timely. This means I often can't respond to your messages promptly, as I only notice them when I remember to check GitHub.
Regarding the two methods you mentioned, I prefer the first one, as it is more "seamless" for the user. To be honest, the ZZZ launcher asking for permission to start with administrative privileges every time is quite annoying.
Your method to bypass DirectInput is really a genius solution; apart from some flickering that might occur during its application, it has virtually no downsides!
Starting the manager in administrator mode causes the drag-and-drop image setting feature to fail. I'm not sure about the reason (I don't think the same code should behave differently in admin and non-admin modes, which leads me to believe this could be an Electron bug).
As for the other approach, thank you very much for exploring multiple directions! I took a look at Koffi, and it seems to allow running C code within JavaScript. Although I know several programming languages, working across languages always adds complexity. While it does support Linux, well, let's leave those concerns to Wine 😊
Regarding the library you mentioned, I had a quick look, and it seems to support a wide range of system-related functionalities. Moreover, it even has documentation in Chinese, which is incredibly convenient for me!
Using the features provided by this library, it might become easier to implement some of the future functionalities, such as: file selection, preventing the Manager from starting multiple times...
UI design has always been a headache for me, as I'm not a professional in this area. I just adjust the interface based on what I consider to be "more aesthetically pleasing."
For the new UI design, I mainly drew inspiration from the UI elements in ZZZ games and attempted to imitate them, albeit poorly... The overly simplistic side panel was the reason for the changes. It's certainly not perfect, and whether someone likes it or not is subjective, but I plan to make it more consistent with ZZZ, which I think is the right direction.
Regarding the top panel extending to both sides and placing the side panel underneath, I can imagine the kind of design you're describing. I've also considered something similar before, but there are a few issues with it:
I made two solutions in two different branches (named after the packages they use):
Both solutions use almost the same Windows libraries and APIs, and that's why they are fast, but the hmc-win32 solution has way simpler code as it abstracts a lot of the manual work. That's why I made the MR for that branch first, but I'll let you decide which solution you want, if any, as they both have their pros and cons. You could even combine both later.
Hmc-win32 can't send the keystrokes directly to the game. This is because it sends Virtual Keys, and in my experience ZZZ ignores them. It only works if you send Direct Input Keystrokes. Maybe in the future the package supports it, that would be ideal. To circumvent this issue, i thought of a trick to get the key in the game without sending it directly to the window, that way this solution does not require admin privileges either. In summary this is how it works:
It's fast enough, but it's not the smoothest experience. Here I get the game window through the process name.
Now for the Koffi solution. This is a really amazing package. You have to manually call every Windows function, and define C++ structs and types, but the possibilities are endless. With this code, I actually send the Direct Input key to the game window, as it should be. The downside, you must run the manager as admin, or it doesn't work. This solution tries to get the game window from the process name first, and if it fails, it tries with the window name.
I would suggest to give both branches a test, see if they work for you (as I don't know how it will behave in other machines), and I will let you decide what to do with the code.
Maybe use one over the other, or even pick and choose the code to use a combination of the two (if that were the case, I would personally use the hmc-win32 way of getting the game window, and then, if the manager is running as admin, use the sendinput function from Koffi; if it's not, use the trick). Hmc has the useful function HMC.isAdmin().
Some additional notes:
Anyway, I hope some of this is useful to you, and congrats on the manager progress! 😄