mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Remove minifig accessories that are not set in a template. Fixes #483.
This commit is contained in:
parent
b70a407f58
commit
6f7dc6f1bb
1 changed files with 14 additions and 7 deletions
|
@ -138,19 +138,26 @@ void lcQMinifigDialog::on_TemplateComboBox_currentIndexChanged(const QString& Te
|
|||
|
||||
for (int PartIdx = 0; PartIdx < LC_MFW_NUMITEMS; PartIdx++)
|
||||
{
|
||||
PieceInfo* Info = lcGetPiecesLibrary()->FindPiece(Template.Parts[PartIdx].toLatin1(), nullptr, false, false);
|
||||
|
||||
if (Info)
|
||||
if (!Template.Parts[PartIdx].isEmpty())
|
||||
{
|
||||
for (const lcMinifigPieceInfo& MinifigPieceInfo : mMinifigWidget->mSettings[PartIdx])
|
||||
PieceInfo* Info = lcGetPiecesLibrary()->FindPiece(Template.Parts[PartIdx].toLatin1(), nullptr, false, false);
|
||||
|
||||
if (Info)
|
||||
{
|
||||
if (Info == MinifigPieceInfo.Info)
|
||||
for (const lcMinifigPieceInfo& MinifigPieceInfo : mMinifigWidget->mSettings[PartIdx])
|
||||
{
|
||||
getTypeComboBox(PartIdx)->setCurrentText(MinifigPieceInfo.Description);
|
||||
break;
|
||||
if (Info == MinifigPieceInfo.Info)
|
||||
{
|
||||
getTypeComboBox(PartIdx)->setCurrentText(MinifigPieceInfo.Description);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getTypeComboBox(PartIdx)->setCurrentText("None");
|
||||
}
|
||||
|
||||
getColorPicker(PartIdx)->setCurrentColorCode(Template.Colors[PartIdx]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue