Integrating latest 47acbe8
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
@@ -9,13 +9,31 @@
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
#include "precompiled.h"
|
||||
|
||||
#include <ScriptCanvasDeveloper/ScriptCanvasDeveloperComponent.h>
|
||||
#include "precompiled.h"
|
||||
|
||||
#include <ScriptCanvas/Core/Connection.h>
|
||||
#include <ScriptCanvas/Core/Graph.h>
|
||||
#include <ScriptCanvas/Core/Node.h>
|
||||
#include <ScriptCanvasDeveloper/ScriptCanvasDeveloperComponent.h>
|
||||
|
||||
namespace ScriptCanvasDeveloperComponentCpp
|
||||
{
|
||||
bool GetListEntryFromAZStdStringVector(void* data, int idx, const char** out_text)
|
||||
{
|
||||
AZStd::vector<AZStd::string>* vector = reinterpret_cast<AZStd::vector<AZStd::string>*>(data);
|
||||
|
||||
if (idx < vector->size())
|
||||
{
|
||||
*out_text = (*vector)[idx].c_str();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
namespace ScriptCanvasDeveloper
|
||||
{
|
||||
@@ -27,6 +45,8 @@ namespace ScriptCanvasDeveloper
|
||||
->Version(0)
|
||||
;
|
||||
}
|
||||
|
||||
ScriptCanvas::Execution::PerformanceStatistician::Reflect(context);
|
||||
}
|
||||
|
||||
void SystemComponent::GetProvidedServices(AZ::ComponentDescriptor::DependencyArrayType& provided)
|
||||
@@ -41,9 +61,43 @@ namespace ScriptCanvasDeveloper
|
||||
|
||||
void SystemComponent::Activate()
|
||||
{
|
||||
#ifdef IMGUI_ENABLED
|
||||
ImGui::ImGuiUpdateListenerBus::Handler::BusConnect();
|
||||
#endif // IMGUI_ENABLED
|
||||
|
||||
}
|
||||
|
||||
void SystemComponent::Deactivate()
|
||||
{
|
||||
#ifdef IMGUI_ENABLED
|
||||
ImGui::ImGuiUpdateListenerBus::Handler::BusDisconnect();
|
||||
#endif // IMGUI_ENABLED
|
||||
}
|
||||
|
||||
#ifdef IMGUI_ENABLED
|
||||
|
||||
void SystemComponent::FullPerformanceWindow()
|
||||
{
|
||||
GraphHistoryListBox();
|
||||
}
|
||||
|
||||
void SystemComponent::GraphHistoryListBox()
|
||||
{
|
||||
AZStd::vector<AZStd::string> scriptHistory = m_perfStatistician.GetExecutedScriptsSinceLastSnapshot();
|
||||
int index = 0;
|
||||
const int k_HeightInItemCount = 30;
|
||||
ImGui::ListBox(":Graph", &index, &ScriptCanvasDeveloperComponentCpp::GetListEntryFromAZStdStringVector, &scriptHistory, aznumeric_cast<int>(scriptHistory.size()), k_HeightInItemCount);
|
||||
}
|
||||
|
||||
void SystemComponent::OnImGuiMainMenuUpdate()
|
||||
{
|
||||
if (ImGui::BeginMenu("Script Canvas"))
|
||||
{
|
||||
FullPerformanceWindow();
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
}
|
||||
|
||||
#endif // IMGUI_ENABLED
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user