Browse Source

rename function

Michael 2 năm trước cách đây
mục cha
commit
eb618fbff9
2 tập tin đã thay đổi với 5 bổ sung5 xóa
  1. 4 4
      client/mainmenu/CMainMenu.cpp
  2. 1 1
      client/mainmenu/CMainMenu.h

+ 4 - 4
client/mainmenu/CMainMenu.cpp

@@ -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")

+ 1 - 1
client/mainmenu/CMainMenu.h

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