mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
* Initial commit.
:)
This commit is contained in:
30
source/GUI/Screen/RenameMPLevelScreen.cpp
Normal file
30
source/GUI/Screen/RenameMPLevelScreen.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "RenameMPLevelScreen.hpp"
|
||||
#include "StartMenuScreen.hpp"
|
||||
|
||||
RenameMPLevelScreen::RenameMPLevelScreen(const std::string& levelName) : m_levelName(levelName)
|
||||
{
|
||||
}
|
||||
|
||||
void RenameMPLevelScreen::init()
|
||||
{
|
||||
m_pMinecraft->platform()->showDialog(AppPlatform::DLG_RENAME_MP_WORLD);
|
||||
m_pMinecraft->platform()->createUserInput();
|
||||
}
|
||||
|
||||
void RenameMPLevelScreen::render(int mouseX, int mouseY, float f)
|
||||
{
|
||||
int userInputStatus = m_pMinecraft->platform()->getUserInputStatus();
|
||||
if (userInputStatus < 0)
|
||||
return;
|
||||
|
||||
if (userInputStatus == 1)
|
||||
{
|
||||
std::vector<std::string> input = m_pMinecraft->platform()->getUserInput();
|
||||
if (input.size() > 0 && !input[0].empty())
|
||||
{
|
||||
m_pMinecraft->getLevelSource()->renameLevel(m_levelName, input[0]);
|
||||
}
|
||||
}
|
||||
|
||||
m_pMinecraft->setScreen(new StartMenuScreen);
|
||||
}
|
||||
Reference in New Issue
Block a user