From 04f13ab4a72b3de095d3cecdc95e1f83ef98b82e Mon Sep 17 00:00:00 2001 From: InviseDivine Date: Tue, 10 Mar 2026 22:06:28 +0200 Subject: [PATCH] Fix: gui, block destroy Feat: speed up on left mouse button in credits --- src/client/Minecraft.cpp | 4 ++++ src/client/gui/screens/CreditsScreen.cpp | 10 +++++++++- src/client/gui/screens/OptionsScreen.cpp | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/client/Minecraft.cpp b/src/client/Minecraft.cpp index 96c9051..2b49033 100755 --- a/src/client/Minecraft.cpp +++ b/src/client/Minecraft.cpp @@ -864,6 +864,10 @@ void Minecraft::tickInput() { static bool prevMouseDownLeft = false; + if (Mouse::getButtonState(MouseAction::ACTION_LEFT) == 0) { + gameMode->stopDestroyBlock(); + } + if (useTouchscreen()) { // Touch: gesture recognizer classifies the action type (turn/destroy/build) BuildActionIntention bai; diff --git a/src/client/gui/screens/CreditsScreen.cpp b/src/client/gui/screens/CreditsScreen.cpp index a6089d8..1412fff 100644 --- a/src/client/gui/screens/CreditsScreen.cpp +++ b/src/client/gui/screens/CreditsScreen.cpp @@ -4,6 +4,7 @@ #include "../../Minecraft.h" #include "../components/Button.h" #include "../components/ImageButton.h" +#include "platform/input/Mouse.h" CreditsScreen::CreditsScreen() : bHeader(NULL), btnBack(NULL) @@ -65,11 +66,16 @@ void CreditsScreen::tick() { if (_scrollY + totalHeight < 0) { _scrollY = height; } + + if (Mouse::isButtonDown(MouseAction::ACTION_LEFT)) { + _scrollSpeed = 1.5f; + } else { + _scrollSpeed = 0.5f; + } } void CreditsScreen::render(int xm, int ym, float a) { renderBackground(); - super::render(xm, ym, a); int w = width; Font* font = minecraft->font; float y = _scrollY; @@ -87,6 +93,8 @@ void CreditsScreen::render(int xm, int ym, float a) { } y += lineHeight; } + + super::render(xm, ym, a); } void CreditsScreen::buttonClicked(Button* button) { diff --git a/src/client/gui/screens/OptionsScreen.cpp b/src/client/gui/screens/OptionsScreen.cpp index c73156f..0a4ca89 100755 --- a/src/client/gui/screens/OptionsScreen.cpp +++ b/src/client/gui/screens/OptionsScreen.cpp @@ -77,8 +77,8 @@ void OptionsScreen::init() { categoryButtons.push_back(new Touch::TButton(4, "Controls")); categoryButtons.push_back(new Touch::TButton(5, "Graphics")); - btnChangeUsername = new Button(10, "Username"); - btnCredits = new Button(11, "Credits"); + btnChangeUsername = new Touch::TButton(10, "Username"); + btnCredits = new Touch::TButton(11, "Credits"); buttons.push_back(bHeader); buttons.push_back(btnClose);