blue-nebula / base

Main repository of Blue Nebula, a fast-paced shooter with a unique parkour system. It is a fork of Red Eclipse and is free software.
https://blue-nebula.org
15 stars 6 forks source link

GUI doesn't remember focus #200

Open robalni opened 3 years ago

robalni commented 3 years ago

You may have noticed that when you try to drag the scrollbar e.g. in the server browser it only works while you have the mouse cursor on it and if you release the mouse button somewhere else that counts as a click there. Or if you drag from one button to another it will count as a click on the second button.

That happens because the game doesn't store information about GUI objects to the next frame, so on the next frame the game will not know what object you were interacting with on the previous frame, and therefore it can't remember that you were using the scrollbar when the cursor leaves it.

This is annoying and it should be fixed so that you can drag-scroll while not looking at the cursor, and button clicks should only count if you pressed down the mouse button on the same GUI button as you release it on.

I'm already working on a fix for this.