many sparse changes
This commit is contained in:
1 parent
2c26c6f795
commit
7aa4ea4425
23 files changed
+1317
-290
No files matched your search
+81
-12
@@ -28,37 +28,106 @@
|
||||
|
||||
#include "Global.h"
|
||||
|
||||
#include "Cevo/CevoGraphicSet.h"
|
||||
#include "Cevo/CevoScreenTools.h"
|
||||
#include "Cevo/CevoTexture.h"
|
||||
#include <QDebug>
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
bool fullScreen = false;
|
||||
bool musicEnabled = true;
|
||||
bool generateNames = true;
|
||||
|
||||
QString getGraphicsDir()
|
||||
namespace {
|
||||
// The CEVO_RESOURCE_DIR environment variable overrides the compile-time
|
||||
// install location, to run a build-tree binary against the source resources/.
|
||||
QString resourceDir()
|
||||
{
|
||||
const QByteArray fromEnvironment = qgetenv("CEVO_RESOURCE_DIR");
|
||||
if (!fromEnvironment.isEmpty())
|
||||
return QString::fromLocal8Bit(fromEnvironment);
|
||||
#ifdef CEVO_RESOURCE_DIR
|
||||
return QStringLiteral(CEVO_RESOURCE_DIR "/Graphics");
|
||||
return QStringLiteral(CEVO_RESOURCE_DIR);
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
QString getGraphicsDir()
|
||||
{
|
||||
const QString dir = resourceDir();
|
||||
return dir.isEmpty() ? QString() : dir + QStringLiteral("/Graphics");
|
||||
}
|
||||
|
||||
QString getMusicDir()
|
||||
{
|
||||
#ifdef CEVO_RESOURCE_DIR
|
||||
return QStringLiteral(CEVO_RESOURCE_DIR "/Music");
|
||||
#else
|
||||
return QString();
|
||||
#endif
|
||||
const QString dir = resourceDir();
|
||||
return dir.isEmpty() ? QString() : dir + QStringLiteral("/Music");
|
||||
}
|
||||
|
||||
QString localizedFilePath(const QString &path)
|
||||
{
|
||||
#ifdef CEVO_RESOURCE_DIR
|
||||
return QStringLiteral(CEVO_RESOURCE_DIR "/") + path;
|
||||
#else
|
||||
return path;
|
||||
#endif
|
||||
const QString dir = resourceDir();
|
||||
return dir.isEmpty() ? path : dir + QLatin1Char('/') + path;
|
||||
}
|
||||
|
||||
StringTable phrases;
|
||||
StringTable phrases2;
|
||||
bool phrases2FallenBackToEnglish = false;
|
||||
|
||||
void loadPhrases()
|
||||
{
|
||||
phrases2FallenBackToEnglish = false;
|
||||
if (!phrases.loadFromFile(localizedFilePath(QStringLiteral("Language.txt"))))
|
||||
qWarning("Language.txt not found in %s", qPrintable(localizedFilePath(QString())));
|
||||
if (!phrases2.loadFromFile(localizedFilePath(QStringLiteral("Language2.txt"))))
|
||||
qWarning("Language2.txt not found in %s", qPrintable(localizedFilePath(QString())));
|
||||
}
|
||||
|
||||
void loadAssets()
|
||||
{
|
||||
graphicsDir = getGraphicsDir();
|
||||
loadPhrases();
|
||||
loadFonts(localizedFilePath(QStringLiteral("Fonts.txt")));
|
||||
|
||||
Templates = loadGraphicSet(QStringLiteral("Templates") + QLatin1String(PngExt), false);
|
||||
HGrSystem = loadGraphicSet(QStringLiteral("System") + QLatin1String(PngExt));
|
||||
HGrSystem2 = loadGraphicSet(QStringLiteral("System2") + QLatin1String(PngExt));
|
||||
|
||||
static Dpi::Bitmap colorsBitmap;
|
||||
static Dpi::Bitmap bigImpBitmap;
|
||||
static Texture mainTexture;
|
||||
colorsBitmap.loadFromFile(graphicsDir + QStringLiteral("/Colors") + QLatin1String(PngExt));
|
||||
paper.loadFromFile(graphicsDir + QStringLiteral("/Paper") + QLatin1String(JpgExt));
|
||||
bigImpBitmap.loadFromFile(graphicsDir + QStringLiteral("/Icons") + QLatin1String(PngExt));
|
||||
Colors = &colorsBitmap;
|
||||
bigImp = &bigImpBitmap;
|
||||
MainTexture = &mainTexture;
|
||||
}
|
||||
|
||||
QString phraseToQtFormat(const QString &text)
|
||||
{
|
||||
QString converted;
|
||||
int argNumber = 0;
|
||||
for (int i = 0; i < text.length(); ++i) {
|
||||
if (text.at(i) == QLatin1Char('%') && i + 1 < text.length()) {
|
||||
const QChar next = text.at(i + 1);
|
||||
if (next == QLatin1Char('d') || next == QLatin1Char('s')) {
|
||||
converted += QLatin1Char('%') + QString::number(++argNumber);
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
if (next == QLatin1Char('%')) {
|
||||
converted += QLatin1Char('%');
|
||||
++i;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
converted += text.at(i);
|
||||
}
|
||||
return converted;
|
||||
}
|
||||
|
||||
} // namespace Cevo
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Cevo/CevoStringTables.h"
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace Cevo {
|
||||
@@ -70,6 +72,23 @@ QString getMusicDir();
|
||||
// fallback branch the original always takes once no localized file exists.
|
||||
QString localizedFilePath(const QString &path);
|
||||
|
||||
// ScreenTools.pas's `Phrases`/`Phrases2` string tables (Language.txt /
|
||||
// Language2.txt) and `Phrases2FallenBackToEnglish`; filled by loadPhrases().
|
||||
extern StringTable phrases;
|
||||
extern StringTable phrases2;
|
||||
extern bool phrases2FallenBackToEnglish;
|
||||
// ScreenTools.pas's LoadPhrases(): (re)loads the two tables.
|
||||
void loadPhrases();
|
||||
// Converts a Language.txt Pascal Format() string (%d/%s/%%) to QString::arg()
|
||||
// style numbered placeholders (%1, %2, ...) in order of appearance.
|
||||
QString phraseToQtFormat(const QString &text);
|
||||
|
||||
// ScreenTools.pas's UnitInit()/LoadAssets(): points the widget layer at the
|
||||
// graphics directory and loads the phrases, fonts, system graphic sets,
|
||||
// colour palette, paper/icon bitmaps and the main texture. Call once after
|
||||
// the QApplication exists; safe to call again to reload.
|
||||
void loadAssets();
|
||||
|
||||
// Equivalent of a user-settings `GenerateNames` flag (Start.pas - not
|
||||
// ported - whether cities get tribe-script-generated names or plain
|
||||
// "Founder.Index" numeric ones).
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
// prepare()/offscreenPaint()/line() render a plain single-paragraph
|
||||
// placeholder per page instead of the original's full icon-rich,
|
||||
// per-TextFormat layout engine (pkAdvIcon/pkBigIcon/pkTer/pkModel/...),
|
||||
// because that engine's actual CONTENT comes from Help/Help.txt via
|
||||
// StringTables.pas, which isn't ported (StringTable below is a disclosed
|
||||
// stub). waterSign()/paintTerrIcon() (cosmetic pixel effects) are no-ops.
|
||||
// Extend this file (not a new one) if StringTables.pas is ever ported.
|
||||
// because that engine's actual CONTENT comes from Help/Help.txt (loaded
|
||||
// through the real StringTable, but the file isn't shipped in resources/
|
||||
// yet). waterSign()/paintTerrIcon() (cosmetic pixel effects) are no-ops.
|
||||
// Extend this file (not a new one) to port the real layout engine.
|
||||
|
||||
#include "Help.h"
|
||||
#include "ui_Help.h"
|
||||
@@ -401,13 +401,11 @@ void HelpDlg::searchBtnClicked()
|
||||
void HelpDlg::search(const QString &searchString)
|
||||
{
|
||||
searchResult.clear();
|
||||
// Real full-text search needs Help/Help.txt's content via
|
||||
// StringTables.pas (not ported) - the StringTable stub's search()
|
||||
// always returns false, so this never finds anything yet.
|
||||
// The result list isn't built yet (needs the Help.txt layout engine):
|
||||
// the matches are found but not recorded.
|
||||
int handle = -1;
|
||||
int index = -1;
|
||||
while (helpText.search(searchString, handle, index)) {
|
||||
// unreachable with the current StringTable stub
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-28
@@ -30,6 +30,7 @@
|
||||
|
||||
#include "Cevo/CevoBaseWin.h"
|
||||
#include "Cevo/CevoPVScrollBar.h"
|
||||
#include "Cevo/CevoStringTables.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QString>
|
||||
@@ -103,34 +104,6 @@ struct HistItem {
|
||||
QString searchContent;
|
||||
};
|
||||
|
||||
// Minimal stand-in for StringTables.pas's TStringTable (not ported) - a
|
||||
// key->text lookup with handle-based indirection and full-text search.
|
||||
// Since Help/Help.txt's real content isn't available without a
|
||||
// StringTables.pas port, every lookup returns a disclosed placeholder and
|
||||
// search() never matches anything.
|
||||
class StringTable {
|
||||
public:
|
||||
void loadFromFile(const QString &fileName) { Q_UNUSED(fileName); }
|
||||
QString operator[](const QString &key) const { return key; }
|
||||
int getHandle(const QString &key) const
|
||||
{
|
||||
Q_UNUSED(key);
|
||||
return -1;
|
||||
}
|
||||
QString lookupByHandle(int handle) const
|
||||
{
|
||||
Q_UNUSED(handle);
|
||||
return QString();
|
||||
}
|
||||
bool search(const QString &searchString, int &handle, int &index) const
|
||||
{
|
||||
Q_UNUSED(searchString);
|
||||
Q_UNUSED(handle);
|
||||
Q_UNUSED(index);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// THelpDlg equivalent: the in-game encyclopedia/hypertext browser. UI built
|
||||
// from Help.ui (adapted from the original's Help.lfm). The real content
|
||||
// (Help/Help.txt via StringTables.pas) isn't available, so prepare()/
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Term {
|
||||
|
||||
MainScreen::MainScreen(QWidget *parent) : DrawDlg(parent)
|
||||
{
|
||||
mainScreen = this;
|
||||
IsoEngine::init([](int emix) { return initEnemyModel(emix); });
|
||||
|
||||
mainScreenZoomToCity = [this](int loc, bool nextUnitOnClose, int showEvent) {
|
||||
@@ -73,7 +74,11 @@ MainScreen::MainScreen(QWidget *parent) : DrawDlg(parent)
|
||||
};
|
||||
}
|
||||
|
||||
MainScreen::~MainScreen() = default;
|
||||
MainScreen::~MainScreen()
|
||||
{
|
||||
if (mainScreen == this)
|
||||
mainScreen = nullptr;
|
||||
}
|
||||
|
||||
Wonders::WondersDlg &MainScreen::wondersDlg()
|
||||
{
|
||||
@@ -250,14 +255,15 @@ void MainScreen::arrangeDialogs()
|
||||
}
|
||||
|
||||
namespace {
|
||||
// Original: `if G.RO[DipMem[Me].pContact] <> nil then ApplyToVisibleForms
|
||||
// (faClose) else begin if CityDlg.Visible ... end;` - the ApplyToVisibleForms
|
||||
// branch is multiplayer/hotseat-only (closes every dialog so the next
|
||||
// player's turn starts clean) and isn't reachable without the full
|
||||
// GRO[]/hotseat machinery; simplified to always take the single-player
|
||||
// "close CityDlg/UnitStatDlg if open" path, disclosed.
|
||||
// Closes every dialog for the next (hot-seat) player when the contacted
|
||||
// nation is also locally controlled, otherwise just the city/unit dialogs.
|
||||
void closeDialogsForNextPlayer(MainScreen &mainScreen)
|
||||
{
|
||||
const int pContact = dipMem[static_cast<std::size_t>(ClientTools::me)].pContact;
|
||||
if (pContact >= 0 && ClientTools::g.RO[pContact] != nullptr) {
|
||||
applyToVisibleForms(FormAction::Close);
|
||||
return;
|
||||
}
|
||||
if (mainScreen.cityDlg().isVisible())
|
||||
mainScreen.cityDlg().close();
|
||||
if (mainScreen.unitStatDlg().isVisible())
|
||||
@@ -535,6 +541,19 @@ void MainScreen::showEnemyShipChange(const TShowShipChange &change)
|
||||
dlg.showModal();
|
||||
}
|
||||
|
||||
void MainScreen::initModule()
|
||||
{
|
||||
initAdvIcons();
|
||||
unusedTribeFiles.clear();
|
||||
Tribes::hGrStdUnits = loadGraphicSet(QStringLiteral("StdUnits") + QLatin1String(PngExt));
|
||||
initSmallImp();
|
||||
}
|
||||
|
||||
void MainScreen::doneModule()
|
||||
{
|
||||
unusedTribeFiles.clear();
|
||||
}
|
||||
|
||||
void MainScreen::rememberPeaceViolation()
|
||||
{
|
||||
myData->peaceEvaHappened = 0;
|
||||
|
||||
@@ -113,6 +113,10 @@ public:
|
||||
// Picks (at random among the best) the unused tribe whose colour differs most from the tribes in play.
|
||||
int chooseUnusedTribe();
|
||||
void showEnemyShipChange(const TShowShipChange &showShipChange);
|
||||
// Term.pas's InitModule()/DoneModule(): one-time asset/table setup
|
||||
// (advance icons, StdUnits graphics, smallImp).
|
||||
void initModule();
|
||||
void doneModule();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Wonders::WondersDlg> m_wondersDlg;
|
||||
|
||||
+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)
|
||||
|
||||
@@ -234,8 +234,7 @@ constexpr int chTypeDel = 0x8000;
|
||||
constexpr int nCityEventPriority = 16;
|
||||
extern const std::array<int, nCityEventPriority> CityEventPriority;
|
||||
extern const std::array<QString, 16> CityEventSoundItem;
|
||||
// TODO: needs Phrases/Phrases2 (StringTables.pas not ported) - falls back
|
||||
// to a plain English description per event index.
|
||||
// Term.pas's CityEventName(): the description of city event index i.
|
||||
QString cityEventName(int i);
|
||||
|
||||
// Term.pas's HelpOnTerrain(): opens the help dialog on the terrain-info
|
||||
@@ -316,6 +315,9 @@ bool createTribe(int p, QString fileName, bool original);
|
||||
void tellNewContacts();
|
||||
void tellNewModels();
|
||||
|
||||
// Term.pas's InitModule() `AdvIcon` table setup (the icon displayed with each advance).
|
||||
void initAdvIcons();
|
||||
|
||||
// Term.pas's `UnusedTribeFiles` (name + colour of every tribe file not yet in play).
|
||||
struct UnusedTribe {
|
||||
QString fileName;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QHash>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <limits>
|
||||
@@ -358,50 +357,7 @@ QString Tribe::tString(QString templateText) const
|
||||
|
||||
QString Tribe::tPhrase(const QString &item) const
|
||||
{
|
||||
// Phrases/Phrases2 (StringTables.pas) aren't ported; these are
|
||||
// disclosed plain-English placeholders for the keys looked up via
|
||||
// Tribe::TPhrase() across this file and Diplomacy.pas, run through
|
||||
// TString() for the tribe's own #x name-template substitution.
|
||||
static const QHash<QString, QString> table = {
|
||||
{QStringLiteral("GENCITY"), QStringLiteral("City %1")},
|
||||
{QStringLiteral("SHORTNAME"), QStringLiteral("#A")},
|
||||
{QStringLiteral("PRICE_CIVIL"), QStringLiteral("our civil report")},
|
||||
{QStringLiteral("PRICE_MIL"), QStringLiteral("our military report")},
|
||||
{QStringLiteral("PRICE_MAP"), QStringLiteral("our map")},
|
||||
{QStringLiteral("PRICE_ALLTECH"), QStringLiteral("all our advances")},
|
||||
{QStringLiteral("PRICE_ALLMODEL"), QStringLiteral("all our unit designs")},
|
||||
{QStringLiteral("FRACCEPTTREATY"), QStringLiteral("We accept your treaty proposal.")},
|
||||
{QStringLiteral("FRACCEPTDEMAND_STRONG"), QStringLiteral("As you wish.")},
|
||||
{QStringLiteral("FRACCEPTPRESENT"), QStringLiteral("We gladly accept your gift.")},
|
||||
{QStringLiteral("FRACCEPTOFFER"), QStringLiteral("We accept your offer.")},
|
||||
{QStringLiteral("FRBREAK"), QStringLiteral("We break off negotiations.")},
|
||||
{QStringLiteral("FRNOTACCEPTTREATY"), QStringLiteral("We do not accept this treaty.")},
|
||||
{QStringLiteral("FRNOTACCEPTDEMAND_STRONG"), QStringLiteral("We refuse your demand.")},
|
||||
{QStringLiteral("FRNOTACCEPTPRESENT"), QStringLiteral("We decline your gift.")},
|
||||
{QStringLiteral("FRBYE"), QStringLiteral("Farewell.")},
|
||||
{QStringLiteral("FRNOTACCEPTOFFER"), QStringLiteral("We do not accept this offer.")},
|
||||
{QStringLiteral("FRNEWNATION"), QStringLiteral("We have contact to #n now.")},
|
||||
{QStringLiteral("SHIPBUILT"), QStringLiteral("#N have completed a part of their transstellar colony ship.")},
|
||||
{QStringLiteral("SHIPBITRADE1"), QStringLiteral("#S and")},
|
||||
{QStringLiteral("SHIPBITRADE2"), QStringLiteral("#s are exchanging colony ship parts.")},
|
||||
{QStringLiteral("SHIPUNITRADE1"), QStringLiteral("#N receive")},
|
||||
{QStringLiteral("SHIPUNITRADE2"), QStringLiteral("colony ship parts from #s.")},
|
||||
{QStringLiteral("SHIPCAPTURE1"), QStringLiteral("#N take control of the")},
|
||||
{QStringLiteral("SHIPCAPTURE2"), QStringLiteral("#a colony ship!")},
|
||||
{QStringLiteral("SHIPDESTROYED"), QStringLiteral("#N lost control of their colony ship.")},
|
||||
{QStringLiteral("FRPEACE"), QStringLiteral("we propose a peace treaty")},
|
||||
{QStringLiteral("FRFRIENDLY"), QStringLiteral("we propose friendly relations")},
|
||||
{QStringLiteral("FRALLIANCE"), QStringLiteral("we propose an alliance")},
|
||||
{QStringLiteral("FRDEMAND_STRONG"), QStringLiteral("we demand %1")},
|
||||
{QStringLiteral("FRPRESENT"), QStringLiteral("we offer you %1 as a gift")},
|
||||
{QStringLiteral("FRSTART_NOTREATY"), QStringLiteral("Greetings.")},
|
||||
{QStringLiteral("FRSTART_PEACE"), QStringLiteral("Greetings, friend.")},
|
||||
{QStringLiteral("WONDEROWNER"), QStringLiteral("built by the #A")},
|
||||
{QStringLiteral("GENMODEL"), QStringLiteral("Model #%1")},
|
||||
{QStringLiteral("OWNED"), QStringLiteral("%1 (owned)")},
|
||||
};
|
||||
const auto it = table.constFind(item);
|
||||
return tString(it != table.constEnd() ? it.value() : item);
|
||||
return tString(phraseToQtFormat(phrases.lookup(item)));
|
||||
}
|
||||
|
||||
void Tribe::initAge(int age)
|
||||
|
||||
@@ -104,9 +104,8 @@ public:
|
||||
QString getCityName(int i) const;
|
||||
void setCityName(int i, const QString &newName);
|
||||
QString tString(QString templateText) const;
|
||||
// Phrases/Phrases2 (StringTables.pas) aren't ported; falls back to a
|
||||
// plain-English template for the one phrase this file needs (city-name
|
||||
// generation past the end of a tribe's scripted name list).
|
||||
// TString(Phrases[item]) with the %d/%s placeholders turned into
|
||||
// QString::arg() style %1, %2, ...
|
||||
QString tPhrase(const QString &item) const;
|
||||
void setModelPicture(const ModelPictureInfo &info, bool isNew);
|
||||
bool chooseModelPicture(ModelPictureInfo &picture, int code, int turn, bool forceNew);
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
// This file is part of c-evo-evo.
|
||||
//
|
||||
// This software is governed by the CeCILL license under French law and
|
||||
// abiding by the rules of distribution of free software. You can use,
|
||||
// modify and/or redistribute the software under the terms of the CeCILL
|
||||
// license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
// "http://www.cecill.info".
|
||||
//
|
||||
// As a counterpart to the access to the source code and rights to copy,
|
||||
// modify and redistribute granted by the license, users are provided only
|
||||
// with a limited warranty and the software's author, the holder of the
|
||||
// economic rights, and the successive licensors have only limited
|
||||
// liability.
|
||||
//
|
||||
// In this respect, the user's attention is drawn to the risks associated
|
||||
// with loading, using, modifying and/or developing or reproducing the
|
||||
// software by the user in light of its specific status of free software,
|
||||
// that may mean that it is complicated to manipulate, and that also
|
||||
// therefore means that it is reserved for developers and experienced
|
||||
// professionals having in-depth computer knowledge. Users are therefore
|
||||
// encouraged to load and test the software's suitability as regards their
|
||||
// requirements in conditions enabling the security of their systems and/or
|
||||
// data to be ensured and, more generally, to use and operate it in the
|
||||
// same conditions as regards security.
|
||||
//
|
||||
// The fact that you are presently reading this means that you have had
|
||||
// knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
#include "mainwindow.h"
|
||||
#include "./ui_mainwindow.h"
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
// This file is part of c-evo-evo.
|
||||
//
|
||||
// This software is governed by the CeCILL license under French law and
|
||||
// abiding by the rules of distribution of free software. You can use,
|
||||
// modify and/or redistribute the software under the terms of the CeCILL
|
||||
// license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
// "http://www.cecill.info".
|
||||
//
|
||||
// As a counterpart to the access to the source code and rights to copy,
|
||||
// modify and redistribute granted by the license, users are provided only
|
||||
// with a limited warranty and the software's author, the holder of the
|
||||
// economic rights, and the successive licensors have only limited
|
||||
// liability.
|
||||
//
|
||||
// In this respect, the user's attention is drawn to the risks associated
|
||||
// with loading, using, modifying and/or developing or reproducing the
|
||||
// software by the user in light of its specific status of free software,
|
||||
// that may mean that it is complicated to manipulate, and that also
|
||||
// therefore means that it is reserved for developers and experienced
|
||||
// professionals having in-depth computer knowledge. Users are therefore
|
||||
// encouraged to load and test the software's suitability as regards their
|
||||
// requirements in conditions enabling the security of their systems and/or
|
||||
// data to be ensured and, more generally, to use and operate it in the
|
||||
// same conditions as regards security.
|
||||
//
|
||||
// The fact that you are presently reading this means that you have had
|
||||
// knowledge of the CeCILL license and that you accept its terms.
|
||||
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class MainWindow;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MainWindow(QWidget *parent = nullptr);
|
||||
~MainWindow();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
Vendored
-60
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This file is part of c-evo-evo.
|
||||
|
||||
This software is governed by the CeCILL license under French law and
|
||||
abiding by the rules of distribution of free software. You can use,
|
||||
modify and/or redistribute the software under the terms of the CeCILL
|
||||
license as circulated by CEA, CNRS and INRIA at the following URL
|
||||
"http://www.cecill.info".
|
||||
|
||||
As a counterpart to the access to the source code and rights to copy,
|
||||
modify and redistribute granted by the license, users are provided only
|
||||
with a limited warranty and the software's author, the holder of the
|
||||
economic rights, and the successive licensors have only limited
|
||||
liability.
|
||||
|
||||
In this respect, the user's attention is drawn to the risks associated
|
||||
with loading, using, modifying and/or developing or reproducing the
|
||||
software by the user in light of its specific status of free software,
|
||||
that may mean that it is complicated to manipulate, and that also
|
||||
therefore means that it is reserved for developers and experienced
|
||||
professionals having in-depth computer knowledge. Users are therefore
|
||||
encouraged to load and test the software's suitability as regards their
|
||||
requirements in conditions enabling the security of their systems and/or
|
||||
data to be ensured and, more generally, to use and operate it in the
|
||||
same conditions as regards security.
|
||||
|
||||
The fact that you are presently reading this means that you have had
|
||||
knowledge of the CeCILL license and that you accept its terms.
|
||||
-->
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget"/>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
Reference in new issue
Block a user