add SC cvar settings cache
Signed-off-by: chcurran <82187351+carlitosan@users.noreply.github.com>
This commit is contained in:
@@ -314,13 +314,6 @@ namespace ScriptCanvasBuilder
|
||||
}
|
||||
else
|
||||
{
|
||||
// force load all dependencies into memory
|
||||
// for (auto& dependency : m_processEditorAssetDependencies)
|
||||
// {
|
||||
// auto depAsset = AZ::Data::AssetManager::Instance().GetAsset(dependency.m_assetId, dependency.m_assetType, AZ::Data::AssetLoadBehavior::PreLoad);
|
||||
// depAsset.BlockUntilLoadComplete();
|
||||
// }
|
||||
|
||||
AZ::Entity* buildEntity = asset.Get()->GetScriptCanvasEntity();
|
||||
|
||||
ProcessTranslationJobInput input;
|
||||
|
||||
@@ -218,6 +218,7 @@ namespace ScriptCanvasEditor
|
||||
m_inProgressAsset = m_assetsToUpgrade.erase(m_inProgressAsset);
|
||||
m_inProgress = false;
|
||||
m_state = ProcessState::Inactive;
|
||||
m_settingsCache.reset();
|
||||
AZ::SystemTickBus::Handler::BusDisconnect();
|
||||
AZ::Debug::TraceMessageBus::Handler::BusDisconnect();
|
||||
}
|
||||
@@ -277,7 +278,7 @@ namespace ScriptCanvasEditor
|
||||
void VersionExplorer::OnUpgradeAll()
|
||||
{
|
||||
m_state = ProcessState::Upgrade;
|
||||
// cache these...with a widget thing
|
||||
m_settingsCache = AZStd::make_unique<ScriptCanvas::Grammar::SettingsCache>();
|
||||
ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile = false;
|
||||
ScriptCanvas::Grammar::g_printAbstractCodeModel = false;
|
||||
ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile = false;
|
||||
@@ -693,6 +694,7 @@ namespace ScriptCanvasEditor
|
||||
AZ::Debug::TraceMessageBus::Handler::BusDisconnect();
|
||||
UpgradeNotifications::Bus::Handler::BusDisconnect();
|
||||
AZ::Interface<IUpgradeRequests>::Get()->SetIsUpgrading(false);
|
||||
m_settingsCache.reset();
|
||||
}
|
||||
|
||||
// Scanning
|
||||
@@ -712,8 +714,7 @@ namespace ScriptCanvasEditor
|
||||
void VersionExplorer::DoScan()
|
||||
{
|
||||
m_state = ProcessState::Scan;
|
||||
// cache pre-tool values (make a little widget that does that, actually
|
||||
// so one can destroy it and reset it
|
||||
m_settingsCache = AZStd::make_unique<ScriptCanvas::Grammar::SettingsCache>();
|
||||
ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile = false;
|
||||
ScriptCanvas::Grammar::g_printAbstractCodeModel = false;
|
||||
ScriptCanvas::Grammar::g_saveRawTranslationOuputToFile = false;
|
||||
@@ -938,6 +939,7 @@ namespace ScriptCanvasEditor
|
||||
UpgradeNotifications::Bus::Handler::BusDisconnect();
|
||||
|
||||
m_keepEditorAlive.reset();
|
||||
m_settingsCache.reset();
|
||||
m_state = ProcessState::Inactive;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,6 +135,8 @@ namespace ScriptCanvasEditor
|
||||
|
||||
AZStd::unique_ptr<Ui::VersionExplorer> m_ui;
|
||||
|
||||
AZStd::unique_ptr<ScriptCanvas::Grammar::SettingsCache> m_settingsCache;
|
||||
|
||||
// upgrade fields
|
||||
AZStd::recursive_mutex m_mutex;
|
||||
bool m_upgradeComplete = false;
|
||||
|
||||
@@ -17,5 +17,23 @@ namespace ScriptCanvas
|
||||
AZ_CVAR(bool, g_printAbstractCodeModelAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Print out the Abstract Code Model at the end of parsing (at prefab time) for debug purposes.");
|
||||
AZ_CVAR(bool, g_saveRawTranslationOuputToFile, true, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation for debug purposes.");
|
||||
AZ_CVAR(bool, g_saveRawTranslationOuputToFileAtPrefabTime, false, {}, AZ::ConsoleFunctorFlags::Null, "Save out the raw result of translation (at prefab time) for debug purposes.");
|
||||
|
||||
SettingsCache::SettingsCache()
|
||||
{
|
||||
m_disableParseOnGraphValidation = g_disableParseOnGraphValidation;
|
||||
m_printAbstractCodeModel = g_printAbstractCodeModel;
|
||||
m_printAbstractCodeModelAtPrefabTime = g_printAbstractCodeModelAtPrefabTime;
|
||||
m_saveRawTranslationOuputToFile = g_saveRawTranslationOuputToFile;
|
||||
m_saveRawTranslationOuputToFileAtPrefabTime = g_saveRawTranslationOuputToFileAtPrefabTime;
|
||||
}
|
||||
|
||||
SettingsCache::~SettingsCache()
|
||||
{
|
||||
g_disableParseOnGraphValidation = m_disableParseOnGraphValidation;
|
||||
g_printAbstractCodeModel = m_printAbstractCodeModel;
|
||||
g_printAbstractCodeModelAtPrefabTime = m_printAbstractCodeModelAtPrefabTime;
|
||||
g_saveRawTranslationOuputToFile = m_saveRawTranslationOuputToFile;
|
||||
g_saveRawTranslationOuputToFileAtPrefabTime = m_saveRawTranslationOuputToFileAtPrefabTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,6 +248,22 @@ namespace ScriptCanvas
|
||||
AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFile);
|
||||
AZ_CVAR_EXTERNED(bool, g_saveRawTranslationOuputToFileAtPrefabTime);
|
||||
|
||||
class SettingsCache
|
||||
{
|
||||
public:
|
||||
AZ_CLASS_ALLOCATOR(SettingsCache, AZ::SystemAllocator, 0);
|
||||
|
||||
SettingsCache();
|
||||
~SettingsCache();
|
||||
|
||||
private:
|
||||
bool m_disableParseOnGraphValidation;
|
||||
bool m_printAbstractCodeModel;
|
||||
bool m_printAbstractCodeModelAtPrefabTime;
|
||||
bool m_saveRawTranslationOuputToFile;
|
||||
bool m_saveRawTranslationOuputToFileAtPrefabTime;
|
||||
};
|
||||
|
||||
struct DependencyInfo
|
||||
{
|
||||
AZ::Data::AssetId assetId;
|
||||
|
||||
Reference in New Issue
Block a user