1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
This commit is contained in:
Laserlicht 2024-07-16 02:20:49 +02:00
parent af2b6a0051
commit 97f49030d2
2 changed files with 5 additions and 2 deletions

View File

@ -925,6 +925,9 @@ OptionsTab::PlayerOptionsEntry::PlayerOptionsEntry(const PlayerSettings & S, con
labelHandicap = std::make_shared<CMultiLineLabel>(Rect(56, 24, 49, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), EFonts::FONT_TINY, ETextAlignment::CENTER, Colors::WHITE, s->handicap.empty() ? CGI->generaltexth->arraytxt[210] : MetaString::createFromTextID("vcmi.lobby.handicap").toString());
handicap = std::make_shared<LRClickableArea>(Rect(56, 24, 49, (int)graphics->fonts[EFonts::FONT_TINY]->getLineHeight()*2), [this](){
if(!CSH->isHost())
return;
TResources resources = TResources();
resources[EGameResID::GOLD] = 50000;
CSH->setPlayerHandicap(s->color, resources);

View File

@ -1052,7 +1052,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
for (const auto & pi : si->playerInfos)
if(pi.second.isControlledByHuman() && !pi.second.handicap.empty())
if(!pi.second.handicap.empty())
{
MetaString str;
str.appendTextID("vcmi.lobby.handicap");
@ -1067,7 +1067,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
str.appendRawString(":");
str.appendRawString(std::to_string(pi.second.handicap[res]));
}
announceTxt(str);
gh->playerMessages->broadcastSystemMessage(str);
}
std::vector<std::string> optionIds;