mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-08 21:17:53 +00:00
CModelEditorWindow: Convert old signal/slot to modern style
Turns out this was attached incorrectly.
This commit is contained in:
@@ -118,7 +118,7 @@ CModelEditorWindow::CModelEditorWindow(CModel *pModel, QWidget *pParent)
|
|||||||
connect(ui->TevKAlphaSelComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
connect(ui->TevKAlphaSelComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
||||||
connect(ui->TevRasSelComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
connect(ui->TevRasSelComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
||||||
connect(ui->TexCoordSrcComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
connect(ui->TexCoordSrcComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
||||||
connect(ui->PassTextureResSelector, SIGNAL(ResourceChanged(QString)), this, SLOT(UpdateMaterial(QString)));
|
connect(ui->PassTextureResSelector, &CResourceSelector::ResourceChanged, this, qOverload<const CResourceEntry*>(&CModelEditorWindow::UpdateMaterial));
|
||||||
connect(ui->TevColor1ComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
connect(ui->TevColor1ComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
||||||
connect(ui->TevColor2ComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
connect(ui->TevColor2ComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
||||||
connect(ui->TevColor3ComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
connect(ui->TevColor3ComboBox, &QComboBox::currentIndexChanged, this, qOverload<int>(&CModelEditorWindow::UpdateMaterial));
|
||||||
@@ -568,17 +568,23 @@ void CModelEditorWindow::UpdateMaterial(const QColor& Color)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CModelEditorWindow::UpdateMaterial(const QString& Value)
|
void CModelEditorWindow::UpdateMaterial(const CResourceEntry* Entry)
|
||||||
{
|
{
|
||||||
// This function takes input from WResourceSelectors
|
// This function takes input from WResourceSelectors
|
||||||
if (!mpCurrentMat) return;
|
if (!mpCurrentMat)
|
||||||
if (mIgnoreSignals) return;
|
return;
|
||||||
|
if (mIgnoreSignals)
|
||||||
|
return;
|
||||||
|
|
||||||
EModelEditorWidget Widget = (EModelEditorWidget) sender()->property("ModelEditorWidgetType").toInt();
|
TResPtr<CTexture> pTex;
|
||||||
TResPtr<CTexture> pTex = gpResourceStore->LoadResource(TO_TSTRING(Value));
|
if (Entry)
|
||||||
if (pTex->Type() != EResourceType::Texture) pTex = nullptr;
|
{
|
||||||
|
pTex = gpResourceStore->LoadResource(Entry->ID());
|
||||||
|
if (pTex->Type() != EResourceType::Texture)
|
||||||
|
pTex = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
switch (Widget)
|
switch (static_cast<EModelEditorWidget>(sender()->property("ModelEditorWidgetType").toInt()))
|
||||||
{
|
{
|
||||||
case EModelEditorWidget::PassTextureResSelector:
|
case EModelEditorWidget::PassTextureResSelector:
|
||||||
mpCurrentPass->SetTexture(pTex);
|
mpCurrentPass->SetTexture(pTex);
|
||||||
@@ -587,7 +593,9 @@ void CModelEditorWindow::UpdateMaterial(const QString& Value)
|
|||||||
case EModelEditorWidget::IndTextureResSelector:
|
case EModelEditorWidget::IndTextureResSelector:
|
||||||
mpCurrentMat->SetIndTexture(pTex);
|
mpCurrentMat->SetIndTexture(pTex);
|
||||||
break;
|
break;
|
||||||
default: break;
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void CModelEditorWindow::UpdateUI(int Value)
|
void CModelEditorWindow::UpdateUI(int Value)
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public slots:
|
|||||||
void UpdateMaterial(double Value);
|
void UpdateMaterial(double Value);
|
||||||
void UpdateMaterial(bool Value);
|
void UpdateMaterial(bool Value);
|
||||||
void UpdateMaterial(const QColor& Color);
|
void UpdateMaterial(const QColor& Color);
|
||||||
void UpdateMaterial(const QString& Value);
|
void UpdateMaterial(const CResourceEntry* Entry);
|
||||||
void UpdateUI(int Value);
|
void UpdateUI(int Value);
|
||||||
void UpdateAnimParamUI(EUVAnimMode Mode);
|
void UpdateAnimParamUI(EUVAnimMode Mode);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user