mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-30 20:13:31 +00:00
.h -> .hpp everything
This commit is contained in:
55
src/client/gui/screens/DisconnectionScreen.hpp
Executable file
55
src/client/gui/screens/DisconnectionScreen.hpp
Executable file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include "client/gui/Screen.hpp"
|
||||
#include "client/gui/Font.hpp"
|
||||
#include "client/gui/components/Button.hpp"
|
||||
#include "client/Minecraft.hpp"
|
||||
#include <string>
|
||||
|
||||
class DisconnectionScreen: public Screen
|
||||
{
|
||||
typedef Screen super;
|
||||
public:
|
||||
DisconnectionScreen(const std::string& msg)
|
||||
: _msg(msg),
|
||||
_back(NULL)
|
||||
{}
|
||||
|
||||
~DisconnectionScreen() {
|
||||
delete _back;
|
||||
}
|
||||
|
||||
void init() {
|
||||
if (/* minecraft->useTouchscreen() */ true)
|
||||
_back = new Touch::TButton(1, "Ok");
|
||||
else
|
||||
_back = new Button(1, "Ok");
|
||||
|
||||
buttons.push_back(_back);
|
||||
tabButtons.push_back(_back);
|
||||
|
||||
_back->width = 128;
|
||||
_back->x = (width - _back->width) / 2;
|
||||
_back->y = height / 2;
|
||||
}
|
||||
|
||||
void render( int xm, int ym, float a ) {
|
||||
renderBackground();
|
||||
super::render(xm, ym, a);
|
||||
|
||||
int center = (width - minecraft->font->width(_msg)) / 2;
|
||||
minecraft->font->drawShadow(_msg, (float)center, (float)(height / 2 - 32), 0xffffffff);
|
||||
}
|
||||
|
||||
void buttonClicked(Button* button) {
|
||||
if (button->id == _back->id) {
|
||||
minecraft->leaveGame();
|
||||
}
|
||||
}
|
||||
bool isInGameScreen() { return false; }
|
||||
|
||||
private:
|
||||
std::string _msg;
|
||||
Button* _back;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user