Disable stud logo options from preferences when unofficial parts are missing.

This commit is contained in:
Leonardo Zide 2020-12-12 15:21:30 -08:00
parent 847cbfeb87
commit ea99066465
3 changed files with 14 additions and 1 deletions

View file

@ -1537,6 +1537,11 @@ void lcPiecesLibrary::UploadTextures(lcContext* Context)
mTextureUploads.clear();
}
bool lcPiecesLibrary::SupportsStudLogo() const
{
return mZipFiles[LC_ZIPFILE_UNOFFICIAL] || mHasUnofficial;
}
void lcPiecesLibrary::SetStudLogo(int StudLogo, bool Reload)
{
mStudLogo = StudLogo;

View file

@ -127,6 +127,7 @@ public:
bool LoadPrimitive(lcLibraryPrimitive* Primitive);
bool SupportsStudLogo() const;
void SetStudLogo(int StudLogo, bool Reload);
int GetStudLogo() const

View file

@ -182,6 +182,12 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
else
ui->PreviewViewSphereSizeCombo->setCurrentIndex(0);
if (!lcGetPiecesLibrary()->SupportsStudLogo())
{
ui->studLogo->setEnabled(false);
ui->studLogoCombo->setEnabled(false);
}
ui->studLogo->setChecked(mOptions->StudLogo);
if (ui->studLogo->isChecked())
ui->studLogoCombo->setCurrentIndex(mOptions->StudLogo - 1);
@ -556,7 +562,8 @@ void lcQPreferencesDialog::ColorButtonClicked()
void lcQPreferencesDialog::on_studLogo_toggled()
{
ui->studLogoCombo->setEnabled(ui->studLogo->isChecked());
if (lcGetPiecesLibrary()->SupportsStudLogo())
ui->studLogoCombo->setEnabled(ui->studLogo->isChecked());
}
void lcQPreferencesDialog::on_antiAliasing_toggled()