@ -146,6 +146,8 @@ InputGroup AiL::KEY_SHOULDER2;
InputGroup AiL : : KEY_CHANGE_LOADOUT ;
InputGroup AiL : : KEY_MOUSE_RIGHT ;
InputGroup AiL : : KEY_TOGGLE_MAP ;
# ifndef __EMSCRIPTEN__
: : discord : : Core * Discord { } ;
# endif
@ -2770,14 +2772,24 @@ bool Steam_Init(){
int main ( )
{
# ifndef __EMSCRIPTEN__
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! " ) ;
if ( ! std : : filesystem : : exists ( " assets/config/configuration.txt " ) ) {
ERR ( " WARNING! Could not find initial config file! Aborting. " ) ;
return false ;
}
{
utils : : datafile configFile ;
utils : : datafile : : Read ( configFile , " assets/config/configuration.txt " ) ;
if ( configFile [ " steam_api " ] . GetBool ( ) ) {
# ifndef __EMSCRIPTEN__
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
}
{
AiL demo ;
@ -3169,6 +3181,10 @@ void AiL::InitializeDefaultKeybinds(){
KEY_UNEQUIP . AddKeybind ( { CONTROLLER , static_cast < int > ( GPButtons : : FACE_U ) } ) ;
KEY_FACEDOWN . AddKeybind ( { STEAM , Steam : : FUNCTION_1 } ) ;
KEY_TOGGLE_MAP . AddKeybind ( { KEY , TAB } ) ;
KEY_TOGGLE_MAP . AddKeybind ( { CONTROLLER , static_cast < int > ( GPButtons : : R3 ) } ) ;
KEY_TOGGLE_MAP . AddKeybind ( { STEAM , Steam : : TOGGLE_MAP } ) ;
KEY_MOUSE_RIGHT . AddKeybind ( { MOUSE , Mouse : : RIGHT } ) ;
# define TieMenuNameToMenuInputGroup(KEY_NAME) \
@ -3196,6 +3212,7 @@ void AiL::InitializeDefaultKeybinds(){
TieMenuNameToGameplayInputGroup ( Player : : KEY_ITEM1 ) ;
TieMenuNameToGameplayInputGroup ( Player : : KEY_ITEM2 ) ;
TieMenuNameToGameplayInputGroup ( Player : : KEY_ITEM3 ) ;
TieMenuNameToGameplayInputGroup ( KEY_TOGGLE_MAP ) ;
InputGroup : : menuNamesToInputGroups . SetInitialized ( ) ;
}
@ -3740,7 +3757,7 @@ void AiL::UpdateDiscordStatus(std::string levelName,std::string className){
}
SteamFriends ( ) - > SetRichPresence ( " steam_display " , " #Status " ) ;
} else {
if ( Steam_Init ( ) ) {
if ( " steam_api " _B & & Steam_Init ( ) ) {
retry = true ;
LOG ( " Steam API Initialized successfully! " ) ;
}
@ -3786,6 +3803,7 @@ void AiL::ResetGame(bool changeToMainMenu){
SetChapter ( 1 ) ;
SaveFile : : SetSaveFileName ( " " ) ;
Tutorial : : Initialize ( ) ;
minimap . SetMinimapMode ( MinimapMode : : SMALL ) ;
minimap . EraseChunkData ( ) ;
}