mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -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 ) {
|
public override bool HandlesMouseClick( int mouseX, int mouseY, MouseButton button ) {
|
||||||
if( draggingMouse || game.hudScreen.hotbar.HandlesMouseClick( mouseX, mouseY, button ) )
|
if( draggingMouse || game.hudScreen.hotbar.HandlesMouseClick( mouseX, mouseY, button ) )
|
||||||
return true;
|
return true;
|
||||||
if( button == MouseButton.Left && mouseX >= TableX && mouseX < TableX + scrollbarWidth ) {
|
if( button == MouseButton.Left && mouseX >= TableX - scrollbarWidth && mouseX < TableX ) {
|
||||||
ScrollbarClick( mouseY );
|
ScrollbarClick( mouseY );
|
||||||
} else if( button == MouseButton.Left ) {
|
} else if( button == MouseButton.Left ) {
|
||||||
if( selIndex != -1 )
|
if( selIndex != -1 )
|
||||||
|
@ -27,8 +27,8 @@ namespace ClassicalSharp.Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandlesMouseScroll( int delta ) {
|
public override bool HandlesMouseScroll( int delta ) {
|
||||||
bool bounds = Contains( TableX, TableY, TableWidth, TableHeight,
|
bool bounds = Contains( TableX - scrollbarWidth, TableY, TableWidth + scrollbarWidth,
|
||||||
game.Mouse.X, game.Mouse.Y );
|
TableHeight, game.Mouse.X, game.Mouse.Y );
|
||||||
bool hotbar = game.IsKeyDown( Key.AltLeft ) || game.IsKeyDown( Key.AltRight );
|
bool hotbar = game.IsKeyDown( Key.AltLeft ) || game.IsKeyDown( Key.AltRight );
|
||||||
if( !bounds || hotbar ) return false;
|
if( !bounds || hotbar ) return false;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ namespace ClassicalSharp.Gui {
|
|||||||
// Column 1
|
// Column 1
|
||||||
MakeBool( -1, -150, "Black text shadows", OptionsKey.BlackTextShadows,
|
MakeBool( -1, -150, "Black text shadows", OptionsKey.BlackTextShadows,
|
||||||
OnWidgetClick, g => g.Drawer2D.BlackTextShadows,
|
OnWidgetClick, g => g.Drawer2D.BlackTextShadows,
|
||||||
(g, v) => { g.Drawer2D.BlackTextShadows =v; HandleFontChange(); } ),
|
(g, v) => { g.Drawer2D.BlackTextShadows = v; HandleFontChange(); } ),
|
||||||
|
|
||||||
MakeBool( -1, -100, "Show FPS", OptionsKey.ShowFPS,
|
MakeBool( -1, -100, "Show FPS", OptionsKey.ShowFPS,
|
||||||
OnWidgetClick, g => g.ShowFPS, (g, v) => g.ShowFPS = v ),
|
OnWidgetClick, g => g.ShowFPS, (g, v) => g.ShowFPS = v ),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user