mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-04 03:34:18 +03:00
31 lines
785 B
C++
31 lines
785 B
C++
#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);
|
|
}
|