mirror of
https://gitea.sffempire.ru/Kolyah35/minecraft-pe-0.6.1.git
synced 2026-03-20 06:53:30 +00:00
REMOVE: license verification and BuyGame btns/screens
This commit is contained in:
@@ -5,9 +5,7 @@
|
||||
#include "JoinGameScreen.h"
|
||||
#include "OptionsScreen.h"
|
||||
#include "PauseScreen.h"
|
||||
#include "InvalidLicenseScreen.h"
|
||||
#include "PrerenderTilesScreen.h" // test button
|
||||
//#include "BuyGameScreen.h"
|
||||
|
||||
#include "../../../util/Mth.h"
|
||||
|
||||
@@ -27,9 +25,7 @@
|
||||
StartMenuScreen::StartMenuScreen()
|
||||
: bHost( 2, 0, 0, 160, 24, "Start Game"),
|
||||
bJoin( 3, 0, 0, 160, 24, "Join Game"),
|
||||
bOptions( 4, 0, 0, 78, 22, "Options"),
|
||||
bBuy( 5, 0, 0, 78, 22, "Buy"),
|
||||
bTest( 999, 0, 0, 78, 22, "Create")
|
||||
bOptions( 4, 0, 0, 78, 22, "Options")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,6 +35,9 @@ StartMenuScreen::~StartMenuScreen()
|
||||
|
||||
void StartMenuScreen::init()
|
||||
{
|
||||
|
||||
bJoin.active = bHost.active = bOptions.active = true;
|
||||
|
||||
if (minecraft->options.username.empty()) {
|
||||
return; // tick() will redirect to UsernameScreen
|
||||
}
|
||||
@@ -94,14 +93,12 @@ void StartMenuScreen::setupPositions() {
|
||||
#endif
|
||||
|
||||
bOptions.y = yBase + 28 + 2;
|
||||
bTest.y = bBuy.y = bOptions.y;
|
||||
//#endif
|
||||
|
||||
// Center buttons
|
||||
bHost.x = (width - bHost.width) / 2;
|
||||
bJoin.x = (width - bJoin.width) / 2;
|
||||
bOptions.x = (width - bJoin.width) / 2;
|
||||
bTest.x = bBuy.x = bOptions.x + bOptions.width + 4;
|
||||
|
||||
copyrightPosX = width - minecraft->font->width(copyright) - 1;
|
||||
versionPosX = (width - minecraft->font->width(version)) / 2;// - minecraft->font->width(version) - 2;
|
||||
@@ -112,7 +109,6 @@ void StartMenuScreen::tick() {
|
||||
minecraft->setScreen(new UsernameScreen());
|
||||
return;
|
||||
}
|
||||
_updateLicense();
|
||||
}
|
||||
|
||||
void StartMenuScreen::buttonClicked(Button* button) {
|
||||
@@ -134,16 +130,6 @@ void StartMenuScreen::buttonClicked(Button* button) {
|
||||
{
|
||||
minecraft->setScreen(new OptionsScreen());
|
||||
}
|
||||
if (button->id == bTest.id)
|
||||
{
|
||||
//minecraft->setScreen(new PauseScreen());
|
||||
//minecraft->setScreen(new PrerenderTilesScreen());
|
||||
}
|
||||
if (button->id == bBuy.id)
|
||||
{
|
||||
minecraft->platform()->buyGame();
|
||||
//minecraft->setScreen(new BuyGameScreen());
|
||||
}
|
||||
}
|
||||
|
||||
bool StartMenuScreen::isInGameScreen() { return false; }
|
||||
@@ -202,23 +188,6 @@ void StartMenuScreen::render( int xm, int ym, float a )
|
||||
}
|
||||
}
|
||||
|
||||
void StartMenuScreen::_updateLicense()
|
||||
{
|
||||
int id = minecraft->getLicenseId();
|
||||
if (LicenseCodes::isReady(id))
|
||||
{
|
||||
if (LicenseCodes::isOk(id))
|
||||
bJoin.active = bHost.active = bOptions.active = true;
|
||||
else
|
||||
{
|
||||
bool hasBuyButton = minecraft->platform()->hasBuyButtonWhenInvalidLicense();
|
||||
minecraft->setScreen(new InvalidLicenseScreen(id, hasBuyButton));
|
||||
}
|
||||
} else {
|
||||
bJoin.active = bHost.active = bOptions.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
void StartMenuScreen::mouseClicked(int x, int y, int buttonNum) {
|
||||
const int logoX = 2;
|
||||
const int logoW = 8 + 2 + font->width("Kolyah35/minecraft-pe-0.6.1");
|
||||
|
||||
Reference in New Issue
Block a user