mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-19 22:43:32 +00:00
TextBox / removed BuyButton / impoved CreateWorldScreen
This commit is contained in:
@@ -25,6 +25,11 @@ void Screen::render( int xm, int ym, float a )
|
||||
Button* button = buttons[i];
|
||||
button->render(minecraft, xm, ym);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < textBoxes.size(); i++) {
|
||||
TextBox* textbox = textBoxes[i];
|
||||
textbox->render(minecraft, xm, ym);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::init( Minecraft* minecraft, int width, int height )
|
||||
@@ -157,6 +162,11 @@ void Screen::keyPressed( int eventKey )
|
||||
minecraft->setScreen(NULL);
|
||||
//minecraft->grabMouse();
|
||||
}
|
||||
|
||||
for (auto& textbox : textBoxes) {
|
||||
textbox->handleKey(eventKey);
|
||||
}
|
||||
|
||||
if (minecraft->useTouchscreen())
|
||||
return;
|
||||
|
||||
@@ -181,6 +191,14 @@ 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())
|
||||
@@ -210,6 +228,10 @@ void Screen::mouseClicked( int x, int y, int buttonNum )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& textbox : textBoxes) {
|
||||
textbox->mouseClicked(minecraft, x, y, buttonNum);
|
||||
}
|
||||
}
|
||||
|
||||
void Screen::mouseReleased( int x, int y, int buttonNum )
|
||||
@@ -253,3 +275,9 @@ 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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user