Towdium / JustEnoughCalculation

A simple minecraft mod help you calculate the cost for recipes
Other
54 stars 41 forks source link

Sometimes disambiguate setting can't scroll #83

Closed Discreater closed 3 years ago

Discreater commented 3 years ago

Version: 1.16.5 And the slot under the overlay hovered incorrectly jeca

Discreater commented 3 years ago

It seems caused by the getLabelUnderMouse function doesn't check the overlay.

https://github.com/Towdium/JustEnoughCalculation/blob/bca80a1600a8193c30d2f1bef959ec6e69994aad/src/main/java/me/towdium/jecalculation/gui/widgets/WLabel.java#L86-L89

https://github.com/Towdium/JustEnoughCalculation/blob/bca80a1600a8193c30d2f1bef959ec6e69994aad/src/main/java/me/towdium/jecalculation/gui/widgets/WContainer.java#L121-L127

So, when recipe gui handling the mouse scroll event, it will get the label under the overlay.

https://github.com/Towdium/JustEnoughCalculation/blob/bca80a1600a8193c30d2f1bef959ec6e69994aad/src/main/java/me/towdium/jecalculation/gui/guis/GuiRecipe.java#L126-L135

Towdium commented 3 years ago

As I remember, the overlay is basically a widget at the top of the widget list. So every user input will get handled by the overlay first. If the overlay can handle it (mouse inside overlay area), it will not pass to underlaying widgets.

I guess I'm doing something wrong with mouse positon offsetting. So the input is not at the position of expected widget.

Never mind, I'll check it.