mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
Address overloads, fix default configuration.
Took 1 hour 9 minutes Took 8 seconds
This commit is contained in:
parent
42e289b57d
commit
56732609ba
2 changed files with 11 additions and 3 deletions
|
|
@ -68,12 +68,12 @@ DrawProbabilityWidget::DrawProbabilityWidget(QWidget *parent, DeckListStatistics
|
|||
layout->addWidget(resultTable);
|
||||
|
||||
// Connections
|
||||
connect(criteriaCombo, &QComboBox::currentIndexChanged, this, [this] {
|
||||
connect(criteriaCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this] {
|
||||
config.criteria = criteriaCombo->currentData().toString();
|
||||
updateDisplay();
|
||||
});
|
||||
|
||||
connect(exactnessCombo, &QComboBox::currentIndexChanged, this, [this] {
|
||||
connect(exactnessCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this] {
|
||||
config.atLeast = exactnessCombo->currentData().toBool();
|
||||
updateDisplay();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
#include "abstract_analytics_panel_widget.h"
|
||||
#include "add_analytics_panel_dialog.h"
|
||||
#include "analytics_panel_widget_factory.h"
|
||||
#include "analyzer_modules/mana_base/mana_base_config.h"
|
||||
#include "analyzer_modules/mana_devotion/mana_devotion_config.h"
|
||||
#include "deck_list_statistics_analyzer.h"
|
||||
#include "resizable_panel.h"
|
||||
|
||||
|
|
@ -159,7 +161,13 @@ void DeckAnalyticsWidget::addDefaultPanels()
|
|||
QString type;
|
||||
QJsonObject cfg;
|
||||
};
|
||||
QVector<DefaultPanel> defaults = {{"manaCurve", {}}, {"manaBase", {}}, {"manaDevotion", {}}};
|
||||
|
||||
// Prepare configs
|
||||
QJsonObject manaCurveCfg; // empty config
|
||||
QJsonObject manaBaseCfg = ManaBaseConfig("combinedBar", {}).toJson();
|
||||
QJsonObject manaDevotionCfg = ManaDevotionConfig("combinedBar", {}).toJson();
|
||||
QVector<DefaultPanel> defaults = {
|
||||
{"manaCurve", manaCurveCfg}, {"manaBase", manaBaseCfg}, {"manaDevotion", manaDevotionCfg}};
|
||||
|
||||
for (auto &d : defaults) {
|
||||
AbstractAnalyticsPanelWidget *w = AnalyticsPanelWidgetFactory::instance().create(d.type, this, statsAnalyzer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue