mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-22 04:24:44 +00:00
fix clang-format issues
This commit is contained in:
parent
d2a7c78316
commit
319e6c5c74
3 changed files with 30 additions and 31 deletions
|
@ -6,38 +6,38 @@
|
|||
#include "src/qt_gui/discord_rpc_handler.h"
|
||||
|
||||
namespace DiscordRPCHandler {
|
||||
|
||||
void RPC::init() {
|
||||
DiscordEventHandlers handlers{};
|
||||
std::string discordAppId = "1290207945476280360";
|
||||
Discord_Initialize(discordAppId.c_str(), &handlers, 1, nullptr);
|
||||
startTimestamp = time(nullptr);
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
void RPC::setStatusIdling() {
|
||||
DiscordRichPresence rpc{};
|
||||
rpc.largeImageKey = "https://github.com/shadps4-emu/shadPS4/raw/main/.github/shadps4.png";
|
||||
rpc.largeImageText = "ShadPS4 is a PS4 emulator";
|
||||
rpc.startTimestamp = startTimestamp;
|
||||
rpc.details = "Idle";
|
||||
void RPC::init() {
|
||||
DiscordEventHandlers handlers{};
|
||||
std::string discordAppId = "1290207945476280360";
|
||||
Discord_Initialize(discordAppId.c_str(), &handlers, 1, nullptr);
|
||||
startTimestamp = time(nullptr);
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
Discord_UpdatePresence(&rpc);
|
||||
}
|
||||
void RPC::setStatusIdling() {
|
||||
DiscordRichPresence rpc{};
|
||||
rpc.largeImageKey = "https://github.com/shadps4-emu/shadPS4/raw/main/.github/shadps4.png";
|
||||
rpc.largeImageText = "ShadPS4 is a PS4 emulator";
|
||||
rpc.startTimestamp = startTimestamp;
|
||||
rpc.details = "Idle";
|
||||
|
||||
void RPC::setStatusPlaying(const std::string& game_name, const std::string& game_id) {
|
||||
DiscordRichPresence rpc{};
|
||||
Discord_UpdatePresence(&rpc);
|
||||
}
|
||||
|
||||
rpc.details = "Playing";
|
||||
rpc.state = game_name.c_str();
|
||||
std::string largeImageUrl =
|
||||
"https://store.playstation.com/store/api/chihiro/00_09_000/titlecontainer/US/en/999/" +
|
||||
game_id + "_00/image";
|
||||
rpc.largeImageKey = largeImageUrl.c_str();
|
||||
rpc.largeImageText = game_name.c_str();
|
||||
rpc.startTimestamp = startTimestamp;
|
||||
void RPC::setStatusPlaying(const std::string& game_name, const std::string& game_id) {
|
||||
DiscordRichPresence rpc{};
|
||||
|
||||
Discord_UpdatePresence(&rpc);
|
||||
}
|
||||
rpc.details = "Playing";
|
||||
rpc.state = game_name.c_str();
|
||||
std::string largeImageUrl =
|
||||
"https://store.playstation.com/store/api/chihiro/00_09_000/titlecontainer/US/en/999/" +
|
||||
game_id + "_00/image";
|
||||
rpc.largeImageKey = largeImageUrl.c_str();
|
||||
rpc.largeImageText = game_name.c_str();
|
||||
rpc.startTimestamp = startTimestamp;
|
||||
|
||||
Discord_UpdatePresence(&rpc);
|
||||
}
|
||||
|
||||
} // namespace DiscordRPCHandler
|
||||
|
|
|
@ -70,7 +70,7 @@ bool MainWindow::Init() {
|
|||
"Games: " + QString::number(numGames) + " (" + QString::number(duration.count()) + "ms)";
|
||||
statusBar->showMessage(statusMessage);
|
||||
|
||||
//Initialize Discord RPC
|
||||
// Initialize Discord RPC
|
||||
discordRPC.init();
|
||||
discordRPC.setStatusIdling();
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "common/path_util.h"
|
||||
#include "core/file_format/psf.h"
|
||||
#include "core/file_sys/fs.h"
|
||||
#include "qt_gui/discord_rpc_handler.h"
|
||||
#include "elf_viewer.h"
|
||||
#include "emulator.h"
|
||||
#include "game_grid_frame.h"
|
||||
|
@ -22,6 +21,7 @@
|
|||
#include "main_window_themes.h"
|
||||
#include "main_window_ui.h"
|
||||
#include "pkg_viewer.h"
|
||||
#include "qt_gui/discord_rpc_handler.h"
|
||||
|
||||
class GameListFrame;
|
||||
|
||||
|
@ -95,7 +95,6 @@ private:
|
|||
QTranslator* translator;
|
||||
|
||||
DiscordRPCHandler::RPC discordRPC;
|
||||
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||
|
|
Loading…
Add table
Reference in a new issue