1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge remote-tracking branch 'origin/beta' into fix_rmg_teams

This commit is contained in:
Tomasz Zieliński
2023-08-14 18:59:45 +02:00
217 changed files with 5923 additions and 3597 deletions

View File

@ -147,7 +147,6 @@ void RandomMapTab::updateMapInfoByHost()
mapInfo->mapHeader->twoLevel = mapGenOptions->getHasTwoLevels();
// Generate player information
mapInfo->mapHeader->players.clear();
int playersToGen = PlayerColor::PLAYER_LIMIT_I;
if(mapGenOptions->getPlayerCount() != CMapGenOptions::RANDOM_SIZE)
{
@ -157,7 +156,6 @@ void RandomMapTab::updateMapInfoByHost()
playersToGen = mapGenOptions->getPlayerCount();
}
mapInfo->mapHeader->howManyTeams = playersToGen;
//FIXME: Assign all human-controlled colors in first place
@ -165,6 +163,12 @@ void RandomMapTab::updateMapInfoByHost()
//TODO: Get human player count
std::set<TeamID> occupiedTeams;
for(int i = 0; i < PlayerColor::PLAYER_LIMIT_I; ++i)
{
mapInfo->mapHeader->players[i].canComputerPlay = false;
mapInfo->mapHeader->players[i].canHumanPlay = false;
}
for(int i = 0; i < playersToGen; ++i)
{
PlayerInfo player;
@ -183,7 +187,7 @@ void RandomMapTab::updateMapInfoByHost()
occupiedTeams.insert(team);
player.hasMainTown = true;
player.generateHeroAtMainTown = true;
mapInfo->mapHeader->players.push_back(player);
mapInfo->mapHeader->players[i] = player;
}
for(auto & player : mapInfo->mapHeader->players)
{
@ -317,7 +321,7 @@ void RandomMapTab::setMapGenOptions(std::shared_ptr<CMapGenOptions> opts)
if(tmpl)
w->addTextOverlay(tmpl->getName(), EFonts::FONT_SMALL);
else
w->addTextOverlay(readText(variables["defaultTemplate"]), EFonts::FONT_SMALL);
w->addTextOverlay(readText(variables["randomTemplate"]), EFonts::FONT_SMALL);
}
for(auto r : VLC->roadTypeHandler->objects)
{
@ -337,7 +341,7 @@ void RandomMapTab::setTemplate(const CRmgTemplate * tmpl)
if(tmpl)
w->addTextOverlay(tmpl->getName(), EFonts::FONT_SMALL);
else
w->addTextOverlay(readText(variables["defaultTemplate"]), EFonts::FONT_SMALL);
w->addTextOverlay(readText(variables["randomTemplate"]), EFonts::FONT_SMALL);
}
updateMapInfoByHost();
}
@ -398,7 +402,7 @@ void TemplatesDropBox::ListItem::updateItem(int idx, const CRmgTemplate * _item)
if(idx)
w->setText("");
else
w->setText(readText(dropBox.variables["defaultTemplate"]));
w->setText(readText(dropBox.variables["randomTemplate"]));
}
}
}