From 4702e6bb96ed5f943039956224b8a5e28d862c75 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 21 Aug 2025 14:32:29 -0400 Subject: Fix bug with Macondo simulate --- quacker/macondo.cpp | 11 +++++++++++ quacker/macondo.h | 1 + quacker/quacker.cpp | 5 ++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/quacker/macondo.cpp b/quacker/macondo.cpp index 831e94d..3b301c4 100644 --- a/quacker/macondo.cpp +++ b/quacker/macondo.cpp @@ -15,9 +15,13 @@ TODO: #include #include #include +#include +#include Macondo::Macondo(Quackle::Game *game) : View() { m_game = game; + QFont boldFont; + boldFont.setWeight(QFont::Bold); m_useMacondo = new QCheckBox(tr("Use Macondo for 'Simulate'")); const char *home = getenv("HOME"); std::string execPath = home ? home : "/"; @@ -27,10 +31,17 @@ Macondo::Macondo(Quackle::Game *game) : View() { connectBackendSignals(); m_solve = new QPushButton(tr("Solve")); m_solve->setDisabled(true); + QGroupBox *pegBox = new QGroupBox(tr("Pre-endgame options")); + QVBoxLayout *pegLayout = new QVBoxLayout; + m_generatedMovesOnly = new QCheckBox(tr("Generated moves only")); + m_generatedMovesOnly->setToolTip("Only analyze the moves that have been generated in the 'Choices' box."); + pegLayout->addWidget(m_generatedMovesOnly); QGridLayout *layout = new QGridLayout(this); + pegBox->setLayout(pegLayout); layout->setAlignment(Qt::AlignTop); layout->addWidget(m_useMacondo, 0, 0); layout->addWidget(m_solve, 1, 0); + layout->addWidget(pegBox, 2, 0); connect(m_solve, SIGNAL(clicked()), this, SLOT(solve())); } diff --git a/quacker/macondo.h b/quacker/macondo.h index 27d3fb7..a8916c9 100644 --- a/quacker/macondo.h +++ b/quacker/macondo.h @@ -43,6 +43,7 @@ private: void connectBackendSignals(); void updateSolveButton(); QCheckBox *m_useMacondo; + QCheckBox *m_generatedMovesOnly; QPushButton *m_solve; Quackle::Game *m_game; MacondoBackend *m_backend; diff --git a/quacker/quacker.cpp b/quacker/quacker.cpp index cf1b4c7..c15b826 100644 --- a/quacker/quacker.cpp +++ b/quacker/quacker.cpp @@ -1063,11 +1063,10 @@ void TopLevel::simulate(bool startSimulation) // it's not so useful to have sim control show/hide // like this //m_simulatorWidget->setVisible(startSimulation); - if (m_macondo->useForSimulation()) { - m_macondo->simulate(); - } if (startSimulation) { + if (m_macondo->useForSimulation()) + m_macondo->simulate(); logfileChanged(); incrementSimulation(); } -- cgit v1.2.3