Files
o3de/Gems/LyShine/Code/Source/UiNavigationHelpers.h
T
michabr 4d5aad13d1 Remove legacy renderer dependencies in LyShine and move LyShine headers to gem (#6049)
* Remove CryRenderer dependencies

Signed-off-by: abrmich <abrmich@amazon.com>

* Fix non-unity compile error

Signed-off-by: abrmich <abrmich@amazon.com>

* Remove ITexture.h reference

Signed-off-by: abrmich <abrmich@amazon.com>

* Simple file moves from CryCommon to LyShine Gem

Signed-off-by: abrmich <abrmich@amazon.com>

* More simple file moves from CryCommon to LyShine Gem

Signed-off-by: abrmich <abrmich@amazon.com>

* Move more headers from CryCommon to LyShine Gem

Signed-off-by: abrmich <abrmich@amazon.com>

* Add LyShine gem module as a build dependency to fix compile error in some gems

Signed-off-by: abrmich <abrmich@amazon.com>
2021-12-02 14:47:32 -08:00

64 lines
2.3 KiB
C++

/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <LyShine/Bus/UiTransformBus.h>
#include <AzFramework/Input/Channels/InputChannelDigitalWithSharedModifierKeyStates.h>
#include <LyShine/UiBase.h>
namespace AzFramework
{
class InputChannelId;
}
namespace UiNavigationHelpers
{
enum class Command
{
Up,
Down,
Left,
Right,
Enter,
Back,
NavEnd,
NavHome,
Unknown
};
//! Map input channel ids to interactable ui commands
UiNavigationHelpers::Command MapInputChannelIdToUiNavigationCommand(const AzFramework::InputChannelId& inputChannelId, AzFramework::ModifierKeyMask activeModifierKeys);
using ValidationFunction = AZStd::function<bool(AZ::EntityId)>;
//! Find the next element given the current element and a direction
AZ::EntityId GetNextElement(AZ::EntityId curEntityId, Command command,
const LyShine::EntityArray& navigableElements, AZ::EntityId defaultEntityId,
ValidationFunction isValidResult, AZ::EntityId parentElement = AZ::EntityId());
//! Find the next element in the given direction for automatic mode
AZ::EntityId SearchForNextElement(AZ::EntityId curElement, Command command,
const LyShine::EntityArray& navigableElements, AZ::EntityId parentElement = AZ::EntityId());
//! Follow one of the custom links (used when navigation mode is custom)
AZ::EntityId FollowCustomLink(AZ::EntityId curEntityId, Command command);
//! Check if an interactable can be navigated to
bool IsInteractableNavigable(AZ::EntityId interactableEntityId);
//! Check if an element is an interactable that can be navigated to
bool IsElementInteractableAndNavigable(AZ::EntityId entityId);
//! Make a list of all navigable & interactable elements under the specified parent
void FindNavigableInteractables(AZ::EntityId parentElement, AZ::EntityId ignoreElement, LyShine::EntityArray& result);
//! Find the first ancestor that's a navigable interactable
AZ::EntityId FindAncestorNavigableInteractable(AZ::EntityId childInteractable, bool ignoreAutoActivatedAncestors = false);
} // namespace UiNavigationHelpers