Removed wireframe from perspective menu and fixed crash on right click (#575)

This commit is contained in:
Terry Michaels
2021-05-05 11:10:19 -05:00
committed by GitHub
parent 7b95b5e329
commit 01976a890c
+1 -19
View File
@@ -1298,26 +1298,8 @@ namespace AZ::ViewportHelpers
//////////////////////////////////////////////////////////////////////////
void EditorViewportWidget::OnTitleMenu(QMenu* menu)
{
const int nWireframe = gEnv->pConsole->GetCVar("r_wireframe")->GetIVal();
QAction* action = menu->addAction(tr("Wireframe"));
connect(action, &QAction::triggered, action, []()
{
ICVar* piVar(gEnv->pConsole->GetCVar("r_wireframe"));
int nRenderMode = piVar->GetIVal();
if (nRenderMode != R_WIREFRAME_MODE)
{
piVar->Set(R_WIREFRAME_MODE);
}
else
{
piVar->Set(R_SOLID_MODE);
}
});
action->setCheckable(true);
action->setChecked(nWireframe == R_WIREFRAME_MODE);
const bool bDisplayLabels = GetIEditor()->GetDisplaySettings()->IsDisplayLabels();
action = menu->addAction(tr("Labels"));
QAction* action = menu->addAction(tr("Labels"));
connect(action, &QAction::triggered, this, [bDisplayLabels] {GetIEditor()->GetDisplaySettings()->DisplayLabels(!bDisplayLabels);
});
action->setCheckable(true);