mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-05 18:10:09 +03:00
* Add splash text rendering to the start menu screen.
This commit is contained in:
@@ -17,6 +17,317 @@
|
||||
#define CAN_QUIT
|
||||
#endif
|
||||
|
||||
// actual name
|
||||
const char* gSplashes[] =
|
||||
{
|
||||
"1 star! Deal with it notch!",
|
||||
"100% more yellow text!",
|
||||
"Glowing creepy eyes!",
|
||||
"Toilet friendly!",
|
||||
"Annoying touch buttons!",
|
||||
"Astronomically accurate!",
|
||||
"0xffff-1 chunks!",
|
||||
"Cubism!",
|
||||
"Pocket!",
|
||||
"Mostly harmless!",
|
||||
"!!!1!",
|
||||
"Dramatic lighting!",
|
||||
"As seen on TV!",
|
||||
"Awesome!",
|
||||
"100% pure!",
|
||||
"May contain nuts!",
|
||||
"Better than Prey!",
|
||||
"Less polygons!",
|
||||
"Sexy!",
|
||||
"Limited edition!",
|
||||
"Flashing letters!",
|
||||
"Made by Mojang!",
|
||||
"It's here!",
|
||||
"Best in class!",
|
||||
"It's alpha!",
|
||||
"100% dragon free!",
|
||||
"Excitement!",
|
||||
"More than 500 sold!",
|
||||
"One of a kind!",
|
||||
"Heaps of hits on YouTube!",
|
||||
"Indev!",
|
||||
"Spiders everywhere!",
|
||||
"Check it out!",
|
||||
"Holy cow, man!",
|
||||
"It's a game!",
|
||||
"Made in Sweden!",
|
||||
"Uses C++!",
|
||||
"Reticulating splines!",
|
||||
"Minecraft!",
|
||||
"Yaaay!",
|
||||
"Multiplayer!",
|
||||
"Touch compatible!",
|
||||
"Undocumented!",
|
||||
"Ingots!",
|
||||
"Exploding creepers!",
|
||||
"That's no moon!",
|
||||
"l33t!",
|
||||
"Create!",
|
||||
"Survive!",
|
||||
"Dungeon!",
|
||||
"Exclusive!",
|
||||
"The bee's knees!",
|
||||
"Down with O.P.P.!",
|
||||
"Closed source!",
|
||||
"Classy!",
|
||||
"Wow!",
|
||||
"Not on steam!",
|
||||
"Oh man!",
|
||||
"Awesome community!",
|
||||
"Pixels!",
|
||||
"Teetsuuuuoooo!",
|
||||
"Kaaneeeedaaaa!",
|
||||
"Enhanced!",
|
||||
"90% bug free!",
|
||||
"Pretty!",
|
||||
"12 herbs and spices!",
|
||||
"Fat free!",
|
||||
"Absolutely no memes!",
|
||||
"Free dental!",
|
||||
"Ask your doctor!",
|
||||
"Minors welcome!",
|
||||
"Cloud computing!",
|
||||
"Legal in Finland!",
|
||||
"Hard to label!",
|
||||
"Technically good!",
|
||||
"Bringing home the bacon!",
|
||||
"Quite Indie!",
|
||||
"GOTY!",
|
||||
"Euclidian!",
|
||||
"Now in 3D!",
|
||||
"Inspirational!",
|
||||
"Herregud!",
|
||||
"Complex cellular automata!",
|
||||
"Yes, sir!",
|
||||
"Played by cowboys!",
|
||||
"OpenGL ES 1.1!",
|
||||
"Thousands of colors!",
|
||||
"Try it!",
|
||||
"Age of Wonders is better!",
|
||||
"Try the mushroom stew!",
|
||||
"Sensational!",
|
||||
"Hot tamale, hot hot tamale!",
|
||||
"Play him off, keyboard cat!",
|
||||
"Guaranteed!",
|
||||
"Macroscopic!",
|
||||
"Bring it on!",
|
||||
"Random splash!",
|
||||
"Call your mother!",
|
||||
"Monster infighting!",
|
||||
"Loved by millions!",
|
||||
"Ultimate edition!",
|
||||
"Freaky!",
|
||||
"You've got a brand new key!",
|
||||
"Water proof!",
|
||||
"Uninflammable!",
|
||||
"Whoa, dude!",
|
||||
"All inclusive!",
|
||||
"Tell your friends!",
|
||||
"NP is not in P!",
|
||||
"Notch <3 ez!",
|
||||
"Livestreamed!",
|
||||
"Haunted!",
|
||||
"Polynomial!",
|
||||
"Terrestrial!",
|
||||
"All is full of love!",
|
||||
"Full of stars!",
|
||||
"Scientific!",
|
||||
"Cooler than Spock!",
|
||||
"Collaborate and listen!",
|
||||
"Never dig down!",
|
||||
"Take frequent breaks!",
|
||||
"Not linear!",
|
||||
"Han shot first!",
|
||||
"Nice to meet you!",
|
||||
"Buckets of lava!",
|
||||
"Ride the pig!",
|
||||
"Larger than Earth!",
|
||||
"sqrt(-1) love you!",
|
||||
"Phobos anomaly!",
|
||||
"Punching wood!",
|
||||
"Falling off cliffs!",
|
||||
"0% sugar!",
|
||||
"150% hyperbole!",
|
||||
"Synecdoche!",
|
||||
"Let's danec!",
|
||||
"Seecret Friday update!",
|
||||
"Ported implementation!",
|
||||
"Lewd with two dudes with food!",
|
||||
"Kiss the sky!",
|
||||
"20 GOTO 10!",
|
||||
"Verlet intregration!",
|
||||
"Peter Griffin!",
|
||||
"Do not distribute!",
|
||||
"Cogito ergo sum!",
|
||||
"4815162342 lines of code!",
|
||||
"A skeleton popped out!",
|
||||
"The Work of Notch!",
|
||||
"The sum of its parts!",
|
||||
"BTAF used to be good!",
|
||||
"I miss ADOM!",
|
||||
"umop-apisdn!",
|
||||
"OICU812!",
|
||||
"Bring me Ray Cokes!",
|
||||
"Finger-licking!",
|
||||
"Thematic!",
|
||||
"Pneumatic!",
|
||||
"Sublime!",
|
||||
"Octagonal!",
|
||||
"Une baguette!",
|
||||
"Gargamel plays it!",
|
||||
"Rita is the new top dog!",
|
||||
"SWM forever!",
|
||||
"Representing Edsbyn!",
|
||||
"Matt Damon!",
|
||||
"Supercalifragilisticexpialidocious!",
|
||||
"Consummate V's!",
|
||||
"Cow Tools!",
|
||||
"Double buffered!",
|
||||
"V-synched!",
|
||||
"Fan fiction!",
|
||||
"Flaxkikare!",
|
||||
"Jason! Jason! Jason!",
|
||||
"Hotter than the sun!",
|
||||
"Internet enabled!",
|
||||
"Autonomous!",
|
||||
"Engage!",
|
||||
"Fantasy!",
|
||||
"DRR! DRR! DRR!",
|
||||
"Kick it root down!",
|
||||
"Regional resources!",
|
||||
"Woo, facepunch!",
|
||||
"Woo, somethingawful!",
|
||||
"Woo, /v/!",
|
||||
"Woo, tigsource!",
|
||||
"Woo, minecraftforum!",
|
||||
"Woo, worldofminecraft!",
|
||||
"Woo, reddit!",
|
||||
"Woo, 2pp!",
|
||||
"Google anlyticsed!",
|
||||
"Give us Gordon!",
|
||||
"Tip your waiter!",
|
||||
"Very fun!",
|
||||
"12345 is a bad password!",
|
||||
"Vote for net neutrality!",
|
||||
"Lives in a pineapple under the sea!",
|
||||
"Omnipotent!",
|
||||
"Gasp!",
|
||||
"...!",
|
||||
"Bees, bees, bees, bees!",
|
||||
"Haha, LOL!",
|
||||
"Hampsterdance!",
|
||||
"Switches and ores!",
|
||||
"Menger sponge!",
|
||||
"idspispopd!",
|
||||
"Eple (original edit)!",
|
||||
"So fresh, so clean!",
|
||||
"Don't look directly at the bugs!",
|
||||
"Oh, ok, Pigmen!",
|
||||
"Scary!",
|
||||
"Play Minecraft, Watch Topgear, Get Pig!",
|
||||
"Twittered about!",
|
||||
"Jump up, jump up, and get down!",
|
||||
"Joel is neat!",
|
||||
"A riddle, wrapped in a mystery!",
|
||||
"Huge tracts of land!",
|
||||
"Welcome to your Doom!",
|
||||
"Stay a while, stay forever!",
|
||||
"Stay a while and listen!",
|
||||
"Treatment for your rash!",
|
||||
"\"Autological\" is!",
|
||||
"Information wants to be free!",
|
||||
"\"Almost never\" is an interesting concept!",
|
||||
"Lots of truthiness!",
|
||||
"The creeper is a spy!",
|
||||
"It's groundbreaking!",
|
||||
"Let our battle's begin!",
|
||||
"The sky is the limit!",
|
||||
"Jeb has amazing hair!",
|
||||
"Casual gaming!",
|
||||
"Undefeated!",
|
||||
"Kinda like Lemmings!",
|
||||
"Follow the train, CJ!",
|
||||
"Leveraging synergy!",
|
||||
"DungeonQuest is unfair!",
|
||||
"110813!",
|
||||
"90210!",
|
||||
"Tyrion would love it!",
|
||||
"Also try VVVVVV!",
|
||||
"Also try Super Meat Boy!",
|
||||
"Also try Terraria!",
|
||||
"Also try Mount And Blade!",
|
||||
"Also try Project Zomboid!",
|
||||
"Also try World of Goo!",
|
||||
"Also try Limbo!",
|
||||
"Also try Pixeljunk Shooter!",
|
||||
"Also try Braid!",
|
||||
"That's super!",
|
||||
"Bread is pain!",
|
||||
"Read more books!",
|
||||
"Khaaaaaaaaan!",
|
||||
"Less addictive than TV Tropes!",
|
||||
"More addictive than lemonade!",
|
||||
"Bigger than a bread box!",
|
||||
"Millions of peaches!",
|
||||
"Fnord!",
|
||||
"This is my true form!",
|
||||
"Totally forgot about Dre!",
|
||||
"Don't bother with the clones!",
|
||||
"Pumpkinhead!",
|
||||
"Hobo humping slobo babe!",
|
||||
"Endless!",
|
||||
"Feature packed!",
|
||||
"Boots with the fur!",
|
||||
"Stop, hammertime!",
|
||||
"Conventional!",
|
||||
"Homeomorphic to a 3-sphere!",
|
||||
"Doesn't avoid double negatives!",
|
||||
"Place ALL the blocks!",
|
||||
"Does barrel rolls!",
|
||||
"Meeting expectations!",
|
||||
"PC gaming since 1873!",
|
||||
"Ghoughpteighbteau tchoghs!",
|
||||
"Got your nose!",
|
||||
"Haley loves Elan!",
|
||||
"Afraid of the big, black bat!",
|
||||
"Doesn't use the U-word!",
|
||||
"Child's play!",
|
||||
"See you next Friday or so!",
|
||||
"150 bpm for 400000 minutes!",
|
||||
"Technologic!",
|
||||
"Funk soul brother!",
|
||||
"Pumpa kungen!",
|
||||
"Helo Cymru!",
|
||||
"My life for Aiur!",
|
||||
"Lennart lennart = new Lennart();",
|
||||
"I see your vocabulary has improved!",
|
||||
"Who put it there?",
|
||||
"You can't explain that!",
|
||||
"if not ok then return end",
|
||||
"SOPA means LOSER in Swedish!",
|
||||
"Big Pointy Teeth!",
|
||||
"Bekarton guards the gate!",
|
||||
"Mmmph, mmph!",
|
||||
"Don't feed avocados to parrots!",
|
||||
"Swords for everyone!",
|
||||
"Plz reply to my tweet!",
|
||||
".party()!",
|
||||
"Take her pillow!",
|
||||
"Put that cookie down!",
|
||||
"Pretty scary!",
|
||||
"I have a suggestion.",
|
||||
"Now with extra hugs!",
|
||||
"Almost C++11!",
|
||||
"Woah.",
|
||||
"HURNERJSGER?",
|
||||
"What's up, Doc?"
|
||||
};
|
||||
|
||||
StartMenuScreen::StartMenuScreen() :
|
||||
m_startButton (2, 0, 0, 160, 24, "Start Game"),
|
||||
m_joinButton (3, 0, 0, 160, 24, "Join Game"),
|
||||
@@ -25,6 +336,7 @@ StartMenuScreen::StartMenuScreen() :
|
||||
m_buyButton (5, 0, 0, 78, 22, "Buy")
|
||||
//, m_testBox(1, 10, 10, 200, 16, "Insert some text...")
|
||||
{
|
||||
m_chosenSplash = -1;
|
||||
}
|
||||
|
||||
void StartMenuScreen::_updateLicense()
|
||||
@@ -133,9 +445,6 @@ void StartMenuScreen::init()
|
||||
m_buyButton.m_text = "Quit";
|
||||
#endif
|
||||
|
||||
//m_testBox.init(m_pFont);
|
||||
//m_textInputs.push_back(&m_testBox);
|
||||
|
||||
_updateLicense();
|
||||
}
|
||||
|
||||
@@ -153,6 +462,10 @@ void StartMenuScreen::render(int a, int b, float c)
|
||||
int id = tx->loadTexture("gui/title.png", true);
|
||||
Texture *pTex = tx->getTemporaryTextureData(id);
|
||||
|
||||
//const int titleYPos = 4;
|
||||
//const int titleYPos = 30; // -- MC Java position
|
||||
const int titleYPos = 15;
|
||||
|
||||
if (pTex)
|
||||
{
|
||||
if (id != tx->m_currBoundTex)
|
||||
@@ -168,16 +481,34 @@ void StartMenuScreen::render(int a, int b, float c)
|
||||
Tesselator& t = Tesselator::instance;
|
||||
glColor4f(1, 1, 1, 1);
|
||||
t.begin();
|
||||
t.vertexUV(float(left), float(height + 4), field_4, 0.0f, 1.0f);
|
||||
t.vertexUV(float(left + width), float(height + 4), field_4, 1.0f, 1.0f);
|
||||
t.vertexUV(float(left + width), 4, field_4, 1.0f, 0.0f);
|
||||
t.vertexUV(float(left), 4, field_4, 0.0f, 0.0f);
|
||||
t.vertexUV(float(left), float(height + titleYPos), field_4, 0.0f, 1.0f);
|
||||
t.vertexUV(float(left + width), float(height + titleYPos), field_4, 1.0f, 1.0f);
|
||||
t.vertexUV(float(left + width), titleYPos, field_4, 1.0f, 0.0f);
|
||||
t.vertexUV(float(left), titleYPos, field_4, 0.0f, 0.0f);
|
||||
t.draw();
|
||||
}
|
||||
|
||||
drawString(m_pFont, field_170, field_188, 62, 0xFFCCCCCC);
|
||||
drawString(m_pFont, field_170, field_188, 58 + titleYPos, 0xFFCCCCCC);
|
||||
drawString(m_pFont, field_154, field_16C, m_height - 10, 0x00FFFFFF);
|
||||
|
||||
// Draw the splash text.
|
||||
glPushMatrix();
|
||||
|
||||
std::string splashText = getSplashString();
|
||||
int textWidth = m_pFont->width(splashText), textHeight = m_pFont->height(splashText);
|
||||
|
||||
glTranslatef(float(m_width) / 2.0f + 90.0f, 70.0f, 0.0f);
|
||||
glRotatef(-20.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
float timeMS = float(getTimeMs() % 1000) / 1000.0f;
|
||||
float scale = 1.8f - Mth::abs(0.1f * Mth::sin(2.0f * float(M_PI) * timeMS));
|
||||
scale = (scale * 100.0f) / (32.0f + textWidth);
|
||||
glScalef(scale, scale, scale);
|
||||
|
||||
drawCenteredString(m_pFont, splashText, 0, -8, 0xFFFF00);
|
||||
|
||||
glPopMatrix();
|
||||
|
||||
Screen::render(a, b, c);
|
||||
}
|
||||
|
||||
@@ -185,3 +516,14 @@ void StartMenuScreen::tick()
|
||||
{
|
||||
_updateLicense();
|
||||
}
|
||||
|
||||
std::string StartMenuScreen::getSplashString()
|
||||
{
|
||||
if (m_chosenSplash == -1)
|
||||
{
|
||||
Random random;
|
||||
m_chosenSplash = random.nextInt(int(sizeof(gSplashes) / sizeof(*gSplashes)));
|
||||
}
|
||||
|
||||
return std::string(gSplashes[m_chosenSplash]);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public:
|
||||
void render(int, int, float) override;
|
||||
void tick() override;
|
||||
|
||||
std::string getSplashString();
|
||||
|
||||
private:
|
||||
Button m_startButton;
|
||||
Button m_joinButton;
|
||||
@@ -33,6 +35,6 @@ private:
|
||||
std::string field_170;
|
||||
int field_188;
|
||||
|
||||
//TextInputBox m_testBox;
|
||||
int m_chosenSplash;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user