Fix: gui, block destroy

Feat: speed up on left mouse button in credits
This commit is contained in:
InviseDivine
2026-03-10 22:06:28 +02:00
parent 2d17f9d152
commit 04f13ab4a7
3 changed files with 15 additions and 3 deletions

View File

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

View File

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