mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-13 05:20:00 -08:00
Use chart-only Essence palettes and canonical Essence ordering
This commit is contained in:
parent
537002a1ee
commit
d04736d81a
1 changed files with 4 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "mana_base_widget.h"
|
||||
|
||||
#include "../../../../essence_chart_colors.h"
|
||||
#include "../../../general/display/charts/bars/bar_widget.h"
|
||||
#include "../../../general/display/charts/bars/color_bar.h"
|
||||
#include "../../../general/display/charts/pies/color_pie.h"
|
||||
|
|
@ -30,7 +31,7 @@ namespace
|
|||
{
|
||||
|
||||
AnalyticsPanelWidgetRegistrar registerManaBase{
|
||||
"manaBase", ManaBaseWidget::tr("Mana Base"),
|
||||
"manaBase", ManaBaseWidget::tr("Essence Production"),
|
||||
[](QWidget *parent, DeckListStatisticsAnalyzer *analyzer) { return new ManaBaseWidget(parent, analyzer); }};
|
||||
|
||||
} // anonymous namespace
|
||||
|
|
@ -83,16 +84,12 @@ void ManaBaseWidget::updateDisplay()
|
|||
|
||||
// Choose display mode
|
||||
if (config.displayType == "bar") {
|
||||
const QList<QPair<QString, int>> sortedColors = GameSpecificColors::MTG::sortManaMapWUBRGCFirst(mapSorted);
|
||||
static const QHash<QString, QColor> colorMap = {
|
||||
{"W", QColor(248, 231, 185)}, {"U", QColor(14, 104, 171)}, {"B", QColor(21, 11, 0)},
|
||||
{"R", QColor(211, 32, 42)}, {"G", QColor(0, 115, 62)}, {"C", QColor(150, 150, 150)},
|
||||
};
|
||||
const QList<QPair<QString, int>> sortedColors = EssenceCharts::ordered(mapSorted);
|
||||
|
||||
for (const auto &[color, count] : sortedColors) {
|
||||
QString label = QString("%1 %2 (%3)").arg(color).arg(count).arg(cardCount.value(color));
|
||||
|
||||
BarWidget *bar = new BarWidget(label, count, highest, colorMap.value(color, Qt::gray), this);
|
||||
BarWidget *bar = new BarWidget(label, count, highest, EssenceCharts::colorFor(color), this);
|
||||
|
||||
barLayout->addWidget(bar);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue