Merge branch 'stabilization/2106' into JsonSerialization/UnsupportedWarnings

This commit is contained in:
AMZN-koppersr
2021-06-09 17:02:25 -07:00
43 changed files with 137484 additions and 264 deletions
@@ -322,12 +322,6 @@ namespace AzFramework
//! @param optionalArgs Optional additional arguments, see BarrierOptionalArgs.
virtual void Barrier(EntitySpawnTicket& ticket, BarrierCallback completionCallback, BarrierOptionalArgs optionalArgs = {}) = 0;
//! Register a handler for OnSpawned events.
virtual void AddOnSpawnedHandler(AZ::Event<AZ::Data::Asset<Spawnable>>::Handler& handler) = 0;
//! Register a handler for OnDespawned events.
virtual void AddOnDespawnedHandler(AZ::Event<AZ::Data::Asset<Spawnable>>::Handler& handler) = 0;
protected:
[[nodiscard]] virtual AZStd::pair<EntitySpawnTicket::Id, void*> CreateTicket(AZ::Data::Asset<Spawnable>&& spawnable) = 0;
virtual void DestroyTicket(void* ticket) = 0;
@@ -150,16 +150,6 @@ namespace AzFramework
QueueRequest(ticket, optionalArgs.m_priority, AZStd::move(queueEntry));
}
void SpawnableEntitiesManager::AddOnSpawnedHandler(AZ::Event<AZ::Data::Asset<Spawnable>>::Handler& handler)
{
handler.Connect(m_onSpawnedEvent);
}
void SpawnableEntitiesManager::AddOnDespawnedHandler(AZ::Event<AZ::Data::Asset<Spawnable>>::Handler& handler)
{
handler.Connect(m_onDespawnedEvent);
}
auto SpawnableEntitiesManager::ProcessQueue(CommandQueuePriority priority) -> CommandQueueStatus
{
CommandQueueStatus result = CommandQueueStatus::NoCommandsLeft;
@@ -320,8 +310,6 @@ namespace AzFramework
ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end()));
}
m_onSpawnedEvent.Signal(ticket.m_spawnable);
ticket.m_currentRequestId++;
return true;
}
@@ -401,8 +389,6 @@ namespace AzFramework
ticket.m_spawnedEntities.begin() + spawnedEntitiesInitialCount, ticket.m_spawnedEntities.end()));
}
m_onSpawnedEvent.Signal(ticket.m_spawnable);
ticket.m_currentRequestId++;
return true;
}
@@ -434,8 +420,6 @@ namespace AzFramework
request.m_completionCallback(request.m_ticketId);
}
m_onDespawnedEvent.Signal(ticket.m_spawnable);
ticket.m_currentRequestId++;
return true;
}
@@ -463,8 +447,6 @@ namespace AzFramework
}
}
m_onDespawnedEvent.Signal(ticket.m_spawnable);
// Rebuild the list of entities.
ticket.m_spawnedEntities.clear();
const Spawnable::EntityList& entities = request.m_spawnable->GetEntities();
@@ -517,8 +499,6 @@ namespace AzFramework
ticket.m_currentRequestId++;
m_onSpawnedEvent.Signal(ticket.m_spawnable);
return true;
}
else
@@ -73,9 +73,6 @@ namespace AzFramework
void Barrier(EntitySpawnTicket& spawnInfo, BarrierCallback completionCallback, BarrierOptionalArgs optionalArgs = {}) override;
void AddOnSpawnedHandler(AZ::Event<AZ::Data::Asset<Spawnable>>::Handler& handler) override;
void AddOnDespawnedHandler(AZ::Event<AZ::Data::Asset<Spawnable>>::Handler& handler) override;
//
// The following function is thread safe but intended to be run from the main thread.
//
@@ -200,9 +197,6 @@ namespace AzFramework
Queue m_highPriorityQueue;
Queue m_regularPriorityQueue;
AZ::Event<AZ::Data::Asset<Spawnable>> m_onSpawnedEvent;
AZ::Event<AZ::Data::Asset<Spawnable>> m_onDespawnedEvent;
AZ::SerializeContext* m_defaultSerializeContext { nullptr };
//! The threshold used to determine if a request goes in the regular (if bigger than the value) or high priority queue (if smaller
//! or equal to this value). The starting value of 64 is chosen as it's between default values SpawnablePriority_High and
@@ -1447,6 +1447,49 @@ namespace AzToolsFramework
GUI->SetBrowseButtonIcon(QIcon(iconPath.c_str()));
}
}
else if (attrib == AZ_CRC("EditCallback", 0xb74f2ee1))
{
PropertyAssetCtrl::EditCallbackType* func = azdynamic_cast<PropertyAssetCtrl::EditCallbackType*>(attrValue->GetAttribute());
if (func)
{
GUI->SetEditButtonVisible(true);
GUI->SetEditNotifyCallback(func);
}
else
{
GUI->SetEditNotifyCallback(nullptr);
}
}
else if (attrib == AZ_CRC("EditButton", 0x898c35dc))
{
GUI->SetEditButtonVisible(true);
AZStd::string iconPath;
attrValue->Read<AZStd::string>(iconPath);
if (!iconPath.empty())
{
QString path(iconPath.c_str());
if (!QFile::exists(path))
{
AZ::IO::FixedMaxPathString engineRoot = AZ::Utils::GetEnginePath();
QDir engineDir = !engineRoot.empty() ? QDir(QString(engineRoot.c_str())) : QDir::current();
path = engineDir.absoluteFilePath(iconPath.c_str());
}
GUI->SetEditButtonIcon(QIcon(path));
}
}
else if (attrib == AZ_CRC("EditDescription", 0x9b52634a))
{
AZStd::string buttonTooltip;
if (attrValue->Read<AZStd::string>(buttonTooltip))
{
GUI->SetEditButtonTooltip(tr(buttonTooltip.c_str()));
}
}
}
void SimpleAssetPropertyHandlerDefault::WriteGUIValuesIntoProperty(size_t index, PropertyAssetCtrl* GUI, property_t& instance, InstanceDataNode* node)
@@ -1476,6 +1519,7 @@ namespace AzToolsFramework
// Set the hint in case the asset is not able to be found by assetId
GUI->SetCurrentAssetHint(instance.GetAssetPath());
GUI->SetSelectedAssetID(assetId, instance.GetAssetType());
GUI->SetEditNotifyTarget(node->GetParent()->GetInstance(0));
GUI->blockSignals(false);
return false;