added draft and natstat with their requirements
This commit is contained in:
1 parent
6513c6f8ec
commit
1667e18dda
10 files changed
+1542
No files matched your search
@@ -28,11 +28,40 @@
|
||||
|
||||
#include "Term.h"
|
||||
|
||||
#include "Global.h"
|
||||
#include "Tribes.h"
|
||||
|
||||
namespace Cevo {
|
||||
namespace Term {
|
||||
|
||||
PersistentData *myData = nullptr;
|
||||
Dpi::Bitmap *smallImp = nullptr;
|
||||
ClientTools::SaveOptions optionChecked = 0;
|
||||
bool supervising = false;
|
||||
std::array<DipMemEntry, nPl> dipMem{};
|
||||
std::function<int(int)> mainScreenDipCall = [](int) { return eInvalid; };
|
||||
std::function<bool(int, const QString &)> mainScreenContactRefused = [](int, const QString &) { return false; };
|
||||
|
||||
int roughCredibility(int credibility)
|
||||
{
|
||||
if (credibility <= 69)
|
||||
return 0;
|
||||
if (credibility <= 89)
|
||||
return 1;
|
||||
if (credibility <= 99)
|
||||
return 2;
|
||||
return 3;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void impImage(Dpi::Canvas &canvas, int x, int y, int iix, int government, bool isControl)
|
||||
{
|
||||
@@ -46,5 +75,29 @@ void impImage(Dpi::Canvas &canvas, int x, int y, int iix, int government, bool i
|
||||
(iix + SystemIconLines * 7) / 7 * ySizeBig, isControl);
|
||||
}
|
||||
|
||||
void chooseModelPicture(int p, int mix, int code, int hash, int turn, bool forceNew, bool final)
|
||||
{
|
||||
Tribes::ModelPictureInfo picture;
|
||||
picture.trix = p;
|
||||
picture.mix = mix;
|
||||
picture.hash = hash;
|
||||
const bool isNew = Tribes::tribe[static_cast<std::size_t>(p)]->chooseModelPicture(picture, code, turn, forceNew);
|
||||
if (final) {
|
||||
Tribes::tribe[static_cast<std::size_t>(p)]->setModelPicture(picture, isNew);
|
||||
} else {
|
||||
Tribes::ModelPicture &mp = Tribes::tribe[static_cast<std::size_t>(p)]->modelPictureAt(mix);
|
||||
mp.hGr = loadGraphicSet(picture.grName);
|
||||
mp.pix = picture.pix;
|
||||
}
|
||||
}
|
||||
|
||||
void initMyModel(int mix, bool final)
|
||||
{
|
||||
TModelInfo mi{};
|
||||
MakeModelInfo(ClientTools::me, mix, ClientTools::myModel[mix], mi);
|
||||
chooseModelPicture(ClientTools::me, mix, Tribes::modelCode(mi), ClientTools::modelHash(mi),
|
||||
ClientTools::myRO->Turn, false, final);
|
||||
}
|
||||
|
||||
} // namespace Term
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user