From a564d06798fec8a5eea2b0451eb81e6126f0e10d Mon Sep 17 00:00:00 2001 From: Geoffray Levasseur Date: Mon, 9 Nov 2026 12:18:42 +0100 Subject: [PATCH] make map size customizable in star dialog --- game/Start.Paint.cpp | 10 ++++++++++ game/Start.cpp | 7 +++++-- game/localplayer/Enhance.cpp | 5 ++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/game/Start.Paint.cpp b/game/Start.Paint.cpp index 03cc443..01dd4b3 100644 --- a/game/Start.Paint.cpp +++ b/game/Start.Paint.cpp @@ -245,6 +245,16 @@ void StartDlg::offscreenPaint() } } else if (m_page == Page::StartRandom || m_page == Page::StartMap) { underlinedTitleValue(canvas, startControl(10), Term::turnToString(m_maxTurn), 344, y0Mini + 61, 170); + if (m_page == Page::StartRandom) { + // c-evo-evo extension: world size is adjustable here too, not + // just in the map editor (see Start.cpp's Up1Btn/Down1Btn tags). + const QPoint world = WorldSizes[m_worldSize]; + underlinedTitleValue( + canvas, startControl(5), + QString::number((world.x() * world.y() * 20 + DefaultWorldTiles / 2) / DefaultWorldTiles * 5) + + QLatin1Char('%'), + 344, y0Mini - 77, 170); + } QString s = startControl(7); loweredTextOut(canvas, -2, *MainTexture, x0Brain + 32 - canvas.textWidth(s) / 2, y0Brain + dyBrain + 69, s); diff --git a/game/Start.cpp b/game/Start.cpp index 1b91a5c..944defe 100644 --- a/game/Start.cpp +++ b/game/Start.cpp @@ -148,8 +148,11 @@ StartDlg::StartDlg(DirectDlg *direct, Background *background) // Page visibility tags (Tag and (256 shl Page) <> 0). setTag(ui->startBtn, 15104); - setTag(ui->down1Btn, 4096); - setTag(ui->up1Btn, 4096); + // c-evo-evo extension: world size is also adjustable directly from the + // "Start new game" quick-start page, not just the map editor (+256 for + // Page::StartRandom, on top of the original's Page::EditRandom bit). + setTag(ui->down1Btn, 4352); + setTag(ui->up1Btn, 4352); setTag(ui->renameBtn, 10240); setTag(ui->deleteBtn, 10240); setTag(ui->down2Btn, 6912); diff --git a/game/localplayer/Enhance.cpp b/game/localplayer/Enhance.cpp index a1b87be..8ee8caf 100644 --- a/game/localplayer/Enhance.cpp +++ b/game/localplayer/Enhance.cpp @@ -354,10 +354,9 @@ void EnhanceDlg::keyPressEvent(QKeyEvent *event) { const QKeySequence pressed(event->key() | event->modifiers()); if (KeyBindings::bHelp && pressed.matches(KeyBindings::bHelp->shortCut) == QKeySequence::ExactMatch) { - // TODO: needs a live HelpDlg instance's textIndex() (Term.pas's - // MainScreen.HelpDlg isn't ported yet) - placeholder text index. if (auto *dlg = Term::mainScreenHelpDlg()) - dlg->showNewContent(windowModeMakePersistent(windowMode()), Help::LinkCategory::Text, 0); + dlg->showNewContent(windowModeMakePersistent(windowMode()), Help::LinkCategory::Text, + dlg->textIndex(QStringLiteral("MACRO"))); } else FramedDlg::keyPressEvent(event); }