diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h index bdfc28c34c..d4855306be 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.h @@ -122,7 +122,6 @@ namespace AZ int m_currentHistoryIndex = -1; //!< The current index into the input history when browsing. int m_maxEntriesToDisplay = DefaultMaxEntriesToDisplay; //!< The maximum entries to display. int m_maxInputHistorySize = DefaultMaxInputHistorySize; //!< The maximum input history size. - int m_logLevelToSet = 0; //!< The minimum log level to set (see AZ::LogLevel). bool m_isShowing = false; //!< Is the debug console currently being displayed? bool m_autoScroll = true; //!< Should we auto-scroll as new entries are added? bool m_forceScroll = false; //!< Do we need to force scroll after input entered? diff --git a/Gems/GameState/Code/CMakeLists.txt b/Gems/GameState/Code/CMakeLists.txt index 7aa99446cb..debedd8500 100644 --- a/Gems/GameState/Code/CMakeLists.txt +++ b/Gems/GameState/Code/CMakeLists.txt @@ -17,8 +17,8 @@ ly_add_target( PUBLIC Include BUILD_DEPENDENCIES - PRIVATE - Legacy::CryCommon + PUBLIC + AZ::AzCore ) ly_add_target( @@ -33,7 +33,6 @@ ly_add_target( Include BUILD_DEPENDENCIES PRIVATE - Legacy::CryCommon Gem::GameState.Static ) @@ -58,7 +57,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED) BUILD_DEPENDENCIES PRIVATE AZ::AzTest - Legacy::CryCommon Gem::GameState.Static ) ly_add_googletest( diff --git a/Gems/GameStateSamples/Code/CMakeLists.txt b/Gems/GameStateSamples/Code/CMakeLists.txt index 34132e67b1..5d1d180de0 100644 --- a/Gems/GameStateSamples/Code/CMakeLists.txt +++ b/Gems/GameStateSamples/Code/CMakeLists.txt @@ -21,6 +21,7 @@ ly_add_target( INTERFACE Gem::GameState Gem::LocalUser + Gem::LyShine.Static Gem::SaveData.Static Gem::MessagePopup.Static Legacy::CryCommon @@ -47,6 +48,7 @@ ly_add_target( Gem::LmbrCentral ) -# Clients and Servers use the above module. There is no editor or tools module required. -ly_create_alias(NAME GameStateSamples.Clients NAMESPACE Gem TARGETS GameStateSamples) -ly_create_alias(NAME GameStateSamples.Servers NAMESPACE Gem TARGETS GameStateSamples) +# Clients and Servers use the above module, and it contains assets so is needed by builders. +ly_create_alias(NAME GameStateSamples.Clients NAMESPACE Gem TARGETS Gem::GameStateSamples) +ly_create_alias(NAME GameStateSamples.Servers NAMESPACE Gem TARGETS Gem::GameStateSamples) +ly_create_alias(NAME GameStateSamples.Builders NAMESPACE Gem TARGETS Gem::UiBasics.Builders Gem::LyShineExamples.Builders) diff --git a/Gems/GameStateSamples/Code/Source/GameStateSamplesModule.cpp b/Gems/GameStateSamples/Code/Source/GameStateSamplesModule.cpp index 24a29c97ab..f175619bf4 100644 --- a/Gems/GameStateSamples/Code/Source/GameStateSamplesModule.cpp +++ b/Gems/GameStateSamples/Code/Source/GameStateSamplesModule.cpp @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -55,6 +56,7 @@ namespace GameStateSamples //! class GameStateSamplesModule : public CryHooksModule + , public AZ::TickBus::Handler , public GameOptionRequestBus::Handler { public: @@ -86,6 +88,22 @@ namespace GameStateSamples { CryHooksModule::OnCrySystemInitialized(system, systemInitParams); + AZ::TickBus::Handler::BusConnect(); + } + + void OnTick([[maybe_unused]]float deltaTime, [[maybe_unused]]AZ::ScriptTimePoint scriptTimePoint) override + { + // Ideally this would be called at startup (either above in OnCrySystemInitialized, or better during AZ system component + // initialisation), but because the initial game state depends on loading a UI canvas using LYShine we need to wait until + // the first tick, because LyShine in turn is not properly initialized until UiRenderer::OnBootstrapSceneReady has been + // called, which doesn't happen until a queued tick event that gets called right at the end of initialisation before we + // enter the main game loop. + CreateAndPushInitialGameState(); + AZ::TickBus::Handler::BusDisconnect(); + } + + void CreateAndPushInitialGameState() + { REGISTER_INT("sys_primaryUserSelectionEnabled", 2, VF_NULL, "Controls whether the game forces selection of a primary user at startup.\n" "0 : Skip selection of a primary user at startup on all platform.\n"