CTweakEditor: Unindent some code
This commit is contained in:
parent
a65af0dd22
commit
63678a558b
|
@ -61,39 +61,39 @@ bool CTweakEditor::Save()
|
||||||
|
|
||||||
void CTweakEditor::SetActiveTweakData(CTweakData* pTweakData)
|
void CTweakEditor::SetActiveTweakData(CTweakData* pTweakData)
|
||||||
{
|
{
|
||||||
for( int TweakIdx = 0; TweakIdx < mTweakAssets.size(); TweakIdx++ )
|
for (int TweakIdx = 0; TweakIdx < mTweakAssets.size(); TweakIdx++)
|
||||||
{
|
{
|
||||||
if (mTweakAssets[TweakIdx] == pTweakData)
|
if (mTweakAssets[TweakIdx] != pTweakData)
|
||||||
{
|
continue;
|
||||||
CSetTweakIndexCommand* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, TweakIdx);
|
|
||||||
UndoStack().push(pCommand);
|
auto* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, TweakIdx);
|
||||||
break;
|
UndoStack().push(pCommand);
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTweakEditor::SetActiveTweakIndex(int Index)
|
void CTweakEditor::SetActiveTweakIndex(int Index)
|
||||||
{
|
{
|
||||||
if( mCurrentTweakIndex != Index )
|
if (mCurrentTweakIndex == Index)
|
||||||
{
|
return;
|
||||||
mCurrentTweakIndex = Index;
|
|
||||||
|
|
||||||
CTweakData* pTweakData = mTweakAssets[Index];
|
mCurrentTweakIndex = Index;
|
||||||
mpUI->PropertyView->SetIntrinsicProperties(pTweakData->TweakData());
|
|
||||||
|
|
||||||
mpUI->TweakTabs->blockSignals(true);
|
CTweakData* pTweakData = mTweakAssets[Index];
|
||||||
mpUI->TweakTabs->setCurrentIndex(Index);
|
mpUI->PropertyView->SetIntrinsicProperties(pTweakData->TweakData());
|
||||||
mpUI->TweakTabs->blockSignals(false);
|
|
||||||
}
|
mpUI->TweakTabs->blockSignals(true);
|
||||||
|
mpUI->TweakTabs->setCurrentIndex(Index);
|
||||||
|
mpUI->TweakTabs->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTweakEditor::OnTweakTabClicked(int Index)
|
void CTweakEditor::OnTweakTabClicked(int Index)
|
||||||
{
|
{
|
||||||
if (Index != mCurrentTweakIndex)
|
if (Index == mCurrentTweakIndex)
|
||||||
{
|
return;
|
||||||
CSetTweakIndexCommand* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, Index);
|
|
||||||
UndoStack().push(pCommand);
|
auto* pCommand = new CSetTweakIndexCommand(this, mCurrentTweakIndex, Index);
|
||||||
}
|
UndoStack().push(pCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CTweakEditor::OnProjectChanged(CGameProject* pNewProject)
|
void CTweakEditor::OnProjectChanged(CGameProject* pNewProject)
|
||||||
|
@ -144,5 +144,5 @@ void CTweakEditor::OnProjectChanged(CGameProject* pNewProject)
|
||||||
mpUI->TweakTabs->blockSignals(false);
|
mpUI->TweakTabs->blockSignals(false);
|
||||||
|
|
||||||
// Hide "save and repack" button for MP2+ as it doesn't do anything different from the regular Save button
|
// Hide "save and repack" button for MP2+ as it doesn't do anything different from the regular Save button
|
||||||
mpUI->ActionSaveAndRepack->setVisible( !pNewProject || pNewProject->Game() <= EGame::Prime );
|
mpUI->ActionSaveAndRepack->setVisible(!pNewProject || pNewProject->Game() <= EGame::Prime);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue