mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 04:38:49 +00:00
Merge branch 'master' of https://github.com/dolphin-emu/dolphin into dolphin-emu-master
This commit is contained in:
commit
4e86922408
89 changed files with 544 additions and 18490 deletions
|
@ -24,6 +24,8 @@
|
|||
#include "Common/HttpRequest.h"
|
||||
#include "Common/StringUtil.h"
|
||||
|
||||
#include "Core/AchievementManager.h"
|
||||
#include "Core/Config/AchievementSettings.h"
|
||||
#include "Core/System.h"
|
||||
|
||||
#endif
|
||||
|
@ -37,6 +39,9 @@ namespace
|
|||
{
|
||||
Handler* event_handler = nullptr;
|
||||
const char* username = "";
|
||||
static int64_t s_start_timestamp = std::chrono::duration_cast<std::chrono::seconds>(
|
||||
std::chrono::system_clock::now().time_since_epoch())
|
||||
.count();
|
||||
|
||||
void HandleDiscordReady(const DiscordUser* user)
|
||||
{
|
||||
|
@ -199,7 +204,7 @@ bool UpdateDiscordPresenceRaw(const std::string& details, const std::string& sta
|
|||
}
|
||||
|
||||
void UpdateDiscordPresence(int party_size, SecretType type, const std::string& secret,
|
||||
const std::string& current_game)
|
||||
const std::string& current_game, bool reset_timer)
|
||||
{
|
||||
#ifdef USE_DISCORD_PRESENCE
|
||||
if (!Config::Get(Config::MAIN_USE_DISCORD_PRESENCE))
|
||||
|
@ -227,6 +232,9 @@ void UpdateDiscordPresence(int party_size, SecretType type, const std::string& s
|
|||
}
|
||||
discord_presence.details = title.empty() ? "Not in-game" : title.c_str();
|
||||
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
std::string state_string;
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
if (party_size > 0)
|
||||
{
|
||||
if (party_size < 4)
|
||||
|
@ -241,6 +249,19 @@ void UpdateDiscordPresence(int party_size, SecretType type, const std::string& s
|
|||
// Note: joining still works without partyMax
|
||||
}
|
||||
}
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
else if (Config::Get(Config::RA_ENABLED) && Config::Get(Config::RA_DISCORD_PRESENCE_ENABLED))
|
||||
{
|
||||
state_string = AchievementManager::GetInstance().GetRichPresence().data();
|
||||
if (state_string.length() >= 128)
|
||||
{
|
||||
// 124 characters + 3 dots + null terminator - thanks to Stenzek for format
|
||||
state_string.resize(124);
|
||||
state_string += "...";
|
||||
}
|
||||
discord_presence.state = state_string.c_str();
|
||||
}
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
std::string party_id;
|
||||
std::string secret_final;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue