mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
added ifdef for discordrpc
This commit is contained in:
parent
c45af9a2ca
commit
bcb861561b
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include "src/common/discord_rpc_handler.h"
|
#include "discord_rpc_handler.h"
|
||||||
|
|
||||||
namespace DiscordRPCHandler {
|
namespace DiscordRPCHandler {
|
||||||
|
|
||||||
|
@ -76,12 +76,13 @@ bool MainWindow::Init() {
|
|||||||
"Games: " + QString::number(numGames) + " (" + QString::number(duration.count()) + "ms)";
|
"Games: " + QString::number(numGames) + " (" + QString::number(duration.count()) + "ms)";
|
||||||
statusBar->showMessage(statusMessage);
|
statusBar->showMessage(statusMessage);
|
||||||
|
|
||||||
// Initialize Discord RPC
|
#ifdef ENABLE_DISCORD_RPC
|
||||||
if (Config::getEnableDiscordRPC()) {
|
if (Config::getEnableDiscordRPC()) {
|
||||||
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
||||||
rpc->init();
|
rpc->init();
|
||||||
rpc->setStatusIdling();
|
rpc->setStatusIdling();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
|
|
||||||
#include "background_music_player.h"
|
#include "background_music_player.h"
|
||||||
#include "common/config.h"
|
#include "common/config.h"
|
||||||
|
#ifdef ENABLE_DISCORD_RPC
|
||||||
#include "common/discord_rpc_handler.h"
|
#include "common/discord_rpc_handler.h"
|
||||||
|
#endif
|
||||||
#include "common/path_util.h"
|
#include "common/path_util.h"
|
||||||
#include "core/file_format/psf.h"
|
#include "core/file_format/psf.h"
|
||||||
#include "core/file_sys/fs.h"
|
#include "core/file_sys/fs.h"
|
||||||
|
@ -173,6 +173,7 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||||||
BackgroundMusicPlayer::getInstance().setVolume(val);
|
BackgroundMusicPlayer::getInstance().setVolume(val);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#ifdef ENABLE_DISCORD_RPC
|
||||||
connect(ui->discordRPCCheckbox, &QCheckBox::stateChanged, this, [](int val) {
|
connect(ui->discordRPCCheckbox, &QCheckBox::stateChanged, this, [](int val) {
|
||||||
Config::setEnableDiscordRPC(val);
|
Config::setEnableDiscordRPC(val);
|
||||||
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
||||||
@ -183,6 +184,7 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices, QWidge
|
|||||||
rpc->shutdown();
|
rpc->shutdown();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Input TAB
|
// Input TAB
|
||||||
|
Loading…
Reference in New Issue
Block a user