merging latest development
Signed-off-by: kberg-amzn <karlberg@amazon.com>
This commit is contained in:
+17
-17
@@ -35,32 +35,32 @@ public:
|
||||
Q2DViewport(QWidget* parent = nullptr);
|
||||
virtual ~Q2DViewport();
|
||||
|
||||
virtual void SetType(EViewportType type);
|
||||
virtual EViewportType GetType() const { return m_viewType; }
|
||||
virtual float GetAspectRatio() const { return 1.0f; };
|
||||
void SetType(EViewportType type) override;
|
||||
EViewportType GetType() const override { return m_viewType; }
|
||||
float GetAspectRatio() const override { return 1.0f; };
|
||||
|
||||
virtual void ResetContent();
|
||||
virtual void UpdateContent(int flags);
|
||||
void ResetContent() override;
|
||||
void UpdateContent(int flags) override;
|
||||
|
||||
public slots:
|
||||
// Called every frame to update viewport.
|
||||
virtual void Update();
|
||||
void Update() override;
|
||||
|
||||
public:
|
||||
//! Map world space position to viewport position.
|
||||
virtual QPoint WorldToView(const Vec3& wp) const;
|
||||
QPoint WorldToView(const Vec3& wp) const override;
|
||||
|
||||
virtual QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const; //Eric@conffx
|
||||
QPoint WorldToViewParticleEditor(const Vec3& wp, int width, int height) const override; //Eric@conffx
|
||||
|
||||
//! Map viewport position to world space position.
|
||||
virtual Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
|
||||
Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
|
||||
//! Map viewport position to world space ray from camera.
|
||||
virtual void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const;
|
||||
void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const override;
|
||||
|
||||
void OnTitleMenu(QMenu* menu) override;
|
||||
|
||||
virtual bool HitTest(const QPoint& point, HitContext& hitInfo) override;
|
||||
virtual bool IsBoundsVisible(const AABB& box) const;
|
||||
bool HitTest(const QPoint& point, HitContext& hitInfo) override;
|
||||
bool IsBoundsVisible(const AABB& box) const override;
|
||||
|
||||
// ovverided from CViewport.
|
||||
float GetScreenScaleFactor(const Vec3& worldPoint) const override;
|
||||
@@ -111,8 +111,8 @@ protected:
|
||||
virtual void SetZoom(float fZoomFactor, const QPoint& center);
|
||||
|
||||
// overrides from CViewport.
|
||||
virtual void MakeConstructionPlane(int axis);
|
||||
virtual const Matrix34& GetConstructionMatrix(RefCoordSys coordSys);
|
||||
void MakeConstructionPlane(int axis) override;
|
||||
const Matrix34& GetConstructionMatrix(RefCoordSys coordSys) override;
|
||||
|
||||
//! Calculate view transformation matrix.
|
||||
virtual void CalculateViewTM();
|
||||
@@ -146,9 +146,9 @@ protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
void paintEvent(QPaintEvent* event) override;
|
||||
int OnCreate();
|
||||
void OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point);
|
||||
void OnRButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point);
|
||||
void OnMouseWheel(Qt::KeyboardModifiers modifiers, short zDelta, const QPoint& pt);
|
||||
void OnRButtonDown(Qt::KeyboardModifiers modifiers, const QPoint& point) override;
|
||||
void OnRButtonUp(Qt::KeyboardModifiers modifiers, const QPoint& point) override;
|
||||
void OnMouseWheel(Qt::KeyboardModifiers modifiers, short zDelta, const QPoint& pt) override;
|
||||
void OnDestroy();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// AzCore
|
||||
#include <AzCore/Casting/numeric_cast.h> // for aznumeric_cast
|
||||
|
||||
#include <AzQtComponents/Utilities/PixmapScaleUtilities.h>
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <ui_AboutDialog.h>
|
||||
@@ -46,8 +47,13 @@ CAboutDialog::CAboutDialog(QString versionText, QString richTextCopyrightNotice,
|
||||
CAboutDialog > QLabel#link { text-decoration: underline; color: #94D2FF; }");
|
||||
|
||||
// Prepare background image
|
||||
QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg"));
|
||||
m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
m_backgroundImage = AzQtComponents::ScalePixmapForScreenDpi(
|
||||
QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")),
|
||||
screen(),
|
||||
QSize(m_enforcedWidth, m_enforcedHeight),
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation
|
||||
);
|
||||
|
||||
// Draw the Open 3D Engine logo from svg
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/o3de_logo.svg"));
|
||||
|
||||
@@ -353,7 +353,7 @@ public:
|
||||
m_actionHandlers[id] = std::bind(method, object, id);
|
||||
}
|
||||
|
||||
bool eventFilter(QObject* watched, QEvent* event);
|
||||
bool eventFilter(QObject* watched, QEvent* event) override;
|
||||
|
||||
// returns false if the action was already inserted, indicating that the action should not be processed again
|
||||
bool InsertActionExecuting(int id);
|
||||
|
||||
@@ -197,7 +197,7 @@ private:
|
||||
|
||||
virtual void OnSequenceRemoved(CTrackViewSequence* pSequence) override;
|
||||
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
|
||||
void AnimateActiveSequence();
|
||||
|
||||
|
||||
+17
-17
@@ -40,57 +40,57 @@ public:
|
||||
//! Set library name.
|
||||
virtual void SetName(const QString& name);
|
||||
//! Get library name.
|
||||
const QString& GetName() const;
|
||||
const QString& GetName() const override;
|
||||
|
||||
//! Set new filename for this library.
|
||||
virtual bool SetFilename(const QString& filename, [[maybe_unused]] bool checkForUnique = true) { m_filename = filename.toLower(); return true; };
|
||||
const QString& GetFilename() const { return m_filename; };
|
||||
const QString& GetFilename() const override { return m_filename; };
|
||||
|
||||
virtual bool Save() = 0;
|
||||
virtual bool Load(const QString& filename) = 0;
|
||||
virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0;
|
||||
bool Save() override = 0;
|
||||
bool Load(const QString& filename) override = 0;
|
||||
void Serialize(XmlNodeRef& node, bool bLoading) override = 0;
|
||||
|
||||
//! Mark library as modified.
|
||||
void SetModified(bool bModified = true);
|
||||
void SetModified(bool bModified = true) override;
|
||||
//! Check if library was modified.
|
||||
bool IsModified() const { return m_bModified; };
|
||||
bool IsModified() const override { return m_bModified; };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Working with items.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Add a new prototype to library.
|
||||
void AddItem(IDataBaseItem* item, bool bRegister = true);
|
||||
void AddItem(IDataBaseItem* item, bool bRegister = true) override;
|
||||
//! Get number of known prototypes.
|
||||
int GetItemCount() const { return static_cast<int>(m_items.size()); }
|
||||
int GetItemCount() const override { return static_cast<int>(m_items.size()); }
|
||||
//! Get prototype by index.
|
||||
IDataBaseItem* GetItem(int index);
|
||||
IDataBaseItem* GetItem(int index) override;
|
||||
|
||||
//! Delete item by pointer of item.
|
||||
void RemoveItem(IDataBaseItem* item);
|
||||
void RemoveItem(IDataBaseItem* item) override;
|
||||
|
||||
//! Delete all items from library.
|
||||
void RemoveAllItems();
|
||||
void RemoveAllItems() override;
|
||||
|
||||
//! Find library item by name.
|
||||
//! Using linear search.
|
||||
IDataBaseItem* FindItem(const QString& name);
|
||||
IDataBaseItem* FindItem(const QString& name) override;
|
||||
|
||||
//! Check if this library is local level library.
|
||||
bool IsLevelLibrary() const { return m_bLevelLib; };
|
||||
bool IsLevelLibrary() const override { return m_bLevelLib; };
|
||||
|
||||
//! Set library to be level library.
|
||||
void SetLevelLibrary(bool bEnable) { m_bLevelLib = bEnable; };
|
||||
void SetLevelLibrary(bool bEnable) override { m_bLevelLib = bEnable; };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Return manager for this library.
|
||||
IBaseLibraryManager* GetManager();
|
||||
IBaseLibraryManager* GetManager() override;
|
||||
|
||||
// Saves the library with the main tag defined by the parameter name
|
||||
bool SaveLibrary(const char* name, bool saveEmptyLibrary = false);
|
||||
|
||||
//CONFETTI BEGIN
|
||||
// Used to change the library item order
|
||||
virtual void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) override;
|
||||
void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) override;
|
||||
//CONFETTI END
|
||||
|
||||
signals:
|
||||
|
||||
@@ -35,112 +35,112 @@ public:
|
||||
~CBaseLibraryManager();
|
||||
|
||||
//! Clear all libraries.
|
||||
virtual void ClearAll() override;
|
||||
void ClearAll() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// IDocListener implementation.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Library items.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Make a new item in specified library.
|
||||
virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) override;
|
||||
IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) override;
|
||||
//! Delete item from library and manager.
|
||||
virtual void DeleteItem(IDataBaseItem* pItem) override;
|
||||
void DeleteItem(IDataBaseItem* pItem) override;
|
||||
|
||||
//! Find Item by its GUID.
|
||||
virtual IDataBaseItem* FindItem(REFGUID guid) const;
|
||||
virtual IDataBaseItem* FindItemByName(const QString& fullItemName);
|
||||
virtual IDataBaseItem* LoadItemByName(const QString& fullItemName);
|
||||
IDataBaseItem* FindItem(REFGUID guid) const override;
|
||||
IDataBaseItem* FindItemByName(const QString& fullItemName) override;
|
||||
IDataBaseItem* LoadItemByName(const QString& fullItemName) override;
|
||||
virtual IDataBaseItem* FindItemByName(const char* fullItemName);
|
||||
virtual IDataBaseItem* LoadItemByName(const char* fullItemName);
|
||||
|
||||
virtual IDataBaseItemEnumerator* GetItemEnumerator() override;
|
||||
IDataBaseItemEnumerator* GetItemEnumerator() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Set item currently selected.
|
||||
virtual void SetSelectedItem(IDataBaseItem* pItem) override;
|
||||
void SetSelectedItem(IDataBaseItem* pItem) override;
|
||||
// Get currently selected item.
|
||||
virtual IDataBaseItem* GetSelectedItem() const override;
|
||||
virtual IDataBaseItem* GetSelectedParentItem() const override;
|
||||
IDataBaseItem* GetSelectedItem() const override;
|
||||
IDataBaseItem* GetSelectedParentItem() const override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Libraries.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Add Item library.
|
||||
virtual IDataBaseLibrary* AddLibrary(const QString& library, bool bIsLevelLibrary = false, bool bIsLoading = true) override;
|
||||
virtual void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) override;
|
||||
IDataBaseLibrary* AddLibrary(const QString& library, bool bIsLevelLibrary = false, bool bIsLoading = true) override;
|
||||
void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) override;
|
||||
//! Get number of libraries.
|
||||
virtual int GetLibraryCount() const override { return static_cast<int>(m_libs.size()); };
|
||||
int GetLibraryCount() const override { return static_cast<int>(m_libs.size()); };
|
||||
//! Get number of modified libraries.
|
||||
virtual int GetModifiedLibraryCount() const override;
|
||||
int GetModifiedLibraryCount() const override;
|
||||
|
||||
//! Get Item library by index.
|
||||
virtual IDataBaseLibrary* GetLibrary(int index) const override;
|
||||
IDataBaseLibrary* GetLibrary(int index) const override;
|
||||
|
||||
//! Get Level Item library.
|
||||
virtual IDataBaseLibrary* GetLevelLibrary() const override;
|
||||
IDataBaseLibrary* GetLevelLibrary() const override;
|
||||
|
||||
//! Find Items Library by name.
|
||||
virtual IDataBaseLibrary* FindLibrary(const QString& library) override;
|
||||
IDataBaseLibrary* FindLibrary(const QString& library) override;
|
||||
|
||||
//! Find Items Library's index by name.
|
||||
int FindLibraryIndex(const QString& library) override;
|
||||
|
||||
//! Load Items library.
|
||||
virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) override;
|
||||
IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) override;
|
||||
|
||||
//! Save all modified libraries.
|
||||
virtual void SaveAllLibs() override;
|
||||
void SaveAllLibs() override;
|
||||
|
||||
//! Serialize property manager.
|
||||
virtual void Serialize(XmlNodeRef& node, bool bLoading) override;
|
||||
void Serialize(XmlNodeRef& node, bool bLoading) override;
|
||||
|
||||
//! Export items to game.
|
||||
virtual void Export([[maybe_unused]] XmlNodeRef& node) override {};
|
||||
void Export([[maybe_unused]] XmlNodeRef& node) override {};
|
||||
|
||||
//! Returns unique name base on input name.
|
||||
virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") override;
|
||||
virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) override;
|
||||
QString MakeUniqueItemName(const QString& name, const QString& libName = "") override;
|
||||
QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) override;
|
||||
|
||||
//! Root node where this library will be saved.
|
||||
virtual QString GetRootNodeName() override = 0;
|
||||
QString GetRootNodeName() override = 0;
|
||||
//! Path to libraries in this manager.
|
||||
virtual QString GetLibsPath() override = 0;
|
||||
QString GetLibsPath() override = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Validate library items for errors.
|
||||
virtual void Validate() override;
|
||||
void Validate() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void GatherUsedResources(CUsedResources& resources) override;
|
||||
void GatherUsedResources(CUsedResources& resources) override;
|
||||
|
||||
virtual void AddListener(IDataBaseManagerListener* pListener) override;
|
||||
virtual void RemoveListener(IDataBaseManagerListener* pListener) override;
|
||||
void AddListener(IDataBaseManagerListener* pListener) override;
|
||||
void RemoveListener(IDataBaseManagerListener* pListener) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) override;
|
||||
virtual void RegisterItem(CBaseLibraryItem* pItem) override;
|
||||
virtual void UnregisterItem(CBaseLibraryItem* pItem) override;
|
||||
void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) override;
|
||||
void RegisterItem(CBaseLibraryItem* pItem) override;
|
||||
void UnregisterItem(CBaseLibraryItem* pItem) override;
|
||||
|
||||
// Only Used internally.
|
||||
virtual void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) override;
|
||||
void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) override;
|
||||
|
||||
// Called by items to indicated that they have been modified.
|
||||
// Sends item changed event to listeners.
|
||||
virtual void OnItemChanged(IDataBaseItem* pItem) override;
|
||||
virtual void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) override;
|
||||
void OnItemChanged(IDataBaseItem* pItem) override;
|
||||
void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) override;
|
||||
|
||||
QString MakeFilename(const QString& library);
|
||||
virtual bool IsUniqueFilename(const QString& library) override;
|
||||
bool IsUniqueFilename(const QString& library) override;
|
||||
|
||||
//CONFETTI BEGIN
|
||||
// Used to change the library item order
|
||||
virtual void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) override;
|
||||
void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) override;
|
||||
|
||||
virtual bool SetLibraryName(CBaseLibrary* lib, const QString& name) override;
|
||||
bool SetLibraryName(CBaseLibrary* lib, const QString& name) override;
|
||||
|
||||
protected:
|
||||
void SplitFullItemName(const QString& fullItemName, QString& libraryName, QString& itemName);
|
||||
@@ -199,8 +199,8 @@ public:
|
||||
m_pMap = pMap;
|
||||
m_iterator = m_pMap->begin();
|
||||
}
|
||||
virtual void Release() { delete this; };
|
||||
virtual IDataBaseItem* GetFirst()
|
||||
void Release() override { delete this; };
|
||||
IDataBaseItem* GetFirst() override
|
||||
{
|
||||
m_iterator = m_pMap->begin();
|
||||
if (m_iterator == m_pMap->end())
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
}
|
||||
return m_iterator->second;
|
||||
}
|
||||
virtual IDataBaseItem* GetNext()
|
||||
IDataBaseItem* GetNext() override
|
||||
{
|
||||
if (m_iterator != m_pMap->end())
|
||||
{
|
||||
|
||||
@@ -81,7 +81,7 @@ protected:
|
||||
HIT_SPLINE,
|
||||
};
|
||||
|
||||
void paintEvent(QPaintEvent* e);
|
||||
void paintEvent(QPaintEvent* e) override;
|
||||
void resizeEvent(QResizeEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
|
||||
@@ -83,7 +83,7 @@ protected Q_SLOTS:
|
||||
void OnIndexDoubleClicked(const QModelIndex& index);
|
||||
|
||||
protected:
|
||||
virtual void OnFileMonitorChange(const SFileChangeInfo& rChange);
|
||||
void OnFileMonitorChange(const SFileChangeInfo& rChange) override;
|
||||
void contextMenuEvent(QContextMenuEvent* e) override;
|
||||
|
||||
void InitTree();
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
void SetVariable(IVariable* pVariable) override;
|
||||
void SyncReflectedVarToIVar(IVariable* pVariable) override;
|
||||
void SyncIVarToReflectedVar(IVariable* pVariable) override;
|
||||
virtual void OnVariableChange(IVariable* var);
|
||||
void OnVariableChange(IVariable* var) override;
|
||||
CReflectedVar* GetReflectedVar() override { return m_reflectedVar.data(); }
|
||||
|
||||
protected:
|
||||
|
||||
@@ -70,7 +70,7 @@ protected:
|
||||
m_splineEntries.resize(m_splineEntries.size() + 1);
|
||||
SplineEntry& entry = m_splineEntries.back();
|
||||
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
|
||||
entry.id = (pSplineSet ? pSplineSet->GetIDFromSpline(pSpline) : nullptr);
|
||||
entry.id = (pSplineSet ? pSplineSet->GetIDFromSpline(pSpline) : AZStd::string{});
|
||||
entry.pSpline = pSpline;
|
||||
|
||||
const int numKeys = pSpline->GetKeyCount();
|
||||
|
||||
@@ -159,15 +159,15 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// IKeyTimeSet Implementation
|
||||
virtual int GetKeyTimeCount() const;
|
||||
virtual float GetKeyTime(int index) const;
|
||||
virtual void MoveKeyTimes(int numChanges, int* indices, float scale, float offset, bool copyKeys);
|
||||
virtual bool GetKeyTimeSelected(int index) const;
|
||||
virtual void SetKeyTimeSelected(int index, bool selected);
|
||||
virtual int GetKeyCount(int index) const;
|
||||
virtual int GetKeyCountBound() const;
|
||||
virtual void BeginEdittingKeyTimes();
|
||||
virtual void EndEdittingKeyTimes();
|
||||
int GetKeyTimeCount() const override;
|
||||
float GetKeyTime(int index) const override;
|
||||
void MoveKeyTimes(int numChanges, int* indices, float scale, float offset, bool copyKeys) override;
|
||||
bool GetKeyTimeSelected(int index) const override;
|
||||
void SetKeyTimeSelected(int index, bool selected) override;
|
||||
int GetKeyCount(int index) const override;
|
||||
int GetKeyCountBound() const override;
|
||||
void BeginEdittingKeyTimes() override;
|
||||
void EndEdittingKeyTimes() override;
|
||||
|
||||
void SetEditLock(bool bLock) { m_bEditLock = bLock; }
|
||||
|
||||
@@ -361,8 +361,8 @@ public:
|
||||
SplineWidget(QWidget* parent);
|
||||
virtual ~SplineWidget();
|
||||
|
||||
void update() { QWidget::update(); }
|
||||
void update(const QRect& rect) { QWidget::update(rect); }
|
||||
void update() override { QWidget::update(); }
|
||||
void update(const QRect& rect) override { QWidget::update(rect); }
|
||||
|
||||
QPoint mapFromGlobal(const QPoint& point) const override { return QWidget::mapFromGlobal(point); }
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
void setGeometry(const QRect& r) override { QWidget::setGeometry(r); }
|
||||
|
||||
void SetTimeRange(const Range& r) { m_timeRange = r; }
|
||||
void SetTimeMarker(float fTime);
|
||||
void SetTimeMarker(float fTime) override;
|
||||
float GetTimeMarker() const { return m_fTimeMarker; }
|
||||
|
||||
void SetZoom(float fZoom);
|
||||
@@ -113,7 +113,7 @@ protected:
|
||||
void OnLButtonUp(const QPoint& point, Qt::KeyboardModifiers modifiers);
|
||||
void OnRButtonDown(const QPoint& point, Qt::KeyboardModifiers modifiers);
|
||||
void OnRButtonUp(const QPoint& point, Qt::KeyboardModifiers modifiers);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
void keyPressEvent(QKeyEvent* event) override;
|
||||
|
||||
// Drawing functions
|
||||
float ClientToTime(int x);
|
||||
|
||||
@@ -44,7 +44,7 @@ enum
|
||||
{
|
||||
// in milliseconds
|
||||
GameModeIdleFrequency = 0,
|
||||
EditorModeIdleFrequency = 1,
|
||||
EditorModeIdleFrequency = 0,
|
||||
InactiveModeFrequency = 10,
|
||||
UninitializedFrequency = 9999,
|
||||
};
|
||||
|
||||
+75
-18
@@ -33,6 +33,7 @@ AZ_POP_DISABLE_WARNING
|
||||
#include <QScopedValueRollback>
|
||||
#include <QClipboard>
|
||||
#include <QMenuBar>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
// Aws Native SDK
|
||||
#include <aws/sts/STSClient.h>
|
||||
@@ -716,8 +717,24 @@ void CCryEditApp::OnFileSave()
|
||||
}
|
||||
|
||||
const QScopedValueRollback<bool> rollback(m_savingLevel, true);
|
||||
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
|
||||
|
||||
GetIEditor()->GetDocument()->DoFileSave();
|
||||
if (!usePrefabSystemForLevels)
|
||||
{
|
||||
GetIEditor()->GetDocument()->DoFileSave();
|
||||
}
|
||||
else
|
||||
{
|
||||
auto* prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
auto* prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
AZ_Assert(prefabEditorEntityOwnershipInterface != nullptr, "PrefabEditorEntityOwnershipInterface is not found.");
|
||||
AZ_Assert(prefabIntegrationInterface != nullptr, "PrefabIntegrationInterface is not found.");
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
prefabIntegrationInterface->ExecuteSavePrefabDialog(rootPrefabTemplateId, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3128,29 +3145,69 @@ bool CCryEditApp::CreateLevel(bool& wasCreateLevelOperationCancelled)
|
||||
bool bIsDocModified = GetIEditor()->GetDocument()->IsModified();
|
||||
if (GetIEditor()->GetDocument()->IsDocumentReady() && bIsDocModified)
|
||||
{
|
||||
QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName());
|
||||
int result = QMessageBox::question(AzToolsFramework::GetActiveWindow(), QObject::tr("Save Level"), str, QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
if (QMessageBox::Yes == result)
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
|
||||
if (!usePrefabSystemForLevels)
|
||||
{
|
||||
if (!GetIEditor()->GetDocument()->DoFileSave())
|
||||
QString str = QObject::tr("Level %1 has been changed. Save Level?").arg(GetIEditor()->GetGameEngine()->GetLevelName());
|
||||
int result = QMessageBox::question(
|
||||
AzToolsFramework::GetActiveWindow(), QObject::tr("Save Level"), str,
|
||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
if (QMessageBox::Yes == result)
|
||||
{
|
||||
if (!GetIEditor()->GetDocument()->DoFileSave())
|
||||
{
|
||||
// if the file save operation failed, assume that the user was informed of why
|
||||
// already and treat it as a cancel
|
||||
wasCreateLevelOperationCancelled = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bIsDocModified = false;
|
||||
}
|
||||
else if (QMessageBox::No == result)
|
||||
{
|
||||
// Set Modified flag to false to prevent show Save unchanged dialog again
|
||||
GetIEditor()->GetDocument()->SetModifiedFlag(false);
|
||||
}
|
||||
else if (QMessageBox::Cancel == result)
|
||||
{
|
||||
// if the file save operation failed, assume that the user was informed of why
|
||||
// already and treat it as a cancel
|
||||
wasCreateLevelOperationCancelled = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto* prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
auto* prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
AZ_Assert(prefabEditorEntityOwnershipInterface != nullptr, "PrefabEditorEntityOwnershipInterface is not found.");
|
||||
AZ_Assert(prefabIntegrationInterface != nullptr, "PrefabIntegrationInterface is not found.");
|
||||
|
||||
bIsDocModified = false;
|
||||
}
|
||||
else if (QMessageBox::No == result)
|
||||
{
|
||||
// Set Modified flag to false to prevent show Save unchanged dialog again
|
||||
GetIEditor()->GetDocument()->SetModifiedFlag(false);
|
||||
}
|
||||
else if (QMessageBox::Cancel == result)
|
||||
{
|
||||
wasCreateLevelOperationCancelled = true;
|
||||
return false;
|
||||
if (prefabEditorEntityOwnershipInterface == nullptr || prefabIntegrationInterface == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
int prefabSaveSelection = prefabIntegrationInterface->ExecuteClosePrefabDialog(rootPrefabTemplateId);
|
||||
|
||||
// In order to get the accept and reject codes of QDialog and QDialogButtonBox aligned, we do (1-prefabSaveSelection) here.
|
||||
// For example, QDialog::Rejected(0) is emitted when dialog is closed. But the int value corresponds to
|
||||
// QDialogButtonBox::AcceptRole(0).
|
||||
switch (1 - prefabSaveSelection)
|
||||
{
|
||||
case QDialogButtonBox::AcceptRole:
|
||||
bIsDocModified = false;
|
||||
break;
|
||||
case QDialogButtonBox::RejectRole:
|
||||
wasCreateLevelOperationCancelled = true;
|
||||
return false;
|
||||
case QDialogButtonBox::InvalidRole:
|
||||
// Set Modified flag to false to prevent show Save unchanged dialog again
|
||||
GetIEditor()->GetDocument()->SetModifiedFlag(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -462,6 +462,7 @@ class CCryDocManager
|
||||
CCrySingleDocTemplate* m_pDefTemplate = nullptr;
|
||||
public:
|
||||
CCryDocManager();
|
||||
virtual ~CCryDocManager() = default;
|
||||
CCrySingleDocTemplate* SetDefaultTemplate(CCrySingleDocTemplate* pNew);
|
||||
// Copied from MFC to get rid of the silly ugly unoverridable doc-type pick dialog
|
||||
virtual void OnFileNew();
|
||||
|
||||
+76
-20
@@ -13,6 +13,7 @@
|
||||
|
||||
// Qt
|
||||
#include <QDateTime>
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
// AzCore
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
@@ -30,7 +31,6 @@
|
||||
#include <AzToolsFramework/UI/UICore/WidgetHelpers.h>
|
||||
#include <AzToolsFramework/UI/Layer/NameConflictWarning.hxx>
|
||||
#include <AzToolsFramework/API/EditorLevelNotificationBus.h>
|
||||
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
|
||||
|
||||
// Editor
|
||||
#include "Settings.h"
|
||||
@@ -132,6 +132,19 @@ CCryEditDoc::CCryEditDoc()
|
||||
RegisterConsoleVariables();
|
||||
|
||||
MainWindow::instance()->GetActionManager()->RegisterActionHandler(ID_FILE_SAVE_AS, this, &CCryEditDoc::OnFileSaveAs);
|
||||
bool isPrefabSystemEnabled = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(isPrefabSystemEnabled, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
if (isPrefabSystemEnabled)
|
||||
{
|
||||
m_prefabSystemComponentInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabSystemComponentInterface>::Get();
|
||||
AZ_Assert(m_prefabSystemComponentInterface, "PrefabSystemComponentInterface is not found.");
|
||||
m_prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
AZ_Assert(m_prefabEditorEntityOwnershipInterface, "PrefabEditorEntityOwnershipInterface is not found.");
|
||||
m_prefabLoaderInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabLoaderInterface>::Get();
|
||||
AZ_Assert(m_prefabLoaderInterface, "PrefabLoaderInterface is not found.");
|
||||
m_prefabIntegrationInterface = AZ::Interface<AzToolsFramework::Prefab::PrefabIntegrationInterface>::Get();
|
||||
AZ_Assert(m_prefabIntegrationInterface, "PrefabIntegrationInterface is not found.");
|
||||
}
|
||||
}
|
||||
|
||||
CCryEditDoc::~CCryEditDoc()
|
||||
@@ -664,19 +677,56 @@ bool CCryEditDoc::SaveModified()
|
||||
return true;
|
||||
}
|
||||
|
||||
auto button = QMessageBox::question(AzToolsFramework::GetActiveWindow(), QString(), tr("Save changes to %1?").arg(GetTitle()),
|
||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
switch (button)
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
|
||||
if (!usePrefabSystemForLevels)
|
||||
{
|
||||
case QMessageBox::Cancel:
|
||||
return false;
|
||||
case QMessageBox::Yes:
|
||||
return DoFileSave();
|
||||
case QMessageBox::No:
|
||||
SetModifiedFlag(false);
|
||||
return true;
|
||||
QMessageBox saveModifiedMessageBox(AzToolsFramework::GetActiveWindow());
|
||||
saveModifiedMessageBox.setText(QString("Save changes to %1?").arg(GetTitle()));
|
||||
saveModifiedMessageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
saveModifiedMessageBox.setIcon(QMessageBox::Icon::Question);
|
||||
|
||||
auto button = QMessageBox::question(
|
||||
AzToolsFramework::GetActiveWindow(), QString(), tr("Save changes to %1?").arg(GetTitle()),
|
||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
switch (button)
|
||||
{
|
||||
case QMessageBox::Cancel:
|
||||
return false;
|
||||
case QMessageBox::Yes:
|
||||
return DoFileSave();
|
||||
case QMessageBox::No:
|
||||
SetModifiedFlag(false);
|
||||
return true;
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
else
|
||||
{
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId = m_prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
if (!m_prefabSystemComponentInterface->AreDirtyTemplatesPresent(rootPrefabTemplateId))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
int prefabSaveSelection = m_prefabIntegrationInterface->ExecuteClosePrefabDialog(rootPrefabTemplateId);
|
||||
|
||||
// In order to get the accept and reject codes of QDialog and QDialogButtonBox aligned, we do (1-prefabSaveSelection) here.
|
||||
// For example, QDialog::Rejected(0) is emitted when dialog is closed. But the int value corresponds to
|
||||
// QDialogButtonBox::AcceptRole(0).
|
||||
switch (1 - prefabSaveSelection)
|
||||
{
|
||||
case QDialogButtonBox::AcceptRole:
|
||||
return true;
|
||||
case QDialogButtonBox::RejectRole:
|
||||
return false;
|
||||
case QDialogButtonBox::InvalidRole:
|
||||
SetModifiedFlag(false);
|
||||
return true;
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
Q_UNREACHABLE();
|
||||
}
|
||||
|
||||
void CCryEditDoc::OnFileSaveAs()
|
||||
@@ -690,6 +740,15 @@ void CCryEditDoc::OnFileSaveAs()
|
||||
if (OnSaveDocument(levelFileDialog.GetFileName()))
|
||||
{
|
||||
CCryEditApp::instance()->AddToRecentFileList(levelFileDialog.GetFileName());
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
|
||||
if (usePrefabSystemForLevels)
|
||||
{
|
||||
AzToolsFramework::Prefab::TemplateId rootPrefabTemplateId =
|
||||
m_prefabEditorEntityOwnershipInterface->GetRootPrefabTemplateId();
|
||||
SetModifiedFlag(m_prefabSystemComponentInterface->AreDirtyTemplatesPresent(rootPrefabTemplateId));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1076,7 +1135,6 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
{
|
||||
// if we're saving to a new folder, we need to copy the old folder tree.
|
||||
auto pIPak = GetIEditor()->GetSystem()->GetIPak();
|
||||
pIPak->Lock();
|
||||
|
||||
const QString oldLevelPattern = QDir(oldLevelFolder).absoluteFilePath("*.*");
|
||||
const QString oldLevelName = Path::GetFile(GetLevelPathName());
|
||||
@@ -1140,7 +1198,6 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
QFile(filePath).setPermissions(QFile::ReadOther | QFile::WriteOther);
|
||||
});
|
||||
|
||||
pIPak->Unlock();
|
||||
}
|
||||
|
||||
// Save level to XML archive.
|
||||
@@ -1238,8 +1295,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
}
|
||||
else
|
||||
{
|
||||
auto prefabEditorEntityOwnershipInterface = AZ::Interface<AzToolsFramework::PrefabEditorEntityOwnershipInterface>::Get();
|
||||
if (prefabEditorEntityOwnershipInterface)
|
||||
if (m_prefabEditorEntityOwnershipInterface)
|
||||
{
|
||||
AZ::IO::FileIOBase* fileIO = AZ::IO::FileIOBase::GetInstance();
|
||||
AZ_Assert(fileIO, "No File IO implementation available");
|
||||
@@ -1250,7 +1306,7 @@ bool CCryEditDoc::SaveLevel(const QString& filename)
|
||||
if (openResult)
|
||||
{
|
||||
AZ::IO::FileIOStream stream(tempSaveFileHandle, AZ::IO::OpenMode::ModeWrite | AZ::IO::OpenMode::ModeBinary, false);
|
||||
contentsAllSaved = prefabEditorEntityOwnershipInterface->SaveToStream(stream, AZStd::string_view(filenameStrData.data(), filenameStrData.size()));
|
||||
contentsAllSaved = m_prefabEditorEntityOwnershipInterface->SaveToStream(stream, AZStd::string_view(filenameStrData.data(), filenameStrData.size()));
|
||||
stream.Close();
|
||||
}
|
||||
}
|
||||
@@ -1755,8 +1811,8 @@ bool CCryEditDoc::BackupBeforeSave(bool force)
|
||||
QString subFolder = theTime.toString("yyyy-MM-dd [HH.mm.ss]");
|
||||
|
||||
QString levelName = GetIEditor()->GetGameEngine()->GetLevelName();
|
||||
QString backupPath = saveBackupPath + "/" + subFolder + "/";
|
||||
gEnv->pCryPak->MakeDir(backupPath.toUtf8().data());
|
||||
QString backupPath = saveBackupPath + "/" + subFolder;
|
||||
AZ::IO::FileIOBase::GetDirectInstance()->CreatePath(backupPath.toUtf8().data());
|
||||
|
||||
QString sourcePath = QString::fromUtf8(resolvedLevelPath) + "/";
|
||||
|
||||
@@ -1970,7 +2026,7 @@ const char* CCryEditDoc::GetTemporaryLevelName() const
|
||||
void CCryEditDoc::DeleteTemporaryLevel()
|
||||
{
|
||||
QString tempLevelPath = (Path::GetEditingGameDataFolder() + "/Levels/" + GetTemporaryLevelName()).c_str();
|
||||
GetIEditor()->GetSystem()->GetIPak()->ClosePacks(tempLevelPath.toUtf8().data(), AZ::IO::IArchive::EPathResolutionRules::FLAGS_ADD_TRAILING_SLASH);
|
||||
GetIEditor()->GetSystem()->GetIPak()->ClosePacks(tempLevelPath.toUtf8().data());
|
||||
CFileUtil::Deltree(tempLevelPath.toUtf8().data(), true);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,13 @@
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include "DocMultiArchive.h"
|
||||
#include <AzToolsFramework/Entity/PrefabEditorEntityOwnershipInterface.h>
|
||||
#include <AzToolsFramework/Entity/SliceEditorEntityOwnershipServiceBus.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabSystemComponentInterface.h>
|
||||
#include <AzToolsFramework/UI/Prefab/PrefabIntegrationInterface.h>
|
||||
#include <AzCore/Component/Component.h>
|
||||
#include <AzQtComponents/Components/Widgets/Card.h>
|
||||
#include <TimeValue.h>
|
||||
#include <IEditor.h>
|
||||
#endif
|
||||
@@ -207,6 +212,10 @@ protected:
|
||||
const char* m_envProbeSliceRelativePath = "EngineAssets/Slices/DefaultLevelSetup.slice";
|
||||
const float m_envProbeHeight = 200.0f;
|
||||
bool m_hasErrors = false; ///< This is used to warn the user that they may lose work when they go to save.
|
||||
AzToolsFramework::Prefab::PrefabSystemComponentInterface* m_prefabSystemComponentInterface = nullptr;
|
||||
AzToolsFramework::PrefabEditorEntityOwnershipInterface* m_prefabEditorEntityOwnershipInterface = nullptr;
|
||||
AzToolsFramework::Prefab::PrefabLoaderInterface* m_prefabLoaderInterface = nullptr;
|
||||
AzToolsFramework::Prefab::PrefabIntegrationInterface* m_prefabIntegrationInterface = nullptr;
|
||||
};
|
||||
|
||||
class CAutoDocNotReady
|
||||
|
||||
@@ -77,10 +77,6 @@ namespace
|
||||
// This closes the current document (level)
|
||||
currentLevel->OnNewDocument();
|
||||
|
||||
// Then we freeze the viewport's input
|
||||
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Broadcast(
|
||||
&AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Events::FreezeViewportInput, true);
|
||||
|
||||
// Then we need to tell the game engine there is no level to render anymore
|
||||
if (GetIEditor()->GetGameEngine())
|
||||
{
|
||||
|
||||
@@ -79,6 +79,8 @@ CPythonScriptsDialog::CPythonScriptsDialog(QWidget* parent)
|
||||
GetGemSourcePathsVisitor(AZ::SettingsRegistryInterface& settingsRegistry)
|
||||
: m_settingsRegistry(settingsRegistry)
|
||||
{}
|
||||
|
||||
using AZ::SettingsRegistryInterface::Visitor::Visit;
|
||||
void Visit(AZStd::string_view path, AZStd::string_view, AZ::SettingsRegistryInterface::Type,
|
||||
AZStd::string_view value) override
|
||||
{
|
||||
|
||||
@@ -42,6 +42,10 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->Field("EnableSceneInspector", &GeneralSettings::m_enableSceneInspector)
|
||||
->Field("RestoreViewportCamera", &GeneralSettings::m_restoreViewportCamera);
|
||||
|
||||
serialize.Class<LevelSaveSettings>()
|
||||
->Version(1)
|
||||
->Field("SaveAllPrefabsPreference", &LevelSaveSettings::m_saveAllPrefabsPreference);
|
||||
|
||||
serialize.Class<Messaging>()
|
||||
->Version(2)
|
||||
->Field("ShowDashboard", &Messaging::m_showDashboard)
|
||||
@@ -64,6 +68,7 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
serialize.Class<CEditorPreferencesPage_General>()
|
||||
->Version(1)
|
||||
->Field("General Settings", &CEditorPreferencesPage_General::m_generalSettings)
|
||||
->Field("Level Save Settings", &CEditorPreferencesPage_General::m_levelSaveSettings)
|
||||
->Field("Messaging", &CEditorPreferencesPage_General::m_messaging)
|
||||
->Field("Undo", &CEditorPreferencesPage_General::m_undo)
|
||||
->Field("Deep Selection", &CEditorPreferencesPage_General::m_deepSelection)
|
||||
@@ -92,6 +97,14 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_restoreViewportCamera, EditorPreferencesGeneralRestoreViewportCameraSettingName, "Keep the original editor viewport transform when exiting game mode.")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &GeneralSettings::m_enableSceneInspector, "Enable Scene Inspector (EXPERIMENTAL)", "Enable the option to inspect the internal data loaded from scene files like .fbx. This is an experimental feature. Restart the Scene Settings if the option is not visible under the Help menu.");
|
||||
|
||||
editContext->Class<LevelSaveSettings>("Level Save Settings", "")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::ComboBox, &LevelSaveSettings::m_saveAllPrefabsPreference, "Save All Prefabs Preference",
|
||||
"This option controls whether prefabs should be saved along with the level")
|
||||
->EnumAttribute(AzToolsFramework::Prefab::SaveAllPrefabsPreference::AskEveryTime, "Ask every time")
|
||||
->EnumAttribute(AzToolsFramework::Prefab::SaveAllPrefabsPreference::SaveAll, "Save all")
|
||||
->EnumAttribute(AzToolsFramework::Prefab::SaveAllPrefabsPreference::SaveNone, "Save none");
|
||||
|
||||
editContext->Class<Messaging>("Messaging", "")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showDashboard, "Show Welcome to Open 3D Engine at startup", "Show Welcome to Open 3D Engine at startup")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Messaging::m_showCircularDependencyError, "Show Error: Circular dependency", "Show an error message when adding a slice instance to the target slice would create a cyclic asset dependency. All other valid overrides will be saved even if this is turned off.");
|
||||
@@ -115,6 +128,7 @@ void CEditorPreferencesPage_General::Reflect(AZ::SerializeContext& serialize)
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_generalSettings, "General Settings", "General Editor Preferences")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_levelSaveSettings, "Level Save Settings", "File>Save")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_messaging, "Messaging", "Messaging")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_undo, "Undo", "Undo Preferences")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_General::m_deepSelection, "Selection", "Selection")
|
||||
@@ -161,6 +175,9 @@ void CEditorPreferencesPage_General::OnApply()
|
||||
MainWindow::instance()->AdjustToolBarIconSize(m_generalSettings.m_toolbarIconSize);
|
||||
}
|
||||
|
||||
//prefabs
|
||||
gSettings.levelSaveSettings.saveAllPrefabsPreference = m_levelSaveSettings.m_saveAllPrefabsPreference;
|
||||
|
||||
//undo
|
||||
gSettings.undoLevels = m_undo.m_undoLevels;
|
||||
|
||||
@@ -190,6 +207,9 @@ void CEditorPreferencesPage_General::InitializeSettings()
|
||||
|
||||
m_generalSettings.m_toolbarIconSize = static_cast<AzQtComponents::ToolBar::ToolBarIconSize>(gSettings.gui.nToolbarIconSize);
|
||||
|
||||
//prefabs
|
||||
m_levelSaveSettings.m_saveAllPrefabsPreference = gSettings.levelSaveSettings.saveAllPrefabsPreference;
|
||||
|
||||
//Messaging
|
||||
m_messaging.m_showDashboard = gSettings.bShowDashboardAtStartup;
|
||||
m_messaging.m_showCircularDependencyError = gSettings.m_showCircularDependencyError;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzQtComponents/Components/Widgets/ToolBar.h>
|
||||
#include <AzToolsFramework/Editor/EditorSettingsAPIBus.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
|
||||
#include <QIcon>
|
||||
|
||||
#include "Settings.h"
|
||||
@@ -57,6 +58,12 @@ private:
|
||||
bool m_enableSceneInspector;
|
||||
};
|
||||
|
||||
struct LevelSaveSettings
|
||||
{
|
||||
AZ_TYPE_INFO(LevelSaveSettings, "{E297DAE3-3985-4BC2-8B43-45F3B1522F6B}");
|
||||
AzToolsFramework::Prefab::SaveAllPrefabsPreference m_saveAllPrefabsPreference;
|
||||
};
|
||||
|
||||
struct Messaging
|
||||
{
|
||||
AZ_TYPE_INFO(Messaging, "{A6AD87CB-E905-409B-A2BF-C43CDCE63B0C}")
|
||||
@@ -89,6 +96,7 @@ private:
|
||||
};
|
||||
|
||||
GeneralSettings m_generalSettings;
|
||||
LevelSaveSettings m_levelSaveSettings;
|
||||
Messaging m_messaging;
|
||||
Undo m_undo;
|
||||
DeepSelection m_deepSelection;
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "EditorPreferencesPageViewportGeneral.h"
|
||||
#include "EditorViewportSettings.h"
|
||||
|
||||
#include <AzQtComponents/Components/StyleManager.h>
|
||||
|
||||
@@ -15,7 +17,6 @@
|
||||
#include "DisplaySettings.h"
|
||||
#include "Settings.h"
|
||||
|
||||
|
||||
void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& serialize)
|
||||
{
|
||||
serialize.Class<General>()
|
||||
@@ -23,7 +24,8 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
|
||||
->Field("Sync2DViews", &General::m_sync2DViews)
|
||||
->Field("DefaultFOV", &General::m_defaultFOV)
|
||||
->Field("DefaultAspectRatio", &General::m_defaultAspectRatio)
|
||||
->Field("EnableContextMenu", &General::m_enableContextMenu);
|
||||
->Field("EnableContextMenu", &General::m_contextMenuEnabled)
|
||||
->Field("StickySelect", &General::m_stickySelectEnabled);
|
||||
|
||||
serialize.Class<Display>()
|
||||
->Version(1)
|
||||
@@ -46,10 +48,12 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
|
||||
->Field("ShowGridGuide", &Display::m_showGridGuide)
|
||||
->Field("DisplayDimensions", &Display::m_displayDimension);
|
||||
|
||||
// clang-format off
|
||||
serialize.Class<MapViewport>()
|
||||
->Version(1)
|
||||
->Field("SwapXY", &MapViewport::m_swapXY)
|
||||
->Field("Resolution", &MapViewport::m_resolution);
|
||||
// clang-format on
|
||||
|
||||
serialize.Class<TextLabels>()
|
||||
->Version(1)
|
||||
@@ -80,31 +84,51 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
|
||||
editContext->Class<General>("General Viewport Settings", "")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &General::m_sync2DViews, "Synchronize 2D Viewports", "Synchronize 2D Viewports")
|
||||
->DataElement(AZ::Edit::UIHandlers::SpinBox, &General::m_defaultFOV, "Perspective View FOV", "Perspective View FOV")
|
||||
->Attribute("Multiplier", RAD2DEG(1))
|
||||
->Attribute(AZ::Edit::Attributes::Min, 1.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 120.0f)
|
||||
->DataElement(AZ::Edit::UIHandlers::SpinBox, &General::m_defaultAspectRatio, "Perspective View Aspect Ratio", "Perspective View Aspect Ratio")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &General::m_enableContextMenu, "Enable Right-Click Context Menu", "Enable Right-Click Context Menu");
|
||||
->Attribute("Multiplier", RAD2DEG(1))
|
||||
->Attribute(AZ::Edit::Attributes::Min, 1.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 120.0f)
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::SpinBox, &General::m_defaultAspectRatio, "Perspective View Aspect Ratio",
|
||||
"Perspective View Aspect Ratio")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &General::m_contextMenuEnabled, "Enable Right-Click Context Menu",
|
||||
"Enable Right-Click Context Menu")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &General::m_stickySelectEnabled, "Enable Sticky Select", "Enable Sticky Select");
|
||||
|
||||
editContext->Class<Display>("Viewport Display Settings", "")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showSafeFrame, "Show 4:3 Aspect Ratio Frame", "Show 4:3 Aspect Ratio Frame")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_highlightSelGeom, "Highlight Selected Geometry", "Highlight Selected Geometry")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_highlightSelVegetation, "Highlight Selected Vegetation", "Highlight Selected Vegetation")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_highlightOnMouseOver, "Highlight Geometry On Mouse Over", "Highlight Geometry On Mouse Over")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_hideMouseCursorWhenCaptured, "Hide Cursor When Captured", "Hide Mouse Cursor When Captured")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_showSafeFrame, "Show 4:3 Aspect Ratio Frame", "Show 4:3 Aspect Ratio Frame")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_highlightSelGeom, "Highlight Selected Geometry", "Highlight Selected Geometry")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_highlightSelVegetation, "Highlight Selected Vegetation",
|
||||
"Highlight Selected Vegetation")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_highlightOnMouseOver, "Highlight Geometry On Mouse Over",
|
||||
"Highlight Geometry On Mouse Over")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_hideMouseCursorWhenCaptured, "Hide Cursor When Captured",
|
||||
"Hide Mouse Cursor When Captured")
|
||||
->DataElement(AZ::Edit::UIHandlers::SpinBox, &Display::m_dragSquareSize, "Drag Square Size", "Drag Square Size")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_displayLinks, "Display Object Links", "Display Object Links")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_displayTracks, "Display Animation Tracks", "Display Animation Tracks")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_alwaysShowRadii, "Always Show Radii", "Always Show Radii")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showBBoxes, "Show Bounding Boxes", "Show Bounding Boxes")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_drawEntityLabels, "Always Draw Entity Labels", "Always Draw Entity Labels")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showTriggerBounds, "Always Show Trigger Bounds", "Always Show Trigger Bounds")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_drawEntityLabels, "Always Draw Entity Labels", "Always Draw Entity Labels")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_showTriggerBounds, "Always Show Trigger Bounds", "Always Show Trigger Bounds")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showIcons, "Show Object Icons", "Show Object Icons")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_distanceScaleIcons, "Scale Object Icons with Distance", "Scale Object Icons with Distance")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showFrozenHelpers, "Show Helpers of Frozen Objects", "Show Helpers of Frozen Objects")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_distanceScaleIcons, "Scale Object Icons with Distance",
|
||||
"Scale Object Icons with Distance")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_showFrozenHelpers, "Show Helpers of Frozen Objects",
|
||||
"Show Helpers of Frozen Objects")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_fillSelectedShapes, "Fill Selected Shapes", "Fill Selected Shapes")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showGridGuide, "Show Snapping Grid Guide", "Show Snapping Grid Guide")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_displayDimension, "Display Dimension Figures", "Display Dimension Figures");
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::CheckBox, &Display::m_displayDimension, "Display Dimension Figures", "Display Dimension Figures");
|
||||
|
||||
editContext->Class<MapViewport>("Map Viewport Settings", "")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &MapViewport::m_swapXY, "Swap X/Y Axis", "Swap X/Y Axis")
|
||||
@@ -113,42 +137,64 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
|
||||
editContext->Class<TextLabels>("Text Label Settings", "")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &TextLabels::m_labelsOn, "Enabled", "Enabled")
|
||||
->DataElement(AZ::Edit::UIHandlers::CheckBox, &TextLabels::m_labelsDistance, "Distance", "Distance")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 100000.f);
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 100000.f);
|
||||
|
||||
editContext->Class<SelectionPreviewColor>("Selection Preview Color Settings", "")
|
||||
->DataElement(AZ::Edit::UIHandlers::Color, &SelectionPreviewColor::m_colorGroupBBox, "Group Bounding Box", "Group Bounding Box")
|
||||
->DataElement(AZ::Edit::UIHandlers::Color, &SelectionPreviewColor::m_colorEntityBBox, "Entity Bounding Box", "Entity Bounding Box")
|
||||
->DataElement(AZ::Edit::UIHandlers::SpinBox, &SelectionPreviewColor::m_fBBoxAlpha, "Bounding Box Highlight Alpha", "Bounding Box Highlight Alpha")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.0f)
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Color, &SelectionPreviewColor::m_colorEntityBBox, "Entity Bounding Box", "Entity Bounding Box")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::SpinBox, &SelectionPreviewColor::m_fBBoxAlpha, "Bounding Box Highlight Alpha",
|
||||
"Bounding Box Highlight Alpha")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.0f)
|
||||
->DataElement(AZ::Edit::UIHandlers::Color, &SelectionPreviewColor::m_geometryHighlightColor, "Geometry Color", "Geometry Color")
|
||||
->DataElement(AZ::Edit::UIHandlers::Color, &SelectionPreviewColor::m_solidBrushGeometryColor, "Solid Brush Geometry Color", "Solid Brush Geometry Color")
|
||||
->DataElement(AZ::Edit::UIHandlers::SpinBox, &SelectionPreviewColor::m_fgeomAlpha, "Geometry Highlight Alpha", "Geometry Highlight Alpha")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.0f)
|
||||
->DataElement(AZ::Edit::UIHandlers::SpinBox, &SelectionPreviewColor::m_childObjectGeomAlpha, "Child Geometry Highlight Alpha", "Child Geometry Highlight Alpha")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.0f);
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Color, &SelectionPreviewColor::m_solidBrushGeometryColor, "Solid Brush Geometry Color",
|
||||
"Solid Brush Geometry Color")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::SpinBox, &SelectionPreviewColor::m_fgeomAlpha, "Geometry Highlight Alpha", "Geometry Highlight Alpha")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.0f)
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::SpinBox, &SelectionPreviewColor::m_childObjectGeomAlpha, "Child Geometry Highlight Alpha",
|
||||
"Child Geometry Highlight Alpha")
|
||||
->Attribute(AZ::Edit::Attributes::Min, 0.0f)
|
||||
->Attribute(AZ::Edit::Attributes::Max, 1.0f);
|
||||
|
||||
editContext->Class<CEditorPreferencesPage_ViewportGeneral>("General Viewport Preferences", "General Viewport Preferences")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_general, "General Viewport Settings", "General Viewport Settings")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_display, "Viewport Display Settings", "Viewport Display Settings")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_map, "Map Viewport Settings", "Map Viewport Settings")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_textLabels, "Text Label Settings", "Text Label Settings")
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_selectionPreviewColor, "Selection Preview Color Settings", "Selection Preview Color Settings");
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_general, "General Viewport Settings",
|
||||
"General Viewport Settings")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_display, "Viewport Display Settings",
|
||||
"Viewport Display Settings")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_map, "Map Viewport Settings",
|
||||
"Map Viewport Settings")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_textLabels, "Text Label Settings",
|
||||
"Text Label Settings")
|
||||
->DataElement(
|
||||
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGeneral::m_selectionPreviewColor,
|
||||
"Selection Preview Color Settings", "Selection Preview Color Settings");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CEditorPreferencesPage_ViewportGeneral::CEditorPreferencesPage_ViewportGeneral()
|
||||
{
|
||||
InitializeSettings();
|
||||
m_icon = QIcon(":/res/Viewport.svg");
|
||||
}
|
||||
|
||||
const char* CEditorPreferencesPage_ViewportGeneral::GetCategory()
|
||||
{
|
||||
return "Viewports";
|
||||
}
|
||||
|
||||
const char* CEditorPreferencesPage_ViewportGeneral::GetTitle()
|
||||
{
|
||||
return "Viewport";
|
||||
@@ -159,14 +205,25 @@ QIcon& CEditorPreferencesPage_ViewportGeneral::GetIcon()
|
||||
return m_icon;
|
||||
}
|
||||
|
||||
void CEditorPreferencesPage_ViewportGeneral::OnCancel()
|
||||
{
|
||||
// noop
|
||||
}
|
||||
|
||||
bool CEditorPreferencesPage_ViewportGeneral::OnQueryCancel()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void CEditorPreferencesPage_ViewportGeneral::OnApply()
|
||||
{
|
||||
CDisplaySettings* ds = GetIEditor()->GetDisplaySettings();
|
||||
|
||||
gSettings.viewports.fDefaultAspectRatio = m_general.m_defaultAspectRatio;
|
||||
gSettings.viewports.fDefaultFov = m_general.m_defaultFOV;
|
||||
gSettings.viewports.bEnableContextMenu = m_general.m_enableContextMenu;
|
||||
gSettings.viewports.bEnableContextMenu = m_general.m_contextMenuEnabled;
|
||||
gSettings.viewports.bSync2DViews = m_general.m_sync2DViews;
|
||||
SandboxEditor::SetStickySelectEnabled(m_general.m_stickySelectEnabled);
|
||||
|
||||
gSettings.viewports.bShowSafeFrame = m_display.m_showSafeFrame;
|
||||
gSettings.viewports.bHighlightSelectedGeometry = m_display.m_highlightSelGeom;
|
||||
@@ -202,19 +259,19 @@ void CEditorPreferencesPage_ViewportGeneral::OnApply()
|
||||
|
||||
gSettings.objectColorSettings.fChildGeomAlpha = m_selectionPreviewColor.m_childObjectGeomAlpha;
|
||||
gSettings.objectColorSettings.entityHighlight = QColor(
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorEntityBBox.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorEntityBBox.GetG() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorEntityBBox.GetB() * 255.0f));
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorEntityBBox.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorEntityBBox.GetG() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorEntityBBox.GetB() * 255.0f));
|
||||
gSettings.objectColorSettings.groupHighlight = QColor(
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorGroupBBox.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorGroupBBox.GetG() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorGroupBBox.GetB() * 255.0f));
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorGroupBBox.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorGroupBBox.GetG() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_colorGroupBBox.GetB() * 255.0f));
|
||||
gSettings.objectColorSettings.fBBoxAlpha = m_selectionPreviewColor.m_fBBoxAlpha;
|
||||
gSettings.objectColorSettings.fGeomAlpha = m_selectionPreviewColor.m_fgeomAlpha;
|
||||
gSettings.objectColorSettings.geometryHighlightColor = QColor(
|
||||
static_cast<int>(m_selectionPreviewColor.m_geometryHighlightColor.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_geometryHighlightColor.GetG() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_geometryHighlightColor.GetB() * 255.0f));
|
||||
static_cast<int>(m_selectionPreviewColor.m_geometryHighlightColor.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_geometryHighlightColor.GetG() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_geometryHighlightColor.GetB() * 255.0f));
|
||||
gSettings.objectColorSettings.solidBrushGeometryColor = QColor(
|
||||
static_cast<int>(m_selectionPreviewColor.m_solidBrushGeometryColor.GetR() * 255.0f),
|
||||
static_cast<int>(m_selectionPreviewColor.m_solidBrushGeometryColor.GetG() * 255.0f),
|
||||
@@ -227,8 +284,9 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings()
|
||||
|
||||
m_general.m_defaultAspectRatio = gSettings.viewports.fDefaultAspectRatio;
|
||||
m_general.m_defaultFOV = gSettings.viewports.fDefaultFov;
|
||||
m_general.m_enableContextMenu = gSettings.viewports.bEnableContextMenu;
|
||||
m_general.m_contextMenuEnabled = gSettings.viewports.bEnableContextMenu;
|
||||
m_general.m_sync2DViews = gSettings.viewports.bSync2DViews;
|
||||
m_general.m_stickySelectEnabled = SandboxEditor::StickySelectEnabled();
|
||||
|
||||
m_display.m_showSafeFrame = gSettings.viewports.bShowSafeFrame;
|
||||
m_display.m_highlightSelGeom = gSettings.viewports.bHighlightSelectedGeometry;
|
||||
@@ -256,10 +314,22 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings()
|
||||
m_textLabels.m_labelsDistance = ds->GetLabelsDistance();
|
||||
|
||||
m_selectionPreviewColor.m_childObjectGeomAlpha = gSettings.objectColorSettings.fChildGeomAlpha;
|
||||
m_selectionPreviewColor.m_colorEntityBBox.Set(static_cast<float>(gSettings.objectColorSettings.entityHighlight.redF()), static_cast<float>(gSettings.objectColorSettings.entityHighlight.greenF()), static_cast<float>(gSettings.objectColorSettings.entityHighlight.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_colorGroupBBox.Set(static_cast<float>(gSettings.objectColorSettings.groupHighlight.redF()), static_cast<float>(gSettings.objectColorSettings.groupHighlight.greenF()), static_cast<float>(gSettings.objectColorSettings.groupHighlight.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_colorEntityBBox.Set(
|
||||
static_cast<float>(gSettings.objectColorSettings.entityHighlight.redF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.entityHighlight.greenF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.entityHighlight.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_colorGroupBBox.Set(
|
||||
static_cast<float>(gSettings.objectColorSettings.groupHighlight.redF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.groupHighlight.greenF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.groupHighlight.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_fBBoxAlpha = gSettings.objectColorSettings.fBBoxAlpha;
|
||||
m_selectionPreviewColor.m_fgeomAlpha = gSettings.objectColorSettings.fGeomAlpha;
|
||||
m_selectionPreviewColor.m_geometryHighlightColor.Set(static_cast<float>(gSettings.objectColorSettings.geometryHighlightColor.redF()), static_cast<float>(gSettings.objectColorSettings.geometryHighlightColor.greenF()), static_cast<float>(gSettings.objectColorSettings.geometryHighlightColor.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_solidBrushGeometryColor.Set(static_cast<float>(gSettings.objectColorSettings.solidBrushGeometryColor.redF()), static_cast<float>(gSettings.objectColorSettings.solidBrushGeometryColor.greenF()), static_cast<float>(gSettings.objectColorSettings.solidBrushGeometryColor.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_geometryHighlightColor.Set(
|
||||
static_cast<float>(gSettings.objectColorSettings.geometryHighlightColor.redF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.geometryHighlightColor.greenF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.geometryHighlightColor.blueF()), 1.0f);
|
||||
m_selectionPreviewColor.m_solidBrushGeometryColor.Set(
|
||||
static_cast<float>(gSettings.objectColorSettings.solidBrushGeometryColor.redF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.solidBrushGeometryColor.greenF()),
|
||||
static_cast<float>(gSettings.objectColorSettings.solidBrushGeometryColor.blueF()), 1.0f);
|
||||
}
|
||||
|
||||
@@ -5,18 +5,17 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Include/IPreferencesPage.h"
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/Math/Color.h>
|
||||
#include <AzCore/RTTI/RTTI.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <QIcon>
|
||||
|
||||
|
||||
class CEditorPreferencesPage_ViewportGeneral
|
||||
: public IPreferencesPage
|
||||
class CEditorPreferencesPage_ViewportGeneral : public IPreferencesPage
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(CEditorPreferencesPage_ViewportGeneral, "{8511FF7F-F774-47E1-A99B-3DE3A867E403}", IPreferencesPage)
|
||||
@@ -26,12 +25,12 @@ public:
|
||||
CEditorPreferencesPage_ViewportGeneral();
|
||||
virtual ~CEditorPreferencesPage_ViewportGeneral() = default;
|
||||
|
||||
virtual const char* GetCategory() override { return "Viewports"; }
|
||||
virtual const char* GetCategory() override;
|
||||
virtual const char* GetTitle() override;
|
||||
virtual QIcon& GetIcon() override;
|
||||
virtual void OnApply() override;
|
||||
virtual void OnCancel() override {}
|
||||
virtual bool OnQueryCancel() override { return true; }
|
||||
virtual void OnCancel() override;
|
||||
virtual bool OnQueryCancel() override;
|
||||
|
||||
private:
|
||||
void InitializeSettings();
|
||||
@@ -43,7 +42,8 @@ private:
|
||||
bool m_sync2DViews;
|
||||
float m_defaultFOV;
|
||||
float m_defaultAspectRatio;
|
||||
bool m_enableContextMenu;
|
||||
bool m_contextMenuEnabled;
|
||||
bool m_stickySelectEnabled;
|
||||
};
|
||||
|
||||
struct Display
|
||||
@@ -106,5 +106,3 @@ private:
|
||||
SelectionPreviewColor m_selectionPreviewColor;
|
||||
QIcon m_icon;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace EditorInternal
|
||||
|
||||
void RegisterCoreComponents() override;
|
||||
|
||||
AZ::ComponentTypeList GetRequiredSystemComponents() const;
|
||||
AZ::ComponentTypeList GetRequiredSystemComponents() const override;
|
||||
|
||||
void StartCommon(AZ::Entity* systemEntity) override;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace SandboxEditor
|
||||
constexpr AZStd::string_view AngleSnappingSetting = "/Amazon/Preferences/Editor/AngleSnapping";
|
||||
constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize";
|
||||
constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid";
|
||||
constexpr AZStd::string_view StickySelectSetting = "/Amazon/Preferences/Editor/StickySelect";
|
||||
constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth";
|
||||
constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth";
|
||||
constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed";
|
||||
@@ -158,6 +159,16 @@ namespace SandboxEditor
|
||||
SetRegistry(ShowGridSetting, showing);
|
||||
}
|
||||
|
||||
bool StickySelectEnabled()
|
||||
{
|
||||
return GetRegistry(StickySelectSetting, false);
|
||||
}
|
||||
|
||||
void SetStickySelectEnabled(const bool enabled)
|
||||
{
|
||||
SetRegistry(StickySelectSetting, enabled);
|
||||
}
|
||||
|
||||
float ManipulatorLineBoundWidth()
|
||||
{
|
||||
return aznumeric_cast<float>(GetRegistry(ManipulatorLineBoundWidthSetting, 0.1));
|
||||
|
||||
@@ -47,6 +47,9 @@ namespace SandboxEditor
|
||||
SANDBOX_API bool ShowingGrid();
|
||||
SANDBOX_API void SetShowingGrid(bool showing);
|
||||
|
||||
SANDBOX_API bool StickySelectEnabled();
|
||||
SANDBOX_API void SetStickySelectEnabled(bool enabled);
|
||||
|
||||
SANDBOX_API float ManipulatorLineBoundWidth();
|
||||
SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth);
|
||||
|
||||
|
||||
@@ -295,28 +295,17 @@ void EditorViewportWidget::mousePressEvent(QMouseEvent* event)
|
||||
QtViewport::mousePressEvent(event);
|
||||
}
|
||||
|
||||
AzToolsFramework::ViewportInteraction::MousePick EditorViewportWidget::BuildMousePickInternal(const QPoint& point) const
|
||||
AzToolsFramework::ViewportInteraction::MousePick EditorViewportWidget::BuildMousePick(const QPoint& point) const
|
||||
{
|
||||
using namespace AzToolsFramework::ViewportInteraction;
|
||||
|
||||
MousePick mousePick;
|
||||
mousePick.m_screenCoordinates = ScreenPointFromQPoint(point);
|
||||
const auto& ray = m_renderViewport->ViewportScreenToWorldRay(mousePick.m_screenCoordinates);
|
||||
if (ray.has_value())
|
||||
AzToolsFramework::ViewportInteraction::MousePick mousePick;
|
||||
mousePick.m_screenCoordinates = AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(point);
|
||||
if (const auto& ray = m_renderViewport->ViewportScreenToWorldRay(mousePick.m_screenCoordinates);
|
||||
ray.has_value())
|
||||
{
|
||||
mousePick.m_rayOrigin = ray.value().origin;
|
||||
mousePick.m_rayDirection = ray.value().direction;
|
||||
}
|
||||
return mousePick;
|
||||
}
|
||||
|
||||
AzToolsFramework::ViewportInteraction::MousePick EditorViewportWidget::BuildMousePick(const QPoint& point)
|
||||
{
|
||||
using namespace AzToolsFramework::ViewportInteraction;
|
||||
|
||||
PreWidgetRendering();
|
||||
const MousePick mousePick = BuildMousePickInternal(point);
|
||||
PostWidgetRendering();
|
||||
return mousePick;
|
||||
}
|
||||
|
||||
@@ -325,9 +314,7 @@ AzToolsFramework::ViewportInteraction::MouseInteraction EditorViewportWidget::Bu
|
||||
const AzToolsFramework::ViewportInteraction::KeyboardModifiers modifiers,
|
||||
const AzToolsFramework::ViewportInteraction::MousePick& mousePick) const
|
||||
{
|
||||
using namespace AzToolsFramework::ViewportInteraction;
|
||||
|
||||
MouseInteraction mouse;
|
||||
AzToolsFramework::ViewportInteraction::MouseInteraction mouse;
|
||||
mouse.m_interactionId.m_cameraId = m_viewEntityId;
|
||||
mouse.m_interactionId.m_viewportId = GetViewportId();
|
||||
mouse.m_mouseButtons = buttons;
|
||||
@@ -339,11 +326,11 @@ AzToolsFramework::ViewportInteraction::MouseInteraction EditorViewportWidget::Bu
|
||||
AzToolsFramework::ViewportInteraction::MouseInteraction EditorViewportWidget::BuildMouseInteraction(
|
||||
const Qt::MouseButtons buttons, const Qt::KeyboardModifiers modifiers, const QPoint& point)
|
||||
{
|
||||
using namespace AzToolsFramework::ViewportInteraction;
|
||||
namespace AztfVi = AzToolsFramework::ViewportInteraction;
|
||||
|
||||
return BuildMouseInteractionInternal(
|
||||
BuildMouseButtons(buttons),
|
||||
BuildKeyboardModifiers(modifiers),
|
||||
AztfVi::BuildMouseButtons(buttons),
|
||||
AztfVi::BuildKeyboardModifiers(modifiers),
|
||||
BuildMousePick(WidgetToViewport(point)));
|
||||
}
|
||||
|
||||
@@ -682,16 +669,6 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
|
||||
case eNotify_OnEndSceneSave:
|
||||
PopDisableRendering();
|
||||
break;
|
||||
|
||||
case eNotify_OnBeginLoad: // disables viewport input when starting to load an existing level
|
||||
case eNotify_OnBeginCreate: // disables viewport input when starting to create a new level
|
||||
m_freezeViewportInput = true;
|
||||
break;
|
||||
|
||||
case eNotify_OnEndLoad: // enables viewport input when finished loading an existing level
|
||||
case eNotify_OnEndCreate: // enables viewport input when finished creating a new level
|
||||
m_freezeViewportInput = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,8 +698,6 @@ void EditorViewportWidget::OnBeginPrepareRender()
|
||||
return;
|
||||
}
|
||||
|
||||
PreWidgetRendering();
|
||||
|
||||
RenderAll();
|
||||
|
||||
// Draw 2D helpers.
|
||||
@@ -748,8 +723,6 @@ void EditorViewportWidget::OnBeginPrepareRender()
|
||||
|
||||
m_debugDisplay->SetState(prevState);
|
||||
m_debugDisplay->DepthTestOn();
|
||||
|
||||
PostWidgetRendering();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -769,15 +742,14 @@ void EditorViewportWidget::RenderAll()
|
||||
|
||||
if (m_manipulatorManager != nullptr)
|
||||
{
|
||||
using namespace AzToolsFramework::ViewportInteraction;
|
||||
namespace AztfVi = AzToolsFramework::ViewportInteraction;
|
||||
|
||||
m_debugDisplay->DepthTestOff();
|
||||
m_manipulatorManager->DrawManipulators(
|
||||
*m_debugDisplay, GetCameraState(),
|
||||
BuildMouseInteractionInternal(
|
||||
MouseButtons(TranslateMouseButtons(QGuiApplication::mouseButtons())),
|
||||
BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers()),
|
||||
BuildMousePickInternal(WidgetToViewport(mapFromGlobal(QCursor::pos())))));
|
||||
AztfVi::MouseButtons(AztfVi::TranslateMouseButtons(QGuiApplication::mouseButtons())), QueryKeyboardModifiers(),
|
||||
BuildMousePick(WidgetToViewport(mapFromGlobal(QCursor::pos())))));
|
||||
m_debugDisplay->DepthTestOn();
|
||||
}
|
||||
}
|
||||
@@ -950,8 +922,6 @@ AZ::Vector3 EditorViewportWidget::PickTerrain(const AzFramework::ScreenPoint& po
|
||||
|
||||
AZ::EntityId EditorViewportWidget::PickEntity(const AzFramework::ScreenPoint& point)
|
||||
{
|
||||
PreWidgetRendering();
|
||||
|
||||
AZ::EntityId entityId;
|
||||
HitContext hitInfo;
|
||||
hitInfo.view = this;
|
||||
@@ -964,8 +934,6 @@ AZ::EntityId EditorViewportWidget::PickEntity(const AzFramework::ScreenPoint& po
|
||||
}
|
||||
}
|
||||
|
||||
PostWidgetRendering();
|
||||
|
||||
return entityId;
|
||||
}
|
||||
|
||||
@@ -984,43 +952,27 @@ AzFramework::ScreenPoint EditorViewportWidget::ViewportWorldToScreen(const AZ::V
|
||||
return m_renderViewport->ViewportWorldToScreen(worldPosition);
|
||||
}
|
||||
|
||||
bool EditorViewportWidget::IsViewportInputFrozen()
|
||||
{
|
||||
return m_freezeViewportInput;
|
||||
}
|
||||
|
||||
void EditorViewportWidget::FreezeViewportInput(bool freeze)
|
||||
{
|
||||
m_freezeViewportInput = freeze;
|
||||
}
|
||||
|
||||
QWidget* EditorViewportWidget::GetWidgetForViewportContextMenu()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
void EditorViewportWidget::BeginWidgetContext()
|
||||
{
|
||||
PreWidgetRendering();
|
||||
}
|
||||
|
||||
void EditorViewportWidget::EndWidgetContext()
|
||||
{
|
||||
PostWidgetRendering();
|
||||
}
|
||||
|
||||
bool EditorViewportWidget::ShowingWorldSpace()
|
||||
{
|
||||
using namespace AzToolsFramework::ViewportInteraction;
|
||||
return BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers()).Shift();
|
||||
return QueryKeyboardModifiers().Shift();
|
||||
}
|
||||
|
||||
AzToolsFramework::ViewportInteraction::KeyboardModifiers EditorViewportWidget::QueryKeyboardModifiers()
|
||||
{
|
||||
return AzToolsFramework::ViewportInteraction::BuildKeyboardModifiers(QGuiApplication::queryKeyboardModifiers());
|
||||
}
|
||||
|
||||
void EditorViewportWidget::SetViewportId(int id)
|
||||
{
|
||||
CViewport::SetViewportId(id);
|
||||
|
||||
// Clear the cached debugdisplay pointer. we're about to delete that render viewport, and deleting the render
|
||||
// viewport invalidates the debugdisplay.
|
||||
// Clear the cached DebugDisplay pointer. we're about to delete that render viewport, and deleting the render
|
||||
// viewport invalidates the DebugDisplay.
|
||||
m_debugDisplay = nullptr;
|
||||
|
||||
// First delete any existing layout
|
||||
@@ -1085,9 +1037,9 @@ void EditorViewportWidget::SetViewportId(int id)
|
||||
|
||||
void EditorViewportWidget::ConnectViewportInteractionRequestBus()
|
||||
{
|
||||
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler::BusConnect(GetViewportId());
|
||||
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
|
||||
AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
|
||||
AzToolsFramework::ViewportInteraction::EditorModifierKeyRequestBus::Handler::BusConnect();
|
||||
m_viewportUi.ConnectViewportUiBus(GetViewportId());
|
||||
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusConnect();
|
||||
@@ -1098,9 +1050,9 @@ void EditorViewportWidget::DisconnectViewportInteractionRequestBus()
|
||||
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusDisconnect();
|
||||
|
||||
m_viewportUi.DisconnectViewportUiBus();
|
||||
AzToolsFramework::ViewportInteraction::EditorModifierKeyRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusDisconnect();
|
||||
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler::BusDisconnect();
|
||||
}
|
||||
|
||||
namespace AZ::ViewportHelpers
|
||||
@@ -2570,6 +2522,11 @@ float EditorViewportSettings::ManipulatorCircleBoundWidth() const
|
||||
return SandboxEditor::ManipulatorCircleBoundWidth();
|
||||
}
|
||||
|
||||
bool EditorViewportSettings::StickySelectEnabled() const
|
||||
{
|
||||
return SandboxEditor::StickySelectEnabled();
|
||||
}
|
||||
|
||||
AZ_CVAR_EXTERNED(bool, ed_previewGameInFullscreen_once);
|
||||
|
||||
bool EditorViewportWidget::ShouldPreviewFullscreen() const
|
||||
|
||||
@@ -77,6 +77,7 @@ struct EditorViewportSettings : public AzToolsFramework::ViewportInteraction::Vi
|
||||
float AngleStep() const override;
|
||||
float ManipulatorLineBoundWidth() const override;
|
||||
float ManipulatorCircleBoundWidth() const override;
|
||||
bool StickySelectEnabled() const override;
|
||||
};
|
||||
|
||||
// EditorViewportWidget window
|
||||
@@ -89,9 +90,9 @@ class SANDBOX_API EditorViewportWidget final
|
||||
, private Camera::EditorCameraRequestBus::Handler
|
||||
, private Camera::CameraNotificationBus::Handler
|
||||
, private AzFramework::InputSystemCursorConstraintRequestBus::Handler
|
||||
, private AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler
|
||||
, private AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler
|
||||
, private AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler
|
||||
, private AzToolsFramework::ViewportInteraction::EditorModifierKeyRequestBus::Handler
|
||||
, private AzFramework::AssetCatalogEventBus::Handler
|
||||
, private AZ::RPI::SceneNotificationBus::Handler
|
||||
{
|
||||
@@ -201,22 +202,19 @@ private:
|
||||
// AzFramework::InputSystemCursorConstraintRequestBus overrides ...
|
||||
void* GetSystemCursorConstraintWindow() const override;
|
||||
|
||||
// AzToolsFramework::ViewportFreezeRequestBus overrides ...
|
||||
bool IsViewportInputFrozen() override;
|
||||
void FreezeViewportInput(bool freeze) override;
|
||||
|
||||
// AzToolsFramework::MainEditorViewportInteractionRequestBus
|
||||
// AzToolsFramework::MainEditorViewportInteractionRequestBus overrides ...
|
||||
AZ::EntityId PickEntity(const AzFramework::ScreenPoint& point) override;
|
||||
AZ::Vector3 PickTerrain(const AzFramework::ScreenPoint& point) override;
|
||||
float TerrainHeight(const AZ::Vector2& position) override;
|
||||
bool ShowingWorldSpace() override;
|
||||
QWidget* GetWidgetForViewportContextMenu() override;
|
||||
void BeginWidgetContext() override;
|
||||
void EndWidgetContext() override;
|
||||
|
||||
// EditorEntityViewportInteractionRequestBus overrides ...
|
||||
void FindVisibleEntities(AZStd::vector<AZ::EntityId>& visibleEntities) override;
|
||||
|
||||
// EditorModifierKeyRequestBus overrides ...
|
||||
AzToolsFramework::ViewportInteraction::KeyboardModifiers QueryKeyboardModifiers() override;
|
||||
|
||||
// Camera::EditorCameraRequestBus overrides ...
|
||||
void SetViewFromEntityPerspective(const AZ::EntityId& entityId) override;
|
||||
void SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, bool lockCameraMovement) override;
|
||||
@@ -271,7 +269,7 @@ private:
|
||||
// note: The argument passed to parameter **point**, originating
|
||||
// from a Qt event, must first be passed to WidgetToViewport before being
|
||||
// passed to BuildMousePick.
|
||||
AzToolsFramework::ViewportInteraction::MousePick BuildMousePick(const QPoint& point);
|
||||
AzToolsFramework::ViewportInteraction::MousePick BuildMousePick(const QPoint& point) const;
|
||||
|
||||
bool CheckRespondToInput() const;
|
||||
|
||||
@@ -281,7 +279,6 @@ private:
|
||||
void PushDisableRendering();
|
||||
void PopDisableRendering();
|
||||
bool IsRenderingDisabled() const;
|
||||
AzToolsFramework::ViewportInteraction::MousePick BuildMousePickInternal(const QPoint& point) const;
|
||||
|
||||
void RestoreViewportAfterGameMode();
|
||||
|
||||
@@ -386,9 +383,6 @@ private:
|
||||
// Unclear if it's still necessary.
|
||||
QSet<int> m_keyDown;
|
||||
|
||||
// State for ViewportFreezeRequestBus, currently does nothing
|
||||
bool m_freezeViewportInput = false;
|
||||
|
||||
// This widget holds a reference to the manipulator manage because its responsible for drawing manipulators
|
||||
AZStd::shared_ptr<AzToolsFramework::ManipulatorManager> m_manipulatorManager;
|
||||
|
||||
|
||||
@@ -36,8 +36,8 @@ namespace Export
|
||||
public:
|
||||
CMesh();
|
||||
|
||||
virtual int GetFaceCount() const { return static_cast<int>(m_faces.size()); }
|
||||
virtual const Face* GetFaceBuffer() const { return m_faces.size() ? &m_faces[0] : 0; }
|
||||
int GetFaceCount() const override { return static_cast<int>(m_faces.size()); }
|
||||
const Face* GetFaceBuffer() const override { return !m_faces.empty() ? &m_faces[0] : nullptr; }
|
||||
|
||||
private:
|
||||
std::vector<Face> m_faces;
|
||||
@@ -54,13 +54,13 @@ namespace Export
|
||||
CObject(const char* pName);
|
||||
|
||||
int GetVertexCount() const override { return static_cast<int>(m_vertices.size()); }
|
||||
const Vector3D* GetVertexBuffer() const override { return m_vertices.size() ? &m_vertices[0] : nullptr; }
|
||||
const Vector3D* GetVertexBuffer() const override { return !m_vertices.empty() ? &m_vertices[0] : nullptr; }
|
||||
|
||||
int GetNormalCount() const override { return static_cast<int>(m_normals.size()); }
|
||||
const Vector3D* GetNormalBuffer() const override { return m_normals.size() ? &m_normals[0] : nullptr; }
|
||||
const Vector3D* GetNormalBuffer() const override { return !m_normals.empty() ? &m_normals[0] : nullptr; }
|
||||
|
||||
int GetTexCoordCount() const override { return static_cast<int>(m_texCoords.size()); }
|
||||
const UV* GetTexCoordBuffer() const override { return m_texCoords.size() ? &m_texCoords[0] : nullptr; }
|
||||
const UV* GetTexCoordBuffer() const override { return !m_texCoords.empty() ? &m_texCoords[0] : nullptr; }
|
||||
|
||||
int GetMeshCount() const override { return static_cast<int>(m_meshes.size()); }
|
||||
Mesh* GetMesh(int index) const override { return m_meshes[index]; }
|
||||
@@ -68,9 +68,9 @@ namespace Export
|
||||
size_t MeshHash() const override{return m_MeshHash; }
|
||||
|
||||
void SetMaterialName(const char* pName);
|
||||
virtual int GetEntityAnimationDataCount() const {return static_cast<int>(m_entityAnimData.size()); }
|
||||
virtual const EntityAnimData* GetEntityAnimationData(int index) const {return &m_entityAnimData[index]; }
|
||||
virtual void SetEntityAnimationData(EntityAnimData entityData){ m_entityAnimData.push_back(entityData); };
|
||||
int GetEntityAnimationDataCount() const override {return static_cast<int>(m_entityAnimData.size()); }
|
||||
const EntityAnimData* GetEntityAnimationData(int index) const override {return &m_entityAnimData[index]; }
|
||||
void SetEntityAnimationData(EntityAnimData entityData) override{ m_entityAnimData.push_back(entityData); };
|
||||
void SetLastPtr(CBaseObject* pObject){m_pLastObject = pObject; };
|
||||
CBaseObject* GetLastObjectPtr(){return m_pLastObject; };
|
||||
|
||||
@@ -92,9 +92,11 @@ namespace Export
|
||||
: public IData
|
||||
{
|
||||
public:
|
||||
virtual int GetObjectCount() const { return static_cast<int>(m_objects.size()); }
|
||||
virtual Object* GetObject(int index) const { return m_objects[index]; }
|
||||
virtual Object* AddObject(const char* objectName);
|
||||
virtual ~CData() = default;
|
||||
|
||||
int GetObjectCount() const override { return static_cast<int>(m_objects.size()); }
|
||||
Object* GetObject(int index) const override { return m_objects[index]; }
|
||||
Object* AddObject(const char* objectName) override;
|
||||
void Clear();
|
||||
|
||||
private:
|
||||
@@ -117,7 +119,7 @@ public:
|
||||
|
||||
//! Register exporter
|
||||
//! return true if succeed, otherwise false
|
||||
virtual bool RegisterExporter(IExporter* pExporter);
|
||||
bool RegisterExporter(IExporter* pExporter) override;
|
||||
|
||||
//! Export specified geometry
|
||||
//! return true if succeed, otherwise false
|
||||
@@ -139,15 +141,15 @@ public:
|
||||
|
||||
//! Exports the stat obj to the obj file specified
|
||||
//! returns true if succeeded, otherwise false
|
||||
virtual bool ExportSingleStatObj(IStatObj* pStatObj, const char* filename);
|
||||
bool ExportSingleStatObj(IStatObj* pStatObj, const char* filename) override;
|
||||
|
||||
void SetBakedKeysSequenceExport(bool bBaked){m_bBakedKeysSequenceExport = bBaked; };
|
||||
|
||||
void SaveNodeKeysTimeToXML();
|
||||
|
||||
private:
|
||||
void AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh, Matrix34A* pTm = 0);
|
||||
bool AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matrix34A* pTm = 0);
|
||||
void AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh, Matrix34A* pTm = nullptr);
|
||||
bool AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matrix34A* pTm = nullptr);
|
||||
bool AddMeshes(Export::CObject* pObj);
|
||||
bool AddObject(CBaseObject* pBaseObj);
|
||||
void SolveHierarchy();
|
||||
|
||||
@@ -318,7 +318,7 @@ void CGameExporter::ExportLevelInfo(const QString& path)
|
||||
root->setAttr("Name", levelName.toUtf8().data());
|
||||
auto terrain = AzFramework::Terrain::TerrainDataRequestBus::FindFirstHandler();
|
||||
const AZ::Aabb terrainAabb = terrain ? terrain->GetTerrainAabb() : AZ::Aabb::CreateFromPoint(AZ::Vector3::CreateZero());
|
||||
const AZ::Vector2 terrainGridResolution = terrain ? terrain->GetTerrainGridResolution() : AZ::Vector2::CreateOne();
|
||||
const AZ::Vector2 terrainGridResolution = terrain ? terrain->GetTerrainHeightQueryResolution() : AZ::Vector2::CreateOne();
|
||||
const int compiledHeightmapSize = static_cast<int>(terrainAabb.GetXExtent() / terrainGridResolution.GetX());
|
||||
root->setAttr("HeightmapSize", compiledHeightmapSize);
|
||||
|
||||
@@ -432,25 +432,6 @@ void CGameExporter::ExportFileList(const QString& path, const QString& levelName
|
||||
newFileNode->setAttr("src", handle.m_filename.data());
|
||||
newFileNode->setAttr("dest", handle.m_filename.data());
|
||||
newFileNode->setAttr("size", handle.m_fileDesc.nSize);
|
||||
|
||||
unsigned char md5[16];
|
||||
AZStd::string filenameToHash = GetIEditor()->GetGameEngine()->GetLevelPath().toUtf8().data();
|
||||
filenameToHash += "/";
|
||||
filenameToHash += AZStd::string{ handle.m_filename.data(), handle.m_filename.size() };
|
||||
if (gEnv->pCryPak->ComputeMD5(filenameToHash.data(), md5))
|
||||
{
|
||||
char md5string[33];
|
||||
sprintf_s(md5string, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
md5[0], md5[1], md5[2], md5[3],
|
||||
md5[4], md5[5], md5[6], md5[7],
|
||||
md5[8], md5[9], md5[10], md5[11],
|
||||
md5[12], md5[13], md5[14], md5[15]);
|
||||
newFileNode->setAttr("md5", md5string);
|
||||
}
|
||||
else
|
||||
{
|
||||
newFileNode->setAttr("md5", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (handle = gEnv->pCryPak->FindNext(handle));
|
||||
|
||||
@@ -632,14 +632,7 @@ void CEditorImpl::SetReferenceCoordSys(RefCoordSys refCoords)
|
||||
CViewport* pViewport = GetActiveView();
|
||||
if (pViewport)
|
||||
{
|
||||
//Pre and Post widget rendering calls are made here to make sure that the proper camera state is set.
|
||||
//MakeConstructionPlane will make a call to ViewToWorldRay which needs the correct camera state
|
||||
//in the CRenderViewport to be set.
|
||||
pViewport->PreWidgetRendering();
|
||||
|
||||
pViewport->MakeConstructionPlane(GetIEditor()->GetAxisConstrains());
|
||||
|
||||
pViewport->PostWidgetRendering();
|
||||
}
|
||||
|
||||
Notify(eNotify_OnRefCoordSysChange);
|
||||
|
||||
+141
-141
@@ -79,70 +79,70 @@ public:
|
||||
|
||||
|
||||
void SetGameEngine(CGameEngine* ge);
|
||||
void DeleteThis() { delete this; };
|
||||
IEditorClassFactory* GetClassFactory();
|
||||
CEditorCommandManager* GetCommandManager() { return m_pCommandManager; };
|
||||
ICommandManager* GetICommandManager() { return m_pCommandManager; }
|
||||
void ExecuteCommand(const char* sCommand, ...);
|
||||
void ExecuteCommand(const QString& command);
|
||||
void SetDocument(CCryEditDoc* pDoc);
|
||||
CCryEditDoc* GetDocument() const;
|
||||
void DeleteThis() override { delete this; };
|
||||
IEditorClassFactory* GetClassFactory() override;
|
||||
CEditorCommandManager* GetCommandManager() override { return m_pCommandManager; };
|
||||
ICommandManager* GetICommandManager() override { return m_pCommandManager; }
|
||||
void ExecuteCommand(const char* sCommand, ...) override;
|
||||
void ExecuteCommand(const QString& command) override;
|
||||
void SetDocument(CCryEditDoc* pDoc) override;
|
||||
CCryEditDoc* GetDocument() const override;
|
||||
bool IsLevelLoaded() const override;
|
||||
void SetModifiedFlag(bool modified = true);
|
||||
void SetModifiedModule(EModifiedModule eModifiedModule, bool boSet = true);
|
||||
bool IsLevelExported() const;
|
||||
bool SetLevelExported(bool boExported = true);
|
||||
void SetModifiedFlag(bool modified = true) override;
|
||||
void SetModifiedModule(EModifiedModule eModifiedModule, bool boSet = true) override;
|
||||
bool IsLevelExported() const override;
|
||||
bool SetLevelExported(bool boExported = true) override;
|
||||
void InitFinished();
|
||||
bool IsModified();
|
||||
bool IsInitialized() const{ return m_bInitialized; }
|
||||
bool SaveDocument();
|
||||
ISystem* GetSystem();
|
||||
void WriteToConsole(const char* string) { CLogFile::WriteLine(string); };
|
||||
void WriteToConsole(const QString& string) { CLogFile::WriteLine(string); };
|
||||
bool IsModified() override;
|
||||
bool IsInitialized() const override{ return m_bInitialized; }
|
||||
bool SaveDocument() override;
|
||||
ISystem* GetSystem() override;
|
||||
void WriteToConsole(const char* string) override { CLogFile::WriteLine(string); };
|
||||
void WriteToConsole(const QString& string) override { CLogFile::WriteLine(string); };
|
||||
// Change the message in the status bar
|
||||
void SetStatusText(const QString& pszString);
|
||||
virtual IMainStatusBar* GetMainStatusBar() override;
|
||||
bool ShowConsole([[maybe_unused]] bool show)
|
||||
void SetStatusText(const QString& pszString) override;
|
||||
IMainStatusBar* GetMainStatusBar() override;
|
||||
bool ShowConsole([[maybe_unused]] bool show) override
|
||||
{
|
||||
//if (AfxGetMainWnd())return ((CMainFrame *) (AfxGetMainWnd()))->ShowConsole(show);
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetConsoleVar(const char* var, float value);
|
||||
float GetConsoleVar(const char* var);
|
||||
void SetConsoleVar(const char* var, float value) override;
|
||||
float GetConsoleVar(const char* var) override;
|
||||
//! Query main window of the editor
|
||||
QMainWindow* GetEditorMainWindow() const override
|
||||
{
|
||||
return MainWindow::instance();
|
||||
};
|
||||
|
||||
QString GetPrimaryCDFolder();
|
||||
QString GetPrimaryCDFolder() override;
|
||||
QString GetLevelName() override;
|
||||
QString GetLevelFolder();
|
||||
QString GetLevelDataFolder();
|
||||
QString GetSearchPath(EEditorPathName path);
|
||||
QString GetResolvedUserFolder();
|
||||
bool ExecuteConsoleApp(const QString& CommandLine, QString& OutputText, bool bNoTimeOut = false, bool bShowWindow = false);
|
||||
virtual bool IsInGameMode() override;
|
||||
virtual void SetInGameMode(bool inGame) override;
|
||||
virtual bool IsInSimulationMode() override;
|
||||
virtual bool IsInTestMode() override;
|
||||
virtual bool IsInPreviewMode() override;
|
||||
virtual bool IsInConsolewMode() override;
|
||||
virtual bool IsInLevelLoadTestMode() override;
|
||||
virtual bool IsInMatEditMode() override { return m_bMatEditMode; }
|
||||
QString GetLevelFolder() override;
|
||||
QString GetLevelDataFolder() override;
|
||||
QString GetSearchPath(EEditorPathName path) override;
|
||||
QString GetResolvedUserFolder() override;
|
||||
bool ExecuteConsoleApp(const QString& CommandLine, QString& OutputText, bool bNoTimeOut = false, bool bShowWindow = false) override;
|
||||
bool IsInGameMode() override;
|
||||
void SetInGameMode(bool inGame) override;
|
||||
bool IsInSimulationMode() override;
|
||||
bool IsInTestMode() override;
|
||||
bool IsInPreviewMode() override;
|
||||
bool IsInConsolewMode() override;
|
||||
bool IsInLevelLoadTestMode() override;
|
||||
bool IsInMatEditMode() override { return m_bMatEditMode; }
|
||||
|
||||
//! Enables/Disable updates of editor.
|
||||
void EnableUpdate(bool enable) { m_bUpdates = enable; };
|
||||
void EnableUpdate(bool enable) override { m_bUpdates = enable; };
|
||||
//! Enable/Disable accelerator table, (Enabled by default).
|
||||
void EnableAcceleratos(bool bEnable);
|
||||
CGameEngine* GetGameEngine() { return m_pGameEngine; };
|
||||
CDisplaySettings* GetDisplaySettings() { return m_pDisplaySettings; };
|
||||
const SGizmoParameters& GetGlobalGizmoParameters();
|
||||
CBaseObject* NewObject(const char* typeName, const char* fileName = "", const char* name = "", float x = 0.0f, float y = 0.0f, float z = 0.0f, bool modifyDoc = true);
|
||||
void DeleteObject(CBaseObject* obj);
|
||||
CBaseObject* CloneObject(CBaseObject* obj);
|
||||
IObjectManager* GetObjectManager();
|
||||
void EnableAcceleratos(bool bEnable) override;
|
||||
CGameEngine* GetGameEngine() override { return m_pGameEngine; };
|
||||
CDisplaySettings* GetDisplaySettings() override { return m_pDisplaySettings; };
|
||||
const SGizmoParameters& GetGlobalGizmoParameters() override;
|
||||
CBaseObject* NewObject(const char* typeName, const char* fileName = "", const char* name = "", float x = 0.0f, float y = 0.0f, float z = 0.0f, bool modifyDoc = true) override;
|
||||
void DeleteObject(CBaseObject* obj) override;
|
||||
CBaseObject* CloneObject(CBaseObject* obj) override;
|
||||
IObjectManager* GetObjectManager() override;
|
||||
// This will return a null pointer if CrySystem is not loaded before
|
||||
// Global Sandbox Settings are loaded from the registry before CrySystem
|
||||
// At that stage GetSettingsManager will return null and xml node in
|
||||
@@ -150,27 +150,27 @@ public:
|
||||
// After m_IEditor is created and CrySystem loaded, it is possible
|
||||
// to feed memory node with all necessary data needed for export
|
||||
// (gSettings.Load() and CXTPDockingPaneManager/CXTPDockingPaneLayout Sandbox layout management)
|
||||
CSettingsManager* GetSettingsManager();
|
||||
CSelectionGroup* GetSelection();
|
||||
int ClearSelection();
|
||||
CBaseObject* GetSelectedObject();
|
||||
void SelectObject(CBaseObject* obj);
|
||||
void LockSelection(bool bLock);
|
||||
bool IsSelectionLocked();
|
||||
CSettingsManager* GetSettingsManager() override;
|
||||
CSelectionGroup* GetSelection() override;
|
||||
int ClearSelection() override;
|
||||
CBaseObject* GetSelectedObject() override;
|
||||
void SelectObject(CBaseObject* obj) override;
|
||||
void LockSelection(bool bLock) override;
|
||||
bool IsSelectionLocked() override;
|
||||
|
||||
IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType);
|
||||
CMusicManager* GetMusicManager() { return m_pMusicManager; };
|
||||
IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) override;
|
||||
CMusicManager* GetMusicManager() override { return m_pMusicManager; };
|
||||
|
||||
IEditorFileMonitor* GetFileMonitor() override;
|
||||
void RegisterEventLoopHook(IEventLoopHook* pHook) override;
|
||||
void UnregisterEventLoopHook(IEventLoopHook* pHook) override;
|
||||
IIconManager* GetIconManager();
|
||||
float GetTerrainElevation(float x, float y);
|
||||
Editor::EditorQtApplication* GetEditorQtApplication() { return m_QtApplication; }
|
||||
IIconManager* GetIconManager() override;
|
||||
float GetTerrainElevation(float x, float y) override;
|
||||
Editor::EditorQtApplication* GetEditorQtApplication() override { return m_QtApplication; }
|
||||
const QColor& GetColorByName(const QString& name) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
IMovieSystem* GetMovieSystem()
|
||||
IMovieSystem* GetMovieSystem() override
|
||||
{
|
||||
if (m_pSystem)
|
||||
{
|
||||
@@ -179,37 +179,37 @@ public:
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
CPluginManager* GetPluginManager() { return m_pPluginManager; }
|
||||
CViewManager* GetViewManager();
|
||||
CViewport* GetActiveView();
|
||||
void SetActiveView(CViewport* viewport);
|
||||
CPluginManager* GetPluginManager() override { return m_pPluginManager; }
|
||||
CViewManager* GetViewManager() override;
|
||||
CViewport* GetActiveView() override;
|
||||
void SetActiveView(CViewport* viewport) override;
|
||||
|
||||
CLevelIndependentFileMan* GetLevelIndependentFileMan() { return m_pLevelIndependentFileMan; }
|
||||
CLevelIndependentFileMan* GetLevelIndependentFileMan() override { return m_pLevelIndependentFileMan; }
|
||||
|
||||
void UpdateViews(int flags, const AABB* updateRegion);
|
||||
void ResetViews();
|
||||
void ReloadTrackView();
|
||||
Vec3 GetMarkerPosition() { return m_marker; };
|
||||
void SetMarkerPosition(const Vec3& pos) { m_marker = pos; };
|
||||
void SetSelectedRegion(const AABB& box);
|
||||
void GetSelectedRegion(AABB& box);
|
||||
void UpdateViews(int flags, const AABB* updateRegion) override;
|
||||
void ResetViews() override;
|
||||
void ReloadTrackView() override;
|
||||
Vec3 GetMarkerPosition() override { return m_marker; };
|
||||
void SetMarkerPosition(const Vec3& pos) override { m_marker = pos; };
|
||||
void SetSelectedRegion(const AABB& box) override;
|
||||
void GetSelectedRegion(AABB& box) override;
|
||||
bool AddToolbarItem(uint8 iId, IUIEvent* pIHandler);
|
||||
void SetDataModified();
|
||||
void SetOperationMode(EOperationMode mode);
|
||||
EOperationMode GetOperationMode();
|
||||
void SetDataModified() override;
|
||||
void SetOperationMode(EOperationMode mode) override;
|
||||
EOperationMode GetOperationMode() override;
|
||||
|
||||
ITransformManipulator* ShowTransformManipulator(bool bShow);
|
||||
ITransformManipulator* GetTransformManipulator();
|
||||
void SetAxisConstraints(AxisConstrains axis);
|
||||
AxisConstrains GetAxisConstrains();
|
||||
void SetAxisVectorLock(bool bAxisVectorLock) { m_bAxisVectorLock = bAxisVectorLock; }
|
||||
bool IsAxisVectorLocked() { return m_bAxisVectorLock; }
|
||||
void SetTerrainAxisIgnoreObjects(bool bIgnore);
|
||||
bool IsTerrainAxisIgnoreObjects();
|
||||
void SetReferenceCoordSys(RefCoordSys refCoords);
|
||||
RefCoordSys GetReferenceCoordSys();
|
||||
XmlNodeRef FindTemplate(const QString& templateName);
|
||||
void AddTemplate(const QString& templateName, XmlNodeRef& tmpl);
|
||||
ITransformManipulator* ShowTransformManipulator(bool bShow) override;
|
||||
ITransformManipulator* GetTransformManipulator() override;
|
||||
void SetAxisConstraints(AxisConstrains axis) override;
|
||||
AxisConstrains GetAxisConstrains() override;
|
||||
void SetAxisVectorLock(bool bAxisVectorLock) override { m_bAxisVectorLock = bAxisVectorLock; }
|
||||
bool IsAxisVectorLocked() override { return m_bAxisVectorLock; }
|
||||
void SetTerrainAxisIgnoreObjects(bool bIgnore) override;
|
||||
bool IsTerrainAxisIgnoreObjects() override;
|
||||
void SetReferenceCoordSys(RefCoordSys refCoords) override;
|
||||
RefCoordSys GetReferenceCoordSys() override;
|
||||
XmlNodeRef FindTemplate(const QString& templateName) override;
|
||||
void AddTemplate(const QString& templateName, XmlNodeRef& tmpl) override;
|
||||
|
||||
const QtViewPane* OpenView(QString sViewClassName, bool reuseOpened = true) override;
|
||||
|
||||
@@ -220,87 +220,87 @@ public:
|
||||
*/
|
||||
QWidget* FindView(QString viewClassName) override;
|
||||
|
||||
bool CloseView(const char* sViewClassName);
|
||||
bool SetViewFocus(const char* sViewClassName);
|
||||
bool CloseView(const char* sViewClassName) override;
|
||||
bool SetViewFocus(const char* sViewClassName) override;
|
||||
|
||||
virtual QWidget* OpenWinWidget(WinWidgetId openId) override;
|
||||
virtual WinWidget::WinWidgetManager* GetWinWidgetManager() const override;
|
||||
QWidget* OpenWinWidget(WinWidgetId openId) override;
|
||||
WinWidget::WinWidgetManager* GetWinWidgetManager() const override;
|
||||
|
||||
// close ALL panels related to classId, used when unloading plugins.
|
||||
void CloseView(const GUID& classId);
|
||||
void CloseView(const GUID& classId) override;
|
||||
bool SelectColor(QColor &color, QWidget *parent = 0) override;
|
||||
void Update();
|
||||
SFileVersion GetFileVersion() { return m_fileVersion; };
|
||||
SFileVersion GetProductVersion() { return m_productVersion; };
|
||||
SFileVersion GetFileVersion() override { return m_fileVersion; };
|
||||
SFileVersion GetProductVersion() override { return m_productVersion; };
|
||||
//! Get shader enumerator.
|
||||
CUndoManager* GetUndoManager() { return m_pUndoManager; };
|
||||
void BeginUndo();
|
||||
void RestoreUndo(bool undo);
|
||||
void AcceptUndo(const QString& name);
|
||||
void CancelUndo();
|
||||
void SuperBeginUndo();
|
||||
void SuperAcceptUndo(const QString& name);
|
||||
void SuperCancelUndo();
|
||||
void SuspendUndo();
|
||||
void ResumeUndo();
|
||||
void Undo();
|
||||
void Redo();
|
||||
bool IsUndoRecording();
|
||||
bool IsUndoSuspended();
|
||||
void RecordUndo(IUndoObject* obj);
|
||||
bool FlushUndo(bool isShowMessage = false);
|
||||
bool ClearLastUndoSteps(int steps);
|
||||
bool ClearRedoStack();
|
||||
CUndoManager* GetUndoManager() override { return m_pUndoManager; };
|
||||
void BeginUndo() override;
|
||||
void RestoreUndo(bool undo) override;
|
||||
void AcceptUndo(const QString& name) override;
|
||||
void CancelUndo() override;
|
||||
void SuperBeginUndo() override;
|
||||
void SuperAcceptUndo(const QString& name) override;
|
||||
void SuperCancelUndo() override;
|
||||
void SuspendUndo() override;
|
||||
void ResumeUndo() override;
|
||||
void Undo() override;
|
||||
void Redo() override;
|
||||
bool IsUndoRecording() override;
|
||||
bool IsUndoSuspended() override;
|
||||
void RecordUndo(IUndoObject* obj) override;
|
||||
bool FlushUndo(bool isShowMessage = false) override;
|
||||
bool ClearLastUndoSteps(int steps) override;
|
||||
bool ClearRedoStack() override;
|
||||
//! Retrieve current animation context.
|
||||
CAnimationContext* GetAnimation();
|
||||
CAnimationContext* GetAnimation() override;
|
||||
CTrackViewSequenceManager* GetSequenceManager() override;
|
||||
ITrackViewSequenceManager* GetSequenceManagerInterface() override;
|
||||
|
||||
CToolBoxManager* GetToolBoxManager() { return m_pToolBoxManager; };
|
||||
IErrorReport* GetErrorReport() { return m_pErrorReport; }
|
||||
IErrorReport* GetLastLoadedLevelErrorReport() { return m_pLasLoadedLevelErrorReport; }
|
||||
CToolBoxManager* GetToolBoxManager() override { return m_pToolBoxManager; };
|
||||
IErrorReport* GetErrorReport() override { return m_pErrorReport; }
|
||||
IErrorReport* GetLastLoadedLevelErrorReport() override { return m_pLasLoadedLevelErrorReport; }
|
||||
void StartLevelErrorReportRecording() override;
|
||||
void CommitLevelErrorReport() {SAFE_DELETE(m_pLasLoadedLevelErrorReport); m_pLasLoadedLevelErrorReport = new CErrorReport(*m_pErrorReport); }
|
||||
virtual IFileUtil* GetFileUtil() override { return m_pFileUtil; }
|
||||
void Notify(EEditorNotifyEvent event);
|
||||
void NotifyExcept(EEditorNotifyEvent event, IEditorNotifyListener* listener);
|
||||
void RegisterNotifyListener(IEditorNotifyListener* listener);
|
||||
void UnregisterNotifyListener(IEditorNotifyListener* listener);
|
||||
void CommitLevelErrorReport() override {SAFE_DELETE(m_pLasLoadedLevelErrorReport); m_pLasLoadedLevelErrorReport = new CErrorReport(*m_pErrorReport); }
|
||||
IFileUtil* GetFileUtil() override { return m_pFileUtil; }
|
||||
void Notify(EEditorNotifyEvent event) override;
|
||||
void NotifyExcept(EEditorNotifyEvent event, IEditorNotifyListener* listener) override;
|
||||
void RegisterNotifyListener(IEditorNotifyListener* listener) override;
|
||||
void UnregisterNotifyListener(IEditorNotifyListener* listener) override;
|
||||
//! Register document notifications listener.
|
||||
void RegisterDocListener(IDocListener* listener);
|
||||
void RegisterDocListener(IDocListener* listener) override;
|
||||
//! Unregister document notifications listener.
|
||||
void UnregisterDocListener(IDocListener* listener);
|
||||
void UnregisterDocListener(IDocListener* listener) override;
|
||||
//! Retrieve interface to the source control.
|
||||
ISourceControl* GetSourceControl();
|
||||
ISourceControl* GetSourceControl() override;
|
||||
//! Retrieve true if source control is provided and enabled in settings
|
||||
bool IsSourceControlAvailable() override;
|
||||
//! Only returns true if source control is both available AND currently connected and functioning
|
||||
bool IsSourceControlConnected() override;
|
||||
//! Setup Material Editor mode
|
||||
void SetMatEditMode(bool bIsMatEditMode);
|
||||
CUIEnumsDatabase* GetUIEnumsDatabase() { return m_pUIEnumsDatabase; };
|
||||
void AddUIEnums();
|
||||
void ReduceMemory();
|
||||
CUIEnumsDatabase* GetUIEnumsDatabase() override { return m_pUIEnumsDatabase; };
|
||||
void AddUIEnums() override;
|
||||
void ReduceMemory() override;
|
||||
// Get Export manager
|
||||
IExportManager* GetExportManager();
|
||||
IExportManager* GetExportManager() override;
|
||||
// Set current configuration spec of the editor.
|
||||
void SetEditorConfigSpec(ESystemConfigSpec spec, ESystemConfigPlatform platform);
|
||||
ESystemConfigSpec GetEditorConfigSpec() const;
|
||||
ESystemConfigPlatform GetEditorConfigPlatform() const;
|
||||
void ReloadTemplates();
|
||||
void SetEditorConfigSpec(ESystemConfigSpec spec, ESystemConfigPlatform platform) override;
|
||||
ESystemConfigSpec GetEditorConfigSpec() const override;
|
||||
ESystemConfigPlatform GetEditorConfigPlatform() const override;
|
||||
void ReloadTemplates() override;
|
||||
void AddErrorMessage(const QString& text, const QString& caption);
|
||||
virtual void ShowStatusText(bool bEnable);
|
||||
void ShowStatusText(bool bEnable) override;
|
||||
|
||||
void OnObjectContextMenuOpened(QMenu* pMenu, const CBaseObject* pObject);
|
||||
virtual void RegisterObjectContextMenuExtension(TContextMenuExtensionFunc func) override;
|
||||
void RegisterObjectContextMenuExtension(TContextMenuExtensionFunc func) override;
|
||||
|
||||
virtual SSystemGlobalEnvironment* GetEnv() override;
|
||||
virtual IBaseLibraryManager* GetMaterialManagerLibrary() override; // Vladimir@Conffx
|
||||
virtual IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx
|
||||
virtual IImageUtil* GetImageUtil() override; // Vladimir@conffx
|
||||
virtual SEditorSettings* GetEditorSettings() override;
|
||||
virtual IEditorPanelUtils* GetEditorPanelUtils() override;
|
||||
virtual ILogFile* GetLogFile() override { return m_pLogFile; }
|
||||
SSystemGlobalEnvironment* GetEnv() override;
|
||||
IBaseLibraryManager* GetMaterialManagerLibrary() override; // Vladimir@Conffx
|
||||
IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx
|
||||
IImageUtil* GetImageUtil() override; // Vladimir@conffx
|
||||
SEditorSettings* GetEditorSettings() override;
|
||||
IEditorPanelUtils* GetEditorPanelUtils() override;
|
||||
ILogFile* GetLogFile() override { return m_pLogFile; }
|
||||
|
||||
void UnloadPlugins() override;
|
||||
void LoadPlugins() override;
|
||||
|
||||
@@ -27,7 +27,6 @@ enum ObjectEvent
|
||||
EVENT_OUTOFGAME, //!< Signals that editor is switching out of the game mode.
|
||||
EVENT_REFRESH, //!< Signals that editor is refreshing level.
|
||||
EVENT_DBLCLICK, //!< Signals that object have been double clicked.
|
||||
EVENT_KEEP_HEIGHT, //!< Signals that object must preserve its height over changed terrain.
|
||||
EVENT_RELOAD_ENTITY,//!< Signals that entities scripts must be reloaded.
|
||||
EVENT_RELOAD_GEOM, //!< Signals that all possible geometries should be reloaded.
|
||||
EVENT_UNLOAD_GEOM, //!< Signals that all possible geometries should be unloaded.
|
||||
|
||||
@@ -23,7 +23,7 @@ class LevelTreeModelFilter
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LevelTreeModelFilter(QObject* parent = nullptr);
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
|
||||
void setFilterText(const QString&);
|
||||
QVariant data(const QModelIndex& index, int role) const override;
|
||||
private:
|
||||
|
||||
@@ -25,6 +25,8 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
virtual ~CEditorMock() = default;
|
||||
|
||||
MOCK_METHOD0(DeleteThis, void());
|
||||
MOCK_METHOD0(GetSystem, ISystem*());
|
||||
MOCK_METHOD0(GetClassFactory, IEditorClassFactory* ());
|
||||
|
||||
@@ -35,21 +35,21 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Ovverides from CGizmo
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void GetWorldBounds(AABB& bbox);
|
||||
virtual void Display(DisplayContext& dc);
|
||||
virtual bool HitTest(HitContext& hc);
|
||||
virtual const Matrix34& GetMatrix() const;
|
||||
void GetWorldBounds(AABB& bbox) override;
|
||||
void Display(DisplayContext& dc) override;
|
||||
bool HitTest(HitContext& hc) override;
|
||||
const Matrix34& GetMatrix() const override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ITransformManipulator implementation.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual Matrix34 GetTransformation(RefCoordSys coordSys, IDisplayViewport* view = nullptr) const;
|
||||
virtual void SetTransformation(RefCoordSys coordSys, const Matrix34& tm);
|
||||
virtual bool HitTestManipulator(HitContext& hc);
|
||||
virtual bool MouseCallback(CViewport* view, EMouseEvent event, QPoint& point, int nFlags);
|
||||
virtual void SetAlwaysUseLocal(bool on)
|
||||
Matrix34 GetTransformation(RefCoordSys coordSys, IDisplayViewport* view = nullptr) const override;
|
||||
void SetTransformation(RefCoordSys coordSys, const Matrix34& tm) override;
|
||||
bool HitTestManipulator(HitContext& hc) override;
|
||||
bool MouseCallback(CViewport* view, EMouseEvent event, QPoint& point, int nFlags) override;
|
||||
void SetAlwaysUseLocal(bool on) override
|
||||
{ m_bAlwaysUseLocal = on; }
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -618,12 +618,6 @@ bool CBaseObject::SetPos(const Vec3& pos, int flags)
|
||||
StoreUndo("Position", true, flags);
|
||||
}
|
||||
|
||||
float terrainElevation = AzFramework::Terrain::TerrainDataRequests::GetDefaultTerrainHeight();
|
||||
AzFramework::Terrain::TerrainDataRequestBus::BroadcastResult(terrainElevation
|
||||
, &AzFramework::Terrain::TerrainDataRequests::GetHeightFromFloats
|
||||
, pos.x, pos.y, AzFramework::Terrain::TerrainDataRequests::Sampler::BILINEAR, nullptr);
|
||||
m_height = pos.z - terrainElevation;
|
||||
|
||||
if (!bPositionDelegated)
|
||||
{
|
||||
m_pos = pos;
|
||||
@@ -1275,14 +1269,6 @@ void CBaseObject::OnEvent(ObjectEvent event)
|
||||
{
|
||||
switch (event)
|
||||
{
|
||||
case EVENT_KEEP_HEIGHT:
|
||||
{
|
||||
float h = m_height;
|
||||
float newz = GetIEditor()->GetTerrainElevation(m_pos.x, m_pos.y) + m_height;
|
||||
SetPos(Vec3(m_pos.x, m_pos.y, newz));
|
||||
m_height = h;
|
||||
}
|
||||
break;
|
||||
case EVENT_CONFIG_SPEC_CHANGE:
|
||||
UpdateVisibility(!IsHidden());
|
||||
break;
|
||||
|
||||
@@ -712,7 +712,7 @@ protected:
|
||||
// May be overridden in derived classes to handle helpers scaling.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void SetHelperScale([[maybe_unused]] float scale) {};
|
||||
virtual float GetHelperScale() { return 1; };
|
||||
virtual float GetHelperScale() { return 1.0f; };
|
||||
|
||||
void SetNameInternal(const QString& name) { m_name = name; }
|
||||
|
||||
@@ -743,9 +743,6 @@ private:
|
||||
//! Only called once after creation by ObjectManager.
|
||||
void SetClassDesc(CObjectClassDesc* classDesc);
|
||||
|
||||
// From CObject, (not implemented)
|
||||
virtual void Serialize([[maybe_unused]] CArchive& ar) {};
|
||||
|
||||
EScaleWarningLevel GetScaleWarningLevel() const;
|
||||
ERotationWarningLevel GetRotationWarningLevel() const;
|
||||
|
||||
@@ -798,8 +795,6 @@ private:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Area radius around object, where terrain is flatten and static objects removed.
|
||||
float m_flattenArea;
|
||||
//! Every object keeps for itself height above terrain.
|
||||
float m_height;
|
||||
//! Object's name.
|
||||
QString m_name;
|
||||
//! Class description for this object.
|
||||
|
||||
@@ -82,14 +82,14 @@ public:
|
||||
// Overrides from CBaseObject.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Return type name of Entity.
|
||||
QString GetTypeDescription() const { return GetEntityClass(); };
|
||||
QString GetTypeDescription() const override { return GetEntityClass(); };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool IsSameClass(CBaseObject* obj);
|
||||
bool IsSameClass(CBaseObject* obj) override;
|
||||
|
||||
virtual bool Init(IEditor* ie, CBaseObject* prev, const QString& file);
|
||||
virtual void InitVariables();
|
||||
virtual void Done();
|
||||
bool Init(IEditor* ie, CBaseObject* prev, const QString& file) override;
|
||||
void InitVariables() override;
|
||||
void Done() override;
|
||||
|
||||
void DrawExtraLightInfo (DisplayContext& disp);
|
||||
|
||||
@@ -102,29 +102,30 @@ public:
|
||||
void SetEntityPropertyFloat(const char* name, float value);
|
||||
void SetEntityPropertyString(const char* name, const QString& value);
|
||||
|
||||
virtual int MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags);
|
||||
virtual void OnContextMenu(QMenu* menu);
|
||||
int MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags) override;
|
||||
void OnContextMenu(QMenu* menu) override;
|
||||
|
||||
void SetName(const QString& name);
|
||||
void SetSelected(bool bSelect);
|
||||
void SetName(const QString& name) override;
|
||||
void SetSelected(bool bSelect) override;
|
||||
|
||||
virtual void GetLocalBounds(AABB& box);
|
||||
void GetLocalBounds(AABB& box) override;
|
||||
|
||||
virtual bool HitTest(HitContext& hc);
|
||||
virtual bool HitHelperTest(HitContext& hc);
|
||||
virtual bool HitTestRect(HitContext& hc);
|
||||
void UpdateVisibility(bool bVisible);
|
||||
bool ConvertFromObject(CBaseObject* object);
|
||||
bool HitTest(HitContext& hc) override;
|
||||
bool HitHelperTest(HitContext& hc) override;
|
||||
bool HitTestRect(HitContext& hc) override;
|
||||
void UpdateVisibility(bool bVisible) override;
|
||||
bool ConvertFromObject(CBaseObject* object) override;
|
||||
|
||||
virtual void Serialize(CObjectArchive& ar);
|
||||
virtual void PostLoad(CObjectArchive& ar);
|
||||
using CBaseObject::Serialize;
|
||||
void Serialize(CObjectArchive& ar) override;
|
||||
void PostLoad(CObjectArchive& ar) override;
|
||||
|
||||
XmlNodeRef Export(const QString& levelPath, XmlNodeRef& xmlNode);
|
||||
XmlNodeRef Export(const QString& levelPath, XmlNodeRef& xmlNode) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void OnEvent(ObjectEvent event);
|
||||
void OnEvent(ObjectEvent event) override;
|
||||
|
||||
virtual void SetTransformDelegate(ITransformDelegate* pTransformDelegate) override;
|
||||
void SetTransformDelegate(ITransformDelegate* pTransformDelegate) override;
|
||||
|
||||
// Set attach flags and target
|
||||
enum EAttachmentType
|
||||
@@ -139,15 +140,15 @@ public:
|
||||
EAttachmentType GetAttachType() const { return m_attachmentType; }
|
||||
QString GetAttachTarget() const { return m_attachmentTarget; }
|
||||
|
||||
virtual void SetHelperScale(float scale);
|
||||
virtual float GetHelperScale();
|
||||
void SetHelperScale(float scale) override;
|
||||
float GetHelperScale() override;
|
||||
|
||||
virtual void GatherUsedResources(CUsedResources& resources);
|
||||
virtual bool IsSimilarObject(CBaseObject* pObject);
|
||||
void GatherUsedResources(CUsedResources& resources) override;
|
||||
bool IsSimilarObject(CBaseObject* pObject) override;
|
||||
|
||||
virtual bool HasMeasurementAxis() const { return false; }
|
||||
bool HasMeasurementAxis() const override { return false; }
|
||||
|
||||
virtual bool IsIsolated() const { return false; }
|
||||
bool IsIsolated() const override { return false; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// END CBaseObject
|
||||
@@ -232,7 +233,7 @@ protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Must be called after cloning the object on clone of object.
|
||||
//! This will make sure object references are cloned correctly.
|
||||
virtual void PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx);
|
||||
void PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx) override;
|
||||
|
||||
//! Draw default object items.
|
||||
void DrawProjectorPyramid(DisplayContext& dc, float dist);
|
||||
@@ -264,7 +265,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void DeleteThis() { delete this; };
|
||||
void DeleteThis() override { delete this; };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Radius callbacks.
|
||||
|
||||
@@ -23,14 +23,14 @@ class CGizmoManager
|
||||
: public IGizmoManager
|
||||
{
|
||||
public:
|
||||
void AddGizmo(CGizmo* gizmo);
|
||||
void RemoveGizmo(CGizmo* gizmo);
|
||||
void AddGizmo(CGizmo* gizmo) override;
|
||||
void RemoveGizmo(CGizmo* gizmo) override;
|
||||
|
||||
int GetGizmoCount() const override;
|
||||
CGizmo* GetGizmoByIndex(int nIndex) const override;
|
||||
|
||||
void Display(DisplayContext& dc);
|
||||
bool HitTest(HitContext& hc);
|
||||
void Display(DisplayContext& dc) override;
|
||||
bool HitTest(HitContext& hc) override;
|
||||
|
||||
void DeleteAllTransformManipulators();
|
||||
|
||||
|
||||
@@ -30,10 +30,10 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Ovverides from CGizmo
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void SetName(const char* sName);
|
||||
virtual void GetWorldBounds(AABB& bbox);
|
||||
virtual void Display(DisplayContext& dc);
|
||||
virtual bool HitTest(HitContext& hc);
|
||||
void SetName(const char* sName) override;
|
||||
void GetWorldBounds(AABB& bbox) override;
|
||||
void Display(DisplayContext& dc) override;
|
||||
bool HitTest(HitContext& hc) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SetObjects(CBaseObject* pObject1, CBaseObject* pObject2, const QString& boneName = "");
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
GUID guid;
|
||||
|
||||
public:
|
||||
virtual ~CXMLObjectClassDesc() = default;
|
||||
REFGUID ClassID() override
|
||||
{
|
||||
return guid;
|
||||
|
||||
@@ -103,142 +103,142 @@ public:
|
||||
|
||||
void RegisterObjectClasses();
|
||||
|
||||
CBaseObject* NewObject(CObjectClassDesc* cls, CBaseObject* prev = 0, const QString& file = "", const char* newObjectName = nullptr);
|
||||
CBaseObject* NewObject(const QString& typeName, CBaseObject* prev = 0, const QString& file = "", const char* newEntityName = nullptr);
|
||||
CBaseObject* NewObject(CObjectClassDesc* cls, CBaseObject* prev = 0, const QString& file = "", const char* newObjectName = nullptr) override;
|
||||
CBaseObject* NewObject(const QString& typeName, CBaseObject* prev = 0, const QString& file = "", const char* newEntityName = nullptr) override;
|
||||
|
||||
void DeleteObject(CBaseObject* obj);
|
||||
void DeleteSelection(CSelectionGroup* pSelection);
|
||||
void DeleteAllObjects();
|
||||
CBaseObject* CloneObject(CBaseObject* obj);
|
||||
void DeleteObject(CBaseObject* obj) override;
|
||||
void DeleteSelection(CSelectionGroup* pSelection) override;
|
||||
void DeleteAllObjects() override;
|
||||
CBaseObject* CloneObject(CBaseObject* obj) override;
|
||||
|
||||
void BeginEditParams(CBaseObject* obj, int flags);
|
||||
void EndEditParams(int flags = 0);
|
||||
void BeginEditParams(CBaseObject* obj, int flags) override;
|
||||
void EndEditParams(int flags = 0) override;
|
||||
// Hides all transform manipulators.
|
||||
void HideTransformManipulators();
|
||||
|
||||
//! Get number of objects manager by ObjectManager (not contain sub objects of groups).
|
||||
int GetObjectCount() const;
|
||||
int GetObjectCount() const override;
|
||||
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
void GetObjects(CBaseObjectsArray& objects) const;
|
||||
void GetObjects(CBaseObjectsArray& objects) const override;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
void GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const;
|
||||
void GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const override;
|
||||
|
||||
//! Update objects.
|
||||
void Update();
|
||||
|
||||
//! Display objects on display context.
|
||||
void Display(DisplayContext& dc);
|
||||
void Display(DisplayContext& dc) override;
|
||||
|
||||
//! Called when selecting without selection helpers - this is needed since
|
||||
//! the visible object cache is normally not updated when not displaying helpers.
|
||||
void ForceUpdateVisibleObjectCache(DisplayContext& dc);
|
||||
void ForceUpdateVisibleObjectCache(DisplayContext& dc) override;
|
||||
|
||||
//! Check intersection with objects.
|
||||
//! Find intersection with nearest to ray origin object hit by ray.
|
||||
//! If distance tollerance is specified certain relaxation applied on collision test.
|
||||
//! @return true if hit any object, and fills hitInfo structure.
|
||||
bool HitTest(HitContext& hitInfo);
|
||||
bool HitTest(HitContext& hitInfo) override;
|
||||
|
||||
//! Check intersection with an object.
|
||||
//! @return true if hit, and fills hitInfo structure.
|
||||
bool HitTestObject(CBaseObject* obj, HitContext& hc);
|
||||
bool HitTestObject(CBaseObject* obj, HitContext& hc) override;
|
||||
|
||||
//! Send event to all objects.
|
||||
//! Will cause OnEvent handler to be called on all objects.
|
||||
void SendEvent(ObjectEvent event);
|
||||
void SendEvent(ObjectEvent event) override;
|
||||
|
||||
//! Send event to all objects within given bounding box.
|
||||
//! Will cause OnEvent handler to be called on objects within bounding box.
|
||||
void SendEvent(ObjectEvent event, const AABB& bounds);
|
||||
void SendEvent(ObjectEvent event, const AABB& bounds) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Find object by ID.
|
||||
CBaseObject* FindObject(REFGUID guid) const;
|
||||
CBaseObject* FindObject(REFGUID guid) const override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Find object by name.
|
||||
CBaseObject* FindObject(const QString& sName) const;
|
||||
CBaseObject* FindObject(const QString& sName) const override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Find objects of given type.
|
||||
void FindObjectsOfType(const QMetaObject* pClass, std::vector<CBaseObject*>& result) override;
|
||||
void FindObjectsOfType(ObjectType type, std::vector<CBaseObject*>& result) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Find objects which intersect with a given AABB.
|
||||
virtual void FindObjectsInAABB(const AABB& aabb, std::vector<CBaseObject*>& result) const;
|
||||
void FindObjectsInAABB(const AABB& aabb, std::vector<CBaseObject*>& result) const override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Operations on objects.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Makes object visible or invisible.
|
||||
void HideObject(CBaseObject* obj, bool hide);
|
||||
void HideObject(CBaseObject* obj, bool hide) override;
|
||||
//! Shows the last hidden object based on hidden ID
|
||||
void ShowLastHiddenObject();
|
||||
void ShowLastHiddenObject() override;
|
||||
//! Freeze object, making it unselectable.
|
||||
void FreezeObject(CBaseObject* obj, bool freeze);
|
||||
void FreezeObject(CBaseObject* obj, bool freeze) override;
|
||||
//! Unhide all hidden objects.
|
||||
void UnhideAll();
|
||||
void UnhideAll() override;
|
||||
//! Unfreeze all frozen objects.
|
||||
void UnfreezeAll();
|
||||
void UnfreezeAll() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Object Selection.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool SelectObject(CBaseObject* obj, bool bUseMask = true);
|
||||
void UnselectObject(CBaseObject* obj);
|
||||
bool SelectObject(CBaseObject* obj, bool bUseMask = true) override;
|
||||
void UnselectObject(CBaseObject* obj) override;
|
||||
|
||||
//! Select objects within specified distance from given position.
|
||||
//! Return number of selected objects.
|
||||
int SelectObjects(const AABB& box, bool bUnselect = false);
|
||||
int SelectObjects(const AABB& box, bool bUnselect = false) override;
|
||||
|
||||
virtual void SelectEntities(std::set<CEntityObject*>& s);
|
||||
void SelectEntities(std::set<CEntityObject*>& s) override;
|
||||
|
||||
int MoveObjects(const AABB& box, const Vec3& offset, ImageRotationDegrees rotation, bool bIsCopy = false);
|
||||
int MoveObjects(const AABB& box, const Vec3& offset, ImageRotationDegrees rotation, bool bIsCopy = false) override;
|
||||
|
||||
//! Selects/Unselects all objects within 2d rectangle in given viewport.
|
||||
void SelectObjectsInRect(CViewport* view, const QRect& rect, bool bSelect);
|
||||
void FindObjectsInRect(CViewport* view, const QRect& rect, std::vector<GUID>& guids);
|
||||
void SelectObjectsInRect(CViewport* view, const QRect& rect, bool bSelect) override;
|
||||
void FindObjectsInRect(CViewport* view, const QRect& rect, std::vector<GUID>& guids) override;
|
||||
|
||||
//! Clear default selection set.
|
||||
//! @Return number of objects removed from selection.
|
||||
int ClearSelection();
|
||||
int ClearSelection() override;
|
||||
|
||||
//! Deselect all current selected objects and selects object that were unselected.
|
||||
//! @Return number of selected objects.
|
||||
int InvertSelection();
|
||||
int InvertSelection() override;
|
||||
|
||||
//! Get current selection.
|
||||
CSelectionGroup* GetSelection() const { return m_currSelection; };
|
||||
CSelectionGroup* GetSelection() const override { return m_currSelection; };
|
||||
//! Get named selection.
|
||||
CSelectionGroup* GetSelection(const QString& name) const;
|
||||
CSelectionGroup* GetSelection(const QString& name) const override;
|
||||
// Get selection group names
|
||||
void GetNameSelectionStrings(QStringList& names);
|
||||
void GetNameSelectionStrings(QStringList& names) override;
|
||||
//! Change name of current selection group.
|
||||
//! And store it in list.
|
||||
void NameSelection(const QString& name);
|
||||
void NameSelection(const QString& name) override;
|
||||
//! Set one of name selections as current selection.
|
||||
void SetSelection(const QString& name);
|
||||
void RemoveSelection(const QString& name);
|
||||
void SetSelection(const QString& name) override;
|
||||
void RemoveSelection(const QString& name) override;
|
||||
|
||||
bool IsObjectDeletionAllowed(CBaseObject* pObject);
|
||||
|
||||
//! Delete all objects in selection group.
|
||||
void DeleteSelection();
|
||||
void DeleteSelection() override;
|
||||
|
||||
uint32 ForceID() const{return m_ForceID; }
|
||||
void ForceID(uint32 FID){m_ForceID = FID; }
|
||||
uint32 ForceID() const override{return m_ForceID; }
|
||||
void ForceID(uint32 FID) override{m_ForceID = FID; }
|
||||
|
||||
//! Generates uniq name base on type name of object.
|
||||
QString GenerateUniqueObjectName(const QString& typeName);
|
||||
QString GenerateUniqueObjectName(const QString& typeName) override;
|
||||
//! Register object name in object manager, needed for generating uniq names.
|
||||
void RegisterObjectName(const QString& name);
|
||||
void RegisterObjectName(const QString& name) override;
|
||||
//! Decrease name number and remove if it was last in object manager, needed for generating uniq names.
|
||||
void UpdateRegisterObjectName(const QString& name);
|
||||
//! Enable/Disable generating of unique object names (Enabled by default).
|
||||
//! Return previous value.
|
||||
bool EnableUniqObjectNames(bool bEnable);
|
||||
bool EnableUniqObjectNames(bool bEnable) override;
|
||||
|
||||
//! Register XML template of runtime class.
|
||||
void RegisterClassTemplate(const XmlNodeRef& templ);
|
||||
@@ -249,25 +249,25 @@ public:
|
||||
void RegisterCVars();
|
||||
|
||||
//! Find object class by name.
|
||||
CObjectClassDesc* FindClass(const QString& className);
|
||||
void GetClassCategories(QStringList& categories);
|
||||
CObjectClassDesc* FindClass(const QString& className) override;
|
||||
void GetClassCategories(QStringList& categories) override;
|
||||
void GetClassCategoryToolClassNamePairs(std::vector< std::pair<QString, QString> >& categoryToolClassNamePairs) override;
|
||||
void GetClassTypes(const QString& category, QStringList& types);
|
||||
void GetClassTypes(const QString& category, QStringList& types) override;
|
||||
|
||||
//! Export objects to xml.
|
||||
//! When onlyShared is true ony objects with shared flags exported, overwise only not shared object exported.
|
||||
void Export(const QString& levelPath, XmlNodeRef& rootNode, bool onlyShared);
|
||||
void ExportEntities(XmlNodeRef& rootNode);
|
||||
void Export(const QString& levelPath, XmlNodeRef& rootNode, bool onlyShared) override;
|
||||
void ExportEntities(XmlNodeRef& rootNode) override;
|
||||
|
||||
//! Serialize Objects in manager to specified XML Node.
|
||||
//! @param flags Can be one of SerializeFlags.
|
||||
void Serialize(XmlNodeRef& rootNode, bool bLoading, int flags = SERIALIZE_ALL);
|
||||
void Serialize(XmlNodeRef& rootNode, bool bLoading, int flags = SERIALIZE_ALL) override;
|
||||
|
||||
void SerializeNameSelection(XmlNodeRef& rootNode, bool bLoading);
|
||||
void SerializeNameSelection(XmlNodeRef& rootNode, bool bLoading) override;
|
||||
|
||||
//! Load objects from object archive.
|
||||
//! @param bSelect if set newly loaded object will be selected.
|
||||
void LoadObjects(CObjectArchive& ar, bool bSelect);
|
||||
void LoadObjects(CObjectArchive& ar, bool bSelect) override;
|
||||
|
||||
//! Delete from Object manager all objects without SHARED flag.
|
||||
void DeleteNotSharedObjects();
|
||||
@@ -276,57 +276,57 @@ public:
|
||||
|
||||
bool AddObject(CBaseObject* obj);
|
||||
void RemoveObject(CBaseObject* obj);
|
||||
void ChangeObjectId(REFGUID oldId, REFGUID newId);
|
||||
bool IsDuplicateObjectName(const QString& newName) const
|
||||
void ChangeObjectId(REFGUID oldId, REFGUID newId) override;
|
||||
bool IsDuplicateObjectName(const QString& newName) const override
|
||||
{
|
||||
return FindObject(newName) ? true : false;
|
||||
}
|
||||
void ShowDuplicationMsgWarning(CBaseObject* obj, const QString& newName, bool bShowMsgBox) const;
|
||||
void ChangeObjectName(CBaseObject* obj, const QString& newName);
|
||||
void ShowDuplicationMsgWarning(CBaseObject* obj, const QString& newName, bool bShowMsgBox) const override;
|
||||
void ChangeObjectName(CBaseObject* obj, const QString& newName) override;
|
||||
|
||||
//! Convert object of one type to object of another type.
|
||||
//! Original object is deleted.
|
||||
bool ConvertToType(CBaseObject* pObject, const QString& typeName);
|
||||
bool ConvertToType(CBaseObject* pObject, const QString& typeName) override;
|
||||
|
||||
//! Set new selection callback.
|
||||
//! @return previous selection callback.
|
||||
IObjectSelectCallback* SetSelectCallback(IObjectSelectCallback* callback);
|
||||
IObjectSelectCallback* SetSelectCallback(IObjectSelectCallback* callback) override;
|
||||
|
||||
// Enables/Disables creating of game objects.
|
||||
void SetCreateGameObject(bool enable) { m_createGameObjects = enable; };
|
||||
void SetCreateGameObject(bool enable) override { m_createGameObjects = enable; };
|
||||
//! Return true if objects loaded from xml should immidiatly create game objects associated with them.
|
||||
bool IsCreateGameObjects() const { return m_createGameObjects; };
|
||||
bool IsCreateGameObjects() const override { return m_createGameObjects; };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Get access to gizmo manager.
|
||||
IGizmoManager* GetGizmoManager();
|
||||
IGizmoManager* GetGizmoManager() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Invalidate visibily settings of objects.
|
||||
void InvalidateVisibleList();
|
||||
void InvalidateVisibleList() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ObjectManager notification Callbacks.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void AddObjectEventListener(EventListener* listener);
|
||||
void RemoveObjectEventListener(EventListener* listener);
|
||||
void AddObjectEventListener(EventListener* listener) override;
|
||||
void RemoveObjectEventListener(EventListener* listener) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Used to indicate starting and ending of objects loading.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void StartObjectsLoading(int numObjects);
|
||||
void EndObjectsLoading();
|
||||
void StartObjectsLoading(int numObjects) override;
|
||||
void EndObjectsLoading() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Gathers all resources used by all objects.
|
||||
void GatherUsedResources(CUsedResources& resources);
|
||||
void GatherUsedResources(CUsedResources& resources) override;
|
||||
|
||||
virtual bool IsLightClass(CBaseObject* pObject);
|
||||
bool IsLightClass(CBaseObject* pObject) override;
|
||||
|
||||
virtual void FindAndRenameProperty2(const char* property2Name, const QString& oldValue, const QString& newValue);
|
||||
virtual void FindAndRenameProperty2If(const char* property2Name, const QString& oldValue, const QString& newValue, const char* otherProperty2Name, const QString& otherValue);
|
||||
virtual void FindAndRenameProperty2(const char* property2Name, const QString& oldValue, const QString& newValue) override;
|
||||
virtual void FindAndRenameProperty2If(const char* property2Name, const QString& oldValue, const QString& newValue, const char* otherProperty2Name, const QString& otherValue) override;
|
||||
|
||||
bool IsReloading() const { return m_bInReloading; }
|
||||
bool IsReloading() const override { return m_bInReloading; }
|
||||
void SetSkipUpdate(bool bSkipUpdate) override { m_bSkipObjectUpdate = bSkipUpdate; }
|
||||
|
||||
void SetExportingLevel(bool bExporting) override { m_bLevelExporting = bExporting; }
|
||||
@@ -341,7 +341,7 @@ private:
|
||||
@param objectNode Xml node to serialize object info from.
|
||||
@param pUndoObject Pointer to deleted object for undo.
|
||||
*/
|
||||
CBaseObject* NewObject(CObjectArchive& archive, CBaseObject* pUndoObject, bool bMakeNewId);
|
||||
CBaseObject* NewObject(CObjectArchive& archive, CBaseObject* pUndoObject, bool bMakeNewId) override;
|
||||
|
||||
//! Update visibility of all objects.
|
||||
void UpdateVisibilityList();
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
// Always returns false as Component entity highlighting (accenting) is taken care of elsewhere
|
||||
bool IsHighlighted() { return false; }
|
||||
// Component entity highlighting (accenting) is taken care of elsewhere
|
||||
void DrawHighlight(DisplayContext& /*dc*/) {};
|
||||
void DrawHighlight(DisplayContext& /*dc*/) override {};
|
||||
|
||||
// Don't auto-clone children. Cloning happens in groups with reference fixups,
|
||||
// and individually selected objercts should be cloned as individuals.
|
||||
@@ -164,7 +164,7 @@ protected:
|
||||
|
||||
float GetRadius();
|
||||
|
||||
void DeleteThis() { delete this; };
|
||||
void DeleteThis() override { delete this; };
|
||||
|
||||
bool IsNonLayerAncestorSelected() const;
|
||||
bool IsLayer() const;
|
||||
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// AzToolsFramework::EditorContextMenu::Bus::Handler overrides
|
||||
void PopulateEditorGlobalContextMenu(QMenu* menu, const AZ::Vector2& point, int flags) override;
|
||||
int GetMenuPosition() const;
|
||||
int GetMenuPosition() const override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ protected:
|
||||
void AddFavorites(const AZStd::vector<const AZ::SerializeContext::ClassData*>& classDataContainer) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void rowsInserted(const QModelIndex& parent, int start, int end);
|
||||
void rowsInserted(const QModelIndex& parent, int start, int end) override;
|
||||
|
||||
// Context menu handlers
|
||||
void ShowContextMenu(const QPoint&);
|
||||
|
||||
@@ -255,7 +255,7 @@ protected:
|
||||
bool DropMimeDataAssets(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent);
|
||||
bool CanDropMimeDataAssets(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const;
|
||||
|
||||
QMap<int, QVariant> itemData(const QModelIndex &index) const;
|
||||
QMap<int, QVariant> itemData(const QModelIndex &index) const override;
|
||||
QVariant dataForAll(const QModelIndex& index, int role) const;
|
||||
QVariant dataForName(const QModelIndex& index, int role) const;
|
||||
QVariant dataForVisibility(const QModelIndex& index, int role) const;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
#include "CryFile.h"
|
||||
#include "PerforceSourceControl.h"
|
||||
#include "PasswordDlg.h"
|
||||
|
||||
@@ -28,16 +28,16 @@ public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// IUnkown implementation.
|
||||
virtual HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj);
|
||||
virtual ULONG STDMETHODCALLTYPE AddRef();
|
||||
virtual ULONG STDMETHODCALLTYPE Release();
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj) override;
|
||||
ULONG STDMETHODCALLTYPE AddRef() override;
|
||||
ULONG STDMETHODCALLTYPE Release() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual REFGUID ClassID();
|
||||
REFGUID ClassID() override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual int GetPagesCount();
|
||||
virtual IPreferencesPage* CreateEditorPreferencesPage(int index) override;
|
||||
int GetPagesCount() override;
|
||||
IPreferencesPage* CreateEditorPreferencesPage(int index) override;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_PREFERENCESSTDPAGES_H
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/std/any.h>
|
||||
|
||||
namespace AzToolsFramework
|
||||
@@ -138,7 +139,7 @@ namespace AzToolsFramework
|
||||
/*
|
||||
* Finds a pak file name for a given file.
|
||||
*/
|
||||
virtual const char* GetPakFromFile(const char* filename) = 0;
|
||||
virtual AZ::IO::Path GetPakFromFile(const char* filename) = 0;
|
||||
|
||||
/*
|
||||
* Prints the message to the editor console window.
|
||||
|
||||
@@ -625,7 +625,7 @@ namespace
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
const char* PyGetPakFromFile(const char* filename)
|
||||
AZ::IO::Path PyGetPakFromFile(const char* filename)
|
||||
{
|
||||
auto pIPak = GetIEditor()->GetSystem()->GetIPak();
|
||||
AZ::IO::HandleType fileHandle = pIPak->FOpen(filename, "rb");
|
||||
@@ -633,8 +633,9 @@ namespace
|
||||
{
|
||||
throw std::logic_error("Invalid file name.");
|
||||
}
|
||||
const char* pArchPath = pIPak->GetFileArchivePath(fileHandle);
|
||||
AZ::IO::Path pArchPath = pIPak->GetFileArchivePath(fileHandle);
|
||||
pIPak->FClose(fileHandle);
|
||||
|
||||
return pArchPath;
|
||||
}
|
||||
|
||||
@@ -1040,7 +1041,7 @@ namespace AzToolsFramework
|
||||
return PySetAxisConstraint(pConstrain);
|
||||
}
|
||||
|
||||
const char* PythonEditorComponent::GetPakFromFile(const char* filename)
|
||||
AZ::IO::Path PythonEditorComponent::GetPakFromFile(const char* filename)
|
||||
{
|
||||
return PyGetPakFromFile(filename);
|
||||
}
|
||||
@@ -1114,7 +1115,7 @@ namespace AzToolsFramework
|
||||
addLegacyGeneral(behaviorContext->Method("get_axis_constraint", PyGetAxisConstraint, nullptr, "Gets axis."));
|
||||
addLegacyGeneral(behaviorContext->Method("set_axis_constraint", PySetAxisConstraint, nullptr, "Sets axis."));
|
||||
|
||||
addLegacyGeneral(behaviorContext->Method("get_pak_from_file", PyGetPakFromFile, nullptr, "Finds a pak file name for a given file."));
|
||||
addLegacyGeneral(behaviorContext->Method("get_pak_from_file", [](const char* filename) -> AZStd::string { return PyGetPakFromFile(filename).Native(); }, nullptr, "Finds a pak file name for a given file."));
|
||||
|
||||
addLegacyGeneral(behaviorContext->Method("log", PyLog, nullptr, "Prints the message to the editor console window."));
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace AzToolsFramework
|
||||
|
||||
void SetAxisConstraint(AZStd::string_view pConstrain) override;
|
||||
|
||||
const char* GetPakFromFile(const char* filename) override;
|
||||
AZ::IO::Path GetPakFromFile(const char* filename) override;
|
||||
|
||||
void Log(const char* pMessage) override;
|
||||
|
||||
|
||||
@@ -123,18 +123,18 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
virtual ESystemClassID SystemClassID() { return m_classId; };
|
||||
ESystemClassID SystemClassID() override { return m_classId; };
|
||||
static const GUID& GetClassID()
|
||||
{
|
||||
return TWidget::GetClassID();
|
||||
}
|
||||
|
||||
virtual const GUID& ClassID()
|
||||
const GUID& ClassID() override
|
||||
{
|
||||
return GetClassID();
|
||||
}
|
||||
virtual QString ClassName() { return m_name; };
|
||||
virtual QString Category() { return m_category; };
|
||||
QString ClassName() override { return m_name; };
|
||||
QString Category() override { return m_category; };
|
||||
|
||||
QObject* CreateQObject() const override { return new TWidget(); };
|
||||
QString GetPaneTitle() override { return m_name; };
|
||||
|
||||
@@ -30,7 +30,7 @@ protected:
|
||||
void OnInitDialog() override;
|
||||
|
||||
// Derived Dialogs should override this
|
||||
virtual void GetItems(std::vector<SItem>& outItems);
|
||||
void GetItems(std::vector<SItem>& outItems) override;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_SELECTSEQUENCEDIALOG_H
|
||||
|
||||
@@ -171,7 +171,6 @@ SEditorSettings::SEditorSettings()
|
||||
bBackupOnSave = true;
|
||||
backupOnSaveMaxCount = 3;
|
||||
bApplyConfigSpecInEditor = true;
|
||||
useLowercasePaths = 0;
|
||||
showErrorDialogOnLoad = 1;
|
||||
|
||||
consoleBackgroundColorTheme = AzToolsFramework::ConsoleColorTheme::Dark;
|
||||
@@ -241,6 +240,7 @@ SEditorSettings::SEditorSettings()
|
||||
g_TemporaryLevelName = nullptr;
|
||||
|
||||
sliceSettings.dynamicByDefault = false;
|
||||
levelSaveSettings.saveAllPrefabsPreference = AzToolsFramework::Prefab::SaveAllPrefabsPreference::AskEveryTime;
|
||||
}
|
||||
|
||||
void SEditorSettings::Connect()
|
||||
@@ -643,12 +643,20 @@ void SEditorSettings::Save()
|
||||
AzFramework::ApplicationRequests::Bus::Broadcast(
|
||||
&AzFramework::ApplicationRequests::SetPrefabSystemEnabled, prefabSystem);
|
||||
|
||||
AzToolsFramework::Prefab::PrefabLoaderInterface* prefabLoaderInterface =
|
||||
AZ::Interface<AzToolsFramework::Prefab::PrefabLoaderInterface>::Get();
|
||||
prefabLoaderInterface->SetSaveAllPrefabsPreference(levelSaveSettings.saveAllPrefabsPreference);
|
||||
|
||||
SaveSettingsRegistryFile();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void SEditorSettings::Load()
|
||||
{
|
||||
AzToolsFramework::Prefab::PrefabLoaderInterface* prefabLoaderInterface =
|
||||
AZ::Interface<AzToolsFramework::Prefab::PrefabLoaderInterface>::Get();
|
||||
levelSaveSettings.saveAllPrefabsPreference = prefabLoaderInterface->GetSaveAllPrefabsPreference();
|
||||
|
||||
// Load from Settings Registry
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
prefabSystem, &AzFramework::ApplicationRequests::IsPrefabSystemEnabled);
|
||||
@@ -878,6 +886,7 @@ void SEditorSettings::Load()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
AZ_CVAR(bool, ed_previewGameInFullscreen_once, false, nullptr, AZ::ConsoleFunctorFlags::IsInvisible, "Preview the game (Ctrl+G, \"Play Game\", etc.) in fullscreen once");
|
||||
AZ_CVAR(bool, ed_lowercasepaths, false, nullptr, AZ::ConsoleFunctorFlags::Null, "Convert CCryFile paths to lowercase on Open");
|
||||
|
||||
void SEditorSettings::PostInitApply()
|
||||
{
|
||||
@@ -889,7 +898,6 @@ void SEditorSettings::PostInitApply()
|
||||
// Create CVars.
|
||||
REGISTER_CVAR2("ed_highlightGeometry", &viewports.bHighlightMouseOverGeometry, viewports.bHighlightMouseOverGeometry, 0, "Highlight geometry when mouse over it");
|
||||
REGISTER_CVAR2("ed_showFrozenHelpers", &viewports.nShowFrozenHelpers, viewports.nShowFrozenHelpers, 0, "Show helpers of frozen objects");
|
||||
REGISTER_CVAR2("ed_lowercasepaths", &useLowercasePaths, useLowercasePaths, 0, "generate paths in lowercase");
|
||||
gEnv->pConsole->RegisterInt("fe_fbx_savetempfile", 0, 0, "When importing an FBX file into Facial Editor, this will save out a conversion FSQ to the Animations/temp folder for trouble shooting");
|
||||
|
||||
REGISTER_CVAR2_CB("ed_toolbarIconSize", &gui.nToolbarIconSize, gui.nToolbarIconSize, VF_NULL, "Override size of the toolbar icons 0-default, 16,32,...", ToolbarIconSizeChanged);
|
||||
@@ -1110,11 +1118,17 @@ void SEditorSettings::SaveSettingsRegistryFile()
|
||||
|
||||
AZ::SettingsRegistryMergeUtils::DumperSettings dumperSettings;
|
||||
dumperSettings.m_prettifyOutput = true;
|
||||
dumperSettings.m_jsonPointerPrefix = "/Amazon/Preferences";
|
||||
dumperSettings.m_includeFilter = [](AZStd::string_view path)
|
||||
{
|
||||
AZStd::string_view amazonPrefixPath("/Amazon/Preferences");
|
||||
AZStd::string_view o3dePrefixPath("/O3DE/Preferences");
|
||||
return amazonPrefixPath.starts_with(path.substr(0, amazonPrefixPath.size())) ||
|
||||
o3dePrefixPath.starts_with(path.substr(0, o3dePrefixPath.size()));
|
||||
};
|
||||
|
||||
AZStd::string stringBuffer;
|
||||
AZ::IO::ByteContainerStream stringStream(&stringBuffer);
|
||||
if (!AZ::SettingsRegistryMergeUtils::DumpSettingsRegistryToStream(*registry, "/Amazon/Preferences", stringStream, dumperSettings))
|
||||
if (!AZ::SettingsRegistryMergeUtils::DumpSettingsRegistryToStream(*registry, "", stringStream, dumperSettings))
|
||||
{
|
||||
AZ_Warning("SEditorSettings", false, R"(Unable to save changes to the Editor Preferences registry file at "%s"\n)",
|
||||
editorPreferencesFilePath.c_str());
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <QSettings>
|
||||
|
||||
#include <AzToolsFramework/Editor/EditorSettingsAPIBus.h>
|
||||
#include <AzToolsFramework/Prefab/PrefabLoaderInterface.h>
|
||||
#include <AzCore/JSON/document.h>
|
||||
|
||||
#include <AzQtComponents/Components/Widgets/ToolBar.h>
|
||||
@@ -214,6 +215,11 @@ struct SSliceSettings
|
||||
bool dynamicByDefault;
|
||||
};
|
||||
|
||||
struct SLevelSaveSettings
|
||||
{
|
||||
AzToolsFramework::Prefab::SaveAllPrefabsPreference saveAllPrefabsPreference;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct SAssetBrowserSettings
|
||||
{
|
||||
@@ -334,8 +340,6 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
//! how many save backups to keep
|
||||
int backupOnSaveMaxCount;
|
||||
|
||||
int useLowercasePaths;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Autobackup.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -448,6 +452,8 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
|
||||
SSliceSettings sliceSettings;
|
||||
|
||||
SLevelSaveSettings levelSaveSettings;
|
||||
|
||||
bool prefabSystem = true; ///< Toggle to enable/disable the Prefab system for level entities.
|
||||
|
||||
private:
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
// Description : implementation file
|
||||
|
||||
|
||||
#include "EditorDefs.h"
|
||||
|
||||
#include "StartupLogoDialog.h"
|
||||
|
||||
#include <AzQtComponents/Utilities/PixmapScaleUtilities.h>
|
||||
|
||||
// Qt
|
||||
#include <QPainter>
|
||||
#include <QThread>
|
||||
@@ -22,8 +22,6 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <ui_StartupLogoDialog.h>
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CStartupLogoDialog dialog
|
||||
|
||||
@@ -36,13 +34,16 @@ CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopy
|
||||
m_ui->setupUi(this);
|
||||
|
||||
s_pLogoWindow = this;
|
||||
|
||||
m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg"));
|
||||
setFixedSize(QSize(600, 300));
|
||||
|
||||
// Prepare background image
|
||||
QImage backgroundImage(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg"));
|
||||
m_backgroundImage = QPixmap::fromImage(backgroundImage.scaled(m_enforcedWidth, m_enforcedHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
|
||||
m_backgroundImage = AzQtComponents::ScalePixmapForScreenDpi(
|
||||
QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")),
|
||||
screen(),
|
||||
QSize(m_enforcedWidth, m_enforcedHeight),
|
||||
Qt::IgnoreAspectRatio,
|
||||
Qt::SmoothTransformation
|
||||
);
|
||||
|
||||
// Draw the Open 3D Engine logo from svg
|
||||
m_ui->m_logo->load(QStringLiteral(":/StartupLogoDialog/o3de_logo.svg"));
|
||||
|
||||
@@ -191,56 +191,4 @@ ConsoleTextEdit:focus,
|
||||
border-width: 0px;
|
||||
border-color: #e9e9e9;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* Welcome Screen styling */
|
||||
|
||||
WelcomeScreenDialog QLabel
|
||||
{
|
||||
font-size: 12px;
|
||||
color: #FFFFFF;
|
||||
line-height: 20px;
|
||||
background-color: transparent;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QLabel#currentProjectLabel
|
||||
{
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QPushButton
|
||||
{
|
||||
font-size: 14px;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QWidget#articleViewContainerRoot
|
||||
{
|
||||
background: #444444;
|
||||
}
|
||||
|
||||
WelcomeScreenDialog QWidget#levelViewFTUEContainer
|
||||
{
|
||||
background: #282828;
|
||||
}
|
||||
|
||||
QTableWidget#recentLevelTable::item {
|
||||
background-color: rgb(64,64,64);
|
||||
margin-bottom: 4px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Particle Editor */
|
||||
|
||||
#NumParticlesLabel
|
||||
{
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
#LibrarySearchIcon
|
||||
{
|
||||
max-width: 16px;
|
||||
max-height: 16px;
|
||||
qproperty-iconSize: 16px 16px;
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
protected:
|
||||
void dragMoveEvent(QDragMoveEvent* ev) override;
|
||||
void dragEnterEvent(QDragEnterEvent* ev) override;
|
||||
void dropEvent(QDropEvent* ev);
|
||||
void dropEvent(QDropEvent* ev) override;
|
||||
|
||||
private:
|
||||
void OnTabChanged(int index);
|
||||
|
||||
@@ -35,11 +35,11 @@ public:
|
||||
|
||||
/** Get type of this viewport.
|
||||
*/
|
||||
virtual EViewportType GetType() const { return ET_ViewportMap; }
|
||||
virtual void SetType(EViewportType type);
|
||||
EViewportType GetType() const override { return ET_ViewportMap; }
|
||||
void SetType(EViewportType type) override;
|
||||
|
||||
virtual void ResetContent();
|
||||
virtual void UpdateContent(int flags);
|
||||
void ResetContent() override;
|
||||
void UpdateContent(int flags) override;
|
||||
|
||||
//! Map viewport position to world space position.
|
||||
virtual Vec3 ViewToWorld(const QPoint& vp, bool* collideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
protected:
|
||||
// Draw everything.
|
||||
virtual void Draw(DisplayContext& dc);
|
||||
void Draw(DisplayContext& dc) override;
|
||||
|
||||
private:
|
||||
bool m_bContentsUpdated;
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
#include "CryEdit.h"
|
||||
#include "Viewport.h"
|
||||
|
||||
// Atom Renderer
|
||||
#include <Atom/RPI.Public/RPISystemInterface.h>
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
#include <TrackView/ui_SequenceBatchRenderDialog.h>
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
@@ -1234,6 +1237,13 @@ void CSequenceBatchRenderDialog::OnKickIdleTimout()
|
||||
{
|
||||
componentApplication->TickSystem();
|
||||
}
|
||||
|
||||
// Directly tick the renderer, as it's no longer part of the system tick
|
||||
if (auto rpiSystem = AZ::RPI::RPISystemInterface::Get())
|
||||
{
|
||||
rpiSystem->SimulationTick();
|
||||
rpiSystem->RenderTick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ protected:
|
||||
int m_customFPS;
|
||||
|
||||
void InitializeContext();
|
||||
virtual void OnMovieEvent(IMovieListener::EMovieEvent event, IAnimSequence* pSequence);
|
||||
void OnMovieEvent(IMovieListener::EMovieEvent event, IAnimSequence* pSequence) override;
|
||||
|
||||
void CaptureItemStart();
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
void SetPlayCallback(const std::function<void()>& callback);
|
||||
|
||||
// IAnimationContextListener
|
||||
virtual void OnSequenceChanged(CTrackViewSequence* pNewSequence);
|
||||
virtual void OnTimeChanged(float newTime);
|
||||
void OnSequenceChanged(CTrackViewSequence* pNewSequence) override;
|
||||
void OnTimeChanged(float newTime) override;
|
||||
|
||||
protected:
|
||||
void showEvent(QShowEvent* event) override;
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
void OnSplineTimeMarkerChange();
|
||||
|
||||
// IEditorNotifyListener
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
|
||||
//ITrackViewSequenceListener
|
||||
void OnKeysChanged(CTrackViewSequence* pSequence) override;
|
||||
@@ -109,8 +109,8 @@ public:
|
||||
float GetFPS() const { return m_widget->GetFPS(); }
|
||||
void SetTickDisplayMode(ETVTickMode mode) { m_widget->SetTickDisplayMode(mode); }
|
||||
|
||||
virtual void OnSequenceChanged(CTrackViewSequence* pNewSequence) { m_widget->OnSequenceChanged(pNewSequence); }
|
||||
virtual void OnTimeChanged(float newTime) { m_widget->OnTimeChanged(newTime); }
|
||||
void OnSequenceChanged(CTrackViewSequence* pNewSequence) override { m_widget->OnSequenceChanged(pNewSequence); }
|
||||
void OnTimeChanged(float newTime) override { m_widget->OnTimeChanged(newTime); }
|
||||
|
||||
// ITrackViewSequenceListener delegation to m_widget
|
||||
void OnKeysChanged(CTrackViewSequence* pSequence) override { m_widget->OnKeysChanged(pSequence); }
|
||||
|
||||
@@ -69,10 +69,10 @@ public:
|
||||
void UpdateSequenceLockStatus();
|
||||
|
||||
// IAnimationContextListener
|
||||
virtual void OnSequenceChanged(CTrackViewSequence* pNewSequence) override;
|
||||
void OnSequenceChanged(CTrackViewSequence* pNewSequence) override;
|
||||
|
||||
// ITrackViewSequenceListener
|
||||
virtual void OnSequenceSettingsChanged(CTrackViewSequence* pSequence) override;
|
||||
void OnSequenceSettingsChanged(CTrackViewSequence* pSequence) override;
|
||||
|
||||
void UpdateDopeSheetTime(CTrackViewSequence* pSequence);
|
||||
|
||||
@@ -197,8 +197,8 @@ private:
|
||||
bool processRawInput(MSG* pMsg);
|
||||
#endif
|
||||
|
||||
virtual void OnNodeSelectionChanged(CTrackViewSequence* pSequence) override;
|
||||
virtual void OnNodeRenamed(CTrackViewNode* pNode, const char* pOldName) override;
|
||||
void OnNodeSelectionChanged(CTrackViewSequence* pSequence) override;
|
||||
void OnNodeRenamed(CTrackViewNode* pNode, const char* pOldName) override;
|
||||
|
||||
void OnSequenceAdded(CTrackViewSequence* pSequence) override;
|
||||
void OnSequenceRemoved(CTrackViewSequence* pSequence) override;
|
||||
@@ -209,8 +209,8 @@ private:
|
||||
void AddDialogListeners();
|
||||
void RemoveDialogListeners();
|
||||
|
||||
virtual void BeginUndoTransaction();
|
||||
virtual void EndUndoTransaction();
|
||||
void BeginUndoTransaction() override;
|
||||
void EndUndoTransaction() override;
|
||||
void SaveCurrentSequenceToFBX();
|
||||
void SaveSequenceTimingToXML();
|
||||
|
||||
|
||||
@@ -117,13 +117,14 @@ class CTrackViewKeyBundle
|
||||
public:
|
||||
CTrackViewKeyBundle()
|
||||
: m_bAllOfSameType(true) {}
|
||||
virtual ~CTrackViewKeyBundle() = default;
|
||||
|
||||
virtual bool AreAllKeysOfSameType() const override { return m_bAllOfSameType; }
|
||||
bool AreAllKeysOfSameType() const override { return m_bAllOfSameType; }
|
||||
|
||||
virtual unsigned int GetKeyCount() const override { return static_cast<unsigned int>(m_keys.size()); }
|
||||
virtual CTrackViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; }
|
||||
unsigned int GetKeyCount() const override { return static_cast<unsigned int>(m_keys.size()); }
|
||||
CTrackViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; }
|
||||
|
||||
virtual void SelectKeys(const bool bSelected) override;
|
||||
void SelectKeys(const bool bSelected) override;
|
||||
|
||||
CTrackViewKeyHandle GetSingleSelectedKey();
|
||||
|
||||
|
||||
@@ -100,16 +100,16 @@ public:
|
||||
void Load() override;
|
||||
|
||||
// ITrackViewNode
|
||||
virtual ETrackViewNodeType GetNodeType() const override { return eTVNT_Sequence; }
|
||||
ETrackViewNodeType GetNodeType() const override { return eTVNT_Sequence; }
|
||||
|
||||
virtual AZStd::string GetName() const override { return m_pAnimSequence->GetName(); }
|
||||
virtual bool SetName(const char* pName) override;
|
||||
virtual bool CanBeRenamed() const override { return true; }
|
||||
AZStd::string GetName() const override { return m_pAnimSequence->GetName(); }
|
||||
bool SetName(const char* pName) override;
|
||||
bool CanBeRenamed() const override { return true; }
|
||||
|
||||
// Binding/Unbinding
|
||||
virtual void BindToEditorObjects() override;
|
||||
virtual void UnBindFromEditorObjects() override;
|
||||
virtual bool IsBoundToEditorObjects() const override;
|
||||
void BindToEditorObjects() override;
|
||||
void UnBindFromEditorObjects() override;
|
||||
bool IsBoundToEditorObjects() const override;
|
||||
|
||||
// Time range
|
||||
void SetTimeRange(Range timeRange);
|
||||
@@ -136,10 +136,10 @@ public:
|
||||
uint32 GetCryMovieId() const { return m_pAnimSequence->GetId(); }
|
||||
|
||||
// Rendering
|
||||
virtual void Render(const SAnimContext& animContext) override;
|
||||
void Render(const SAnimContext& animContext) override;
|
||||
|
||||
// Playback control
|
||||
virtual void Animate(const SAnimContext& animContext) override;
|
||||
void Animate(const SAnimContext& animContext) override;
|
||||
void Resume() { m_pAnimSequence->Resume(); }
|
||||
void Pause() { m_pAnimSequence->Pause(); }
|
||||
void StillUpdate() { m_pAnimSequence->StillUpdate(); }
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
void TimeChanged(float newTime) { m_pAnimSequence->TimeChanged(newTime); }
|
||||
|
||||
// Check if it's a group node
|
||||
virtual bool IsGroupNode() const override { return true; }
|
||||
bool IsGroupNode() const override { return true; }
|
||||
|
||||
// Track Events (TODO: Undo?)
|
||||
int GetTrackEventsCount() const { return m_pAnimSequence->GetTrackEventsCount(); }
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
bool IsActiveSequence() const;
|
||||
|
||||
// The root sequence node is always an active director
|
||||
virtual bool IsActiveDirector() const override { return true; }
|
||||
bool IsActiveDirector() const override { return true; }
|
||||
|
||||
// Copy keys to clipboard (in XML form)
|
||||
void CopyKeysToClipboard(const bool bOnlySelectedKeys, const bool bOnlyFromSelectedTracks);
|
||||
@@ -306,15 +306,15 @@ private:
|
||||
// Called when an animation updates needs to be schedules
|
||||
void ForceAnimation();
|
||||
|
||||
virtual void CopyKeysToClipboard(XmlNodeRef& xmlNode, const bool bOnlySelectedKeys, const bool bOnlyFromSelectedTracks) override;
|
||||
void CopyKeysToClipboard(XmlNodeRef& xmlNode, const bool bOnlySelectedKeys, const bool bOnlyFromSelectedTracks) override;
|
||||
|
||||
std::deque<CTrackViewTrack*> GetMatchingTracks(CTrackViewAnimNode* pAnimNode, XmlNodeRef trackNode);
|
||||
void GetMatchedPasteLocationsRec(std::vector<TMatchedTrackLocation>& locations, CTrackViewNode* pCurrentNode, XmlNodeRef clipboardNode);
|
||||
|
||||
virtual void BeginUndoTransaction();
|
||||
virtual void EndUndoTransaction();
|
||||
virtual void BeginRestoreTransaction();
|
||||
virtual void EndRestoreTransaction();
|
||||
void BeginUndoTransaction() override;
|
||||
void EndUndoTransaction() override;
|
||||
void BeginRestoreTransaction() override;
|
||||
void EndRestoreTransaction() override;
|
||||
|
||||
// For record mode on AZ::Entities - connect (or disconnect) to buses for notification of property changes
|
||||
void ConnectToBusesForRecording(const AZ::EntityId& entityIdForBus, bool enableConnection);
|
||||
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
CTrackViewSequenceManager();
|
||||
~CTrackViewSequenceManager();
|
||||
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
|
||||
unsigned int GetCount() const { return static_cast<int>(m_sequences.size()); }
|
||||
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
void OnSequenceAdded(CTrackViewSequence* pSequence);
|
||||
void OnSequenceRemoved(CTrackViewSequence* pSequence);
|
||||
|
||||
virtual void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event);
|
||||
void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) override;
|
||||
|
||||
// AZ::EntitySystemBus
|
||||
void OnEntityNameChanged(const AZ::EntityId& entityId, const AZStd::string& name) override;
|
||||
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
CTrackViewSplineCtrl(QWidget* parent);
|
||||
virtual ~CTrackViewSplineCtrl();
|
||||
|
||||
virtual void ClearSelection();
|
||||
void ClearSelection() override;
|
||||
|
||||
void AddSpline(ISplineInterpolator* pSpline, CTrackViewTrack* pTrack, const QColor& color);
|
||||
void AddSpline(ISplineInterpolator * pSpline, CTrackViewTrack * pTrack, QColor anColorArray[4]);
|
||||
@@ -53,12 +53,12 @@ protected:
|
||||
void wheelEvent(QWheelEvent* event) override;
|
||||
|
||||
private:
|
||||
virtual void SelectKey(ISplineInterpolator* pSpline, int nKey, int nDimension, bool bSelect) override;
|
||||
virtual void SelectRectangle(const QRect& rc, bool bSelect) override;
|
||||
void SelectKey(ISplineInterpolator* pSpline, int nKey, int nDimension, bool bSelect) override;
|
||||
void SelectRectangle(const QRect& rc, bool bSelect) override;
|
||||
|
||||
std::vector<CTrackViewTrack*> m_tracks;
|
||||
|
||||
virtual bool GetTangentHandlePts(QPoint& inTangentPt, QPoint& pt, QPoint& outTangentPt,
|
||||
bool GetTangentHandlePts(QPoint& inTangentPt, QPoint& pt, QPoint& outTangentPt,
|
||||
int nSpline, int nKey, int nDimension) override;
|
||||
void ComputeIncomingTangentAndEaseTo(float& ds, float& easeTo, QPoint inTangentPt,
|
||||
int nSpline, int nKey, int nDimension);
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
void AdjustTCB(float d_tension, float d_continuity, float d_bias);
|
||||
void MoveSelectedTangentHandleTo(const QPoint& point);
|
||||
|
||||
virtual ISplineCtrlUndo* CreateSplineCtrlUndoObject(std::vector<ISplineInterpolator*>& splineContainer);
|
||||
ISplineCtrlUndo* CreateSplineCtrlUndoObject(std::vector<ISplineInterpolator*>& splineContainer) override;
|
||||
|
||||
bool m_bKeysFreeze;
|
||||
bool m_bTangentsFreeze;
|
||||
|
||||
@@ -44,7 +44,7 @@ public slots:
|
||||
QVector<int> Groups() const;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent* event)
|
||||
void paintEvent(QPaintEvent* event) override
|
||||
{
|
||||
if (model() && model()->rowCount() > 0)
|
||||
{
|
||||
|
||||
@@ -149,12 +149,13 @@ bool CFileUtil::ExtractFile(QString& file, bool bMsgBoxAskForExtraction, const c
|
||||
// Check if in pack.
|
||||
if (cryfile.IsInPak())
|
||||
{
|
||||
const char* sPakName = cryfile.GetPakPath();
|
||||
|
||||
if (bMsgBoxAskForExtraction)
|
||||
{
|
||||
AZ::IO::FixedMaxPath sPakName{ cryfile.GetPakPath() };
|
||||
// Cannot edit file in pack, suggest to extract it for editing.
|
||||
if (QMessageBox::critical(QApplication::activeWindow(), QString(), QObject::tr("File %1 is inside a PAK file %2\r\nDo you want it to be extracted for editing ?").arg(file, sPakName), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
|
||||
if (QMessageBox::critical(QApplication::activeWindow(), QString(),
|
||||
QObject::tr("File %1 is inside a PAK file %2\r\nDo you want it to be extracted for editing ?").arg(file, sPakName.c_str()),
|
||||
QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -173,10 +174,9 @@ bool CFileUtil::ExtractFile(QString& file, bool bMsgBoxAskForExtraction, const c
|
||||
if (diskFile.open(QFile::WriteOnly))
|
||||
{
|
||||
// Copy data from packed file to disk file.
|
||||
char* data = new char[cryfile.GetLength()];
|
||||
cryfile.ReadRaw(data, cryfile.GetLength());
|
||||
diskFile.write(data, cryfile.GetLength());
|
||||
delete []data;
|
||||
auto data = AZStd::make_unique<char[]>(cryfile.GetLength());
|
||||
cryfile.ReadRaw(data.get(), cryfile.GetLength());
|
||||
diskFile.write(data.get(), cryfile.GetLength());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -185,7 +185,14 @@ bool CFileUtil::ExtractFile(QString& file, bool bMsgBoxAskForExtraction, const c
|
||||
}
|
||||
else
|
||||
{
|
||||
file = cryfile.GetAdjustedFilename();
|
||||
|
||||
if (auto fileIoBase = AZ::IO::FileIOBase::GetInstance(); fileIoBase != nullptr)
|
||||
{
|
||||
if (AZ::IO::FixedMaxPath resolvedFilePath; fileIoBase->ResolvePath(resolvedFilePath, cryfile.GetFilename()))
|
||||
{
|
||||
file = QString::fromUtf8(resolvedFilePath.c_str(), static_cast<int>(resolvedFilePath.Native().size()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -2157,13 +2164,13 @@ uint32 CFileUtil::GetAttributes(const char* filename, bool bUseSourceControl /*=
|
||||
return SCC_FILE_ATTRIBUTE_READONLY | SCC_FILE_ATTRIBUTE_INPAK;
|
||||
}
|
||||
|
||||
const char* adjustedFile = file.GetAdjustedFilename();
|
||||
if (!AZ::IO::SystemFile::Exists(adjustedFile))
|
||||
auto fileIoBase = AZ::IO::FileIOBase::GetInstance();
|
||||
if (!fileIoBase->Exists(file.GetFilename()))
|
||||
{
|
||||
return SCC_FILE_ATTRIBUTE_INVALID;
|
||||
}
|
||||
|
||||
if (!AZ::IO::SystemFile::IsWritable(adjustedFile))
|
||||
if (fileIoBase->IsReadOnly(file.GetFilename()))
|
||||
{
|
||||
return SCC_FILE_ATTRIBUTE_NORMAL | SCC_FILE_ATTRIBUTE_READONLY;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ bool CPakFile::Open(const char* filename, bool bAbsolutePath)
|
||||
|
||||
if (bAbsolutePath)
|
||||
{
|
||||
m_pArchive = pCryPak->OpenArchive(filename, nullptr, AZ::IO::INestedArchive::FLAGS_ABSOLUTE_PATHS);
|
||||
m_pArchive = pCryPak->OpenArchive(filename, {}, AZ::IO::INestedArchive::FLAGS_ABSOLUTE_PATHS);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -93,7 +93,7 @@ bool CPakFile::OpenForRead(const char* filename)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
m_pArchive = pCryPak->OpenArchive(filename, nullptr, AZ::IO::INestedArchive::FLAGS_OPTIMIZED_READ_ONLY | AZ::IO::INestedArchive::FLAGS_ABSOLUTE_PATHS);
|
||||
m_pArchive = pCryPak->OpenArchive(filename, {}, AZ::IO::INestedArchive::FLAGS_OPTIMIZED_READ_ONLY | AZ::IO::INestedArchive::FLAGS_ABSOLUTE_PATHS);
|
||||
if (m_pArchive)
|
||||
{
|
||||
return true;
|
||||
|
||||
+122
-120
@@ -379,11 +379,11 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
|
||||
public:
|
||||
virtual ~CVariableBase() {}
|
||||
|
||||
void SetName(const QString& name) { m_name = name; };
|
||||
void SetName(const QString& name) override { m_name = name; };
|
||||
//! Get name of parameter.
|
||||
QString GetName() const { return m_name; };
|
||||
QString GetName() const override { return m_name; };
|
||||
|
||||
QString GetHumanName() const
|
||||
QString GetHumanName() const override
|
||||
{
|
||||
if (!m_humanName.isEmpty())
|
||||
{
|
||||
@@ -391,82 +391,82 @@ public:
|
||||
}
|
||||
return m_name;
|
||||
}
|
||||
void SetHumanName(const QString& name) { m_humanName = name; }
|
||||
void SetHumanName(const QString& name) override { m_humanName = name; }
|
||||
|
||||
void SetDescription(const char* desc) { m_description = desc; };
|
||||
void SetDescription(const QString& desc) { m_description = desc; };
|
||||
void SetDescription(const char* desc) override { m_description = desc; };
|
||||
void SetDescription(const QString& desc) override { m_description = desc; };
|
||||
|
||||
//! Get name of parameter.
|
||||
QString GetDescription() const { return m_description; };
|
||||
QString GetDescription() const override { return m_description; };
|
||||
|
||||
EType GetType() const { return IVariable::UNKNOWN; };
|
||||
int GetSize() const { return sizeof(*this); };
|
||||
EType GetType() const override { return IVariable::UNKNOWN; };
|
||||
int GetSize() const override { return sizeof(*this); };
|
||||
|
||||
unsigned char GetDataType() const { return m_dataType; };
|
||||
void SetDataType(unsigned char dataType) { m_dataType = dataType; }
|
||||
unsigned char GetDataType() const override { return m_dataType; };
|
||||
void SetDataType(unsigned char dataType) override { m_dataType = dataType; }
|
||||
|
||||
void SetFlags(int flags) { m_flags = static_cast<uint16>(flags); }
|
||||
int GetFlags() const { return m_flags; }
|
||||
void SetFlagRecursive(EFlags flag) { m_flags |= flag; }
|
||||
void SetFlags(int flags) override { m_flags = static_cast<uint16>(flags); }
|
||||
int GetFlags() const override { return m_flags; }
|
||||
void SetFlagRecursive(EFlags flag) override { m_flags |= flag; }
|
||||
|
||||
void SetUserData(const QVariant &data){ m_userData = data; };
|
||||
QVariant GetUserData() const { return m_userData; }
|
||||
void SetUserData(const QVariant &data) override { m_userData = data; };
|
||||
QVariant GetUserData() const override { return m_userData; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Set methods.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Set([[maybe_unused]] int value) { assert(0); }
|
||||
void Set([[maybe_unused]] bool value) { assert(0); }
|
||||
void Set([[maybe_unused]] float value) { assert(0); }
|
||||
void Set([[maybe_unused]] double value) { assert(0); }
|
||||
void Set([[maybe_unused]] const Vec2& value) { assert(0); }
|
||||
void Set([[maybe_unused]] const Vec3& value) { assert(0); }
|
||||
void Set([[maybe_unused]] const Vec4& value) { assert(0); }
|
||||
void Set([[maybe_unused]] const Ang3& value) { assert(0); }
|
||||
void Set([[maybe_unused]] const Quat& value) { assert(0); }
|
||||
void Set([[maybe_unused]] const QString& value) { assert(0); }
|
||||
void Set([[maybe_unused]] const char* value) { assert(0); }
|
||||
void SetDisplayValue(const QString& value) { Set(value); }
|
||||
void Set([[maybe_unused]] int value) override { assert(0); }
|
||||
void Set([[maybe_unused]] bool value) override { assert(0); }
|
||||
void Set([[maybe_unused]] float value) override { assert(0); }
|
||||
void Set([[maybe_unused]] double value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const Vec2& value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const Vec3& value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const Vec4& value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const Ang3& value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const Quat& value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const QString& value) override { assert(0); }
|
||||
void Set([[maybe_unused]] const char* value) override { assert(0); }
|
||||
void SetDisplayValue(const QString& value) override { Set(value); }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Get methods.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Get([[maybe_unused]] int& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] bool& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] float& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] double& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] Vec2& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] Vec3& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] Vec4& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] Ang3& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] Quat& value) const { assert(0); }
|
||||
void Get([[maybe_unused]] QString& value) const { assert(0); }
|
||||
QString GetDisplayValue() const { QString val; Get(val); return val; }
|
||||
void Get([[maybe_unused]] int& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] bool& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] float& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] double& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] Vec2& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] Vec3& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] Vec4& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] Ang3& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] Quat& value) const override { assert(0); }
|
||||
void Get([[maybe_unused]] QString& value) const override { assert(0); }
|
||||
QString GetDisplayValue() const override { QString val; Get(val); return val; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// IVariableContainer functions
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void AddVariable([[maybe_unused]] IVariable* var) { assert(0); }
|
||||
void AddVariable([[maybe_unused]] IVariable* var) override { assert(0); }
|
||||
|
||||
virtual bool DeleteVariable([[maybe_unused]] IVariable* var, [[maybe_unused]] bool recursive = false) { return false; }
|
||||
virtual void DeleteAllVariables() {}
|
||||
bool DeleteVariable([[maybe_unused]] IVariable* var, [[maybe_unused]] bool recursive = false) override { return false; }
|
||||
void DeleteAllVariables() override {}
|
||||
|
||||
virtual int GetNumVariables() const { return 0; }
|
||||
virtual IVariable* GetVariable([[maybe_unused]] int index) const { return nullptr; }
|
||||
int GetNumVariables() const override { return 0; }
|
||||
IVariable* GetVariable([[maybe_unused]] int index) const override { return nullptr; }
|
||||
|
||||
virtual bool IsContainsVariable([[maybe_unused]] IVariable* pVar, [[maybe_unused]] bool bRecursive = false) const { return false; }
|
||||
bool IsContainsVariable([[maybe_unused]] IVariable* pVar, [[maybe_unused]] bool bRecursive = false) const override { return false; }
|
||||
|
||||
virtual IVariable* FindVariable([[maybe_unused]] const char* name, [[maybe_unused]] bool bRecursive = false, [[maybe_unused]] bool bHumanName = false) const { return nullptr; }
|
||||
IVariable* FindVariable([[maybe_unused]] const char* name, [[maybe_unused]] bool bRecursive = false, [[maybe_unused]] bool bHumanName = false) const override { return nullptr; }
|
||||
|
||||
virtual bool IsEmpty() const { return true; }
|
||||
bool IsEmpty() const override { return true; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Wire(IVariable* var)
|
||||
void Wire(IVariable* var) override
|
||||
{
|
||||
m_wiredVars.push_back(var);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Unwire(IVariable* var)
|
||||
void Unwire(IVariable* var) override
|
||||
{
|
||||
if (!var)
|
||||
{
|
||||
@@ -480,7 +480,7 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void AddOnSetCallback(OnSetCallback* func)
|
||||
void AddOnSetCallback(OnSetCallback* func) override
|
||||
{
|
||||
if (!stl::find(m_onSetFuncs, func))
|
||||
{
|
||||
@@ -489,13 +489,13 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void RemoveOnSetCallback(OnSetCallback* func)
|
||||
void RemoveOnSetCallback(OnSetCallback* func) override
|
||||
{
|
||||
stl::find_and_erase(m_onSetFuncs, func);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void ClearOnSetCallbacks()
|
||||
void ClearOnSetCallbacks() override
|
||||
{
|
||||
m_onSetFuncs.clear();
|
||||
}
|
||||
@@ -509,7 +509,7 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void RemoveOnSetEnumCallback(OnSetCallback* func)
|
||||
void RemoveOnSetEnumCallback(OnSetCallback* func) override
|
||||
{
|
||||
stl::find_and_erase(m_onSetEnumFuncs, func);
|
||||
}
|
||||
@@ -520,7 +520,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual void OnSetValue([[maybe_unused]] bool bRecursive)
|
||||
void OnSetValue([[maybe_unused]] bool bRecursive) override
|
||||
{
|
||||
// If have wired variables or OnSet callback, process them.
|
||||
// Send value to wired variable.
|
||||
@@ -549,7 +549,8 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void Serialize(XmlNodeRef node, bool load)
|
||||
using IVariable::Serialize;
|
||||
void Serialize(XmlNodeRef node, bool load) override
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
@@ -567,8 +568,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void EnableUpdateCallbacks(bool boEnable){m_boUpdateCallbacksEnabled = boEnable; };
|
||||
virtual void SetForceModified(bool bForceModified) { m_bForceModified = bForceModified; }
|
||||
void EnableUpdateCallbacks(bool boEnable) override{m_boUpdateCallbacksEnabled = boEnable; };
|
||||
void SetForceModified(bool bForceModified) override { m_bForceModified = bForceModified; }
|
||||
protected:
|
||||
// Constructor.
|
||||
CVariableBase()
|
||||
@@ -641,13 +642,13 @@ public:
|
||||
CVariableArray(){}
|
||||
|
||||
//! Get name of parameter.
|
||||
virtual EType GetType() const { return IVariable::ARRAY; };
|
||||
virtual int GetSize() const { return sizeof(CVariableArray); };
|
||||
EType GetType() const override { return IVariable::ARRAY; };
|
||||
int GetSize() const override { return sizeof(CVariableArray); };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Set methods.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Set(const QString& value)
|
||||
void Set(const QString& value) override
|
||||
{
|
||||
if (m_strValue != value)
|
||||
{
|
||||
@@ -655,7 +656,7 @@ public:
|
||||
OnSetValue(false);
|
||||
}
|
||||
}
|
||||
void OnSetValue(bool bRecursive)
|
||||
void OnSetValue(bool bRecursive) override
|
||||
{
|
||||
CVariableBase::OnSetValue(bRecursive);
|
||||
if (bRecursive)
|
||||
@@ -666,7 +667,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
void SetFlagRecursive(EFlags flag)
|
||||
void SetFlagRecursive(EFlags flag) override
|
||||
{
|
||||
CVariableBase::SetFlagRecursive(flag);
|
||||
for (Variables::iterator it = m_vars.begin(); it != m_vars.end(); ++it)
|
||||
@@ -677,9 +678,9 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Get methods.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Get(QString& value) const { value = m_strValue; }
|
||||
void Get(QString& value) const override { value = m_strValue; }
|
||||
|
||||
virtual bool HasDefaultValue() const
|
||||
bool HasDefaultValue() const override
|
||||
{
|
||||
for (Variables::const_iterator it = m_vars.begin(); it != m_vars.end(); ++it)
|
||||
{
|
||||
@@ -691,7 +692,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void ResetToDefault()
|
||||
void ResetToDefault() override
|
||||
{
|
||||
for (Variables::const_iterator it = m_vars.begin(); it != m_vars.end(); ++it)
|
||||
{
|
||||
@@ -700,7 +701,7 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
IVariable* Clone(bool bRecursive) const
|
||||
IVariable* Clone(bool bRecursive) const override
|
||||
{
|
||||
CVariableArray* var = new CVariableArray(*this);
|
||||
|
||||
@@ -713,7 +714,7 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CopyValue(IVariable* fromVar)
|
||||
void CopyValue(IVariable* fromVar) override
|
||||
{
|
||||
assert(fromVar);
|
||||
if (fromVar->GetType() != IVariable::ARRAY)
|
||||
@@ -733,20 +734,20 @@ public:
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual int GetNumVariables() const { return static_cast<int>(m_vars.size()); }
|
||||
int GetNumVariables() const override { return static_cast<int>(m_vars.size()); }
|
||||
|
||||
virtual IVariable* GetVariable(int index) const
|
||||
IVariable* GetVariable(int index) const override
|
||||
{
|
||||
assert(index >= 0 && index < (int)m_vars.size());
|
||||
return m_vars[index];
|
||||
}
|
||||
|
||||
virtual void AddVariable(IVariable* var)
|
||||
void AddVariable(IVariable* var) override
|
||||
{
|
||||
m_vars.push_back(var);
|
||||
}
|
||||
|
||||
virtual bool DeleteVariable(IVariable* var, bool recursive /*=false*/)
|
||||
bool DeleteVariable(IVariable* var, bool recursive /*=false*/) override
|
||||
{
|
||||
bool found = stl::find_and_erase(m_vars, var);
|
||||
if (!found && recursive)
|
||||
@@ -762,12 +763,12 @@ public:
|
||||
return found;
|
||||
}
|
||||
|
||||
virtual void DeleteAllVariables()
|
||||
void DeleteAllVariables() override
|
||||
{
|
||||
m_vars.clear();
|
||||
}
|
||||
|
||||
virtual bool IsContainsVariable(IVariable* pVar, bool bRecursive) const
|
||||
bool IsContainsVariable(IVariable* pVar, bool bRecursive) const override
|
||||
{
|
||||
for (Variables::const_iterator it = m_vars.begin(); it != m_vars.end(); ++it)
|
||||
{
|
||||
@@ -793,14 +794,15 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual IVariable* FindVariable(const char* name, bool bRecursive, bool bHumanName) const;
|
||||
IVariable* FindVariable(const char* name, bool bRecursive, bool bHumanName) const override;
|
||||
|
||||
virtual bool IsEmpty() const
|
||||
bool IsEmpty() const override
|
||||
{
|
||||
return m_vars.empty();
|
||||
}
|
||||
|
||||
void Serialize(XmlNodeRef node, bool load)
|
||||
using IVariable::Serialize;
|
||||
void Serialize(XmlNodeRef node, bool load) override
|
||||
{
|
||||
if (load)
|
||||
{
|
||||
@@ -1074,11 +1076,11 @@ class CVariableVoid
|
||||
{
|
||||
public:
|
||||
CVariableVoid(){};
|
||||
virtual EType GetType() const { return IVariable::UNKNOWN; };
|
||||
virtual IVariable* Clone([[maybe_unused]] bool bRecursive) const { return new CVariableVoid(*this); }
|
||||
virtual void CopyValue([[maybe_unused]] IVariable* fromVar) {};
|
||||
virtual bool HasDefaultValue() const { return true; }
|
||||
virtual void ResetToDefault() {};
|
||||
EType GetType() const override { return IVariable::UNKNOWN; };
|
||||
IVariable* Clone([[maybe_unused]] bool bRecursive) const override { return new CVariableVoid(*this); }
|
||||
void CopyValue([[maybe_unused]] IVariable* fromVar) override {};
|
||||
bool HasDefaultValue() const override { return true; }
|
||||
void ResetToDefault() override {};
|
||||
protected:
|
||||
CVariableVoid(const CVariableVoid& v)
|
||||
: CVariableBase(v) {};
|
||||
@@ -1112,44 +1114,44 @@ public:
|
||||
}
|
||||
|
||||
//! Get name of parameter.
|
||||
virtual EType GetType() const { return (EType)var_type::type_traits<T>::type(); };
|
||||
virtual int GetSize() const { return sizeof(T); };
|
||||
EType GetType() const override { return (EType)var_type::type_traits<T>::type(); };
|
||||
int GetSize() const override { return sizeof(T); };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Set methods.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Set(int value) { SetValue(value); }
|
||||
virtual void Set(bool value) { SetValue(value); }
|
||||
virtual void Set(float value) { SetValue(value); }
|
||||
virtual void Set(double value) { SetValue(value); }
|
||||
virtual void Set(const Vec2& value) { SetValue(value); }
|
||||
virtual void Set(const Vec3& value) { SetValue(value); }
|
||||
virtual void Set(const Vec4& value) { SetValue(value); }
|
||||
virtual void Set(const Ang3& value) { SetValue(value); }
|
||||
virtual void Set(const Quat& value) { SetValue(value); }
|
||||
virtual void Set(const QString& value) { SetValue(value); }
|
||||
virtual void Set(const char* value) { SetValue(QString(value)); }
|
||||
void Set(int value) override { SetValue(value); }
|
||||
void Set(bool value) override { SetValue(value); }
|
||||
void Set(float value) override { SetValue(value); }
|
||||
void Set(double value) override { SetValue(value); }
|
||||
void Set(const Vec2& value) override { SetValue(value); }
|
||||
void Set(const Vec3& value) override { SetValue(value); }
|
||||
void Set(const Vec4& value) override { SetValue(value); }
|
||||
void Set(const Ang3& value) override { SetValue(value); }
|
||||
void Set(const Quat& value) override { SetValue(value); }
|
||||
void Set(const QString& value) override { SetValue(value); }
|
||||
void Set(const char* value) override { SetValue(QString(value)); }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Get methods.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Get(int& value) const { GetValue(value); }
|
||||
virtual void Get(bool& value) const { GetValue(value); }
|
||||
virtual void Get(float& value) const { GetValue(value); }
|
||||
virtual void Get(double& value) const { GetValue(value); }
|
||||
virtual void Get(Vec2& value) const { GetValue(value); }
|
||||
virtual void Get(Vec3& value) const { GetValue(value); }
|
||||
virtual void Get(Vec4& value) const { GetValue(value); }
|
||||
virtual void Get(Quat& value) const { GetValue(value); }
|
||||
virtual void Get(QString& value) const { GetValue(value); }
|
||||
virtual bool HasDefaultValue() const
|
||||
void Get(int& value) const override { GetValue(value); }
|
||||
void Get(bool& value) const override { GetValue(value); }
|
||||
void Get(float& value) const override { GetValue(value); }
|
||||
void Get(double& value) const override { GetValue(value); }
|
||||
void Get(Vec2& value) const override { GetValue(value); }
|
||||
void Get(Vec3& value) const override { GetValue(value); }
|
||||
void Get(Vec4& value) const override { GetValue(value); }
|
||||
void Get(Quat& value) const override { GetValue(value); }
|
||||
void Get(QString& value) const override { GetValue(value); }
|
||||
bool HasDefaultValue() const override
|
||||
{
|
||||
T defval;
|
||||
var_type::init(defval);
|
||||
return m_valueDef == defval;
|
||||
}
|
||||
|
||||
virtual void ResetToDefault()
|
||||
void ResetToDefault() override
|
||||
{
|
||||
T defval;
|
||||
var_type::init(defval);
|
||||
@@ -1159,7 +1161,7 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Limits.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void SetLimits(float fMin, float fMax, float fStep = 0.f, bool bHardMin = true, bool bHardMax = true)
|
||||
void SetLimits(float fMin, float fMax, float fStep = 0.f, bool bHardMin = true, bool bHardMax = true) override
|
||||
{
|
||||
m_valueMin = fMin;
|
||||
m_valueMax = fMax;
|
||||
@@ -1171,7 +1173,7 @@ public:
|
||||
m_customLimits = true;
|
||||
}
|
||||
|
||||
virtual void GetLimits(float& fMin, float& fMax, float& fStep, bool& bHardMin, bool& bHardMax)
|
||||
void GetLimits(float& fMin, float& fMax, float& fStep, bool& bHardMin, bool& bHardMax) override
|
||||
{
|
||||
if (!m_customLimits && var_type::type_traits<T>::supports_range())
|
||||
{
|
||||
@@ -1199,7 +1201,7 @@ public:
|
||||
m_customLimits = false;
|
||||
}
|
||||
|
||||
virtual bool HasCustomLimits()
|
||||
bool HasCustomLimits() override
|
||||
{
|
||||
return m_customLimits;
|
||||
}
|
||||
@@ -1217,14 +1219,14 @@ public:
|
||||
void operator=(const T& value) { SetValue(value); }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
IVariable* Clone([[maybe_unused]] bool bRecursive) const
|
||||
IVariable* Clone([[maybe_unused]] bool bRecursive) const override
|
||||
{
|
||||
Self* var = new Self(*this);
|
||||
return var;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CopyValue(IVariable* fromVar)
|
||||
void CopyValue(IVariable* fromVar) override
|
||||
{
|
||||
assert(fromVar);
|
||||
T val;
|
||||
@@ -1668,7 +1670,7 @@ struct CSmartVariableBase
|
||||
return *pV;
|
||||
} // Cast to CVariableBase&
|
||||
VarType& operator*() const { return *pVar; }
|
||||
VarType* operator->(void) const { return pVar; }
|
||||
VarType* operator->() const { return pVar; }
|
||||
|
||||
VarType* GetVar() const { return pVar; };
|
||||
|
||||
@@ -1730,7 +1732,7 @@ struct CSmartVariableArray
|
||||
}
|
||||
|
||||
VarType& operator*() const { return *pVar; }
|
||||
VarType* operator->(void) const { return pVar; }
|
||||
VarType* operator->() const { return pVar; }
|
||||
|
||||
VarType* GetVar() const { return pVar; };
|
||||
|
||||
@@ -1752,35 +1754,35 @@ public:
|
||||
// Dtor.
|
||||
virtual ~CVarBlock() {}
|
||||
//! Add variable to block.
|
||||
virtual void AddVariable(IVariable* var);
|
||||
void AddVariable(IVariable* var) override;
|
||||
//! Remove variable from block
|
||||
virtual bool DeleteVariable(IVariable* var, bool bRecursive = false);
|
||||
bool DeleteVariable(IVariable* var, bool bRecursive = false) override;
|
||||
|
||||
void AddVariable(IVariable* pVar, const char* varName, unsigned char dataType = IVariable::DT_SIMPLE);
|
||||
// This used from smart variable pointer.
|
||||
void AddVariable(CVariableBase& var, const char* varName, unsigned char dataType = IVariable::DT_SIMPLE);
|
||||
|
||||
//! Returns number of variables in block.
|
||||
virtual int GetNumVariables() const { return static_cast<int>(m_vars.size()); }
|
||||
int GetNumVariables() const override { return static_cast<int>(m_vars.size()); }
|
||||
|
||||
//! Get pointer to stored variable by index.
|
||||
virtual IVariable* GetVariable(int index) const
|
||||
IVariable* GetVariable(int index) const override
|
||||
{
|
||||
assert(index >= 0 && index < m_vars.size());
|
||||
return m_vars[index];
|
||||
}
|
||||
|
||||
// Clear all vars from VarBlock.
|
||||
virtual void DeleteAllVariables() { m_vars.clear(); };
|
||||
void DeleteAllVariables() override { m_vars.clear(); };
|
||||
|
||||
//! Return true if variable block is empty (Does not have any vars).
|
||||
virtual bool IsEmpty() const { return m_vars.empty(); }
|
||||
bool IsEmpty() const override { return m_vars.empty(); }
|
||||
|
||||
// Returns true if var block contains specified variable.
|
||||
virtual bool IsContainsVariable(IVariable* pVar, bool bRecursive = true) const;
|
||||
bool IsContainsVariable(IVariable* pVar, bool bRecursive = true) const override;
|
||||
|
||||
//! Find variable by name.
|
||||
virtual IVariable* FindVariable(const char* name, bool bRecursive = true, bool bHumanName = false) const;
|
||||
IVariable* FindVariable(const char* name, bool bRecursive = true, bool bHumanName = false) const override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Clone var block.
|
||||
|
||||
@@ -124,7 +124,7 @@ bool CXmlArchive::SaveToPak([[maybe_unused]] const QString& levelPath, CPakFile&
|
||||
|
||||
if (pakFile.GetArchive())
|
||||
{
|
||||
CLogFile::FormatLine("Saving pak file %s", (const char*)pakFile.GetArchive()->GetFullPath());
|
||||
CLogFile::FormatLine("Saving pak file %.*s", AZ_STRING_ARG(pakFile.GetArchive()->GetFullPath().Native()));
|
||||
}
|
||||
|
||||
pNamedData->Save(pakFile);
|
||||
|
||||
@@ -43,12 +43,7 @@
|
||||
void QtViewport::BuildDragDropContext(AzQtComponents::ViewportDragContext& context, const QPoint& pt)
|
||||
{
|
||||
context.m_hitLocation = AZ::Vector3::CreateZero();
|
||||
|
||||
PreWidgetRendering(); // required so that the current render cam is set.
|
||||
|
||||
context.m_hitLocation = GetHitLocation(pt);
|
||||
|
||||
PostWidgetRendering();
|
||||
}
|
||||
|
||||
|
||||
@@ -1352,28 +1347,6 @@ bool QtViewport::MouseCallback(EMouseEvent event, const QPoint& point, Qt::Keybo
|
||||
return true;
|
||||
}
|
||||
|
||||
// RAII wrapper for Pre / PostWidgetRendering calls.
|
||||
// It also tracks the times a mouse callback potentially created a new viewport context.
|
||||
struct ScopedProcessingMouseCallback
|
||||
{
|
||||
explicit ScopedProcessingMouseCallback(QtViewport* viewport)
|
||||
: m_viewport(viewport)
|
||||
{
|
||||
m_viewport->m_processingMouseCallbacksCounter++;
|
||||
m_viewport->PreWidgetRendering();
|
||||
}
|
||||
|
||||
~ScopedProcessingMouseCallback()
|
||||
{
|
||||
m_viewport->PostWidgetRendering();
|
||||
m_viewport->m_processingMouseCallbacksCounter--;
|
||||
}
|
||||
|
||||
QtViewport* m_viewport;
|
||||
};
|
||||
|
||||
ScopedProcessingMouseCallback scopedProcessingMouseCallback(this);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Hit test gizmo objects.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+53
-64
@@ -172,7 +172,7 @@ public:
|
||||
|
||||
//! Get current view matrix.
|
||||
//! This is a matrix that transforms from world space to view space.
|
||||
virtual const Matrix34& GetViewTM() const
|
||||
const Matrix34& GetViewTM() const override
|
||||
{
|
||||
AZ_Error("CryLegacy", false, "QtViewport::GetViewTM not implemented");
|
||||
static const Matrix34 m;
|
||||
@@ -182,7 +182,7 @@ public:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Get current screen matrix.
|
||||
//! Screen matrix transform from World space to Screen space.
|
||||
virtual const Matrix34& GetScreenTM() const
|
||||
const Matrix34& GetScreenTM() const override
|
||||
{
|
||||
return m_screenTM;
|
||||
}
|
||||
@@ -190,9 +190,9 @@ public:
|
||||
virtual Vec3 MapViewToCP(const QPoint& point) = 0;
|
||||
|
||||
//! Map viewport position to world space position.
|
||||
virtual Vec3 ViewToWorld(const QPoint& vp, bool* pCollideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const = 0;
|
||||
Vec3 ViewToWorld(const QPoint& vp, bool* pCollideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override = 0;
|
||||
//! Convert point on screen to world ray.
|
||||
virtual void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const = 0;
|
||||
void ViewToWorldRay(const QPoint& vp, Vec3& raySrc, Vec3& rayDir) const override = 0;
|
||||
//! Get normal for viewport position
|
||||
virtual Vec3 ViewToWorldNormal(const QPoint& vp, bool onlyTerrain, bool bTestRenderMesh = false) = 0;
|
||||
|
||||
@@ -261,7 +261,7 @@ public:
|
||||
virtual void SetCursorString(const QString& str) = 0;
|
||||
|
||||
virtual void SetFocus() = 0;
|
||||
virtual void Invalidate(bool bErase = 1) = 0;
|
||||
virtual void Invalidate(bool bErase = true) = 0;
|
||||
|
||||
// Is overridden by RenderViewport
|
||||
virtual void SetFOV([[maybe_unused]] float fov) {}
|
||||
@@ -274,13 +274,7 @@ public:
|
||||
|
||||
void SetViewPane(CLayoutViewPane* viewPane) { m_viewPane = viewPane; }
|
||||
|
||||
//Child classes can override these to provide extra logic that wraps
|
||||
//widget rendering. Needed by the RenderViewport to handle raycasts
|
||||
//from screen-space to world-space.
|
||||
virtual void PreWidgetRendering() {}
|
||||
virtual void PostWidgetRendering() {}
|
||||
|
||||
virtual CViewport *asCViewport() { return this; }
|
||||
CViewport *asCViewport() override { return this; }
|
||||
|
||||
protected:
|
||||
CLayoutViewPane* m_viewPane = nullptr;
|
||||
@@ -289,7 +283,7 @@ protected:
|
||||
// Screen Matrix
|
||||
Matrix34 m_screenTM;
|
||||
int m_nCurViewportID;
|
||||
// Final game view matrix before drpping back to editor
|
||||
// Final game view matrix before dropping back to editor
|
||||
Matrix34 m_gameTM;
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
@@ -342,7 +336,7 @@ public:
|
||||
void SetActiveWindow() override { activateWindow(); }
|
||||
|
||||
//! Called while window is idle.
|
||||
virtual void Update();
|
||||
void Update() override;
|
||||
|
||||
/** Set name of this viewport.
|
||||
*/
|
||||
@@ -350,24 +344,24 @@ public:
|
||||
|
||||
/** Get name of viewport
|
||||
*/
|
||||
QString GetName() const;
|
||||
QString GetName() const override;
|
||||
|
||||
virtual void SetFocus() { setFocus(); }
|
||||
virtual void Invalidate([[maybe_unused]] bool bErase = 1) { update(); }
|
||||
void SetFocus() override { setFocus(); }
|
||||
void Invalidate([[maybe_unused]] bool bErase = 1) override { update(); }
|
||||
|
||||
// Is overridden by RenderViewport
|
||||
virtual void SetFOV([[maybe_unused]] float fov) {}
|
||||
virtual float GetFOV() const;
|
||||
void SetFOV([[maybe_unused]] float fov) override {}
|
||||
float GetFOV() const override;
|
||||
|
||||
// Must be overridden in derived classes.
|
||||
// Returns:
|
||||
// e.g. 4.0/3.0
|
||||
virtual float GetAspectRatio() const = 0;
|
||||
virtual void GetDimensions(int* pWidth, int* pHeight) const;
|
||||
virtual void ScreenToClient(QPoint& pPoint) const override;
|
||||
float GetAspectRatio() const override = 0;
|
||||
void GetDimensions(int* pWidth, int* pHeight) const override;
|
||||
void ScreenToClient(QPoint& pPoint) const override;
|
||||
|
||||
virtual void ResetContent();
|
||||
virtual void UpdateContent(int flags);
|
||||
void ResetContent() override;
|
||||
void UpdateContent(int flags) override;
|
||||
|
||||
//! Set current zoom factor for this viewport.
|
||||
virtual void SetZoomFactor(float fZoomFactor);
|
||||
@@ -379,10 +373,10 @@ public:
|
||||
virtual void OnDeactivate();
|
||||
|
||||
//! Map world space position to viewport position.
|
||||
virtual QPoint WorldToView(const Vec3& wp) const override;
|
||||
QPoint WorldToView(const Vec3& wp) const override;
|
||||
|
||||
//! Map world space position to 3D viewport position.
|
||||
virtual Vec3 WorldToView3D(const Vec3& wp, int nFlags = 0) const;
|
||||
Vec3 WorldToView3D(const Vec3& wp, int nFlags = 0) const override;
|
||||
|
||||
//! Map viewport position to world space position.
|
||||
virtual Vec3 ViewToWorld(const QPoint& vp, bool* pCollideWithTerrain = nullptr, bool onlyTerrain = false, bool bSkipVegetation = false, bool bTestRenderMesh = false, bool* collideWithObject = nullptr) const override;
|
||||
@@ -397,17 +391,18 @@ public:
|
||||
|
||||
//! This method return a vector (p2-p1) in world space alligned to construction plane and restriction axises.
|
||||
//! p1 and p2 must be given in world space and lie on construction plane.
|
||||
virtual Vec3 GetCPVector(const Vec3& p1, const Vec3& p2, int axis);
|
||||
using CViewport::GetCPVector;
|
||||
Vec3 GetCPVector(const Vec3& p1, const Vec3& p2, int axis) override;
|
||||
|
||||
//! Snap any given 3D world position to grid lines if snap is enabled.
|
||||
Vec3 SnapToGrid(const Vec3& vec) override;
|
||||
virtual float GetGridStep() const;
|
||||
float GetGridStep() const override;
|
||||
|
||||
//! Returns the screen scale factor for a point given in world coordinates.
|
||||
//! This factor gives the width in world-space units at the point's distance of the viewport.
|
||||
virtual float GetScreenScaleFactor([[maybe_unused]] const Vec3& worldPoint) const { return 1; };
|
||||
float GetScreenScaleFactor([[maybe_unused]] const Vec3& worldPoint) const override { return 1; };
|
||||
|
||||
void SetAxisConstrain(int axis);
|
||||
void SetAxisConstrain(int axis) override;
|
||||
|
||||
/// Take raw input and create a final mouse interaction.
|
||||
/// @attention Do not map **point** from widget to viewport explicitly,
|
||||
@@ -419,7 +414,7 @@ public:
|
||||
// Selection.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Resets current selection region.
|
||||
virtual void ResetSelectionRegion();
|
||||
void ResetSelectionRegion() override;
|
||||
//! Set 2D selection rectangle.
|
||||
void SetSelectionRectangle(const QRect& rect) override;
|
||||
|
||||
@@ -427,13 +422,13 @@ public:
|
||||
QRect GetSelectionRectangle() const override { return m_selectedRect; };
|
||||
//! Called when dragging selection rectangle.
|
||||
void OnDragSelectRectangle(const QRect& rect, bool bNormalizeRect = false) override;
|
||||
//! Get selection procision tolerance.
|
||||
float GetSelectionTolerance() const { return m_selectionTolerance; }
|
||||
//! Get selection precision tolerance.
|
||||
float GetSelectionTolerance() const override { return m_selectionTolerance; }
|
||||
//! Center viewport on selection.
|
||||
void CenterOnSelection() override {}
|
||||
void CenterOnAABB([[maybe_unused]] const AABB& aabb) override {}
|
||||
|
||||
virtual void CenterOnSliceInstance() {}
|
||||
void CenterOnSliceInstance() override {}
|
||||
|
||||
//! Performs hit testing of 2d point in view to find which object hit.
|
||||
bool HitTest(const QPoint& point, HitContext& hitInfo) override;
|
||||
@@ -446,10 +441,10 @@ public:
|
||||
float GetDistanceToLine(const Vec3& lineP1, const Vec3& lineP2, const QPoint& point) const override;
|
||||
|
||||
// Access to the member m_bAdvancedSelectMode so interested modules can know its value.
|
||||
bool GetAdvancedSelectModeFlag();
|
||||
bool GetAdvancedSelectModeFlag() override;
|
||||
|
||||
virtual void GetPerpendicularAxis(EAxis* pAxis, bool* pIs2D) const;
|
||||
virtual const ::Plane* GetConstructionPlane() const { return &m_constructionPlane; }
|
||||
void GetPerpendicularAxis(EAxis* pAxis, bool* pIs2D) const override;
|
||||
const ::Plane* GetConstructionPlane() const override { return &m_constructionPlane; }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -457,7 +452,7 @@ public:
|
||||
//! Set construction plane from given position construction matrix refrence coord system and axis settings.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void MakeConstructionPlane(int axis) override;
|
||||
virtual void SetConstructionMatrix(RefCoordSys coordSys, const Matrix34& xform);
|
||||
void SetConstructionMatrix(RefCoordSys coordSys, const Matrix34& xform) override;
|
||||
virtual const Matrix34& GetConstructionMatrix(RefCoordSys coordSys);
|
||||
// Set simple construction plane origin.
|
||||
void SetConstructionOrigin(const Vec3& worldPos);
|
||||
@@ -467,11 +462,11 @@ public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Undo for viewpot operations.
|
||||
void BeginUndo();
|
||||
void AcceptUndo(const QString& undoDescription);
|
||||
void CancelUndo();
|
||||
void RestoreUndo();
|
||||
bool IsUndoRecording() const;
|
||||
void BeginUndo() override;
|
||||
void AcceptUndo(const QString& undoDescription) override;
|
||||
void CancelUndo() override;
|
||||
void RestoreUndo() override;
|
||||
bool IsUndoRecording() const override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//! Get prefered original size for this viewport.
|
||||
@@ -479,39 +474,39 @@ public:
|
||||
virtual QSize GetIdealSize() const;
|
||||
|
||||
//! Check if world space bounding box is visible in this view.
|
||||
virtual bool IsBoundsVisible(const AABB& box) const;
|
||||
bool IsBoundsVisible(const AABB& box) const override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void SetCursor(const QCursor& cursor)
|
||||
void SetCursor(const QCursor& cursor) override
|
||||
{
|
||||
setCursor(cursor);
|
||||
}
|
||||
|
||||
// Set`s current cursor string.
|
||||
void SetCurrentCursor(const QCursor& hCursor, const QString& cursorString);
|
||||
virtual void SetCurrentCursor(EStdCursor stdCursor, const QString& cursorString);
|
||||
void SetCurrentCursor(EStdCursor stdCursor);
|
||||
virtual void SetCursorString(const QString& cursorString);
|
||||
void ResetCursor();
|
||||
void SetSupplementaryCursorStr(const QString& str);
|
||||
void SetCurrentCursor(EStdCursor stdCursor, const QString& cursorString) override;
|
||||
void SetCurrentCursor(EStdCursor stdCursor) override;
|
||||
void SetCursorString(const QString& cursorString) override;
|
||||
void ResetCursor() override;
|
||||
void SetSupplementaryCursorStr(const QString& str) override;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Return visble objects cache.
|
||||
CBaseObjectsCache* GetVisibleObjectsCache() { return m_pVisibleObjectsCache; };
|
||||
CBaseObjectsCache* GetVisibleObjectsCache() override { return m_pVisibleObjectsCache; };
|
||||
|
||||
void RegisterRenderListener(IRenderListener* piListener);
|
||||
bool UnregisterRenderListener(IRenderListener* piListener);
|
||||
bool IsRenderListenerRegistered(IRenderListener* piListener);
|
||||
void RegisterRenderListener(IRenderListener* piListener) override;
|
||||
bool UnregisterRenderListener(IRenderListener* piListener) override;
|
||||
bool IsRenderListenerRegistered(IRenderListener* piListener) override;
|
||||
|
||||
void AddPostRenderer(IPostRenderer* pPostRenderer);
|
||||
bool RemovePostRenderer(IPostRenderer* pPostRenderer);
|
||||
void AddPostRenderer(IPostRenderer* pPostRenderer) override;
|
||||
bool RemovePostRenderer(IPostRenderer* pPostRenderer) override;
|
||||
|
||||
void CaptureMouse() override { m_mouseCaptured = true; QWidget::grabMouse(); }
|
||||
void ReleaseMouse() override { m_mouseCaptured = false; QWidget::releaseMouse(); }
|
||||
|
||||
virtual void setRay(QPoint& vp, Vec3& raySrc, Vec3& rayDir);
|
||||
virtual void setHitcontext(QPoint& vp, Vec3& raySrc, Vec3& rayDir);
|
||||
void setRay(QPoint& vp, Vec3& raySrc, Vec3& rayDir) override;
|
||||
void setHitcontext(QPoint& vp, Vec3& raySrc, Vec3& rayDir) override;
|
||||
QPoint m_vp;
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
Vec3 m_raySrc;
|
||||
@@ -572,12 +567,6 @@ protected:
|
||||
void dragLeaveEvent(QDragLeaveEvent* event) override;
|
||||
void dropEvent(QDropEvent* event) override;
|
||||
|
||||
//Child classes can override these to provide extra logic that wraps
|
||||
//widget rendering. Needed by the RenderViewport to handle raycasts
|
||||
//from screen-space to world-space.
|
||||
virtual void PreWidgetRendering() {}
|
||||
virtual void PostWidgetRendering() {}
|
||||
|
||||
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
AzToolsFramework::ViewportUi::ViewportUiManager m_viewportUi;
|
||||
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
|
||||
|
||||
@@ -154,6 +154,8 @@ void CViewportTitleDlg::SetupCameraDropdownMenu()
|
||||
cameraMenu->addMenu(GetFovMenu());
|
||||
m_ui->m_cameraMenu->setMenu(cameraMenu);
|
||||
m_ui->m_cameraMenu->setPopupMode(QToolButton::InstantPopup);
|
||||
QObject::connect(cameraMenu, &QMenu::aboutToShow, this, &CViewportTitleDlg::CheckForCameraSpeedUpdate);
|
||||
|
||||
QAction* gotoPositionAction = new QAction("Go to position", cameraMenu);
|
||||
connect(gotoPositionAction, &QAction::triggered, this, &CViewportTitleDlg::OnBnClickedGotoPosition);
|
||||
cameraMenu->addAction(gotoPositionAction);
|
||||
|
||||
@@ -77,7 +77,7 @@ Q_SIGNALS:
|
||||
protected:
|
||||
virtual void OnInitDialog();
|
||||
|
||||
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
|
||||
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
|
||||
void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) override;
|
||||
|
||||
void OnMaximize();
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
// AzQtComponents
|
||||
#include <AzQtComponents/Components/Widgets/CheckBox.h>
|
||||
#include <AzQtComponents/Components/WindowDecorationWrapper.h>
|
||||
#include <AzQtComponents/Utilities/PixmapScaleUtilities.h>
|
||||
|
||||
// Editor
|
||||
#include "Settings.h"
|
||||
@@ -79,8 +80,11 @@ WelcomeScreenDialog::WelcomeScreenDialog(QWidget* pParent)
|
||||
{
|
||||
projectPreviewPath = ":/WelcomeScreenDialog/DefaultProjectImage.png";
|
||||
}
|
||||
|
||||
ui->activeProjectIcon->setPixmap(
|
||||
QPixmap(projectPreviewPath).scaled(
|
||||
AzQtComponents::ScalePixmapForScreenDpi(
|
||||
QPixmap(projectPreviewPath),
|
||||
screen(),
|
||||
ui->activeProjectIcon->size(),
|
||||
Qt::KeepAspectRatioByExpanding,
|
||||
Qt::SmoothTransformation
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/functional.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
//! Sets a variable upon construction and again when the object goes out of scope.
|
||||
template<typename T>
|
||||
class ScopedValue
|
||||
{
|
||||
private:
|
||||
T* m_ptr;
|
||||
T m_finalValue;
|
||||
|
||||
public:
|
||||
ScopedValue(T* ptr, T initialValue, T finalValue) :
|
||||
m_ptr(ptr), m_finalValue(finalValue)
|
||||
{
|
||||
AZ_Assert(m_ptr, "ScopedValue::m_ptr is null");
|
||||
*m_ptr = initialValue;
|
||||
}
|
||||
|
||||
~ScopedValue()
|
||||
{
|
||||
*m_ptr = m_finalValue;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace AZ
|
||||
@@ -19,4 +19,5 @@ set(FILES
|
||||
std/containers/vector_set.h
|
||||
std/containers/vector_set_base.h
|
||||
std/parallel/concurrency_checker.h
|
||||
Utils/ScopedValue.h
|
||||
)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include <AtomCore/Utils/ScopedValue.h>
|
||||
#include <AzCore/UnitTest/TestTypes.h>
|
||||
|
||||
namespace UnitTest
|
||||
{
|
||||
TEST(ScopedValueTest, TestBoolValue)
|
||||
{
|
||||
bool localValue = false;
|
||||
|
||||
{
|
||||
AZ::ScopedValue<bool> scopedValue(&localValue, true, false);
|
||||
EXPECT_EQ(true, localValue);
|
||||
}
|
||||
|
||||
EXPECT_EQ(false, localValue);
|
||||
}
|
||||
|
||||
TEST(ScopedValueTest, TestIntValue)
|
||||
{
|
||||
int localValue = 0;
|
||||
|
||||
{
|
||||
AZ::ScopedValue<int> scopedValue(&localValue, 1, 2);
|
||||
EXPECT_EQ(1, localValue);
|
||||
}
|
||||
|
||||
EXPECT_EQ(2, localValue);
|
||||
}
|
||||
}
|
||||
@@ -12,5 +12,6 @@ set(FILES
|
||||
InstanceDatabase.cpp
|
||||
lru_cache.cpp
|
||||
Main.cpp
|
||||
ScopedValueTest.cpp
|
||||
vector_set.cpp
|
||||
)
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace AZ
|
||||
|
||||
void AssetData::Acquire()
|
||||
{
|
||||
AZ_Assert(m_useCount >= 0, "AssetData has been deleted")
|
||||
AZ_Assert(m_useCount >= 0, "AssetData has been deleted");
|
||||
|
||||
AcquireWeak();
|
||||
++m_useCount;
|
||||
|
||||
@@ -990,7 +990,7 @@ namespace AZ
|
||||
template<class T>
|
||||
u8 Asset<T>::GetFlags() const
|
||||
{
|
||||
AZ_Warning("Asset", false, "Deprecated - replaced by GetAutoLoadBehavior")
|
||||
AZ_Warning("Asset", false, "Deprecated - replaced by GetAutoLoadBehavior");
|
||||
return static_cast<u8>(m_loadBehavior);
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ namespace AZ
|
||||
template<class T>
|
||||
bool Asset<T>::SetFlags(u8 flags)
|
||||
{
|
||||
AZ_Warning("Asset", false, "Deprecated - replaced by SetAutoLoadBehavior")
|
||||
AZ_Warning("Asset", false, "Deprecated - replaced by SetAutoLoadBehavior");
|
||||
if (!m_assetData)
|
||||
{
|
||||
AZ_Assert(flags < static_cast<u8>(AssetLoadBehavior::Count), "Flags value is out of range");
|
||||
|
||||
@@ -2132,7 +2132,7 @@ namespace AZ
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Warning("AssetManager", false, "Couldn't find handler for asset %s (%s)", asset.GetId().ToString<AZStd::string>().c_str(), asset.GetHint().c_str())
|
||||
AZ_Warning("AssetManager", false, "Couldn't find handler for asset %s (%s)", asset.GetId().ToString<AZStd::string>().c_str(), asset.GetHint().c_str());
|
||||
}
|
||||
|
||||
// Notify any dependent jobs.
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <AzCore/Asset/AssetCommon.h>
|
||||
#include <AzCore/RTTI/BehaviorContext.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
|
||||
namespace AZ {
|
||||
struct Uuid;
|
||||
|
||||
@@ -8,14 +8,25 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// This is disabled by default because it puts in costly runtime checking of casted values.
|
||||
// You can either change it here to enable it across the engine, or use push/pop_macro to enable per file/feature.
|
||||
// Note that if using push/pop_macro, you may get some of the functions not inline and the definition coming from
|
||||
// another compilation unit, in such case, you will have to push/pop_macro on that compilation unit as well.
|
||||
// #define AZ_NUMERICCAST_ENABLED 1
|
||||
|
||||
#if !AZ_NUMERICCAST_ENABLED
|
||||
|
||||
#define aznumeric_cast static_cast
|
||||
|
||||
#else
|
||||
|
||||
#include <AzCore/Casting/numeric_cast_internal.h>
|
||||
#include <AzCore/std/typetraits/is_arithmetic.h>
|
||||
#include <AzCore/std/typetraits/is_class.h>
|
||||
#include <AzCore/std/typetraits/is_enum.h>
|
||||
#include <AzCore/std/typetraits/is_floating_point.h>
|
||||
#include <AzCore/std/typetraits/is_integral.h>
|
||||
#include <AzCore/std/typetraits/is_same.h>
|
||||
#include <AzCore/std/typetraits/is_signed.h>
|
||||
#include <AzCore/std/typetraits/is_unsigned.h>
|
||||
#include <AzCore/std/typetraits/remove_cvref.h>
|
||||
#include <AzCore/std/typetraits/underlying_type.h>
|
||||
#include <AzCore/std/utils.h>
|
||||
@@ -28,7 +39,7 @@
|
||||
// enabled.
|
||||
//
|
||||
// Because we can't do partial function specialization, I'm using enable_if to chop up the implementation into one of these
|
||||
// implementations. If none of these fit, then we will get a compile error because it is an unknown conversionr.
|
||||
// implementations. If none of these fit, then we will get a compile error because it is an unknown conversion.
|
||||
//
|
||||
//--------------------------------------------
|
||||
// TYPE <- TYPE DigitLoss
|
||||
@@ -51,85 +62,7 @@
|
||||
// (K) Floating Floating Y
|
||||
*/
|
||||
|
||||
// This is disabled by default because it puts in costly runtime checking of casted values.
|
||||
// You can either change it here to enable it across the engine, or use push/pop_macro to enable per file/feature.
|
||||
// Note that if using push/pop_macro, you may get some of the functions not inline and the definition coming from
|
||||
// another compilation unit, in such case, you will have to push/pop_macro on that compilation unit as well.
|
||||
// #define AZ_NUMERICCAST_ENABLED 1
|
||||
|
||||
#if AZ_NUMERICCAST_ENABLED
|
||||
#define AZ_NUMERIC_ASSERT(expr, ...) AZ_Assert(expr, __VA_ARGS__)
|
||||
#else
|
||||
#define AZ_NUMERIC_ASSERT(expr, ...) void(0)
|
||||
#endif
|
||||
|
||||
#pragma push_macro("max")
|
||||
#undef max
|
||||
|
||||
namespace NumericCastInternal
|
||||
{
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
!AZStd::is_integral<FromType>::value || !AZStd::is_floating_point<ToType>::value
|
||||
, bool> ::type UnderflowsToType(const FromType& value)
|
||||
{
|
||||
return (value < static_cast<FromType>(std::numeric_limits<ToType>::lowest()));
|
||||
}
|
||||
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
AZStd::is_integral<FromType>::value && AZStd::is_floating_point<ToType>::value
|
||||
, bool> ::type UnderflowsToType(const FromType& value)
|
||||
{
|
||||
return (static_cast<ToType>(value) < std::numeric_limits<ToType>::lowest());
|
||||
}
|
||||
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
!AZStd::is_integral<FromType>::value || !AZStd::is_floating_point<ToType>::value
|
||||
, bool> ::type OverflowsToType(const FromType& value)
|
||||
{
|
||||
return (value > static_cast<FromType>(std::numeric_limits<ToType>::max()));
|
||||
}
|
||||
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
AZStd::is_integral<FromType>::value && AZStd::is_floating_point<ToType>::value
|
||||
, bool> ::type OverflowsToType(const FromType& value)
|
||||
{
|
||||
return (static_cast<ToType>(value) > std::numeric_limits<ToType>::max());
|
||||
}
|
||||
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
AZStd::is_integral<FromType>::value && AZStd::is_integral<ToType>::value
|
||||
&& std::numeric_limits<FromType>::digits <= std::numeric_limits<ToType>::digits
|
||||
&& AZStd::is_signed<FromType>::value && AZStd::is_unsigned<ToType>::value
|
||||
, bool> ::type FitsInToType(const FromType& value)
|
||||
{
|
||||
return !NumericCastInternal::UnderflowsToType<ToType>(value);
|
||||
}
|
||||
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
AZStd::is_integral<FromType>::value && AZStd::is_integral<ToType>::value
|
||||
&& (std::numeric_limits<FromType>::digits > std::numeric_limits<ToType>::digits)
|
||||
&& AZStd::is_unsigned<FromType>::value
|
||||
, bool> ::type FitsInToType(const FromType& value)
|
||||
{
|
||||
return !NumericCastInternal::OverflowsToType<ToType>(value);
|
||||
}
|
||||
|
||||
template <typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
(!AZStd::is_integral<FromType>::value || !AZStd::is_integral<ToType>::value)
|
||||
|| ((std::numeric_limits<FromType>::digits <= std::numeric_limits<ToType>::digits) && (AZStd::is_unsigned<FromType>::value || AZStd::is_signed<ToType>::value))
|
||||
|| ((std::numeric_limits<FromType>::digits > std::numeric_limits<ToType>::digits) && AZStd::is_signed<FromType>::value)
|
||||
, bool> ::type FitsInToType(const FromType& value)
|
||||
{
|
||||
return !NumericCastInternal::OverflowsToType<ToType>(value) && !NumericCastInternal::UnderflowsToType<ToType>(value);
|
||||
}
|
||||
} // namespace AZ
|
||||
|
||||
// INTEGER -> INTEGER
|
||||
// (A) Not losing digits or risking sign loss
|
||||
@@ -276,8 +209,10 @@ inline constexpr auto aznumeric_cast(FromType&& value) ->
|
||||
return static_cast<ToType>(value);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// This is a helper class that lets us induce the destination type of a numeric cast
|
||||
// It should never be directly used by anything other than azlossy_caster.
|
||||
// It should never be directly used by anything other than aznumeric_caster.
|
||||
namespace AZ
|
||||
{
|
||||
template <typename FromType>
|
||||
@@ -295,7 +230,7 @@ namespace AZ
|
||||
|
||||
FromType m_value;
|
||||
};
|
||||
}
|
||||
} // namespace AZ
|
||||
|
||||
// This is the primary function we should use when doing numeric casting, since it induces the
|
||||
// type we need to cast to from the code rather than requiring an explicit coupling in the source.
|
||||
@@ -305,4 +240,3 @@ inline constexpr AZ::NumericCasted<FromType> aznumeric_caster(FromType value)
|
||||
return AZ::NumericCasted<FromType>(value);
|
||||
}
|
||||
|
||||
#pragma pop_macro("max")
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/typetraits/conditional.h>
|
||||
#include <AzCore/std/typetraits/is_floating_point.h>
|
||||
#include <AzCore/std/typetraits/is_integral.h>
|
||||
#include <AzCore/std/typetraits/is_signed.h>
|
||||
#include <AzCore/std/typetraits/is_unsigned.h>
|
||||
#include <limits>
|
||||
|
||||
namespace NumericCastInternal
|
||||
{
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<!AZStd::is_integral<FromType>::value || !AZStd::is_floating_point<ToType>::value, bool>::type
|
||||
UnderflowsToType(const FromType& value)
|
||||
{
|
||||
return (value < static_cast<FromType>(std::numeric_limits<ToType>::lowest()));
|
||||
}
|
||||
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<AZStd::is_integral<FromType>::value && AZStd::is_floating_point<ToType>::value, bool>::type
|
||||
UnderflowsToType(const FromType& value)
|
||||
{
|
||||
return (static_cast<ToType>(value) < std::numeric_limits<ToType>::lowest());
|
||||
}
|
||||
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<!AZStd::is_integral<FromType>::value || !AZStd::is_floating_point<ToType>::value, bool>::type
|
||||
OverflowsToType(const FromType& value)
|
||||
{
|
||||
return (value > static_cast<FromType>(std::numeric_limits<ToType>::max()));
|
||||
}
|
||||
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<AZStd::is_integral<FromType>::value && AZStd::is_floating_point<ToType>::value, bool>::type
|
||||
OverflowsToType(const FromType& value)
|
||||
{
|
||||
return (static_cast<ToType>(value) > std::numeric_limits<ToType>::max());
|
||||
}
|
||||
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
AZStd::is_integral<FromType>::value && AZStd::is_integral<ToType>::value &&
|
||||
std::numeric_limits<FromType>::digits <= std::numeric_limits<ToType>::digits && AZStd::is_signed<FromType>::value &&
|
||||
AZStd::is_unsigned<ToType>::value,
|
||||
bool>::type
|
||||
FitsInToType(const FromType& value)
|
||||
{
|
||||
return !NumericCastInternal::UnderflowsToType<ToType>(value);
|
||||
}
|
||||
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
AZStd::is_integral<FromType>::value && AZStd::is_integral<ToType>::value &&
|
||||
(std::numeric_limits<FromType>::digits > std::numeric_limits<ToType>::digits) && AZStd::is_unsigned<FromType>::value,
|
||||
bool>::type
|
||||
FitsInToType(const FromType& value)
|
||||
{
|
||||
return !NumericCastInternal::OverflowsToType<ToType>(value);
|
||||
}
|
||||
|
||||
template<typename ToType, typename FromType>
|
||||
inline constexpr typename AZStd::enable_if<
|
||||
(!AZStd::is_integral<FromType>::value || !AZStd::is_integral<ToType>::value) ||
|
||||
((std::numeric_limits<FromType>::digits <= std::numeric_limits<ToType>::digits) &&
|
||||
(AZStd::is_unsigned<FromType>::value || AZStd::is_signed<ToType>::value)) ||
|
||||
((std::numeric_limits<FromType>::digits > std::numeric_limits<ToType>::digits) && AZStd::is_signed<FromType>::value),
|
||||
bool>::type
|
||||
FitsInToType(const FromType& value)
|
||||
{
|
||||
return !NumericCastInternal::OverflowsToType<ToType>(value) && !NumericCastInternal::UnderflowsToType<ToType>(value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -266,7 +266,7 @@ namespace AZ
|
||||
_ComponentClass::RTTI_Type().ToString<AZStd::string>().c_str(), descriptor->GetName(), _ComponentClass::RTTI_TypeName()); \
|
||||
return nullptr; \
|
||||
} \
|
||||
else if (descriptor->GetName() != _ComponentClass::RTTI_TypeName()) \
|
||||
if (descriptor->GetName() != _ComponentClass::RTTI_TypeName()) \
|
||||
{ \
|
||||
AZ_Error("Component", false, "The same component UUID (%s) / name (%s) was registered twice. This isn't allowed, " \
|
||||
"it can cause lifetime management issues / crashes.\nThis situation can happen by declaring a component " \
|
||||
|
||||
@@ -74,6 +74,8 @@
|
||||
#include <AzCore/Module/Environment.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
|
||||
AZ_CVAR(float, g_simulation_tick_rate, 0, nullptr, AZ::ConsoleFunctorFlags::Null, "The rate at which the game simulation tick loop runs, or 0 for as fast as possible");
|
||||
|
||||
static void PrintEntityName(const AZ::ConsoleCommandContainer& arguments)
|
||||
{
|
||||
if (arguments.empty())
|
||||
@@ -653,6 +655,7 @@ namespace AZ
|
||||
|
||||
ComponentApplicationBus::Handler::BusConnect();
|
||||
|
||||
m_currentTime = AZStd::chrono::system_clock::now();
|
||||
TickRequestBus::Handler::BusConnect();
|
||||
|
||||
#if defined(AZ_ENABLE_DEBUG_TOOLS)
|
||||
@@ -1249,6 +1252,8 @@ namespace AZ
|
||||
|
||||
return AZ::SettingsRegistryInterface::VisitResponse::Continue;
|
||||
}
|
||||
|
||||
using SettingsRegistryInterface::Visitor::Visit;
|
||||
void Visit(AZStd::string_view path, AZStd::string_view valueName, AZ::SettingsRegistryInterface::Type, bool value) override
|
||||
{
|
||||
// By default the auto load option is true
|
||||
@@ -1365,45 +1370,44 @@ namespace AZ
|
||||
#endif
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Tick
|
||||
//=========================================================================
|
||||
void ComponentApplication::Tick(float deltaOverride /*= -1.f*/)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(System, "Component application simulation tick");
|
||||
AZStd::chrono::system_clock::time_point now = AZStd::chrono::system_clock::now();
|
||||
m_deltaTime = 0.0f;
|
||||
if (now >= m_currentTime)
|
||||
{
|
||||
AZ_PROFILE_SCOPE(System, "Component application simulation tick");
|
||||
AZStd::chrono::duration<float> delta = now - m_currentTime;
|
||||
m_deltaTime = deltaOverride >= 0.f ? deltaOverride : delta.count();
|
||||
}
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AzCore, "ComponentApplication::Tick:ExecuteQueuedEvents");
|
||||
TickBus::ExecuteQueuedEvents();
|
||||
}
|
||||
m_currentTime = now;
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AzCore, "ComponentApplication::Tick:OnTick");
|
||||
EBUS_EVENT(TickBus, OnTick, m_deltaTime, ScriptTimePoint(now));
|
||||
}
|
||||
|
||||
TimeUs now = GetElapsedTimeUs();
|
||||
if (m_currentTime == TimeUs{ 0 })
|
||||
{
|
||||
m_currentTime = now;
|
||||
}
|
||||
// If tick rate limiting is on, ensure (1 / g_simulation_tick_rate) ms has elapsed since the last frame,
|
||||
// sleeping if there's still time remaining.
|
||||
if (g_simulation_tick_rate > 0.f)
|
||||
{
|
||||
now = AZStd::chrono::system_clock::now();
|
||||
|
||||
m_deltaTime = 0.0f;
|
||||
// Work in microsecond durations here as that's the native measurement time for time_point
|
||||
constexpr float microsecondsPerSecond = 1000.f * 1000.f;
|
||||
const AZStd::chrono::microseconds timeBudgetPerTick(static_cast<int>(microsecondsPerSecond / g_simulation_tick_rate));
|
||||
AZStd::chrono::microseconds timeUntilNextTick = m_currentTime + timeBudgetPerTick - now;
|
||||
|
||||
if (now >= m_currentTime)
|
||||
if (timeUntilNextTick.count() > 0)
|
||||
{
|
||||
float delta = TimeUsToSeconds(now - m_currentTime);
|
||||
m_deltaTime = deltaOverride >= 0.f ? deltaOverride : delta;
|
||||
}
|
||||
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AzCore, "ComponentApplication::Tick:ExecuteQueuedEvents");
|
||||
TickBus::ExecuteQueuedEvents();
|
||||
}
|
||||
m_currentTime = now;
|
||||
{
|
||||
AZ_PROFILE_SCOPE(AzCore, "ComponentApplication::Tick:OnTick");
|
||||
auto epoch = AZStd::chrono::time_point<AZStd::chrono::high_resolution_clock>();
|
||||
auto chronoNow = AZStd::chrono::microseconds(aznumeric_cast<int64_t>(now));
|
||||
EBUS_EVENT(TickBus, OnTick, m_deltaTime, ScriptTimePoint(epoch + chronoNow));
|
||||
AZStd::this_thread::sleep_for(timeUntilNextTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Tick
|
||||
//=========================================================================
|
||||
void ComponentApplication::TickSystem()
|
||||
{
|
||||
AZ_PROFILE_SCOPE(System, "Component application tick");
|
||||
@@ -1519,9 +1523,7 @@ namespace AZ
|
||||
//=========================================================================
|
||||
ScriptTimePoint ComponentApplication::GetTimeAtCurrentTick()
|
||||
{
|
||||
auto epoch = AZStd::chrono::time_point<AZStd::chrono::high_resolution_clock>();
|
||||
auto chronoCurrent = AZStd::chrono::microseconds(aznumeric_cast<int64_t>(m_currentTime));
|
||||
return ScriptTimePoint(epoch + chronoCurrent);
|
||||
return ScriptTimePoint(m_currentTime);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
|
||||
@@ -197,14 +197,14 @@ namespace AZ
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ComponentApplicationRequests
|
||||
void RegisterComponentDescriptor(const ComponentDescriptor* descriptor) override final;
|
||||
void UnregisterComponentDescriptor(const ComponentDescriptor* descriptor) override final;
|
||||
void RegisterEntityAddedEventHandler(EntityAddedEvent::Handler& handler) override final;
|
||||
void RegisterEntityRemovedEventHandler(EntityRemovedEvent::Handler& handler) override final;
|
||||
void RegisterEntityActivatedEventHandler(EntityActivatedEvent::Handler& handler) override final;
|
||||
void RegisterEntityDeactivatedEventHandler(EntityDeactivatedEvent::Handler& handler) override final;
|
||||
void SignalEntityActivated(Entity* entity) override final;
|
||||
void SignalEntityDeactivated(Entity* entity) override final;
|
||||
void RegisterComponentDescriptor(const ComponentDescriptor* descriptor) final;
|
||||
void UnregisterComponentDescriptor(const ComponentDescriptor* descriptor) final;
|
||||
void RegisterEntityAddedEventHandler(EntityAddedEvent::Handler& handler) final;
|
||||
void RegisterEntityRemovedEventHandler(EntityRemovedEvent::Handler& handler) final;
|
||||
void RegisterEntityActivatedEventHandler(EntityActivatedEvent::Handler& handler) final;
|
||||
void RegisterEntityDeactivatedEventHandler(EntityDeactivatedEvent::Handler& handler) final;
|
||||
void SignalEntityActivated(Entity* entity) final;
|
||||
void SignalEntityDeactivated(Entity* entity) final;
|
||||
bool AddEntity(Entity* entity) override;
|
||||
bool RemoveEntity(Entity* entity) override;
|
||||
bool DeleteEntity(const EntityId& id) override;
|
||||
@@ -369,7 +369,7 @@ namespace AZ
|
||||
}
|
||||
}
|
||||
|
||||
AZ::TimeUs m_currentTime{ 0 };
|
||||
AZStd::chrono::system_clock::time_point m_currentTime{ AZStd::chrono::system_clock::time_point::max() };
|
||||
float m_deltaTime{ 0.0f };
|
||||
AZStd::unique_ptr<ModuleManager> m_moduleManager;
|
||||
AZStd::unique_ptr<SettingsRegistryInterface> m_settingsRegistry;
|
||||
|
||||
@@ -84,8 +84,9 @@ namespace AZ
|
||||
static TypeId genericComponentWrapperTypeId("{68D358CA-89B9-4730-8BA6-E181DEA28FDE}");
|
||||
for (auto& [componentKey, component] : componentMap)
|
||||
{
|
||||
// if underlying type is genericComponentWrapperTypeId, the template is null and the component should not be addded
|
||||
if (component->GetUnderlyingComponentType() != genericComponentWrapperTypeId)
|
||||
// if the component didn't serialize (i.e. is null) or the underlying type is genericComponentWrapperTypeId, the
|
||||
// template is null and the component should not be addded
|
||||
if (component && (component->GetUnderlyingComponentType() != genericComponentWrapperTypeId))
|
||||
{
|
||||
entityInstance->m_components.emplace_back(component);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ namespace AZ
|
||||
|
||||
TICK_PRE_RENDER = 750, ///< Suggested tick handler position to update render-related data.
|
||||
|
||||
TICK_RENDER = 800, ///< Suggested tick handler position for rendering.
|
||||
|
||||
TICK_DEFAULT = 1000, ///< Default tick handler position when the handler is constructed.
|
||||
|
||||
TICK_UI = 2000, ///< Suggested tick handler position for UI components.
|
||||
|
||||
@@ -86,6 +86,7 @@ namespace AZ
|
||||
class AssetTreeNodeBase
|
||||
{
|
||||
public:
|
||||
virtual ~AssetTreeNodeBase() = default;
|
||||
virtual const AssetPrimaryInfo* GetAssetPrimaryInfo() const = 0;
|
||||
virtual AssetTreeNodeBase* FindOrAddChild(const AssetTrackingId& id, const AssetPrimaryInfo* info) = 0;
|
||||
};
|
||||
@@ -94,6 +95,7 @@ namespace AZ
|
||||
class AssetTreeBase
|
||||
{
|
||||
public:
|
||||
virtual ~AssetTreeBase() = default;
|
||||
virtual AssetTreeNodeBase& GetRoot() = 0;
|
||||
};
|
||||
|
||||
@@ -101,6 +103,7 @@ namespace AZ
|
||||
class AssetAllocationTableBase
|
||||
{
|
||||
public:
|
||||
virtual ~AssetAllocationTableBase() = default;
|
||||
virtual AssetTreeNodeBase* FindAllocation(void* ptr) const = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace AZ
|
||||
{
|
||||
}
|
||||
|
||||
~AssetTreeNode() override = default;
|
||||
|
||||
const AssetPrimaryInfo* GetAssetPrimaryInfo() const override
|
||||
{
|
||||
return m_primaryinfo;
|
||||
@@ -67,6 +69,8 @@ namespace AZ
|
||||
class AssetTree : public AssetTreeBase
|
||||
{
|
||||
public:
|
||||
~AssetTree() override = default;
|
||||
|
||||
AssetTreeNodeBase& GetRoot() override
|
||||
{
|
||||
return m_rootAssets;
|
||||
@@ -99,6 +103,7 @@ namespace AZ
|
||||
AllocationTable(mutex_type& mutex) : m_mutex(mutex)
|
||||
{
|
||||
}
|
||||
~AllocationTable() override = default;
|
||||
|
||||
AssetTreeNodeBase* FindAllocation(void* ptr) const override
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace AZ::Debug
|
||||
class BudgetTracker
|
||||
{
|
||||
public:
|
||||
AZ_RTTI(BudgetTracker, "{E14A746D-BFFE-4C02-90FB-4699B79864A5}");
|
||||
AZ_TYPE_INFO(BudgetTracker, "{E14A746D-BFFE-4C02-90FB-4699B79864A5}");
|
||||
static Budget* GetBudgetFromEnvironment(const char* budgetName, uint32_t crc);
|
||||
|
||||
~BudgetTracker();
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
#define AZ_VA_HAS_ARGS(...) ""#__VA_ARGS__[0] != 0
|
||||
|
||||
#include <AzCore/base.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -262,17 +261,18 @@ namespace AZ
|
||||
#define AZ_VerifyWarning(window, expression, ...) AZ_Warning(window, 0 != (expression), __VA_ARGS__)
|
||||
|
||||
#else // !AZ_ENABLE_TRACING
|
||||
#define AZ_Assert(expression, ...)
|
||||
#define AZ_Error(window, expression, ...)
|
||||
#define AZ_ErrorOnce(window, expression, ...)
|
||||
#define AZ_Warning(window, expression, ...)
|
||||
#define AZ_WarningOnce(window, expression, ...)
|
||||
#define AZ_TracePrintf(window, ...)
|
||||
#define AZ_TracePrintfOnce(window, ...)
|
||||
|
||||
#define AZ_Verify(expression, ...) (void)(expression)
|
||||
#define AZ_VerifyError(window, expression, ...) (void)(expression)
|
||||
#define AZ_VerifyWarning(window, expression, ...) (void)(expression)
|
||||
#define AZ_Assert(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_Error(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_ErrorOnce(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_Warning(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_WarningOnce(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_TracePrintf(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_TracePrintfOnce(...) AZ_UNUSED(__VA_ARGS__);
|
||||
|
||||
#define AZ_Verify(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_VerifyError(...) AZ_UNUSED(__VA_ARGS__);
|
||||
#define AZ_VerifyWarning(...) AZ_UNUSED(__VA_ARGS__);
|
||||
|
||||
#endif // AZ_ENABLE_TRACING
|
||||
|
||||
|
||||
@@ -28,21 +28,21 @@ namespace AZ
|
||||
protected:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Driller
|
||||
virtual const char* GroupName() const { return "SystemDrillers"; }
|
||||
virtual const char* GetName() const { return "TraceMessagesDriller"; }
|
||||
virtual const char* GetDescription() const { return "Handles all system messages like Assert, Exception, Error, Warning, Printf, etc."; }
|
||||
virtual void Start(const Param* params = NULL, int numParams = 0);
|
||||
virtual void Stop();
|
||||
const char* GroupName() const override { return "SystemDrillers"; }
|
||||
const char* GetName() const override { return "TraceMessagesDriller"; }
|
||||
const char* GetDescription() const override { return "Handles all system messages like Assert, Exception, Error, Warning, Printf, etc."; }
|
||||
void Start(const Param* params = NULL, int numParams = 0) override;
|
||||
void Stop() override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// TraceMessagesDrillerBus
|
||||
/// Triggered when a AZ_Assert failed. This is terminating event! (the code will break, crash).
|
||||
virtual void OnAssert(const char* message);
|
||||
virtual void OnException(const char* message);
|
||||
virtual void OnError(const char* window, const char* message);
|
||||
virtual void OnWarning(const char* window, const char* message);
|
||||
virtual void OnPrintf(const char* window, const char* message);
|
||||
void OnAssert(const char* message) override;
|
||||
void OnException(const char* message) override;
|
||||
void OnError(const char* window, const char* message) override;
|
||||
void OnWarning(const char* window, const char* message) override;
|
||||
void OnPrintf(const char* window, const char* message) override;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
} // namespace Debug
|
||||
|
||||
@@ -693,7 +693,7 @@ namespace AZ
|
||||
}
|
||||
else
|
||||
{
|
||||
AZ_Assert(m_isPooledString == false && m_isPooledStringCrc32 == false, "This stream requires using of a string pool as the string is send only once and afterwards only the Crc32 is used!")
|
||||
AZ_Assert(m_isPooledString == false && m_isPooledStringCrc32 == false, "This stream requires using of a string pool as the string is send only once and afterwards only the Crc32 is used!");
|
||||
}
|
||||
return srcData;
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ namespace AZ
|
||||
const unsigned char* GetData() const { return m_data.data(); }
|
||||
unsigned int GetDataSize() const { return static_cast<unsigned int>(m_data.size()); }
|
||||
inline void Reset() { m_data.clear(); }
|
||||
virtual void WriteBinary(const void* data, unsigned int dataSize)
|
||||
void WriteBinary(const void* data, unsigned int dataSize) override
|
||||
{
|
||||
m_data.insert(m_data.end(), reinterpret_cast<const unsigned char*>(data), reinterpret_cast<const unsigned char*>(data) + dataSize);
|
||||
}
|
||||
@@ -489,7 +489,7 @@ namespace AZ
|
||||
}
|
||||
|
||||
unsigned int GetDataLeft() const { return static_cast<unsigned int>(m_dataEnd - m_data); }
|
||||
virtual unsigned int ReadBinary(void* data, unsigned int maxDataSize)
|
||||
unsigned int ReadBinary(void* data, unsigned int maxDataSize) override
|
||||
{
|
||||
AZ_Assert(m_data != nullptr, "You must call SetData function, before you can read data!");
|
||||
AZ_Assert(data != nullptr && maxDataSize > 0, "We must have a valid pointer and max data size!");
|
||||
@@ -523,7 +523,7 @@ namespace AZ
|
||||
bool Open(const char* fileName, int mode, int platformFlags = 0);
|
||||
void Close();
|
||||
|
||||
virtual void WriteBinary(const void* data, unsigned int dataSize);
|
||||
void WriteBinary(const void* data, unsigned int dataSize) override;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -540,7 +540,7 @@ namespace AZ
|
||||
DrillerInputFileStream();
|
||||
~DrillerInputFileStream();
|
||||
bool Open(const char* fileName, int mode, int platformFlags = 0);
|
||||
virtual unsigned int ReadBinary(void* data, unsigned int maxDataSize);
|
||||
unsigned int ReadBinary(void* data, unsigned int maxDataSize) override;
|
||||
void Close();
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user