many sparse changes

This commit is contained in:
Geoffray Levasseur committed 2026-11-03 18:33:45 +01:00
1 parent 2c26c6f795
commit 7aa4ea4425
23 files changed
+1317 -290

No files matched your search

+26 -7
View File
@@ -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;