Fix the GameStateSamples Gem and remove an unused variable from DebugConsole.h (#3347)

Signed-off-by: bosnichd <bosnichd@amazon.com>
monroegm-disable-blank-issue-2
bosnichd 4 years ago committed by GitHub
parent 5bc46fc676
commit cef82f0313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -122,7 +122,6 @@ namespace AZ
int m_currentHistoryIndex = -1; //!< The current index into the input history when browsing. int m_currentHistoryIndex = -1; //!< The current index into the input history when browsing.
int m_maxEntriesToDisplay = DefaultMaxEntriesToDisplay; //!< The maximum entries to display. int m_maxEntriesToDisplay = DefaultMaxEntriesToDisplay; //!< The maximum entries to display.
int m_maxInputHistorySize = DefaultMaxInputHistorySize; //!< The maximum input history size. 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_isShowing = false; //!< Is the debug console currently being displayed?
bool m_autoScroll = true; //!< Should we auto-scroll as new entries are added? 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? bool m_forceScroll = false; //!< Do we need to force scroll after input entered?

@ -17,8 +17,8 @@ ly_add_target(
PUBLIC PUBLIC
Include Include
BUILD_DEPENDENCIES BUILD_DEPENDENCIES
PRIVATE PUBLIC
Legacy::CryCommon AZ::AzCore
) )
ly_add_target( ly_add_target(
@ -33,7 +33,6 @@ ly_add_target(
Include Include
BUILD_DEPENDENCIES BUILD_DEPENDENCIES
PRIVATE PRIVATE
Legacy::CryCommon
Gem::GameState.Static Gem::GameState.Static
) )
@ -58,7 +57,6 @@ if(PAL_TRAIT_BUILD_TESTS_SUPPORTED)
BUILD_DEPENDENCIES BUILD_DEPENDENCIES
PRIVATE PRIVATE
AZ::AzTest AZ::AzTest
Legacy::CryCommon
Gem::GameState.Static Gem::GameState.Static
) )
ly_add_googletest( ly_add_googletest(

@ -21,6 +21,7 @@ ly_add_target(
INTERFACE INTERFACE
Gem::GameState Gem::GameState
Gem::LocalUser Gem::LocalUser
Gem::LyShine.Static
Gem::SaveData.Static Gem::SaveData.Static
Gem::MessagePopup.Static Gem::MessagePopup.Static
Legacy::CryCommon Legacy::CryCommon
@ -47,6 +48,7 @@ ly_add_target(
Gem::LmbrCentral Gem::LmbrCentral
) )
# Clients and Servers use the above module. There is no editor or tools module required. # 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 GameStateSamples) ly_create_alias(NAME GameStateSamples.Clients NAMESPACE Gem TARGETS Gem::GameStateSamples)
ly_create_alias(NAME GameStateSamples.Servers NAMESPACE Gem TARGETS 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)

@ -7,6 +7,7 @@
*/ */
#include <AzCore/Component/ComponentApplicationBus.h> #include <AzCore/Component/ComponentApplicationBus.h>
#include <AzCore/Component/TickBus.h>
#include <AzCore/Memory/SystemAllocator.h> #include <AzCore/Memory/SystemAllocator.h>
#include <AzCore/Module/Module.h> #include <AzCore/Module/Module.h>
#include <AzCore/std/smart_ptr/make_shared.h> #include <AzCore/std/smart_ptr/make_shared.h>
@ -55,6 +56,7 @@ namespace GameStateSamples
//! //!
class GameStateSamplesModule class GameStateSamplesModule
: public CryHooksModule : public CryHooksModule
, public AZ::TickBus::Handler
, public GameOptionRequestBus::Handler , public GameOptionRequestBus::Handler
{ {
public: public:
@ -86,6 +88,22 @@ namespace GameStateSamples
{ {
CryHooksModule::OnCrySystemInitialized(system, systemInitParams); 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, REGISTER_INT("sys_primaryUserSelectionEnabled", 2, VF_NULL,
"Controls whether the game forces selection of a primary user at startup.\n" "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" "0 : Skip selection of a primary user at startup on all platform.\n"

Loading…
Cancel
Save