-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clickthrough secretly picks wrong connectivity manager. #2456
Comments
I tried dealing with this for a bit and found I was hitting a brick wall in that we are using KSP's high level dialog box API (i.e. calling:
And this call isn't letting me easily move the box to somewhere else (it has a Rect parameter, but I can't use it to force the box to move - it seems to be getting ignored). I suspect that fixing this would involve us having to use a home-grown dialog box, not the one KSP comes with. |
Fixes KSP-KOS#2456 The PopupDialog.SpawnPopupDialog() call from stock KSP's API allows you to pass in some "anchor" coordinates to move the window - but it took trial and error to work out what those coordinates really meant. They weren't intuitive (see the comment in the PR for further explanation). But in the end I finally managed to move the window. Note that the same call is in a spot of our code used by another dialog window, so I had to make a way to preserve it's previous (centered) behavior, so I had to add a little extra stuff to make it possible to pass in x,y values to QueueDialog and remember them with the dialog box. It's very hard to regression-test that I didn't break that second dialog box (the "migration dialog") because it's only triggered if you take a very old saved game and try to migrate it to newer kOS. It was years ago when that was a relevant thing and it's nearly impossible to test now without getting some old copies of KSP. I'm happy leaving that part untested, as I couldn't easily make it happen, and anyone who thinks their 3-year old KSP saved game will still work fine today is going to run into lots of other migration issues besides just kOS.
When starting a new savegame, kOS opens up a dialog box on the first KSC scene load. So does the Remote Tech mod. Both of these dialogs appear centered on the screen. It's a race condition which box ends up on top.
When the RT box ends up on top, it completely hides the kOS box, so the user doesn't even know it's there. (See screenshot 1 below).
These boxes are not click-through protected. When the user picks options in the RT box, they can be secretly also picking an answer to the question in the kOS box that they never even saw.
Because of this, I ended up starting a remote tech career with kOS's "PermitAll" connectivity manager chosen and I didn't even see it. Instead I kept wondering, "Why on earth didn't it ask me for connectivity manager? Isn't it supposed to?" I did some debugging before finding out that it was actually there, but I was clicking through to pick a button and making the kOS dialog box go away before I saw it.
The second screenshot below shows how that clickthrough happened (with my window shifted aside so you can see it).
The text was updated successfully, but these errors were encountered: