Merge pull request #7801 from GerbilSoft/feature/Discord-PPCTitleChanged

Update Discord rich presence when the PPC title changes
This commit is contained in:
Léo Lam 2019-05-24 14:30:52 +02:00 committed by GitHub
commit 6eb7c525b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 0 deletions

View File

@ -155,6 +155,10 @@ void Host_UpdateProgressDialog(const char* caption, int position, int total)
{
}
void Host_TitleChanged()
{
}
static bool MsgAlert(const char* caption, const char* text, bool yes_no, MsgType /*style*/)
{
__android_log_print(ANDROID_LOG_ERROR, DOLPHIN_TAG, "%s:%s", caption, text);

View File

@ -725,6 +725,7 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
GetCurrentLanguage(bWii);
m_title_description = title_database.Describe(m_gametdb_id, language);
NOTICE_LOG(CORE, "Active title: %s", m_title_description.c_str());
Host_TitleChanged();
Config::AddLayer(ConfigLoaders::GenerateGlobalGameConfigLoader(game_id, revision));
Config::AddLayer(ConfigLoaders::GenerateLocalGameConfigLoader(game_id, revision));

View File

@ -45,3 +45,4 @@ void Host_UpdateMainFrame();
void Host_UpdateTitle(const std::string& title);
void Host_YieldToUI();
void Host_UpdateProgressDialog(const char* caption, int position, int total);
void Host_TitleChanged();

View File

@ -105,6 +105,13 @@ void Host_UpdateProgressDialog(const char* caption, int position, int total)
{
}
void Host_TitleChanged()
{
#ifdef USE_DISCORD_PRESENCE
Discord::UpdateDiscordPresence();
#endif
}
static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options)
{
std::string platform_name = static_cast<const char*>(options.get("platform"));

View File

@ -17,6 +17,7 @@
#include "Core/Core.h"
#include "Core/Debugger/PPCDebugInterface.h"
#include "Core/Host.h"
#include "Core/NetPlayProto.h"
#include "Core/PowerPC/PowerPC.h"
#include "DolphinQt/QtUtils/QueueOnObject.h"
@ -24,6 +25,8 @@
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "UICommon/DiscordPresence.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoConfig.h"
@ -164,3 +167,12 @@ bool Host_UIBlocksControllerState()
void Host_RefreshDSPDebuggerWindow()
{
}
void Host_TitleChanged()
{
#ifdef USE_DISCORD_PRESENCE
// TODO: Not sure if the NetPlay check is needed.
if (!NetPlay::IsNetPlayRunning())
Discord::UpdateDiscordPresence();
#endif
}

View File

@ -52,3 +52,6 @@ void Host_YieldToUI()
void Host_UpdateProgressDialog(const char* caption, int position, int total)
{
}
void Host_TitleChanged()
{
}

View File

@ -53,3 +53,6 @@ void Host_YieldToUI()
void Host_UpdateProgressDialog(const char* caption, int position, int total)
{
}
void Host_TitleChanged()
{
}