/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #pragma once #include #include #include //////////////////////////////////////////////////////////////////////////////////////////////////// namespace GameStateSamples { //////////////////////////////////////////////////////////////////////////////////////////////// //! Game state that is active while the primary user's controller is disconnected. class GameStatePrimaryControllerDisconnected : public GameState::IGameState , public AzFramework::InputChannelEventListener , public AzFramework::InputDeviceNotificationBus::Handler { public: //////////////////////////////////////////////////////////////////////////////////////////// // Allocator AZ_CLASS_ALLOCATOR(GameStatePrimaryControllerDisconnected, AZ::SystemAllocator, 0); //////////////////////////////////////////////////////////////////////////////////////////// // Type Info AZ_RTTI(GameStatePrimaryControllerDisconnected, "{47FCBC7A-49CB-4FEB-842A-C730CCB19940}", IGameState); //////////////////////////////////////////////////////////////////////////////////////////// //! Default constructor GameStatePrimaryControllerDisconnected() = default; //////////////////////////////////////////////////////////////////////////////////////////// //! Default destructor ~GameStatePrimaryControllerDisconnected() override = default; protected: //////////////////////////////////////////////////////////////////////////////////////////// //! \ref GameState::GameState::OnEnter void OnEnter() override; //////////////////////////////////////////////////////////////////////////////////////////// //! \ref GameState::GameState::OnExit void OnExit() override; //////////////////////////////////////////////////////////////////////////////////////////// //! \ref AzFramework::InputChannelEventListener::GetPriority AZ::s32 GetPriority() const override; //////////////////////////////////////////////////////////////////////////////////////////// //! \ref AzFramework::InputChannelEventListener::OnInputChannelEventFiltered bool OnInputChannelEventFiltered(const AzFramework::InputChannel & inputChannel) override; //////////////////////////////////////////////////////////////////////////////////////////// //! \ref AzFramework::InputDeviceNotifications::OnInputDeviceConnectedEvent void OnInputDeviceConnectedEvent(const AzFramework::InputDevice& inputDevice) override; //////////////////////////////////////////////////////////////////////////////////////////// //! Convenience functions to show/hide the primary controller disconnected popup. ///@{ virtual void ShowPrimaryControllerDisconnectedPopup(); virtual void HidePrimaryControllerDisconnectedPopup(); ///@} private: //////////////////////////////////////////////////////////////////////////////////////////// // Variables AZ::u32 m_primaryControllerDisconnectedPopupId = 0; //!< Id of the popup being displayed }; } // namespace GameStateSamples // Include the implementation inline so the class can be instantiated outside of the gem. #include