make map size customizable in star dialog

This commit is contained in:
Geoffray Levasseur committed 2026-11-09 12:18:42 +01:00
1 parent 8606bf8bcc
commit a564d06798
3 files changed
+17 -5

No files matched your search

+10
View File
@@ -245,6 +245,16 @@ void StartDlg::offscreenPaint()
} }
} else if (m_page == Page::StartRandom || m_page == Page::StartMap) { } else if (m_page == Page::StartRandom || m_page == Page::StartMap) {
underlinedTitleValue(canvas, startControl(10), Term::turnToString(m_maxTurn), 344, y0Mini + 61, 170); 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); QString s = startControl(7);
loweredTextOut(canvas, -2, *MainTexture, x0Brain + 32 - canvas.textWidth(s) / 2, y0Brain + dyBrain + 69, s); loweredTextOut(canvas, -2, *MainTexture, x0Brain + 32 - canvas.textWidth(s) / 2, y0Brain + dyBrain + 69, s);
+5 -2
View File
@@ -148,8 +148,11 @@ StartDlg::StartDlg(DirectDlg *direct, Background *background)
// Page visibility tags (Tag and (256 shl Page) <> 0). // Page visibility tags (Tag and (256 shl Page) <> 0).
setTag(ui->startBtn, 15104); setTag(ui->startBtn, 15104);
setTag(ui->down1Btn, 4096); // c-evo-evo extension: world size is also adjustable directly from the
setTag(ui->up1Btn, 4096); // "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->renameBtn, 10240);
setTag(ui->deleteBtn, 10240); setTag(ui->deleteBtn, 10240);
setTag(ui->down2Btn, 6912); setTag(ui->down2Btn, 6912);
+2 -3
View File
@@ -354,10 +354,9 @@ void EnhanceDlg::keyPressEvent(QKeyEvent *event)
{ {
const QKeySequence pressed(event->key() | event->modifiers()); const QKeySequence pressed(event->key() | event->modifiers());
if (KeyBindings::bHelp && pressed.matches(KeyBindings::bHelp->shortCut) == QKeySequence::ExactMatch) { 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()) 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 } else
FramedDlg::keyPressEvent(event); FramedDlg::keyPressEvent(event);
} }