mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 20:15:35 -04:00
Fix clicking on scrollbar in inventory closing inventory, ooops. (Thanks lavacraft)
This commit is contained in:
parent
93494613ed
commit
041bbc5f5d
@ -38,7 +38,7 @@ namespace ClassicalSharp.Gui {
|
||||
public override bool HandlesMouseClick( int mouseX, int mouseY, MouseButton button ) {
|
||||
if( draggingMouse || game.hudScreen.hotbar.HandlesMouseClick( mouseX, mouseY, button ) )
|
||||
return true;
|
||||
if( button == MouseButton.Left && mouseX >= TableX && mouseX < TableX + scrollbarWidth ) {
|
||||
if( button == MouseButton.Left && mouseX >= TableX - scrollbarWidth && mouseX < TableX ) {
|
||||
ScrollbarClick( mouseY );
|
||||
} else if( button == MouseButton.Left ) {
|
||||
if( selIndex != -1 )
|
||||
|
@ -27,8 +27,8 @@ namespace ClassicalSharp.Gui {
|
||||
}
|
||||
|
||||
public override bool HandlesMouseScroll( int delta ) {
|
||||
bool bounds = Contains( TableX, TableY, TableWidth, TableHeight,
|
||||
game.Mouse.X, game.Mouse.Y );
|
||||
bool bounds = Contains( TableX - scrollbarWidth, TableY, TableWidth + scrollbarWidth,
|
||||
TableHeight, game.Mouse.X, game.Mouse.Y );
|
||||
bool hotbar = game.IsKeyDown( Key.AltLeft ) || game.IsKeyDown( Key.AltRight );
|
||||
if( !bounds || hotbar ) return false;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user