Closed soliddanii closed 1 month ago
I didn't realize before that fs already provided the ability to link files, so that being said I chose to use mklink which I'm more familiar with for functionality, and since it works better there's no reason not to use it.
Regarding the problems I'm having, there are three main ones, so if you could help me with those that would be great:
only being able to use Python to implement analog input: on windows, ZZZ gets its input via directInput, which prevents most analog key presses from triggering the press F10 function in the game. After trying to use C++'s keydb_event method and finding that it didn't work, I tried python, and luckily I found a library that could do this, but that left me with only python to develop the subsequent functionality.
[Find and top ZZZ window] Latency: There are two ways to find the specified window using python, the first one is to get the pid of the game by the process name, and then get the corresponding window by the pid; the second way is to get the window directly by the window name. There are some problems with both ways.
If you use the first way, there will be a big delay: there will be a delay in getting the process table of the application, and the process of getting the pid match by whether the process name is zenless zone zero.exe or not will also consume a certain amount of time, but it can be easily solved by the caching function (because the pid of the game is fixed after it runs, and can be solved by warming up the program). (since the pid is fixed after the game is run, the matching time can be circumvented by warming up the program). But getting the window via pid afterward consumes a lot of time again (and this step requires administrator rights, which I'd prefer to implement in an admin-free state).
With the second method, the delay is reduced because it is no longer necessary to get the application process table, it just gets all the windows and finds the one with the matching title. But the title of the game window seems to be different in different language settings: in Chinese it is displayed as “绝區零” or “絕區零” but in English it is displayed as “zenless zone zero”.
Right now I'm using the first method, but frustratingly it has a delay of almost 3s, which makes this feature seem like a joke: it doesn't make it any easier to refresh the mod, which takes less than a second to do manually.
And it seems to inevitably require the use of administrator privileges, and how to elevate your privileges in electron is a pain in the ass.
For the above two problems, I'd like to know if you have a better solution, such as smaller latency, or no need for administrator privileges ......
Thank you very much for your contribution to this tool, it makes me feel the power of the open source community and makes me determined to make this tool better and better!
Translated with DeepL.com (free version)
Hello! Glad to hear that, you are making a really cool project. Open source is great.
As for refreshing mods with the simulated key press, i've never done anything like that but I may be able to give it a shot. I had never used Github Actions before either, but figured this was a good oportunity to learn, so after some research i managed to get it working. More on that on this merge request.
Thanks!
What this changes: Instead of manually executing the windows mklink command, use the file system node module symlinkSync function.
Why: Even thoguh you only provide a windows release, this allows the manager to work in other platforms, like linux and mac. I personally package and use the manager in both windows and linux, and with this small change, it works without issues.
Tested on both platforms. Let me know what you think or if you encounter any issues.