Fix clicking on scrollbar in inventory closing inventory, ooops. (Thanks lavacraft)

This commit is contained in:
UnknownShadow200 2016-06-07 10:18:31 +10:00
parent 93494613ed
commit 041bbc5f5d
3 changed files with 4 additions and 4 deletions

View File

@ -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 )

View File

@ -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;

View File

@ -15,7 +15,7 @@ namespace ClassicalSharp.Gui {
// Column 1
MakeBool( -1, -150, "Black text shadows", OptionsKey.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,
OnWidgetClick, g => g.ShowFPS, (g, v) => g.ShowFPS = v ),