many sparse changes
This commit is contained in:
1 parent
2c26c6f795
commit
7aa4ea4425
23 files changed
+1317
-290
No files matched your search
+58
-21
@@ -68,9 +68,8 @@ QString turnToString(int turn)
|
||||
if (!generateNames)
|
||||
return QString::number(turn);
|
||||
const int year = turnToYear(turn);
|
||||
// Phrases['BC']/['AD'] (StringTables.pas) aren't ported; disclosed
|
||||
// plain-English fallback format.
|
||||
return year < 0 ? QStringLiteral("%1 BC").arg(-year) : QStringLiteral("AD %1").arg(year);
|
||||
return phraseToQtFormat(phrases.lookup(year < 0 ? QStringLiteral("BC") : QStringLiteral("AD")))
|
||||
.arg(std::abs(year));
|
||||
}
|
||||
|
||||
void impImage(Dpi::Canvas &canvas, int x, int y, int iix, int government, bool isControl)
|
||||
@@ -145,6 +144,57 @@ std::array<int, nAdv> advIcon = [] {
|
||||
result.fill(-1);
|
||||
return result;
|
||||
}();
|
||||
void initAdvIcons()
|
||||
{
|
||||
for (int i = 0; i < nAdv; ++i) {
|
||||
int &icon = advIcon[static_cast<std::size_t>(i)];
|
||||
if (IsFutureTech(i)) {
|
||||
icon = 96 + i - futResearchTechnology;
|
||||
continue;
|
||||
}
|
||||
icon = -1;
|
||||
for (int domain = 0; domain < nDomains; ++domain) {
|
||||
for (int j = 0; j < nUpgrade; ++j) {
|
||||
if (Upgrade[domain][j].Preq == i)
|
||||
icon = icon >= 0 ? 85 : 86 + domain;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < nFeature; ++j) {
|
||||
if (Feature[j].Preq != i)
|
||||
continue;
|
||||
for (int domain = 0; domain < nDomains; ++domain) {
|
||||
if (Feature[j].Domains & (1 << domain))
|
||||
icon = (icon >= 0 && icon != 86 + domain) ? 85 : 86 + domain;
|
||||
}
|
||||
}
|
||||
for (int j = nWonder; j < nImp; ++j) {
|
||||
if (Imp[j].Preq == i)
|
||||
icon = j;
|
||||
}
|
||||
for (int j = nWonder; j < nImp; ++j) {
|
||||
if (Imp[j].Preq == i && Imp[j].Kind != ikCommon)
|
||||
icon = j;
|
||||
}
|
||||
for (int j = 0; j < nJob; ++j) {
|
||||
if (i == JobPreq[j])
|
||||
icon = 84;
|
||||
}
|
||||
for (int j = 0; j < nWonder; ++j) {
|
||||
if (Imp[j].Preq == i)
|
||||
icon = j;
|
||||
}
|
||||
if (icon < 0)
|
||||
icon = ClientTools::advValue[static_cast<std::size_t>(i)] < 1000
|
||||
? -7
|
||||
: 24 + ClientTools::advValue[static_cast<std::size_t>(i)] / 1000;
|
||||
for (int j = 2; j < nGov; ++j) {
|
||||
if (GovPreq[j] == i)
|
||||
icon = j - 8;
|
||||
}
|
||||
}
|
||||
advIcon[adConscription] = 86 + dGround;
|
||||
}
|
||||
|
||||
std::array<int, nPl * nMmax> lostArmy{};
|
||||
int nLostArmy = 0;
|
||||
|
||||
@@ -330,8 +380,8 @@ void tellNewModels()
|
||||
if (dlg) {
|
||||
if (ClientTools::myModel[told].Kind == mkSelfDeveloped)
|
||||
dlg->openSound = QStringLiteral("NEWMODEL_%1").arg(age);
|
||||
// TODO: Phrases['MODELAVAILABLE'] (StringTables.pas not ported) - plain English fallback.
|
||||
dlg->messageText = QStringLiteral("New units are ready for production.");
|
||||
// Phrases['MODELAVAILABLE']
|
||||
dlg->messageText = phrases.lookup(QStringLiteral("MODELAVAILABLE"));
|
||||
if (gameMode == cMovie) {
|
||||
dlg->kind = MessageKind::OkHelp; // doesn't matter
|
||||
dlg->messageText += QLatin1Char('\\') + myTribe.modelNameAt(told);
|
||||
@@ -384,23 +434,10 @@ const std::array<QString, 16> CityEventSoundItem = {
|
||||
|
||||
QString cityEventName(int i)
|
||||
{
|
||||
// TODO: needs Phrases/Phrases2 (StringTables.pas not ported) - plain
|
||||
// English fallback descriptions per event index.
|
||||
static const std::array<QString, 16> fallback = {
|
||||
QStringLiteral("Civil disorder"), QStringLiteral("Population grows"),
|
||||
QStringLiteral("Population declines"), QStringLiteral("Unit lost"),
|
||||
QStringLiteral("Improvement lost"), QStringLiteral("Production sabotaged"),
|
||||
QStringLiteral("No growth without aqueduct/sewer"), QStringLiteral("Pollution"),
|
||||
QStringLiteral("City under siege"), QStringLiteral("Wonder obsolete"),
|
||||
QStringLiteral("Settler production delayed"), QStringLiteral("City founded"),
|
||||
QStringLiteral("City founded"), QStringLiteral(""),
|
||||
QStringLiteral("All improvements built"), QStringLiteral(""),
|
||||
};
|
||||
if (i == 14) // chAllImpsMade
|
||||
return fallback[14];
|
||||
if (i >= 0 && i < static_cast<int>(fallback.size()))
|
||||
return fallback[static_cast<std::size_t>(i)];
|
||||
return QString();
|
||||
return phrases2FallenBackToEnglish ? phrases.lookup(QStringLiteral("CITYEVENTS"), 1)
|
||||
: phrases2.lookup(QStringLiteral("CITYEVENT_ALLIMPSMADE"));
|
||||
return phrases.lookup(QStringLiteral("CITYEVENTS"), i);
|
||||
}
|
||||
|
||||
void helpOnTerrain(int loc, WindowMode newMode)
|
||||
|
||||
Reference in new issue
Block a user