MovingBlocks / Terasology

Terasology - open source voxel world
http://terasology.org
Apache License 2.0
3.69k stars 1.34k forks source link

Gameplay Template scrollbar exits to main menu when clicked, instead of being able to drag and scroll #3668

Closed Qwertygiy closed 5 years ago

Qwertygiy commented 5 years ago

What you were trying to do

Clicking the knob beside the Gameplay Template options in the main menu to drag it and scroll it up and down between choices.

What actually happened

The list of options closed as soon as the knob was clicked, rather than allowing itself to be dragged.

How to reproduce

Screenshot_20190428_205937

Log details and game version

TerasologyOmega, 2.2.0, default installation.

Computer details

Model: Toshiba Satellite C55D-A5206 OS: 64-bit Ubuntu OS Version: 4.15.0.47-generic (as Kubuntu 18.04) CPU: AMD A4-5000 APU GPU: Radeon integrated graphics Driver: X.org AMD KABINI (DRM 2.50.0, LLVM 7.0.0) JVM: OpenJDK 1.8.0 OpenGL: 4.4 (Compatibility Profile) Mesa 18.2.2

Qwertygiy commented 5 years ago

Further information:

My initial guess with this information is that the scrollbar knob is not properly capturing the mouse click before the options in the dropdown list, as if the knob is either "behind" the options; a lower priority than the options; or not "interrupting" the click's progress to prevent it from reaching the options.

profgrammer commented 5 years ago

The universe setup screen in the advanced setup also has the same problem. Clicking a location on the scroll bar makes the menu disappear, but on reopening it we can see that the knob is at the position we clicked on before. worldgen

AlexandrSunLight commented 5 years ago

Same in the languge select menu. 2019-05-11_16-30-44 I think the answer somewhere in UIDropdownScrollable class, because all of thouse are dropdownscrollables, and "video settings" menu is not.

profgrammer commented 5 years ago
@Override
        public boolean onMouseClick(NUIMouseClickEvent event) {
            opened = !opened;
            if (opened) {
                optionListeners.clear();
                for (int i = 0; i < getOptions().size(); ++i) {
                    optionListeners.add(new ItemListener(i));
                }
            }
            return true;
}

Code snippet from the UIDropdownScrollable class. On click, opened is just getting flipped. That explains why the scrollbar is closing on clicking anywhere inside it, including the vertical bar. How can I check whether the click position is on the options, or the scrollbar?