@ -321,19 +321,21 @@ bool AiL::OnUserCreate(){
# endif
# endif
State_OverworldMap : : SetStageMarker ( " starting_map_name " _S ) ;
State_OverworldMap : : SetStageMarker ( " starting_map_name " _S ) ;
if ( SteamInput ( ) ! = nullptr ) {
SteamInput ( ) - > Init ( false ) ;
Input : : LoadSteamButtonIcons ( ) ;
Input : : ingameControlsHandle = SteamInput ( ) - > GetActionSetHandle ( " InGameControls " ) ;
}
if ( steamKeyboardCallbackListener = = nullptr ) {
steamKeyboardCallbackListener = new SteamKeyboardCallbackHandler ( ) ;
}
utils : : datafile : : INITIAL_SETUP_COMPLETE = true ;
utils : : datafile : : INITIAL_SETUP_COMPLETE = true ;
ValidateGameStatus ( ) ; //Checks to make sure everything has been initialized properly.
ValidateGameStatus ( ) ; //Checks to make sure everything has been initialized properly.
# ifndef __EMSCRIPTEN__
# ifndef __EMSCRIPTEN__
SetupDiscord ( ) ;
SetupDiscord ( ) ;
if ( SteamAPI_RestartAppIfNecessary ( 2895980U ) ) return false ; //Immediately quit if steam is detected and can be started through it.
if ( Steam_Init ( ) ) {
LOG ( " Steam API Initialized successfully! " ) ;
} else {
LOG ( " Steam API failed to initialize! " ) ;
}
# endif
# endif
gameInitialized = true ;
gameInitialized = true ;
@ -2650,8 +2652,26 @@ datafiledoubledata AiL::GetDoubleList(std::string key){
return { DATA , key } ;
return { DATA , key } ;
}
}
bool Steam_Init ( ) {
if ( SteamAPI_Init ( ) ) {
if ( SteamUtils ( ) ! = nullptr ) {
SteamUtils ( ) - > SetWarningMessageHook ( [ ] ( int severity , const char * message ) {
LOG ( std : : format ( " STEAM[{}]: {} " , severity , std : : string ( message ) ) ) ;
} ) ;
}
return true ;
}
return false ;
}
int main ( )
int main ( )
{
{
if ( SteamAPI_RestartAppIfNecessary ( 2895980U ) ) return false ; //Immediately quit if steam is detected and can be started through it.
if ( Steam_Init ( ) ) {
LOG ( " Steam API Initialized successfully! " ) ;
} else {
LOG ( " Steam API failed to initialize! " ) ;
}
{
{
AiL demo ;
AiL demo ;
@ -3808,26 +3828,6 @@ int AiL::GetLoadoutSize()const{
return loadout . size ( ) ;
return loadout . size ( ) ;
}
}
bool AiL : : Steam_Init ( ) {
if ( SteamAPI_Init ( ) ) {
if ( SteamUtils ( ) ! = nullptr ) {
SteamUtils ( ) - > SetWarningMessageHook ( [ ] ( int severity , const char * message ) {
LOG ( std : : format ( " STEAM[{}]: {} " , severity , std : : string ( message ) ) ) ;
} ) ;
if ( steamKeyboardCallbackListener = = nullptr ) {
steamKeyboardCallbackListener = new SteamKeyboardCallbackHandler ( ) ;
}
}
if ( SteamInput ( ) ! = nullptr ) {
SteamInput ( ) - > Init ( false ) ;
Input : : LoadSteamButtonIcons ( ) ;
Input : : ingameControlsHandle = SteamInput ( ) - > GetActionSetHandle ( " InGameControls " ) ;
}
return true ;
}
return false ;
}
void AiL : : ActivateActionSetForAllControllers ( InputActionSetHandle_t actionSetHandle ) {
void AiL : : ActivateActionSetForAllControllers ( InputActionSetHandle_t actionSetHandle ) {
for ( int i = 0 ; i < Input : : controllerCount ; i + + ) {
for ( int i = 0 ; i < Input : : controllerCount ; i + + ) {
SteamInput ( ) - > ActivateActionSet ( Input : : steamControllers [ i ] , actionSetHandle ) ;
SteamInput ( ) - > ActivateActionSet ( Input : : steamControllers [ i ] , actionSetHandle ) ;