Fixes and enhancements from my MCPE repository. (https://github.com/mschiller890/mcpe64)

This commit is contained in:
Michal Schiller
2026-03-10 19:31:40 +01:00
parent 0c97ceb340
commit 2fc323639a
69 changed files with 2509 additions and 639 deletions

View File

@@ -26,6 +26,7 @@ void Screen::render( int xm, int ym, float a )
button->render(minecraft, xm, ym);
}
// render any text boxes after buttons
for (unsigned int i = 0; i < textBoxes.size(); i++) {
TextBox* textbox = textBoxes[i];
textbox->render(minecraft, xm, ym);
@@ -163,6 +164,7 @@ void Screen::keyPressed( int eventKey )
//minecraft->grabMouse();
}
// pass key events to any text boxes first
for (auto& textbox : textBoxes) {
textbox->handleKey(eventKey);
}
@@ -191,14 +193,6 @@ void Screen::keyPressed( int eventKey )
updateTabButtonSelection();
}
void Screen::keyboardNewChar(char inputChar) {
// yeah im using these modern cpp features in this project :sunglasses:
for (auto& textbox : textBoxes) {
textbox->handleChar(inputChar);
}
}
void Screen::updateTabButtonSelection()
{
if (minecraft->useTouchscreen())
@@ -229,6 +223,7 @@ void Screen::mouseClicked( int x, int y, int buttonNum )
}
}
// let textboxes see the click regardless
for (auto& textbox : textBoxes) {
textbox->mouseClicked(minecraft, x, y, buttonNum);
}
@@ -275,9 +270,3 @@ void Screen::toGUICoordinate( int& x, int& y ) {
x = x * width / minecraft->width;
y = y * height / minecraft->height - 1;
}
void Screen::tick() {
for (auto& textbox : textBoxes) {
textbox->tick(minecraft);
}
}