show implicitly unlocked items in schematic unlock dialog
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QStringList>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
SchematicChoiceDialog::SchematicChoiceDialog(
|
||||
@@ -74,6 +75,31 @@ SchematicChoiceDialog::SchematicChoiceDialog(
|
||||
statusLabel->setAlignment(Qt::AlignCenter);
|
||||
cardLayout->addWidget(statusLabel);
|
||||
|
||||
QLabel* unlocksHeaderLabel = new QLabel(tr("Unlocks recipes for:"), card);
|
||||
QFont unlocksHeaderFont = unlocksHeaderLabel->font();
|
||||
unlocksHeaderFont.setBold(true);
|
||||
unlocksHeaderLabel->setFont(unlocksHeaderFont);
|
||||
unlocksHeaderLabel->setAlignment(Qt::AlignCenter);
|
||||
cardLayout->addWidget(unlocksHeaderLabel);
|
||||
|
||||
QString unlocksText;
|
||||
if (option.newlyUnlockedItemNames.empty())
|
||||
{
|
||||
unlocksText = tr("None");
|
||||
}
|
||||
else
|
||||
{
|
||||
QStringList itemLines;
|
||||
for (const std::string& itemName : option.newlyUnlockedItemNames)
|
||||
{
|
||||
itemLines << QString::fromStdString(itemName);
|
||||
}
|
||||
unlocksText = itemLines.join("\n");
|
||||
}
|
||||
QLabel* unlocksLabel = new QLabel(unlocksText, card);
|
||||
unlocksLabel->setAlignment(Qt::AlignCenter);
|
||||
cardLayout->addWidget(unlocksLabel);
|
||||
|
||||
QPushButton* selectButton = new QPushButton(tr("Select"), card);
|
||||
cardLayout->addWidget(selectButton);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user