Initial commit

This commit is contained in:
alexpete
2021-03-05 11:26:34 -08:00
commit a10351f38d
27091 changed files with 5521199 additions and 0 deletions
@@ -0,0 +1,97 @@
/*
* 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 <GameState/GameState.h>
#include <GameStateSamples/GameStateLocalUserLobby.h>
#include <AzCore/std/smart_ptr/unique_ptr.h>
#include <ISystem.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
namespace GameStateSamples
{
////////////////////////////////////////////////////////////////////////////////////////////////
//! Game state that is active while displaying the main game menu (or another front-end menu).
class GameStateMainMenu : public GameState::IGameState
, public ISystemEventListener
{
public:
////////////////////////////////////////////////////////////////////////////////////////////
// Allocator
AZ_CLASS_ALLOCATOR(GameStateMainMenu, AZ::SystemAllocator, 0);
////////////////////////////////////////////////////////////////////////////////////////////
// Type Info
AZ_RTTI(GameStateMainMenu, "{53EB59EC-77F1-4C8E-AC5F-B2A94F15AF31}", IGameState);
////////////////////////////////////////////////////////////////////////////////////////////
//! Default constructor
GameStateMainMenu() = default;
////////////////////////////////////////////////////////////////////////////////////////////
//! Default destructor
~GameStateMainMenu() override = default;
protected:
////////////////////////////////////////////////////////////////////////////////////////////
//! \ref GameState::GameState::OnPushed
void OnPushed() override;
////////////////////////////////////////////////////////////////////////////////////////////
//! \ref GameState::GameState::OnPopped
void OnPopped() override;
////////////////////////////////////////////////////////////////////////////////////////////
//! \ref GameState::GameState::OnEnter
void OnEnter() override;
////////////////////////////////////////////////////////////////////////////////////////////
//! \ref GameState::GameState::OnExit
void OnExit() override;
////////////////////////////////////////////////////////////////////////////////////////////
//! \ref GameState::GameState::OnUpdate
void OnUpdate() override;
////////////////////////////////////////////////////////////////////////////////////////////
//! \ref ISystemEventListener::OnSystemEvent
void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) override;
////////////////////////////////////////////////////////////////////////////////////////////
//! Convenience functions to load and unload the main game menu UI canvas.
///@{
virtual void LoadMainMenuCanvas();
virtual void UnloadMainMenuCanvas();
virtual const char* GetMainMenuCanvasAssetPath();
///@}
////////////////////////////////////////////////////////////////////////////////////////////
//! Refresh the list of levels displayed in the main menu.
virtual void RefreshLevelListDisplay();
////////////////////////////////////////////////////////////////////////////////////////////
//! Load options from persistent storage, which is done upon first entry into the main menu.
virtual void LoadGameOptionsFromPersistentStorage();
protected:
////////////////////////////////////////////////////////////////////////////////////////////
// Variables
AZStd::unique_ptr<GameStateLocalUserLobby> m_localUserLobbySubState;
AZ::EntityId m_mainMenuCanvasEntityId;
bool m_shouldRefreshLevelListDisplay = false;
};
} // namespace GameStateSamples
// Include the implementation inline so the class can be instantiated outside of the gem.
#include <GameStateSamples/GameStateMainMenu.inl>