1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

rename function

This commit is contained in:
Michael 2023-05-28 17:29:11 +02:00 committed by GitHub
parent 8672fc7e3d
commit eb618fbff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -400,7 +400,7 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType)
statusBar = CGStatusBar::create(std::make_shared<CPicture>(background->getSurface(), Rect(7, 465, 440, 18), 7, 465));
playerName = std::make_shared<CTextInput>(Rect(19, 436, 334, 16), background->getSurface());
playerName->setText(getDefaultPlayerName());
playerName->setText(getPlayerName());
playerName->cb += std::bind(&CMultiMode::onNameChange, this, _1);
buttonHotseat = std::make_shared<CButton>(Point(373, 78), "MUBHOT.DEF", CGI->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this));
@ -413,17 +413,17 @@ void CMultiMode::hostTCP()
{
auto savedScreenType = screenType;
close();
GH.windows().createAndPushWindow<CMultiPlayers>(getDefaultPlayerName(), savedScreenType, true, ELoadMode::MULTI);
GH.windows().createAndPushWindow<CMultiPlayers>(getPlayerName(), savedScreenType, true, ELoadMode::MULTI);
}
void CMultiMode::joinTCP()
{
auto savedScreenType = screenType;
close();
GH.windows().createAndPushWindow<CMultiPlayers>(getDefaultPlayerName(), savedScreenType, false, ELoadMode::MULTI);
GH.windows().createAndPushWindow<CMultiPlayers>(getPlayerName(), savedScreenType, false, ELoadMode::MULTI);
}
std::string CMultiMode::getDefaultPlayerName()
std::string CMultiMode::getPlayerName()
{
std::string name = settings["general"]["playerName"].String();
if(name == "Player")

View File

@ -91,7 +91,7 @@ public:
CMultiMode(ESelectionScreen ScreenType);
void hostTCP();
void joinTCP();
getDefaultPlayerName()
std::string getPlayerName();
void onNameChange(std::string newText);
};