display faction in selected object name for hq and defence stations
This commit is contained in:
@@ -47,6 +47,11 @@ namespace
|
||||
|
||||
QString buildingTypeName(BuildingType type)
|
||||
{
|
||||
if (type == BuildingType::Hq)
|
||||
{
|
||||
return QObject::tr("Player HQ");
|
||||
}
|
||||
|
||||
const std::string id = buildingTypeId(type);
|
||||
QString result;
|
||||
bool nextUpper = true;
|
||||
@@ -971,7 +976,11 @@ void SelectedBuildingPanel::buildEntityStation(entt::entity entity)
|
||||
EntityAdmin& admin = m_sim->admin();
|
||||
const HealthComponent& health = admin.get<HealthComponent>(entity);
|
||||
|
||||
m_entityTitleLabel->setText(tr("Defence Station"));
|
||||
const bool isEnemy = admin.hasAll<FactionComponent>(entity)
|
||||
&& admin.get<FactionComponent>(entity).isEnemy;
|
||||
m_entityTitleLabel->setText(isEnemy
|
||||
? tr("Enemy Defence Station")
|
||||
: tr("Player Defence Station"));
|
||||
m_entityTitleLabel->show();
|
||||
|
||||
float totalDps = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user