Merge branch 'development' into Prefabs/SpawnableEntityAlias
This commit is contained in:
@@ -204,7 +204,6 @@ namespace AzFramework
|
||||
systemEntity->Activate();
|
||||
AZ_Assert(systemEntity->GetState() == AZ::Entity::State::Active, "System Entity failed to activate.");
|
||||
|
||||
|
||||
if (m_isStarted = (systemEntity->GetState() == AZ::Entity::State::Active); m_isStarted)
|
||||
{
|
||||
if (m_startupParameters.m_loadAssetCatalog)
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
#include <AzCore/Component/ComponentApplicationBus.h>
|
||||
#include <AzCore/Component/ComponentApplicationLifecycle.h>
|
||||
#include <AzCore/Console/IConsole.h>
|
||||
#include <AzCore/Debug/Profiler.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
@@ -363,6 +364,23 @@ namespace AZ::IO
|
||||
, m_mainThreadId{ AZStd::this_thread::get_id() }
|
||||
{
|
||||
CompressionBus::Handler::BusConnect();
|
||||
|
||||
// If the settings registry is not available at this point,
|
||||
// then something catastrophic has happened in the application startup.
|
||||
// That should have been caught and messaged out earlier in startup.
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
// Automatically register the event if it's not registered, because
|
||||
// this system is initialized before the settings registry has loaded the event list.
|
||||
AZ::ComponentApplicationLifecycle::RegisterHandler(
|
||||
*settingsRegistry, m_componentApplicationLifecycleHandler,
|
||||
[this](AZStd::string_view /*path*/, AZ::SettingsRegistryInterface::Type /*type*/)
|
||||
{
|
||||
OnSystemEntityActivated();
|
||||
},
|
||||
"SystemComponentsActivated",
|
||||
/*autoRegisterEvent*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1175,13 +1193,20 @@ namespace AZ::IO
|
||||
}
|
||||
}
|
||||
|
||||
auto bundleManifest = GetBundleManifest(desc.pZip);
|
||||
AZStd::shared_ptr<AzFramework::AssetRegistry> bundleCatalog;
|
||||
auto bundleManifest = GetBundleManifest(desc.pZip);
|
||||
if (bundleManifest)
|
||||
{
|
||||
bundleCatalog = GetBundleCatalog(desc.pZip, bundleManifest->GetCatalogName());
|
||||
}
|
||||
|
||||
// If this archive is loaded before the serialize context is available, then the manifest and catalog will need to be loaded later.
|
||||
if (!bundleManifest || !bundleCatalog)
|
||||
{
|
||||
m_archivesWithCatalogsToLoad.push_back(
|
||||
ArchivesWithCatalogsToLoad(szFullPath, szBindRoot, flags, nextBundle, desc.m_strFileName));
|
||||
}
|
||||
|
||||
bool usePrefabSystemForLevels = false;
|
||||
AzFramework::ApplicationRequests::Bus::BroadcastResult(
|
||||
usePrefabSystemForLevels, &AzFramework::ApplicationRequests::IsPrefabSystemForLevelsEnabled);
|
||||
@@ -1219,12 +1244,17 @@ namespace AZ::IO
|
||||
m_levelOpenEvent.Signal(levelDirs);
|
||||
}
|
||||
|
||||
AZ::IO::ArchiveNotificationBus::Broadcast([](AZ::IO::ArchiveNotifications* archiveNotifications, const char* bundleName,
|
||||
AZStd::shared_ptr<AzFramework::AssetBundleManifest> bundleManifest, const AZ::IO::FixedMaxPath& nextBundle, AZStd::shared_ptr<AzFramework::AssetRegistry> bundleCatalog)
|
||||
if (bundleManifest && bundleCatalog)
|
||||
{
|
||||
archiveNotifications->BundleOpened(bundleName, bundleManifest, nextBundle.c_str(), bundleCatalog);
|
||||
}, desc.m_strFileName.c_str(), bundleManifest, nextBundle, bundleCatalog);
|
||||
|
||||
AZ::IO::ArchiveNotificationBus::Broadcast(
|
||||
[](AZ::IO::ArchiveNotifications* archiveNotifications, const char* bundleName,
|
||||
AZStd::shared_ptr<AzFramework::AssetBundleManifest> bundleManifest, const AZ::IO::FixedMaxPath& nextBundle,
|
||||
AZStd::shared_ptr<AzFramework::AssetRegistry> bundleCatalog)
|
||||
{
|
||||
archiveNotifications->BundleOpened(bundleName, bundleManifest, nextBundle.c_str(), bundleCatalog);
|
||||
},
|
||||
desc.m_strFileName.c_str(), bundleManifest, nextBundle, bundleCatalog);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2138,7 +2168,7 @@ namespace AZ::IO
|
||||
}
|
||||
|
||||
currentDirPattern = currentDir + AZ_FILESYSTEM_SEPARATOR_WILDCARD;
|
||||
currentFilePattern = currentDir + AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING + "levels.pak";
|
||||
currentFilePattern = currentDir + AZ_CORRECT_FILESYSTEM_SEPARATOR_STRING + "level.pak";
|
||||
|
||||
ZipDir::FileEntry* fileEntry = findFile.FindExact(currentFilePattern.c_str());
|
||||
if (fileEntry)
|
||||
@@ -2175,4 +2205,36 @@ namespace AZ::IO
|
||||
|
||||
return catalogInfo;
|
||||
}
|
||||
|
||||
void Archive::OnSystemEntityActivated()
|
||||
{
|
||||
for (const auto& archiveInfo : m_archivesWithCatalogsToLoad)
|
||||
{
|
||||
AZStd::intrusive_ptr<INestedArchive> archive =
|
||||
OpenArchive(archiveInfo.m_fullPath, archiveInfo.m_bindRoot, archiveInfo.m_flags, nullptr);
|
||||
if (!archive)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
ZipDir::CachePtr pZip = static_cast<NestedArchive*>(archive.get())->GetCache();
|
||||
|
||||
AZStd::shared_ptr<AzFramework::AssetRegistry> bundleCatalog;
|
||||
auto bundleManifest = GetBundleManifest(pZip);
|
||||
if (bundleManifest)
|
||||
{
|
||||
bundleCatalog = GetBundleCatalog(pZip, bundleManifest->GetCatalogName());
|
||||
}
|
||||
|
||||
AZ::IO::ArchiveNotificationBus::Broadcast(
|
||||
[](AZ::IO::ArchiveNotifications* archiveNotifications, const char* bundleName,
|
||||
AZStd::shared_ptr<AzFramework::AssetBundleManifest> bundleManifest, const AZ::IO::FixedMaxPath& nextBundle,
|
||||
AZStd::shared_ptr<AzFramework::AssetRegistry> bundleCatalog)
|
||||
{
|
||||
archiveNotifications->BundleOpened(bundleName, bundleManifest, nextBundle.c_str(), bundleCatalog);
|
||||
},
|
||||
archiveInfo.m_strFileName.c_str(), bundleManifest, archiveInfo.m_nextBundle, bundleCatalog);
|
||||
}
|
||||
m_archivesWithCatalogsToLoad.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <AzCore/IO/CompressionBus.h>
|
||||
#include <AzCore/Outcome/Outcome.h>
|
||||
#include <AzCore/IO/Path/Path.h>
|
||||
#include <AzCore/Settings/SettingsRegistry.h>
|
||||
#include <AzCore/std/containers/set.h>
|
||||
#include <AzCore/std/parallel/mutex.h>
|
||||
#include <AzCore/std/parallel/lock.h>
|
||||
@@ -271,6 +272,11 @@ namespace AZ::IO
|
||||
ZipDir::CachePtr* pZip = {}) const;
|
||||
private:
|
||||
|
||||
// Archives can't be fully mounted until the system entity has been activated,
|
||||
// because mounting them requires the BundlingSystemComponent and the serialization system
|
||||
// to both be available.
|
||||
void OnSystemEntityActivated();
|
||||
|
||||
bool OpenPackCommon(AZStd::string_view szBindRoot, AZStd::string_view pName, AZStd::intrusive_ptr<AZ::IO::MemoryBlock> pData = nullptr, bool addLevels = true);
|
||||
bool OpenPacksCommon(AZStd::string_view szDir, AZStd::string_view pWildcardIn, AZStd::vector<AZ::IO::FixedMaxPathString>* pFullPaths = nullptr, bool addLevels = true);
|
||||
|
||||
@@ -313,6 +319,8 @@ namespace AZ::IO
|
||||
mutable AZStd::shared_mutex m_csZips;
|
||||
ZipArray m_arrZips;
|
||||
|
||||
AZ::SettingsRegistryInterface::NotifyEventHandler m_componentApplicationLifecycleHandler;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Opened files collector.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -339,5 +347,34 @@ namespace AZ::IO
|
||||
// [LYN-2376] Remove once legacy slice support is removed
|
||||
LevelPackOpenEvent m_levelOpenEvent;
|
||||
LevelPackCloseEvent m_levelCloseEvent;
|
||||
|
||||
// If pak files are loaded before the serialization and bundling system
|
||||
// are ready to go, their asset catalogs can't be loaded.
|
||||
// In this case, cache information about those archives,
|
||||
// and attempt to load the catalogs later, when the required systems are enabled.
|
||||
struct ArchivesWithCatalogsToLoad
|
||||
{
|
||||
ArchivesWithCatalogsToLoad(
|
||||
AZStd::string_view fullPath,
|
||||
AZStd::string_view bindRoot,
|
||||
int flags,
|
||||
AZ::IO::PathView nextBundle,
|
||||
AZ::IO::Path strFileName)
|
||||
: m_fullPath(fullPath)
|
||||
, m_bindRoot(bindRoot)
|
||||
, m_flags(flags)
|
||||
, m_nextBundle(nextBundle)
|
||||
, m_strFileName(strFileName)
|
||||
{
|
||||
}
|
||||
|
||||
AZ::IO::Path m_strFileName;
|
||||
AZStd::string m_fullPath;
|
||||
AZStd::string m_bindRoot;
|
||||
AZ::IO::PathView m_nextBundle;
|
||||
int m_flags;
|
||||
};
|
||||
|
||||
AZStd::vector<ArchivesWithCatalogsToLoad> m_archivesWithCatalogsToLoad;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -323,6 +323,13 @@ namespace AzFramework
|
||||
return localZ;
|
||||
}
|
||||
|
||||
void TransformComponent::SetWorldRotation(const AZ::Vector3& eulerAnglesRadian)
|
||||
{
|
||||
AZ::Transform newWorldTransform = m_worldTM;
|
||||
newWorldTransform.SetRotation(AZ::Quaternion::CreateFromEulerAnglesRadians(eulerAnglesRadian));
|
||||
SetWorldTM(newWorldTransform);
|
||||
}
|
||||
|
||||
void TransformComponent::SetWorldRotationQuaternion(const AZ::Quaternion& quaternion)
|
||||
{
|
||||
AZ::Transform newWorldTransform = m_worldTM;
|
||||
|
||||
@@ -108,6 +108,7 @@ namespace AzFramework
|
||||
float GetLocalZ() override;
|
||||
|
||||
// Rotation modifiers
|
||||
void SetWorldRotation(const AZ::Vector3& eulerAnglesRadian) override;
|
||||
void SetWorldRotationQuaternion(const AZ::Quaternion& quaternion) override;
|
||||
|
||||
AZ::Vector3 GetWorldRotation() override;
|
||||
|
||||
+5
-13
@@ -229,17 +229,13 @@ namespace AzFramework
|
||||
//! Alias for the EBus implementation of this interface
|
||||
using Bus = AZ::EBus<InputDeviceImplementationRequest<InputDeviceType>>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create the custom implementations
|
||||
using CreateFunctionType = typename InputDeviceType::Implementation*(*)(InputDeviceType&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Set a custom implementation for this input device type, either for a specific instance
|
||||
//! by addressing the call to an InputDeviceId, or for all existing instances by broadcast.
|
||||
//! Passing InputDeviceType::Implementation::Create as the argument will create the default
|
||||
//! device implementation, while passing nullptr will delete any existing implementation.
|
||||
//! \param[in] createFunction Pointer to the function that will create the implementation.
|
||||
virtual void SetCustomImplementation(CreateFunctionType createFunction) = 0;
|
||||
//! \param[in] implementationFactory Pointer to the function that creates the implementation.
|
||||
virtual void SetCustomImplementation(typename InputDeviceType::ImplementationFactory implementationFactory) = 0;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -267,18 +263,14 @@ namespace AzFramework
|
||||
AZ_DISABLE_COPY_MOVE(InputDeviceImplementationRequestHandler);
|
||||
|
||||
protected:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create the custom implementations
|
||||
using CreateFunctionType = typename InputDeviceType::Implementation*(*)(InputDeviceType&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! \ref InputDeviceImplementationRequest<InputDeviceType>::SetCustomImplementation
|
||||
AZ_INLINE void SetCustomImplementation(CreateFunctionType createFunction) override
|
||||
AZ_INLINE void SetCustomImplementation(typename InputDeviceType::ImplementationFactory implementationFactory) override
|
||||
{
|
||||
AZStd::unique_ptr<typename InputDeviceType::Implementation> newImplementation;
|
||||
if (createFunction)
|
||||
if (implementationFactory)
|
||||
{
|
||||
newImplementation.reset(createFunction(m_inputDevice));
|
||||
newImplementation.reset(implementationFactory(m_inputDevice));
|
||||
}
|
||||
m_inputDevice.SetImplementation(AZStd::move(newImplementation));
|
||||
}
|
||||
|
||||
+10
-3
@@ -94,7 +94,14 @@ namespace AzFramework
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceGamepad::InputDeviceGamepad(AZ::u32 index)
|
||||
: InputDevice(InputDeviceId(Name, index))
|
||||
: InputDeviceGamepad(InputDeviceId(Name, index)) // Delegated constructor
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceGamepad::InputDeviceGamepad(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory)
|
||||
: InputDevice(inputDeviceId)
|
||||
, m_allChannelsById()
|
||||
, m_buttonChannelsById()
|
||||
, m_triggerChannelsById()
|
||||
@@ -144,8 +151,8 @@ namespace AzFramework
|
||||
m_thumbStickDirectionChannelsById[channelId] = channel;
|
||||
}
|
||||
|
||||
// Create the platform specific implementation
|
||||
m_pimpl.reset(Implementation::Create(*this));
|
||||
// Create the platform specific or custom implementation
|
||||
m_pimpl.reset(implementationFactory ? implementationFactory(*this) : nullptr);
|
||||
|
||||
// Connect to the haptic feedback request bus
|
||||
InputHapticFeedbackRequestBus::Handler::BusConnect(GetInputDeviceId());
|
||||
|
||||
@@ -182,6 +182,14 @@ namespace AzFramework
|
||||
// Reflection
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Foward declare the internal Implementation class so it can be passed into the constructor
|
||||
class Implementation;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create a custom implementation for this input device
|
||||
using ImplementationFactory = Implementation*(InputDeviceGamepad&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
explicit InputDeviceGamepad();
|
||||
@@ -191,6 +199,13 @@ namespace AzFramework
|
||||
//! \param[in] index Index of the game-pad device
|
||||
explicit InputDeviceGamepad(AZ::u32 index);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
//! \param[in] inputDeviceId Id of the input device
|
||||
//! \param[in] implementationFactory Optional override of the default Implementation::Create
|
||||
explicit InputDeviceGamepad(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory = &Implementation::Create);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable copying
|
||||
AZ_DISABLE_COPY_MOVE(InputDeviceGamepad);
|
||||
|
||||
+5
-4
@@ -182,8 +182,9 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceKeyboard::InputDeviceKeyboard(AzFramework::InputDeviceId id)
|
||||
: InputDevice(id)
|
||||
InputDeviceKeyboard::InputDeviceKeyboard(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory)
|
||||
: InputDevice(inputDeviceId)
|
||||
, m_modifierKeyStates(AZStd::make_shared<ModifierKeyStates>())
|
||||
, m_allChannelsById()
|
||||
, m_keyChannelsById()
|
||||
@@ -203,8 +204,8 @@ namespace AzFramework
|
||||
m_keyChannelsById[channelId] = channel;
|
||||
}
|
||||
|
||||
// Create the platform specific implementation
|
||||
m_pimpl.reset(Implementation::Create(*this));
|
||||
// Create the platform specific or custom implementation
|
||||
m_pimpl.reset(implementationFactory ? implementationFactory(*this) : nullptr);
|
||||
|
||||
// Connect to the text entry request bus
|
||||
InputTextEntryRequestBus::Handler::BusConnect(GetInputDeviceId());
|
||||
|
||||
+12
-1
@@ -370,9 +370,20 @@ namespace AzFramework
|
||||
// Reflection
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Foward declare the internal Implementation class so it can be passed into the constructor
|
||||
class Implementation;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create a custom implementation for this input device
|
||||
using ImplementationFactory = Implementation*(InputDeviceKeyboard&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
InputDeviceKeyboard(AzFramework::InputDeviceId id = Id);
|
||||
//! \param[in] inputDeviceId Optional override of the default input device id
|
||||
//! \param[in] implementationFactory Optional override of the default Implementation::Create
|
||||
explicit InputDeviceKeyboard(const InputDeviceId& inputDeviceId = Id,
|
||||
ImplementationFactory implementationFactory = &Implementation::Create);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable copying
|
||||
|
||||
@@ -60,8 +60,9 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceMotion::InputDeviceMotion()
|
||||
: InputDevice(Id)
|
||||
InputDeviceMotion::InputDeviceMotion(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory)
|
||||
: InputDevice(inputDeviceId)
|
||||
, m_allChannelsById()
|
||||
, m_accelerationChannelsById()
|
||||
, m_rotationRateChannelsById()
|
||||
@@ -107,8 +108,8 @@ namespace AzFramework
|
||||
m_orientationChannelsById[channelId] = channel;
|
||||
}
|
||||
|
||||
// Create the platform specific implementation
|
||||
m_pimpl.reset(Implementation::Create(*this));
|
||||
// Create the platform specific or custom implementation
|
||||
m_pimpl.reset(implementationFactory ? implementationFactory(*this) : nullptr);
|
||||
|
||||
// Connect to the motion sensor request bus
|
||||
InputMotionSensorRequestBus::Handler::BusConnect(GetInputDeviceId());
|
||||
|
||||
@@ -126,9 +126,20 @@ namespace AzFramework
|
||||
// Reflection
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Foward declare the internal Implementation class so it can be passed into the constructor
|
||||
class Implementation;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create a custom implementation for this input device
|
||||
using ImplementationFactory = Implementation*(InputDeviceMotion&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
InputDeviceMotion();
|
||||
//! \param[in] inputDeviceId Optional override of the default input device id
|
||||
//! \param[in] implementationFactory Optional override of the default Implementation::Create
|
||||
explicit InputDeviceMotion(const InputDeviceId& inputDeviceId = Id,
|
||||
ImplementationFactory implementationFactory = &Implementation::Create);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable copying
|
||||
|
||||
@@ -67,8 +67,9 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceMouse::InputDeviceMouse(AzFramework::InputDeviceId id)
|
||||
: InputDevice(id)
|
||||
InputDeviceMouse::InputDeviceMouse(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory)
|
||||
: InputDevice(inputDeviceId)
|
||||
, m_allChannelsById()
|
||||
, m_buttonChannelsById()
|
||||
, m_movementChannelsById()
|
||||
@@ -97,8 +98,8 @@ namespace AzFramework
|
||||
m_cursorPositionChannel = aznew InputChannelDeltaWithSharedPosition2D(SystemCursorPosition, *this, m_cursorPositionData2D);
|
||||
m_allChannelsById[SystemCursorPosition] = m_cursorPositionChannel;
|
||||
|
||||
// Create the platform specific implementation
|
||||
m_pimpl.reset(Implementation::Create(*this));
|
||||
// Create the platform specific or custom implementation
|
||||
m_pimpl.reset(implementationFactory ? implementationFactory(*this) : nullptr);
|
||||
|
||||
// Connect to the system cursor request bus
|
||||
InputSystemCursorRequestBus::Handler::BusConnect(GetInputDeviceId());
|
||||
|
||||
@@ -122,9 +122,20 @@ namespace AzFramework
|
||||
// Reflection
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Foward declare the internal Implementation class so it can be passed into the constructor
|
||||
class Implementation;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create a custom implementation for this input device
|
||||
using ImplementationFactory = Implementation*(InputDeviceMouse&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
explicit InputDeviceMouse(AzFramework::InputDeviceId id = Id);
|
||||
//! \param[in] inputDeviceId Optional override of the default input device id
|
||||
//! \param[in] implementationFactory Optional override of the default Implementation::Create
|
||||
explicit InputDeviceMouse(const InputDeviceId& inputDeviceId = Id,
|
||||
ImplementationFactory implementationFactory = &Implementation::Create);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable copying
|
||||
|
||||
@@ -59,8 +59,9 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceTouch::InputDeviceTouch()
|
||||
: InputDevice(Id)
|
||||
InputDeviceTouch::InputDeviceTouch(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory)
|
||||
: InputDevice(inputDeviceId)
|
||||
, m_allChannelsById()
|
||||
, m_touchChannelsById()
|
||||
, m_pimpl(nullptr)
|
||||
@@ -75,8 +76,8 @@ namespace AzFramework
|
||||
m_touchChannelsById[channelId] = channel;
|
||||
}
|
||||
|
||||
// Create the platform specific implementation
|
||||
m_pimpl.reset(Implementation::Create(*this));
|
||||
// Create the platform specific or custom implementation
|
||||
m_pimpl.reset(implementationFactory ? implementationFactory(*this) : nullptr);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -77,9 +77,20 @@ namespace AzFramework
|
||||
// Reflection
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Foward declare the internal Implementation class so it can be passed into the constructor
|
||||
class Implementation;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create a custom implementation for this input device
|
||||
using ImplementationFactory = Implementation*(InputDeviceTouch&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
InputDeviceTouch();
|
||||
//! \param[in] inputDeviceId Optional override of the default input device id
|
||||
//! \param[in] implementationFactory Optional override of the default Implementation::Create
|
||||
explicit InputDeviceTouch(const InputDeviceId& inputDeviceId = Id,
|
||||
ImplementationFactory implementationFactory = &Implementation::Create);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable copying
|
||||
|
||||
+5
-4
@@ -51,8 +51,9 @@ namespace AzFramework
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
InputDeviceVirtualKeyboard::InputDeviceVirtualKeyboard()
|
||||
: InputDevice(Id)
|
||||
InputDeviceVirtualKeyboard::InputDeviceVirtualKeyboard(const InputDeviceId& inputDeviceId,
|
||||
ImplementationFactory implementationFactory)
|
||||
: InputDevice(inputDeviceId)
|
||||
, m_allChannelsById()
|
||||
, m_pimpl()
|
||||
, m_implementationRequestHandler(*this)
|
||||
@@ -65,8 +66,8 @@ namespace AzFramework
|
||||
m_commandChannelsById[channelId] = channel;
|
||||
}
|
||||
|
||||
// Create the platform specific implementation
|
||||
m_pimpl.reset(Implementation::Create(*this));
|
||||
// Create the platform specific or custom implementation
|
||||
m_pimpl.reset(implementationFactory ? implementationFactory(*this) : nullptr);
|
||||
|
||||
// Connect to the text entry request bus
|
||||
InputTextEntryRequestBus::Handler::BusConnect(GetInputDeviceId());
|
||||
|
||||
+12
-1
@@ -69,9 +69,20 @@ namespace AzFramework
|
||||
// Reflection
|
||||
static void Reflect(AZ::ReflectContext* context);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Foward declare the internal Implementation class so it can be passed into the constructor
|
||||
class Implementation;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Alias for the function type used to create a custom implementation for this input device
|
||||
using ImplementationFactory = Implementation*(InputDeviceVirtualKeyboard&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//! Constructor
|
||||
InputDeviceVirtualKeyboard();
|
||||
//! \param[in] inputDeviceId Optional override of the default input device id
|
||||
//! \param[in] implementationFactory Optional override of the default Implementation::Create
|
||||
explicit InputDeviceVirtualKeyboard(const InputDeviceId& inputDeviceId = Id,
|
||||
ImplementationFactory implementationFactory = &Implementation::Create);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Disable copying
|
||||
|
||||
@@ -24,17 +24,17 @@ namespace AzFramework
|
||||
IMatchmakingRequests() = default;
|
||||
virtual ~IMatchmakingRequests() = default;
|
||||
|
||||
// Registers a player's acceptance or rejection of a proposed matchmaking.
|
||||
// @param acceptMatchRequest The request of AcceptMatch operation
|
||||
//! Registers a player's acceptance or rejection of a proposed matchmaking.
|
||||
//! @param acceptMatchRequest The request of AcceptMatch operation
|
||||
virtual void AcceptMatch(const AcceptMatchRequest& acceptMatchRequest) = 0;
|
||||
|
||||
// Create a game match for a group of players.
|
||||
// @param startMatchmakingRequest The request of StartMatchmaking operation
|
||||
// @return A unique identifier for a matchmaking ticket
|
||||
//! Create a game match for a group of players.
|
||||
//! @param startMatchmakingRequest The request of StartMatchmaking operation
|
||||
//! @return A unique identifier for a matchmaking ticket
|
||||
virtual AZStd::string StartMatchmaking(const StartMatchmakingRequest& startMatchmakingRequest) = 0;
|
||||
|
||||
// Cancels a matchmaking ticket that is currently being processed.
|
||||
// @param stopMatchmakingRequest The request of StopMatchmaking operation
|
||||
//! Cancels a matchmaking ticket that is currently being processed.
|
||||
//! @param stopMatchmakingRequest The request of StopMatchmaking operation
|
||||
virtual void StopMatchmaking(const StopMatchmakingRequest& stopMatchmakingRequest) = 0;
|
||||
};
|
||||
|
||||
@@ -48,16 +48,16 @@ namespace AzFramework
|
||||
IMatchmakingAsyncRequests() = default;
|
||||
virtual ~IMatchmakingAsyncRequests() = default;
|
||||
|
||||
// AcceptMatch Async
|
||||
// @param acceptMatchRequest The request of AcceptMatch operation
|
||||
//! AcceptMatch Async
|
||||
//! @param acceptMatchRequest The request of AcceptMatch operation
|
||||
virtual void AcceptMatchAsync(const AcceptMatchRequest& acceptMatchRequest) = 0;
|
||||
|
||||
// StartMatchmaking Async
|
||||
// @param startMatchmakingRequest The request of StartMatchmaking operation
|
||||
//! StartMatchmaking Async
|
||||
//! @param startMatchmakingRequest The request of StartMatchmaking operation
|
||||
virtual void StartMatchmakingAsync(const StartMatchmakingRequest& startMatchmakingRequest) = 0;
|
||||
|
||||
// StopMatchmaking Async
|
||||
// @param stopMatchmakingRequest The request of StopMatchmaking operation
|
||||
//! StopMatchmaking Async
|
||||
//! @param stopMatchmakingRequest The request of StopMatchmaking operation
|
||||
virtual void StopMatchmakingAsync(const StopMatchmakingRequest& stopMatchmakingRequest) = 0;
|
||||
};
|
||||
|
||||
@@ -76,14 +76,14 @@ namespace AzFramework
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// OnAcceptMatchAsyncComplete is fired once AcceptMatchAsync completes
|
||||
//! OnAcceptMatchAsyncComplete is fired once AcceptMatchAsync completes
|
||||
virtual void OnAcceptMatchAsyncComplete() = 0;
|
||||
|
||||
// OnStartMatchmakingAsyncComplete is fired once StartMatchmakingAsync completes
|
||||
// @param matchmakingTicketId The unique identifier for the matchmaking ticket
|
||||
//! OnStartMatchmakingAsyncComplete is fired once StartMatchmakingAsync completes
|
||||
//! @param matchmakingTicketId The unique identifier for the matchmaking ticket
|
||||
virtual void OnStartMatchmakingAsyncComplete(const AZStd::string& matchmakingTicketId) = 0;
|
||||
|
||||
// OnStopMatchmakingAsyncComplete is fired once StopMatchmakingAsync completes
|
||||
//! OnStopMatchmakingAsyncComplete is fired once StopMatchmakingAsync completes
|
||||
virtual void OnStopMatchmakingAsyncComplete() = 0;
|
||||
};
|
||||
using MatchmakingAsyncRequestNotificationBus = AZ::EBus<MatchmakingAsyncRequestNotifications>;
|
||||
|
||||
@@ -29,17 +29,17 @@ namespace AzFramework
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// OnMatchAcceptance is fired when match is found and pending on acceptance
|
||||
// Use this notification to accept found match
|
||||
//! OnMatchAcceptance is fired when match is found and pending on acceptance
|
||||
//! Use this notification to accept found match
|
||||
virtual void OnMatchAcceptance() = 0;
|
||||
|
||||
// OnMatchComplete is fired when match is complete
|
||||
//! OnMatchComplete is fired when match is complete
|
||||
virtual void OnMatchComplete() = 0;
|
||||
|
||||
// OnMatchError is fired when match is processed with error
|
||||
//! OnMatchError is fired when match is processed with error
|
||||
virtual void OnMatchError() = 0;
|
||||
|
||||
// OnMatchFailure is fired when match is failed to complete
|
||||
//! OnMatchFailure is fired when match is failed to complete
|
||||
virtual void OnMatchFailure() = 0;
|
||||
};
|
||||
using MatchmakingNotificationBus = AZ::EBus<MatchmakingNotifications>;
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace AzFramework
|
||||
AcceptMatchRequest() = default;
|
||||
virtual ~AcceptMatchRequest() = default;
|
||||
|
||||
// Player response to accept or reject match
|
||||
//! Player response to accept or reject match
|
||||
bool m_acceptMatch;
|
||||
// A list of unique identifiers for players delivering the response
|
||||
//! A list of unique identifiers for players delivering the response
|
||||
AZStd::vector<AZStd::string> m_playerIds;
|
||||
// A unique identifier for a matchmaking ticket
|
||||
//! A unique identifier for a matchmaking ticket
|
||||
AZStd::string m_ticketId;
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace AzFramework
|
||||
StartMatchmakingRequest() = default;
|
||||
virtual ~StartMatchmakingRequest() = default;
|
||||
|
||||
// A unique identifier for a matchmaking ticket
|
||||
//! A unique identifier for a matchmaking ticket
|
||||
AZStd::string m_ticketId;
|
||||
};
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace AzFramework
|
||||
StopMatchmakingRequest() = default;
|
||||
virtual ~StopMatchmakingRequest() = default;
|
||||
|
||||
// A unique identifier for a matchmaking ticket
|
||||
//! A unique identifier for a matchmaking ticket
|
||||
AZStd::string m_ticketId;
|
||||
};
|
||||
} // namespace AzFramework
|
||||
|
||||
+67
-1
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <AzCore/Memory/SystemAllocator.h>
|
||||
#include <AzCore/Serialization/SerializeContext.h>
|
||||
#include <AzCore/Serialization/EditContext.h>
|
||||
|
||||
namespace AzPhysics
|
||||
{
|
||||
@@ -28,6 +29,71 @@ namespace AzPhysics
|
||||
->Field("ChildLocalPosition", &JointConfiguration::m_childLocalPosition)
|
||||
->Field("StartSimulationEnabled", &JointConfiguration::m_startSimulationEnabled)
|
||||
;
|
||||
|
||||
if (auto* editContext = serializeContext->GetEditContext())
|
||||
{
|
||||
editContext->Class<JointConfiguration>("Joint Configuration", "Joint configuration.")
|
||||
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
|
||||
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &JointConfiguration::m_parentLocalRotation,
|
||||
"Parent local rotation", "Parent joint frame relative to parent body.")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, &JointConfiguration::GetParentLocalRotationVisibility)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &JointConfiguration::m_parentLocalPosition,
|
||||
"Parent local position", "Joint position relative to parent body.")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, &JointConfiguration::GetParentLocalPositionVisibility)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &JointConfiguration::m_childLocalRotation,
|
||||
"Child local rotation", "Child joint frame relative to child body.")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, &JointConfiguration::GetChildLocalRotationVisibility)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &JointConfiguration::m_childLocalPosition,
|
||||
"Child local position", "Joint position relative to child body.")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, &JointConfiguration::GetChildLocalPositionVisibility)
|
||||
->DataElement(AZ::Edit::UIHandlers::Default, &JointConfiguration::m_startSimulationEnabled,
|
||||
"Start simulation enabled", "When active, the joint will be enabled when the simulation begins.")
|
||||
->Attribute(AZ::Edit::Attributes::Visibility, &JointConfiguration::GetStartSimulationEnabledVisibility)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Crc32 JointConfiguration::GetPropertyVisibility(JointConfiguration::PropertyVisibility property) const
|
||||
{
|
||||
return (m_propertyVisibilityFlags & property) != 0 ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide;
|
||||
}
|
||||
|
||||
void JointConfiguration::SetPropertyVisibility(JointConfiguration::PropertyVisibility property, bool isVisible)
|
||||
{
|
||||
if (isVisible)
|
||||
{
|
||||
m_propertyVisibilityFlags |= property;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_propertyVisibilityFlags &= ~property;
|
||||
}
|
||||
}
|
||||
|
||||
AZ::Crc32 JointConfiguration::GetParentLocalRotationVisibility() const
|
||||
{
|
||||
return GetPropertyVisibility(JointConfiguration::PropertyVisibility::ParentLocalRotation);
|
||||
}
|
||||
|
||||
AZ::Crc32 JointConfiguration::GetParentLocalPositionVisibility() const
|
||||
{
|
||||
return GetPropertyVisibility(JointConfiguration::PropertyVisibility::ParentLocalPosition);
|
||||
}
|
||||
|
||||
AZ::Crc32 JointConfiguration::GetChildLocalRotationVisibility() const
|
||||
{
|
||||
return GetPropertyVisibility(JointConfiguration::PropertyVisibility::ChildLocalRotation);
|
||||
}
|
||||
|
||||
AZ::Crc32 JointConfiguration::GetChildLocalPositionVisibility() const
|
||||
{
|
||||
return GetPropertyVisibility(JointConfiguration::PropertyVisibility::ChildLocalPosition);
|
||||
}
|
||||
|
||||
AZ::Crc32 JointConfiguration::GetStartSimulationEnabledVisibility() const
|
||||
{
|
||||
return GetPropertyVisibility(JointConfiguration::PropertyVisibility::StartSimulationEnabled);
|
||||
}
|
||||
} // namespace AzPhysics
|
||||
|
||||
@@ -31,6 +31,25 @@ namespace AzPhysics
|
||||
JointConfiguration() = default;
|
||||
virtual ~JointConfiguration() = default;
|
||||
|
||||
// Visibility helpers for use in the Editor when reflected.
|
||||
enum PropertyVisibility : AZ::u8
|
||||
{
|
||||
ParentLocalRotation = 1 << 0, //!< Whether the parent local rotation is visible.
|
||||
ParentLocalPosition = 1 << 1, //!< Whether the parent local position is visible.
|
||||
ChildLocalRotation = 1 << 2, //!< Whether the child local rotation is visible.
|
||||
ChildLocalPosition = 1 << 3, //!< Whether the child local position is visible.
|
||||
StartSimulationEnabled = 1 << 4 //!< Whether the start simulation enabled setting is visible.
|
||||
};
|
||||
|
||||
AZ::Crc32 GetPropertyVisibility(PropertyVisibility property) const;
|
||||
void SetPropertyVisibility(PropertyVisibility property, bool isVisible);
|
||||
|
||||
AZ::Crc32 GetParentLocalRotationVisibility() const;
|
||||
AZ::Crc32 GetParentLocalPositionVisibility() const;
|
||||
AZ::Crc32 GetChildLocalRotationVisibility() const;
|
||||
AZ::Crc32 GetChildLocalPositionVisibility() const;
|
||||
AZ::Crc32 GetStartSimulationEnabledVisibility() const;
|
||||
|
||||
// Entity/object association.
|
||||
void* m_customUserData = nullptr;
|
||||
|
||||
@@ -40,8 +59,11 @@ namespace AzPhysics
|
||||
AZ::Quaternion m_childLocalRotation = AZ::Quaternion::CreateIdentity(); ///< Child joint frame relative to child body.
|
||||
AZ::Vector3 m_childLocalPosition = AZ::Vector3::CreateZero(); ///< Joint position relative to child body.
|
||||
bool m_startSimulationEnabled = true;
|
||||
|
||||
|
||||
// For debugging/tracking purposes only.
|
||||
AZStd::string m_debugName;
|
||||
|
||||
// Default all visibility settings to invisible, since most joint configurations don't need to display these.
|
||||
AZ::u8 m_propertyVisibilityFlags = 0;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -18,16 +18,16 @@ namespace AzFramework
|
||||
//! The properties for handling join session request.
|
||||
struct SessionConnectionConfig
|
||||
{
|
||||
// A unique identifier for registered player in session.
|
||||
//! A unique identifier for registered player in session.
|
||||
AZStd::string m_playerSessionId;
|
||||
|
||||
// The DNS identifier assigned to the instance that is running the session.
|
||||
//! The DNS identifier assigned to the instance that is running the session.
|
||||
AZStd::string m_dnsName;
|
||||
|
||||
// The IP address of the session.
|
||||
//! The IP address of the session.
|
||||
AZStd::string m_ipAddress;
|
||||
|
||||
// The port number for the session.
|
||||
//! The port number for the session.
|
||||
uint16_t m_port = 0;
|
||||
};
|
||||
|
||||
@@ -35,10 +35,10 @@ namespace AzFramework
|
||||
//! The properties for handling player connect/disconnect
|
||||
struct PlayerConnectionConfig
|
||||
{
|
||||
// A unique identifier for player connection.
|
||||
//! A unique identifier for player connection.
|
||||
uint32_t m_playerConnectionId = 0;
|
||||
|
||||
// A unique identifier for registered player in session.
|
||||
//! A unique identifier for registered player in session.
|
||||
AZStd::string m_playerSessionId;
|
||||
};
|
||||
|
||||
@@ -51,12 +51,12 @@ namespace AzFramework
|
||||
ISessionHandlingClientRequests() = default;
|
||||
virtual ~ISessionHandlingClientRequests() = default;
|
||||
|
||||
// Request the player join session
|
||||
// @param sessionConnectionConfig The required properties to handle the player join session process
|
||||
// @return The result of player join session process
|
||||
//! Request the player join session
|
||||
//! @param sessionConnectionConfig The required properties to handle the player join session process
|
||||
//! @return The result of player join session process
|
||||
virtual bool RequestPlayerJoinSession(const SessionConnectionConfig& sessionConnectionConfig) = 0;
|
||||
|
||||
// Request the connected player leave session
|
||||
//! Request the connected player leave session
|
||||
virtual void RequestPlayerLeaveSession() = 0;
|
||||
};
|
||||
|
||||
@@ -69,26 +69,26 @@ namespace AzFramework
|
||||
ISessionHandlingProviderRequests() = default;
|
||||
virtual ~ISessionHandlingProviderRequests() = default;
|
||||
|
||||
// Handle the destroy session process
|
||||
//! Handle the destroy session process
|
||||
virtual void HandleDestroySession() = 0;
|
||||
|
||||
// Validate the player join session process
|
||||
// @param playerConnectionConfig The required properties to validate the player join session process
|
||||
// @return The result of player join session validation
|
||||
//! Validate the player join session process
|
||||
//! @param playerConnectionConfig The required properties to validate the player join session process
|
||||
//! @return The result of player join session validation
|
||||
virtual bool ValidatePlayerJoinSession(const PlayerConnectionConfig& playerConnectionConfig) = 0;
|
||||
|
||||
// Handle the player leave session process
|
||||
// @param playerConnectionConfig The required properties to handle the player leave session process
|
||||
//! Handle the player leave session process
|
||||
//! @param playerConnectionConfig The required properties to handle the player leave session process
|
||||
virtual void HandlePlayerLeaveSession(const PlayerConnectionConfig& playerConnectionConfig) = 0;
|
||||
|
||||
// Retrieves the file location of a pem-encoded TLS certificate for Client to Server communication
|
||||
// @return If successful, returns the file location of TLS certificate file; if not successful, returns
|
||||
// empty string.
|
||||
//! Retrieves the file location of a pem-encoded TLS certificate for Client to Server communication
|
||||
//! @return If successful, returns the file location of TLS certificate file; if not successful, returns
|
||||
//! empty string.
|
||||
virtual AZ::IO::Path GetExternalSessionCertificate() = 0;
|
||||
|
||||
// Retrieves the file location of a pem-encoded TLS certificate for Server to Server communication
|
||||
// @return If successful, returns the file location of TLS certificate file; if not successful, returns
|
||||
// empty string.
|
||||
//! Retrieves the file location of a pem-encoded TLS certificate for Server to Server communication
|
||||
//! @return If successful, returns the file location of TLS certificate file; if not successful, returns
|
||||
//! empty string.
|
||||
virtual AZ::IO::Path GetInternalSessionCertificate() = 0;
|
||||
};
|
||||
} // namespace AzFramework
|
||||
|
||||
@@ -25,22 +25,22 @@ namespace AzFramework
|
||||
ISessionRequests() = default;
|
||||
virtual ~ISessionRequests() = default;
|
||||
|
||||
// Create a session for players to find and join.
|
||||
// @param createSessionRequest The request of CreateSession operation
|
||||
// @return The request id if session creation request succeeds; empty if it fails
|
||||
//! Create a session for players to find and join.
|
||||
//! @param createSessionRequest The request of CreateSession operation
|
||||
//! @return The request id if session creation request succeeds; empty if it fails
|
||||
virtual AZStd::string CreateSession(const CreateSessionRequest& createSessionRequest) = 0;
|
||||
|
||||
// Retrieve all active sessions that match the given search criteria and sorted in specific order.
|
||||
// @param searchSessionsRequest The request of SearchSessions operation
|
||||
// @return The response of SearchSessions operation
|
||||
//! Retrieve all active sessions that match the given search criteria and sorted in specific order.
|
||||
//! @param searchSessionsRequest The request of SearchSessions operation
|
||||
//! @return The response of SearchSessions operation
|
||||
virtual SearchSessionsResponse SearchSessions(const SearchSessionsRequest& searchSessionsRequest) const = 0;
|
||||
|
||||
// Reserve an open player slot in a session, and perform connection from client to server.
|
||||
// @param joinSessionRequest The request of JoinSession operation
|
||||
// @return True if joining session succeeds; False otherwise
|
||||
//! Reserve an open player slot in a session, and perform connection from client to server.
|
||||
//! @param joinSessionRequest The request of JoinSession operation
|
||||
//! @return True if joining session succeeds; False otherwise
|
||||
virtual bool JoinSession(const JoinSessionRequest& joinSessionRequest) = 0;
|
||||
|
||||
// Disconnect player from session.
|
||||
//! Disconnect player from session.
|
||||
virtual void LeaveSession() = 0;
|
||||
};
|
||||
|
||||
@@ -54,19 +54,19 @@ namespace AzFramework
|
||||
ISessionAsyncRequests() = default;
|
||||
virtual ~ISessionAsyncRequests() = default;
|
||||
|
||||
// CreateSession Async
|
||||
// @param createSessionRequest The request of CreateSession operation
|
||||
//! CreateSession Async
|
||||
//! @param createSessionRequest The request of CreateSession operation
|
||||
virtual void CreateSessionAsync(const CreateSessionRequest& createSessionRequest) = 0;
|
||||
|
||||
// SearchSessions Async
|
||||
// @param searchSessionsRequest The request of SearchSessions operation
|
||||
//! SearchSessions Async
|
||||
//! @param searchSessionsRequest The request of SearchSessions operation
|
||||
virtual void SearchSessionsAsync(const SearchSessionsRequest& searchSessionsRequest) const = 0;
|
||||
|
||||
// JoinSession Async
|
||||
// @param joinSessionRequest The request of JoinSession operation
|
||||
//! JoinSession Async
|
||||
//! @param joinSessionRequest The request of JoinSession operation
|
||||
virtual void JoinSessionAsync(const JoinSessionRequest& joinSessionRequest) = 0;
|
||||
|
||||
// LeaveSession Async
|
||||
//! LeaveSession Async
|
||||
virtual void LeaveSessionAsync() = 0;
|
||||
};
|
||||
|
||||
@@ -85,19 +85,19 @@ namespace AzFramework
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// OnCreateSessionAsyncComplete is fired once CreateSessionAsync completes
|
||||
// @param createSessionResponse The request id if session creation request succeeds; empty if it fails
|
||||
//! OnCreateSessionAsyncComplete is fired once CreateSessionAsync completes
|
||||
//! @param createSessionResponse The request id if session creation request succeeds; empty if it fails
|
||||
virtual void OnCreateSessionAsyncComplete(const AZStd::string& createSessionReponse) = 0;
|
||||
|
||||
// OnSearchSessionsAsyncComplete is fired once SearchSessionsAsync completes
|
||||
// @param searchSessionsResponse The response of SearchSessions call
|
||||
//! OnSearchSessionsAsyncComplete is fired once SearchSessionsAsync completes
|
||||
//! @param searchSessionsResponse The response of SearchSessions call
|
||||
virtual void OnSearchSessionsAsyncComplete(const SearchSessionsResponse& searchSessionsResponse) = 0;
|
||||
|
||||
// OnJoinSessionAsyncComplete is fired once JoinSessionAsync completes
|
||||
// @param joinSessionsResponse True if joining session succeeds; False otherwise
|
||||
//! OnJoinSessionAsyncComplete is fired once JoinSessionAsync completes
|
||||
//! @param joinSessionsResponse True if joining session succeeds; False otherwise
|
||||
virtual void OnJoinSessionAsyncComplete(bool joinSessionsResponse) = 0;
|
||||
|
||||
// OnLeaveSessionAsyncComplete is fired once LeaveSessionAsync completes
|
||||
//! OnLeaveSessionAsyncComplete is fired once LeaveSessionAsync completes
|
||||
virtual void OnLeaveSessionAsyncComplete() = 0;
|
||||
};
|
||||
using SessionAsyncRequestNotificationBus = AZ::EBus<SessionAsyncRequestNotifications>;
|
||||
|
||||
@@ -24,46 +24,46 @@ namespace AzFramework
|
||||
SessionConfig() = default;
|
||||
virtual ~SessionConfig() = default;
|
||||
|
||||
// A time stamp indicating when this session was created. Format is a number expressed in Unix time as milliseconds.
|
||||
//! A time stamp indicating when this session was created. Format is a number expressed in Unix time as milliseconds.
|
||||
uint64_t m_creationTime = 0;
|
||||
|
||||
// A time stamp indicating when this data object was terminated. Same format as creation time.
|
||||
//! A time stamp indicating when this data object was terminated. Same format as creation time.
|
||||
uint64_t m_terminationTime = 0;
|
||||
|
||||
// A unique identifier for a player or entity creating the session.
|
||||
//! A unique identifier for a player or entity creating the session.
|
||||
AZStd::string m_creatorId;
|
||||
|
||||
// A collection of custom properties for a session.
|
||||
//! A collection of custom properties for a session.
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> m_sessionProperties;
|
||||
|
||||
// The matchmaking process information that was used to create the session.
|
||||
//! The matchmaking process information that was used to create the session.
|
||||
AZStd::string m_matchmakingData;
|
||||
|
||||
// A unique identifier for the session.
|
||||
//! A unique identifier for the session.
|
||||
AZStd::string m_sessionId;
|
||||
|
||||
// A descriptive label that is associated with a session.
|
||||
//! A descriptive label that is associated with a session.
|
||||
AZStd::string m_sessionName;
|
||||
|
||||
// The DNS identifier assigned to the instance that is running the session.
|
||||
//! The DNS identifier assigned to the instance that is running the session.
|
||||
AZStd::string m_dnsName;
|
||||
|
||||
// The IP address of the session.
|
||||
//! The IP address of the session.
|
||||
AZStd::string m_ipAddress;
|
||||
|
||||
// The port number for the session.
|
||||
//! The port number for the session.
|
||||
uint16_t m_port = 0;
|
||||
|
||||
// The maximum number of players that can be connected simultaneously to the session.
|
||||
//! The maximum number of players that can be connected simultaneously to the session.
|
||||
uint64_t m_maxPlayer = 0;
|
||||
|
||||
// Number of players currently in the session.
|
||||
//! Number of players currently in the session.
|
||||
uint64_t m_currentPlayer = 0;
|
||||
|
||||
// Current status of the session.
|
||||
//! Current status of the session.
|
||||
AZStd::string m_status;
|
||||
|
||||
// Provides additional information about session status.
|
||||
//! Provides additional information about session status.
|
||||
AZStd::string m_statusReason;
|
||||
};
|
||||
} // namespace AzFramework
|
||||
|
||||
@@ -29,42 +29,42 @@ namespace AzFramework
|
||||
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// OnSessionHealthCheck is fired in health check process
|
||||
// Use this notification to perform any custom health check
|
||||
// @return True if OnSessionHealthCheck succeeds, false otherwise
|
||||
//! OnSessionHealthCheck is fired in health check process
|
||||
//! Use this notification to perform any custom health check
|
||||
//! @return True if OnSessionHealthCheck succeeds, false otherwise
|
||||
virtual bool OnSessionHealthCheck() = 0;
|
||||
|
||||
// OnCreateSessionBegin is fired at the beginning of session creation process
|
||||
// Use this notification to perform any necessary configuration or initialization before
|
||||
// creating session
|
||||
// @param sessionConfig The properties to describe a session
|
||||
// @return True if OnCreateSessionBegin succeeds, false otherwise
|
||||
//! OnCreateSessionBegin is fired at the beginning of session creation process
|
||||
//! Use this notification to perform any necessary configuration or initialization before
|
||||
//! creating session
|
||||
//! @param sessionConfig The properties to describe a session
|
||||
//! @return True if OnCreateSessionBegin succeeds, false otherwise
|
||||
virtual bool OnCreateSessionBegin(const SessionConfig& sessionConfig) = 0;
|
||||
|
||||
// OnCreateSessionEnd is fired at the end of session creation process
|
||||
// Use this notification to perform any follow-up operation after session is created and active
|
||||
//! OnCreateSessionEnd is fired at the end of session creation process
|
||||
//! Use this notification to perform any follow-up operation after session is created and active
|
||||
virtual void OnCreateSessionEnd() = 0;
|
||||
|
||||
// OnDestroySessionBegin is fired at the beginning of session termination process
|
||||
// Use this notification to perform any cleanup operation before destroying session,
|
||||
// like gracefully disconnect players, cleanup data, etc.
|
||||
// @return True if OnDestroySessionBegin succeeds, false otherwise
|
||||
//! OnDestroySessionBegin is fired at the beginning of session termination process
|
||||
//! Use this notification to perform any cleanup operation before destroying session,
|
||||
//! like gracefully disconnect players, cleanup data, etc.
|
||||
//! @return True if OnDestroySessionBegin succeeds, false otherwise
|
||||
virtual bool OnDestroySessionBegin() = 0;
|
||||
|
||||
// OnDestroySessionEnd is fired at the end of session termination process
|
||||
// Use this notification to perform any follow-up operation after session is destroyed,
|
||||
// like shutdown application process, etc.
|
||||
//! OnDestroySessionEnd is fired at the end of session termination process
|
||||
//! Use this notification to perform any follow-up operation after session is destroyed,
|
||||
//! like shutdown application process, etc.
|
||||
virtual void OnDestroySessionEnd() = 0;
|
||||
|
||||
// OnUpdateSessionBegin is fired at the beginning of session update process
|
||||
// Use this notification to perform any configuration or initialization to handle
|
||||
// the session settings changing
|
||||
// @param sessionConfig The properties to describe a session
|
||||
// @param updateReason The reason for session update
|
||||
//! OnUpdateSessionBegin is fired at the beginning of session update process
|
||||
//! Use this notification to perform any configuration or initialization to handle
|
||||
//! the session settings changing
|
||||
//! @param sessionConfig The properties to describe a session
|
||||
//! @param updateReason The reason for session update
|
||||
virtual void OnUpdateSessionBegin(const SessionConfig& sessionConfig, const AZStd::string& updateReason) = 0;
|
||||
|
||||
// OnUpdateSessionBegin is fired at the end of session update process
|
||||
// Use this notification to perform any follow-up operations after session is updated
|
||||
//! OnUpdateSessionBegin is fired at the end of session update process
|
||||
//! Use this notification to perform any follow-up operations after session is updated
|
||||
virtual void OnUpdateSessionEnd() = 0;
|
||||
};
|
||||
using SessionNotificationBus = AZ::EBus<SessionNotifications>;
|
||||
|
||||
@@ -31,16 +31,16 @@ namespace AzFramework
|
||||
CreateSessionRequest() = default;
|
||||
virtual ~CreateSessionRequest() = default;
|
||||
|
||||
// A unique identifier for a player or entity creating the session.
|
||||
//! A unique identifier for a player or entity creating the session.
|
||||
AZStd::string m_creatorId;
|
||||
|
||||
// A collection of custom properties for a session.
|
||||
//! A collection of custom properties for a session.
|
||||
AZStd::unordered_map<AZStd::string, AZStd::string> m_sessionProperties;
|
||||
|
||||
// A descriptive label that is associated with a session.
|
||||
//! A descriptive label that is associated with a session.
|
||||
AZStd::string m_sessionName;
|
||||
|
||||
// The maximum number of players that can be connected simultaneously to the session.
|
||||
//! The maximum number of players that can be connected simultaneously to the session.
|
||||
uint64_t m_maxPlayer = 0;
|
||||
};
|
||||
|
||||
@@ -54,17 +54,17 @@ namespace AzFramework
|
||||
SearchSessionsRequest() = default;
|
||||
virtual ~SearchSessionsRequest() = default;
|
||||
|
||||
// String containing the search criteria for the session search. If no filter expression is included, the request returns results
|
||||
// for all active sessions.
|
||||
//! String containing the search criteria for the session search. If no filter expression is included, the request returns results
|
||||
//! for all active sessions.
|
||||
AZStd::string m_filterExpression;
|
||||
|
||||
// Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order.
|
||||
//! Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order.
|
||||
AZStd::string m_sortExpression;
|
||||
|
||||
// The maximum number of results to return.
|
||||
//! The maximum number of results to return.
|
||||
uint8_t m_maxResult = 0;
|
||||
|
||||
// A token that indicates the start of the next sequential page of results.
|
||||
//! A token that indicates the start of the next sequential page of results.
|
||||
AZStd::string m_nextToken;
|
||||
};
|
||||
|
||||
@@ -78,10 +78,10 @@ namespace AzFramework
|
||||
SearchSessionsResponse() = default;
|
||||
virtual ~SearchSessionsResponse() = default;
|
||||
|
||||
// A collection of sessions that match the search criteria and sorted in specific order.
|
||||
//! A collection of sessions that match the search criteria and sorted in specific order.
|
||||
AZStd::vector<SessionConfig> m_sessionConfigs;
|
||||
|
||||
// A token that indicates the start of the next sequential page of results.
|
||||
//! A token that indicates the start of the next sequential page of results.
|
||||
AZStd::string m_nextToken;
|
||||
};
|
||||
|
||||
@@ -95,13 +95,13 @@ namespace AzFramework
|
||||
JoinSessionRequest() = default;
|
||||
virtual ~JoinSessionRequest() = default;
|
||||
|
||||
// A unique identifier for the session.
|
||||
//! A unique identifier for the session.
|
||||
AZStd::string m_sessionId;
|
||||
|
||||
// A unique identifier for a player. Player IDs are developer-defined.
|
||||
//! A unique identifier for a player. Player IDs are developer-defined.
|
||||
AZStd::string m_playerId;
|
||||
|
||||
// Developer-defined information related to a player.
|
||||
//! Developer-defined information related to a player.
|
||||
AZStd::string m_playerData;
|
||||
};
|
||||
} // namespace AzFramework
|
||||
|
||||
+23
@@ -54,6 +54,7 @@ namespace AzFramework
|
||||
RECT m_windowRectToRestoreOnFullScreenExit; //!< The position and size of the window to restore when exiting full screen.
|
||||
UINT m_windowStyleToRestoreOnFullScreenExit; //!< The style(s) of the window to restore when exiting full screen.
|
||||
bool m_isInBorderlessWindowFullScreenState = false; //!< Was a borderless window used to enter full screen state?
|
||||
bool m_shouldEnterFullScreenStateOnActivate = false; //!< Should we enter full screen state when the window is activated?
|
||||
|
||||
using GetDpiForWindowType = UINT(HWND hwnd);
|
||||
GetDpiForWindowType* m_getDpiFunction = nullptr;
|
||||
@@ -249,6 +250,28 @@ namespace AzFramework
|
||||
AzFramework::RawInputNotificationBusWindows::Broadcast(&AzFramework::RawInputNotificationsWindows::OnRawInputCodeUnitUTF16Event, codeUnitUTF16);
|
||||
break;
|
||||
}
|
||||
case WM_ACTIVATE:
|
||||
{
|
||||
// Alt-tabbing out of the app while it is in a full screen state does not
|
||||
// work unless we explicitly exit the full screen state upon deactivation,
|
||||
// in which case we want to enter full screen state again upon activation.
|
||||
const bool windowIsNowInactive = (LOWORD(wParam) == WA_INACTIVE);
|
||||
const bool windowFullScreenState = nativeWindowImpl->GetFullScreenState();
|
||||
if (windowIsNowInactive &&
|
||||
windowFullScreenState)
|
||||
{
|
||||
nativeWindowImpl->m_shouldEnterFullScreenStateOnActivate = true;
|
||||
nativeWindowImpl->SetFullScreenState(false);
|
||||
}
|
||||
else if (!windowIsNowInactive &&
|
||||
!windowFullScreenState &&
|
||||
nativeWindowImpl->m_shouldEnterFullScreenStateOnActivate)
|
||||
{
|
||||
nativeWindowImpl->m_shouldEnterFullScreenStateOnActivate = false;
|
||||
nativeWindowImpl->SetFullScreenState(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_SYSKEYDOWN:
|
||||
{
|
||||
// Handle ALT+ENTER to toggle full screen unless exclsuive full screen
|
||||
|
||||
Reference in New Issue
Block a user