Skip to content

Commit

Permalink
fix "By" text reappearing in compact cells
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Feb 19, 2024
1 parent 91bdeed commit 7f6c4d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,10 @@ void BetterInfo::reloadUsernames(LevelBrowserLayer* levelBrowserLayer) {
float oldXSize = textNode->getScaledContentSize().width;

auto userName = GameLevelManager::sharedState()->userNameForUserID(levelCell->m_level->m_userID);
if(userName.empty() || std::string(userName) == "-" || std::string(userName) == "Unknown") continue;

auto oldString = std::string(textNode->getString());
auto newString = fmt::format("By {}", std::string(userName));
auto newString = fmt::format("{}{}", levelCell->m_compactView ? "" : "By ", std::string(userName));

textNode->setString(newString.c_str());

Expand Down

0 comments on commit 7f6c4d9

Please sign in to comment.