|
|
|
@ -74,11 +74,11 @@ All rights reserved. |
|
|
|
|
#include "InventoryScrollableWindowComponent.h" |
|
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
|
#include "discord.h" |
|
|
|
|
#include <steam_api.h> |
|
|
|
|
#endif |
|
|
|
|
#include "GameSettings.h" |
|
|
|
|
#include "LoadingScreen.h" |
|
|
|
|
#include "Tutorial.h" |
|
|
|
|
#include <steam_api.h> |
|
|
|
|
|
|
|
|
|
INCLUDE_EMITTER_LIST |
|
|
|
|
INCLUDE_ITEM_CATEGORIES |
|
|
|
@ -325,15 +325,17 @@ bool AiL::OnUserCreate(){ |
|
|
|
|
if(SteamAPI_RestartAppIfNecessary(2895980U))return false; //Immediately quit if steam is detected and can be started through it.
|
|
|
|
|
if(SteamAPI_Init()){ |
|
|
|
|
std::cout<<"Steam API Initialized successfully!"<<std::endl; |
|
|
|
|
if(SteamUtils()!=nullptr){ |
|
|
|
|
SteamUtils()->SetWarningMessageHook([](int severity,const char*message){ |
|
|
|
|
std::cout<<std::format("STEAM[{}]: {}",severity,std::string(message))<<std::endl; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
if(SteamInput()!=nullptr){ |
|
|
|
|
SteamInput()->Init(false); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
std::cout<<"Steam API failed to initialize!"<<std::endl; |
|
|
|
|
} |
|
|
|
|
if(SteamUtils()!=nullptr) |
|
|
|
|
SteamUtils()->SetWarningMessageHook([](int severity,const char*message){ |
|
|
|
|
std::cout<<std::format("STEAM[{}]: {}",severity,std::string(message))<<std::endl; |
|
|
|
|
}); |
|
|
|
|
if(SteamInput()!=nullptr) |
|
|
|
|
SteamInput()->Init(false); |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -3489,6 +3491,7 @@ void AiL::EndGame(){ |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void AiL::UpdateDiscordStatus(std::string levelName,std::string className){ |
|
|
|
|
std::string originalClassName=className; |
|
|
|
|
#ifndef __EMSCRIPTEN__ |
|
|
|
|
if(Discord){ |
|
|
|
|
::discord::Activity newActivity{}; |
|
|
|
@ -3518,6 +3521,15 @@ void AiL::UpdateDiscordStatus(std::string levelName,std::string className){ |
|
|
|
|
UpdateDiscordStatus(levelName,className); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(SteamFriends()!=nullptr){ |
|
|
|
|
if(levelName!="Main Menu"){ |
|
|
|
|
SteamFriends()->SetRichPresence("status",std::format("Level {} {} - Exploring {}",player->Level(),originalClassName,levelName.c_str()).c_str()); |
|
|
|
|
}else{ |
|
|
|
|
SteamFriends()->SetRichPresence("status","Main Menu"); |
|
|
|
|
} |
|
|
|
|
SteamFriends()->SetRichPresence("steam_display","#Status"); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|