From 3c56faceb4bc8425d83a849b2d6b188ddfdba3bc Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Fri, 20 Aug 2021 17:59:06 -0700 Subject: [PATCH] Gems/LyShine Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp | 2 -- .../Code/Editor/Animation/Controls/UiTimelineCtrl.h | 1 - Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp | 7 +------ .../Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp | 6 ------ Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h | 7 ++----- Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp | 3 --- Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.h | 1 - Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp | 3 ++- .../LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp | 1 - Gems/LyShine/Code/Editor/EditorMenu.cpp | 2 +- Gems/LyShine/Code/Editor/HierarchyMenu.cpp | 2 +- Gems/LyShine/Code/Editor/MainToolbar.cpp | 2 +- Gems/LyShine/Code/Editor/PropertiesContainer.h | 1 - Gems/LyShine/Code/Editor/PropertyHandlerAnchor.cpp | 4 +--- Gems/LyShine/Code/Editor/PropertyHandlerChar.cpp | 7 ++----- Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp | 2 +- Gems/LyShine/Code/Editor/PropertyHandlerOffset.cpp | 4 +--- Gems/LyShine/Code/Editor/PropertyHandlerPivot.cpp | 4 +--- Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp | 1 - Gems/LyShine/Code/Editor/ViewportInteraction.h | 1 - 20 files changed, 14 insertions(+), 47 deletions(-) diff --git a/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp b/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp index cf5c1b2d8f..94a4c77593 100644 --- a/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp +++ b/Gems/LyShine/Code/Editor/Animation/Controls/UiSplineCtrlEx.cpp @@ -824,8 +824,6 @@ void SplineWidget::DrawSpline(QPainter* painter, SSplineInfo& splineInfo, float { const QPen pOldPen = painter->pen(); - const QRect rcClip = painter->clipBoundingRect().intersected(m_rcSpline).toRect(); - ////////////////////////////////////////////////////////////////////////// ISplineInterpolator* pSpline = splineInfo.pSpline; ISplineInterpolator* pDetailSpline = splineInfo.pDetailSpline; diff --git a/Gems/LyShine/Code/Editor/Animation/Controls/UiTimelineCtrl.h b/Gems/LyShine/Code/Editor/Animation/Controls/UiTimelineCtrl.h index d1aeaacb00..701d187ddc 100644 --- a/Gems/LyShine/Code/Editor/Animation/Controls/UiTimelineCtrl.h +++ b/Gems/LyShine/Code/Editor/Animation/Controls/UiTimelineCtrl.h @@ -134,7 +134,6 @@ protected: void DrawFrameTicks(QPainter* dc); private: - bool m_bAutoDelete; QRect m_rcClient; QRect m_rcTimeline; float m_fTimeMarker; diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp index 3646e5a413..54ea410349 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewAnimNode.cpp @@ -149,8 +149,6 @@ void CUiAnimViewAnimNode::UiElementPropertyChanged() bool valueChanged = false; - const float time = GetSequence()->GetTime(); - if (m_nodeEntityId.IsValid() && !m_azEntityDataCache.empty()) { AZ::Entity* pNodeEntity = nullptr; @@ -537,9 +535,6 @@ void CUiAnimViewAnimNode::BindToEditorObjects() CUiAnimViewSequenceNotificationContext context(GetSequence()); - CUiAnimViewAnimNode* pDirector = GetDirector(); - const bool bBelongsToActiveDirector = pDirector ? pDirector->IsActiveDirector() : true; - // if this node represents an AZ entity then register for updates if (m_nodeEntityId.IsValid()) { @@ -1632,7 +1627,7 @@ void CUiAnimViewAnimNode::OnSelectionChanged(const bool bSelected) { if (m_pAnimNode) { - const EUiAnimNodeType animNodeType = GetType(); + [[maybe_unused]] const EUiAnimNodeType animNodeType = GetType(); assert(animNodeType == eUiAnimNodeType_Camera || animNodeType == eUiAnimNodeType_Entity || animNodeType == eUiAnimNodeType_GeomCache); const EUiAnimNodeFlags flags = (EUiAnimNodeFlags)m_pAnimNode->GetFlags(); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp index 4e67fb520e..443480ab0d 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewDopeSheetBase.cpp @@ -192,7 +192,6 @@ void CUiAnimViewDopeSheetBase::SetTimeRange(float start, float end) void CUiAnimViewDopeSheetBase::SetTimeScale(float timeScale, float fAnchorTime) { const double fOldOffset = -fAnchorTime * m_timeScale; - const double fOldScale = m_timeScale; timeScale = std::max(timeScale, 0.001f); timeScale = std::min(timeScale, 100000.0f); @@ -1308,8 +1307,6 @@ void CUiAnimViewDopeSheetBase::OnCaptureChanged() ////////////////////////////////////////////////////////////////////////// bool CUiAnimViewDopeSheetBase::IsOkToAddKeyHere(const CUiAnimViewTrack* pTrack, float time) const { - const float timeEpsilon = 0.05f; - for (unsigned int i = 0; i < pTrack->GetKeyCount(); ++i) { CUiAnimViewKeyHandle keyHandle = const_cast(pTrack)->GetKey(i); @@ -1795,8 +1792,6 @@ void CUiAnimViewDopeSheetBase::AcceptUndo() { if (UiAnimUndo::IsRecording()) { - const QPoint mousePos = mapFromGlobal(QCursor::pos()); - if (m_mouseMode == eUiAVMouseMode_Paste) { UiAnimUndoManager::Get()->Cancel(); @@ -2242,7 +2237,6 @@ void CUiAnimViewDopeSheetBase::DrawBoolTrack(const Range& timeRange, QPainter* p { int x0 = TimeToClient(timeRange.start); float t0 = timeRange.start; - QRect trackRect; const QBrush prevBrush = painter->brush(); painter->setBrush(m_visibilityBrush); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h index 5a82d1be7f..0213cbb410 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNode.h @@ -19,13 +19,11 @@ class CUiAnimViewKeyConstHandle { public: CUiAnimViewKeyConstHandle() - : m_bIsValid(false) - , m_keyIndex(0) + : m_keyIndex(0) , m_pTrack(nullptr) {} CUiAnimViewKeyConstHandle(const CUiAnimViewTrack* pTrack, unsigned int keyIndex) - : m_bIsValid(true) - , m_keyIndex(keyIndex) + : m_keyIndex(keyIndex) , m_pTrack(pTrack) {} void GetKey(IKey* pKey) const; @@ -33,7 +31,6 @@ public: const CUiAnimViewTrack* GetTrack() const { return m_pTrack; } private: - bool m_bIsValid; unsigned int m_keyIndex; const CUiAnimViewTrack* m_pTrack; }; diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp index 74d2c7d4fb..a6c4e2424b 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.cpp @@ -1096,9 +1096,6 @@ void CUiAnimViewNodesCtrl::AddGroupNodeAddItems(UiAnimContextMenu& contextMenu, contextMenu.main.addAction("Add Event Node")->setData(eMI_AddEvent); } - const bool bIsDirectorOrSequence = (pAnimNode->GetType() == eUiAnimNodeType_Director || pAnimNode->GetNodeType() == eUiAVNT_Sequence); - - #if UI_ANIMATION_REMOVED contextMenu.main.addAction("Add Comment Node")->setData(eMI_AddCommentNode); contextMenu.main.addAction("Add Console Variable")->setData(eMI_AddConsoleVariable); diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.h b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.h index a5cce764e3..c7226da23f 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.h +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewNodes.h @@ -182,7 +182,6 @@ private: // Drag and drop CUiAnimViewAnimNodeBundle m_draggedNodes; - CUiAnimViewAnimNode* m_pDragTarget; std::unordered_map m_nodeToRecordMap; diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp index d8888124a4..9c26100bad 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSequence.cpp @@ -488,11 +488,12 @@ void CUiAnimViewSequence::SelectSelectedNodesInViewport() assert(UiAnimUndo::IsRecording()); CUiAnimViewAnimNodeBundle selectedNodes = GetSelectedAnimNodes(); - const unsigned int numSelectedNodes = selectedNodes.GetCount(); std::vector entitiesToBeSelected; #if UI_ANIMATION_REMOVED // lights + const unsigned int numSelectedNodes = selectedNodes.GetCount(); + // Also select objects that refer to light animation const bool bLightAnimationSetActive = GetFlags() & IUiAnimSequence::eSeqFlags_LightAnimationSet; if (bLightAnimationSetActive) diff --git a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp index 8edd13f8cc..382b589ac3 100644 --- a/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp +++ b/Gems/LyShine/Code/Editor/Animation/UiAnimViewSplineCtrl.cpp @@ -589,7 +589,6 @@ void CUiAnimViewSplineCtrl::mouseMoveEvent(QMouseEvent* event) CUiAnimViewSequenceNotificationContext context(pSequence); - QPoint cMousePosPrev = m_cMousePos; m_cMousePos = point; if (m_editMode == SelectMode) diff --git a/Gems/LyShine/Code/Editor/EditorMenu.cpp b/Gems/LyShine/Code/Editor/EditorMenu.cpp index 840bd206ab..8a6c93de6b 100644 --- a/Gems/LyShine/Code/Editor/EditorMenu.cpp +++ b/Gems/LyShine/Code/Editor/EditorMenu.cpp @@ -704,7 +704,7 @@ void EditorWindow::AddMenu_View() action->setEnabled(canvasLoaded); QObject::connect(action, &QAction::triggered, - [this]([[maybe_unused]] bool checked) + []([[maybe_unused]] bool checked) { gEnv->pCryFont->ReloadAllFonts(); }); diff --git a/Gems/LyShine/Code/Editor/HierarchyMenu.cpp b/Gems/LyShine/Code/Editor/HierarchyMenu.cpp index ab0c250434..31c5255538 100644 --- a/Gems/LyShine/Code/Editor/HierarchyMenu.cpp +++ b/Gems/LyShine/Code/Editor/HierarchyMenu.cpp @@ -330,7 +330,7 @@ void HierarchyMenu::SliceMenuItems(HierarchyWidget* hierarchy, slicesAddedToMenu.push_back(sliceAsset.GetId()); QAction* action = menu->addAction(assetPath.c_str()); - QObject::connect(action, &QAction::triggered, [this, hierarchy, sliceAsset] + QObject::connect(action, &QAction::triggered, [hierarchy, sliceAsset] { hierarchy->GetEditorWindow()->EditSliceInNewTab(sliceAsset.GetId()); } diff --git a/Gems/LyShine/Code/Editor/MainToolbar.cpp b/Gems/LyShine/Code/Editor/MainToolbar.cpp index ee2d3db7b5..dd0ab39f89 100644 --- a/Gems/LyShine/Code/Editor/MainToolbar.cpp +++ b/Gems/LyShine/Code/Editor/MainToolbar.cpp @@ -32,7 +32,7 @@ MainToolbar::MainToolbar(EditorWindow* parent) QObject::connect(m_zoomFactorSpinBox, QOverload::of(&AzQtComponents::DoubleSpinBox::valueChanged), - [this, parent](double value) + [parent](double value) { parent->GetViewport()->GetViewportInteraction()->SetCanvasZoomPercent(static_cast(value)); }); diff --git a/Gems/LyShine/Code/Editor/PropertiesContainer.h b/Gems/LyShine/Code/Editor/PropertiesContainer.h index 0d47444281..209a2354ad 100644 --- a/Gems/LyShine/Code/Editor/PropertiesContainer.h +++ b/Gems/LyShine/Code/Editor/PropertiesContainer.h @@ -119,7 +119,6 @@ private: PropertiesWidget* m_propertiesWidget; EditorWindow* m_editorWindow; - QWidget* m_containerWidget; QWidget* m_componentListContents; QVBoxLayout* m_rowLayout; QLineEdit* m_selectedEntityDisplayNameWidget; diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerAnchor.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerAnchor.cpp index 8e00b6f277..5ffba22df6 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerAnchor.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerAnchor.cpp @@ -350,10 +350,8 @@ void PropertyHandlerAnchor::WriteGUIValuesIntoProperty(size_t index, PropertyAnc } } -bool PropertyHandlerAnchor::ReadValuesIntoGUI(size_t index, PropertyAnchorCtrl* GUI, const property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) +bool PropertyHandlerAnchor::ReadValuesIntoGUI([[maybe_unused]] size_t index, PropertyAnchorCtrl* GUI, const property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) { - (int)index; - AzQtComponents::VectorInput* ctrl = GUI->GetPropertyVectorCtrl(); ctrl->blockSignals(true); diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerChar.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerChar.cpp index b3cacec065..d99cd9bf20 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerChar.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerChar.cpp @@ -27,19 +27,16 @@ void PropertyHandlerChar::ConsumeAttribute(AzToolsFramework::PropertyStringLineE { } -void PropertyHandlerChar::WriteGUIValuesIntoProperty(size_t index, AzToolsFramework::PropertyStringLineEditCtrl* GUI, property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) +void PropertyHandlerChar::WriteGUIValuesIntoProperty([[maybe_unused]] size_t index, AzToolsFramework::PropertyStringLineEditCtrl* GUI, property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) { - (int)index; AZStd::string str = GUI->value(); wchar_t character = '\0'; AZStd::to_wstring(&character, 1, str.c_str()); instance = character; } -bool PropertyHandlerChar::ReadValuesIntoGUI(size_t index, AzToolsFramework::PropertyStringLineEditCtrl* GUI, const property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) +bool PropertyHandlerChar::ReadValuesIntoGUI([[maybe_unused]] size_t index, AzToolsFramework::PropertyStringLineEditCtrl* GUI, const property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) { - (int)index; - GUI->blockSignals(true); { // NOTE: this assumes the uint32_t can be interpreted as a wchar_t, it seems to diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp index 1f3e28b077..5a464b2210 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerDirectory.cpp @@ -53,7 +53,7 @@ PropertyDirectoryCtrl::PropertyDirectoryCtrl(QWidget* parent) QObject::connect(refreshButton, &QPushButton::clicked, - [this]([[maybe_unused]] bool checked) + []([[maybe_unused]] bool checked) { UiEditorRefreshDirectoryNotificationBus::Broadcast(&UiEditorRefreshDirectoryNotificationInterface::OnRefreshDirectory); }); diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerOffset.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerOffset.cpp index 22f87b5b53..b8a34ae314 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerOffset.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerOffset.cpp @@ -106,10 +106,8 @@ void PropertyHandlerOffset::WriteGUIValuesIntoProperty(size_t index, AzQtCompone EBUS_EVENT_ID(id, UiTransform2dBus, SetOffsets, newInternalOffset); } -bool PropertyHandlerOffset::ReadValuesIntoGUI(size_t index, AzQtComponents::VectorInput* GUI, const UiTransform2dInterface::Offsets& instance, AzToolsFramework::InstanceDataNode* node) +bool PropertyHandlerOffset::ReadValuesIntoGUI([[maybe_unused]] size_t index, AzQtComponents::VectorInput* GUI, const UiTransform2dInterface::Offsets& instance, AzToolsFramework::InstanceDataNode* node) { - (int)index; - // IMPORTANT: We DON'T need to do validation of data here because that's // done for us BEFORE we get here. We DO need to set the labels here. diff --git a/Gems/LyShine/Code/Editor/PropertyHandlerPivot.cpp b/Gems/LyShine/Code/Editor/PropertyHandlerPivot.cpp index 47d98cf68a..3f89b2fe74 100644 --- a/Gems/LyShine/Code/Editor/PropertyHandlerPivot.cpp +++ b/Gems/LyShine/Code/Editor/PropertyHandlerPivot.cpp @@ -143,10 +143,8 @@ void PropertyHandlerPivot::WriteGUIValuesIntoProperty(size_t index, PropertyPivo } } -bool PropertyHandlerPivot::ReadValuesIntoGUI(size_t index, PropertyPivotCtrl* GUI, const property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) +bool PropertyHandlerPivot::ReadValuesIntoGUI([[maybe_unused]] size_t index, PropertyPivotCtrl* GUI, const property_t& instance, [[maybe_unused]] AzToolsFramework::InstanceDataNode* node) { - (int)index; - AzQtComponents::VectorInput* ctrl = GUI->GetPropertyVectorCtrl(); ctrl->blockSignals(true); diff --git a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp index 04f655123c..93d77bd174 100644 --- a/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp +++ b/Gems/LyShine/Code/Editor/SpriteBorderEditor.cpp @@ -227,7 +227,6 @@ void SpriteBorderEditor::DisplaySelectedCell(AZ::u32 cellIndex) // Determine how much we need to scale the view to fit the cell // contents to the displayed properties image. const AZ::Vector2 cellSize = m_sprite->GetCellSize(cellIndex); - const AZ::Vector2 cellScale = AZ::Vector2(m_unscaledSpriteSheet.size().width() / cellSize.GetX(), m_unscaledSpriteSheet.size().height() / cellSize.GetY()); // Scale-to-fit, while preserving aspect ratio. QRect croppedRect = m_unscaledSpriteSheet.rect(); diff --git a/Gems/LyShine/Code/Editor/ViewportInteraction.h b/Gems/LyShine/Code/Editor/ViewportInteraction.h index 100d1fdb1e..a104d87634 100644 --- a/Gems/LyShine/Code/Editor/ViewportInteraction.h +++ b/Gems/LyShine/Code/Editor/ViewportInteraction.h @@ -261,7 +261,6 @@ private: // data AZStd::string m_cursorStr; QCursor m_cursorRotate; - bool m_inObjectPickMode = false; ViewportInteraction::InteractionMode m_interactionModeBeforePickMode; AZ::EntityId m_hoverElement; bool m_entityPickedOnMousePress; // used to ignore mouse move/release events if element was picked on the mouse press