mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
fix
This commit is contained in:
@@ -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());
|
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](){
|
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();
|
TResources resources = TResources();
|
||||||
resources[EGameResID::GOLD] = 50000;
|
resources[EGameResID::GOLD] = 50000;
|
||||||
CSH->setPlayerHandicap(s->color, resources);
|
CSH->setPlayerHandicap(s->color, resources);
|
||||||
|
@@ -1052,7 +1052,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
|
|||||||
gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
|
gh->playerMessages->broadcastSystemMessage("Use '!help' to list available commands");
|
||||||
|
|
||||||
for (const auto & pi : si->playerInfos)
|
for (const auto & pi : si->playerInfos)
|
||||||
if(pi.second.isControlledByHuman() && !pi.second.handicap.empty())
|
if(!pi.second.handicap.empty())
|
||||||
{
|
{
|
||||||
MetaString str;
|
MetaString str;
|
||||||
str.appendTextID("vcmi.lobby.handicap");
|
str.appendTextID("vcmi.lobby.handicap");
|
||||||
@@ -1067,7 +1067,7 @@ void CVCMIServer::multiplayerWelcomeMessage()
|
|||||||
str.appendRawString(":");
|
str.appendRawString(":");
|
||||||
str.appendRawString(std::to_string(pi.second.handicap[res]));
|
str.appendRawString(std::to_string(pi.second.handicap[res]));
|
||||||
}
|
}
|
||||||
announceTxt(str);
|
gh->playerMessages->broadcastSystemMessage(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::string> optionIds;
|
std::vector<std::string> optionIds;
|
||||||
|
Reference in New Issue
Block a user