REMOVE: license verification and BuyGame btns/screens

This commit is contained in:
Kolyah35
2026-03-11 00:39:27 +03:00
parent 3c71139a7c
commit d25a04f154
15 changed files with 9 additions and 363 deletions

View File

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