tyfon7 / UIFixes

Small QOL fixes for SPTarkov
MIT License
8 stars 1 forks source link

Feature request: Right click outside of window to close. #14

Closed Damntry closed 2 months ago

Damntry commented 2 months ago

Currently there is an option to close dialogs by clicking outside with left click. Would it be possible to add an option to use right click instead? So an accidental double click doesnt do something you dont want.

Extra request: being able to close any modeless window (open bags/rigs/cases, inspection window...) by clicking outside.

I think right clicks outside the window that would open a context menu somewhere, should work and not close the currently active window.

Probably not a simple request, but hopefully you like this idea enough to go ahead and give it a test.

tyfon7 commented 2 months ago

Right click isn't usually supposed to have consequences, so closing with right click doesn't really make sense. I'm also not sure what you mean by accidently double click, because the first click is used to close the dialog and the second click does... what? Clicking items in the inventory has no consequence. Can you give me a specific example of what you're describing?

I'm definitely not going to do anything to nonmodal dialogs, because that breaks a lot of existing behavior like opening two inspect windows for compare or dropping something into a container window.

Damntry commented 2 months ago

This whole idea came from games where you close the current active window with right click since its a button you dont use much for anything, so your brain gets used to it automatically and opening and closing windows "flows" better.

Basically, and only if there are any windows open, a right click outside the active window that doesnt open a context menu, would be the equivalent of pressing Esc.

If this would fuck up something then yeah, not worth it. But maybe it wouldnt need to touch the windows themselves, and instead, on clicks, query for open windows and what the click would do, and if all checks pass call whatever the Esc hotkey does, Way easier said than done I know.

tyfon7 commented 2 months ago

I'm going to keep it simple, as adding right click means i have to implement my own component rather than just built-in unity behavior. I believe you that some games let you close things with right-click but I haven't experienced that and it seems weird to me. Hope it's not too terrible for you ;)

Damntry commented 2 months ago

I get what you mean. No worries this mod is already a life saver as it is.

Thanks for hearing me out!