Fixing ME and ATWindowNotificationBus
Signed-off-by: Dayo Lawal <lawalfua@amazon.com>
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
|
||||
#include <Atom/Document/MaterialDocumentRequestBus.h>
|
||||
#include <Atom/Document/MaterialDocumentSystemRequestBus.h>
|
||||
#include <Atom/Window/MaterialEditorWindowNotificationBus.h>
|
||||
#include <Atom/Window/MaterialEditorWindowSettings.h>
|
||||
|
||||
#include <AtomToolsFramework/Util/Util.h>
|
||||
#include <AtomToolsFramework/Window/AtomToolsMainWindowNotificationBus.h>
|
||||
|
||||
#include <AzFramework/Application/Application.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
@@ -185,7 +185,8 @@ namespace MaterialEditor
|
||||
QByteArray windowState = m_advancedDockManager->saveState();
|
||||
windowSettings->m_mainWindowState.assign(windowState.begin(), windowState.end());
|
||||
|
||||
MaterialEditorWindowNotificationBus::Broadcast(&MaterialEditorWindowNotifications::OnMaterialEditorWindowClosing);
|
||||
AtomToolsFramework::AtomToolsMainWindowNotificationBus::Broadcast(
|
||||
&AtomToolsFramework::AtomToolsMainWindowNotifications::OnAtomToolsMainWindowWindowClosing);
|
||||
}
|
||||
|
||||
void MaterialEditorWindow::OnDocumentOpened(const AZ::Uuid& documentId)
|
||||
@@ -284,7 +285,7 @@ namespace MaterialEditor
|
||||
|
||||
void MaterialEditorWindow::SetupMenu()
|
||||
{
|
||||
AtomToolsFramework::AtomToolsMainWindow::SetupMenu();
|
||||
Base::SetupMenu();
|
||||
|
||||
m_actionNew = m_menuFile->addAction("&New...", [this]() {
|
||||
CreateMaterialDialog createDialog(this);
|
||||
@@ -482,7 +483,7 @@ namespace MaterialEditor
|
||||
|
||||
void MaterialEditorWindow::SetupTabs()
|
||||
{
|
||||
AtomToolsFramework::AtomToolsMainWindow::SetupTabs();
|
||||
Base::SetupTabs();
|
||||
|
||||
// This signal will be triggered whenever a tab is added, removed, selected, clicked, dragged
|
||||
// When the last tab is removed tabIndex will be -1 and the document ID will be null
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
#pragma once
|
||||
|
||||
#if !defined(Q_MOC_RUN)
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <Atom/Document/MaterialDocumentNotificationBus.h>
|
||||
#include <AtomToolsFramework/Window/AtomToolsMainWindow.h>
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
|
||||
AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnings spawned by QT
|
||||
#include <AzQtComponents/Components/DockMainWindow.h>
|
||||
@@ -19,14 +19,13 @@ AZ_PUSH_DISABLE_WARNING(4251 4800, "-Wunknown-warning-option") // disable warnin
|
||||
#include <AzQtComponents/Components/StyledDockWidget.h>
|
||||
#include <AzQtComponents/Components/Widgets/TabWidget.h>
|
||||
|
||||
#include <Atom/Window/MaterialEditorWindowRequestBus.h>
|
||||
#include <Viewport/MaterialViewportWidget.h>
|
||||
#include <Window/ToolBar/MaterialEditorToolBar.h>
|
||||
#include <Window/StatusBar/StatusBarWidget.h>
|
||||
#include <Window/ToolBar/MaterialEditorToolBar.h>
|
||||
|
||||
#include <QMenuBar>
|
||||
#include <QToolBar>
|
||||
#include <QStatusBar>
|
||||
#include <QToolBar>
|
||||
AZ_POP_DISABLE_WARNING
|
||||
#endif
|
||||
|
||||
|
||||
+15
-11
@@ -18,6 +18,8 @@
|
||||
#include <Window/MaterialEditorWindow.h>
|
||||
#include <Window/MaterialEditorWindowComponent.h>
|
||||
#include <Window/ViewportSettingsInspector/ViewportSettingsInspector.h>
|
||||
#include <AtomToolsFramework/Window/AtomToolsMainWindowRequestBus.h>
|
||||
|
||||
|
||||
namespace MaterialEditor
|
||||
{
|
||||
@@ -33,25 +35,27 @@ namespace MaterialEditor
|
||||
|
||||
if (AZ::BehaviorContext* behaviorContext = azrtti_cast<AZ::BehaviorContext*>(context))
|
||||
{
|
||||
behaviorContext->EBus<MaterialEditorWindowFactoryRequestBus>("MaterialEditorWindowFactoryRequestBus")
|
||||
using FactoryRequestBus = MaterialEditorWindowFactoryRequestBus;
|
||||
behaviorContext->EBus<FactoryRequestBus>("MaterialEditorWindowFactoryRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "Editor")
|
||||
->Attribute(AZ::Script::Attributes::Module, "materialeditor")
|
||||
->Event("CreateMaterialEditorWindow", &MaterialEditorWindowFactoryRequestBus::Events::CreateMaterialEditorWindow)
|
||||
->Event("DestroyMaterialEditorWindow", &MaterialEditorWindowFactoryRequestBus::Events::DestroyMaterialEditorWindow)
|
||||
->Event("CreateMaterialEditorWindow", &FactoryRequestBus::Events::CreateMaterialEditorWindow)
|
||||
->Event("DestroyMaterialEditorWindow", &FactoryRequestBus::Events::DestroyMaterialEditorWindow)
|
||||
;
|
||||
|
||||
behaviorContext->EBus<MaterialEditorWindowRequestBus>("MaterialEditorWindowRequestBus")
|
||||
using RequestBus = AtomToolsFramework::AtomToolsMainWindowRequestBus;
|
||||
behaviorContext->EBus<RequestBus>("MaterialEditorWindowRequestBus")
|
||||
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
|
||||
->Attribute(AZ::Script::Attributes::Category, "Editor")
|
||||
->Attribute(AZ::Script::Attributes::Module, "materialeditor")
|
||||
->Event("ActivateWindow", &MaterialEditorWindowRequestBus::Events::ActivateWindow)
|
||||
->Event("SetDockWidgetVisible", &MaterialEditorWindowRequestBus::Events::SetDockWidgetVisible)
|
||||
->Event("IsDockWidgetVisible", &MaterialEditorWindowRequestBus::Events::IsDockWidgetVisible)
|
||||
->Event("GetDockWidgetNames", &MaterialEditorWindowRequestBus::Events::GetDockWidgetNames)
|
||||
->Event("ResizeViewportRenderTarget", &MaterialEditorWindowRequestBus::Events::ResizeViewportRenderTarget)
|
||||
->Event("LockViewportRenderTargetSize", &MaterialEditorWindowRequestBus::Events::LockViewportRenderTargetSize)
|
||||
->Event("UnlockViewportRenderTargetSize", &MaterialEditorWindowRequestBus::Events::UnlockViewportRenderTargetSize)
|
||||
->Event("ActivateWindow", &RequestBus::Events::ActivateWindow)
|
||||
->Event("SetDockWidgetVisible", &RequestBus::Events::SetDockWidgetVisible)
|
||||
->Event("IsDockWidgetVisible", &RequestBus::Events::IsDockWidgetVisible)
|
||||
->Event("GetDockWidgetNames", &RequestBus::Events::GetDockWidgetNames)
|
||||
->Event("ResizeViewportRenderTarget", &RequestBus::Events::ResizeViewportRenderTarget)
|
||||
->Event("LockViewportRenderTargetSize", &RequestBus::Events::LockViewportRenderTargetSize)
|
||||
->Event("UnlockViewportRenderTargetSize", &RequestBus::Events::UnlockViewportRenderTargetSize)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user