mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
rename function
This commit is contained in:
parent
8672fc7e3d
commit
eb618fbff9
@ -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")
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
CMultiMode(ESelectionScreen ScreenType);
|
||||
void hostTCP();
|
||||
void joinTCP();
|
||||
getDefaultPlayerName()
|
||||
std::string getPlayerName();
|
||||
|
||||
void onNameChange(std::string newText);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user