shupershuff / Diablo2RLoader

Diablo 2: Resurrected launcher for multi-boxing
MIT License
59 stars 11 forks source link

Refresh default action #11

Closed never147 closed 1 year ago

never147 commented 1 year ago

Feature request! Possibly simple one. Could you please make refresh the default action in the main prompt? So select 1-N for account id, t for tz, x for exit, enter to refresh.

For extra points perhaps refresh every minute? 😬🤔

Thanks!

shupershuff commented 1 year ago

Thanks, this is a good idea. I had previously thought about this too but have held off implementing as essentially the script would need to constantly be running and checking running processes. Not sure how intensive this would be and I imagine the menu would flicker. It would also require concurrent processing to be performed which is something I've never tackled before in PowerShell.

You might see this in a future release, you might not if it's too tricky or comes with too much baggage.

never147 commented 1 year ago

I was just thinking as an extension of the default action, if you have a timeout on the main question. So you get a prompt saying which profile to pick, default is refresh, if you don't answer within 60 seconds it uses the default action: refresh. Then starts again.

Having a threaded loop with a separate process monitoring diablo processes and updating the running list, as some kind of panel which doesn't cause the whole window to refresh, sounds next level and cool. Understandably more complicated! 😅

On Sun, 4 Jun 2023, 08:01 shupershuff, @.***> wrote:

Thanks, this is a good idea. I had previously thought about this too but have held off implementing as essentially the script would need to constantly be running and checking running processes. Not sure how intensive this would be and I imagine the menu would flicker. It would also require concurrent processing to be performed which is something I've never tackled before in PowerShell.

You might see this in a future release, you might not if it's too tricky or comes with too much baggage.

— Reply to this email directly, view it on GitHub https://github.com/shupershuff/Diablo2RLoader/issues/11#issuecomment-1575433429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANGICHJU2WJQAFHAKSRTATXJQXF5ANCNFSM6AAAAAAYZYFWTI . You are receiving this because you authored the thread.Message ID: @.***>

shupershuff commented 1 year ago

I'm not sure that this is possible do perform with PowerShell's limitations. Separate PowerShell processes (or background jobs) can't relay input information into another PowerShell session. I will keep investigating but for now this seems unlikely. Happy to take any advice in this area, I'm still a bit of a novice when it comes to writing PS scripts.

An actual programming language could get around this easily but I'm not a programmer and I also want to keep this as just a script rather than an executable so people have visibility of what it is they're about to run.

never147 commented 1 year ago

Hey, just did a pull request for what I was thinking. Don't feel obligated to use it. Just thought I'd make a stab at it. It's the first PowerShell I've written so it's probably trash! haha.

never147 commented 1 year ago

Resolved by #13