mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-02 22:28:45 +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"
|
#include "src/qt_gui/discord_rpc_handler.h"
|
||||||
|
|
||||||
namespace DiscordRPCHandler {
|
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() {
|
void RPC::init() {
|
||||||
DiscordRichPresence rpc{};
|
DiscordEventHandlers handlers{};
|
||||||
rpc.largeImageKey = "https://github.com/shadps4-emu/shadPS4/raw/main/.github/shadps4.png";
|
std::string discordAppId = "1290207945476280360";
|
||||||
rpc.largeImageText = "ShadPS4 is a PS4 emulator";
|
Discord_Initialize(discordAppId.c_str(), &handlers, 1, nullptr);
|
||||||
rpc.startTimestamp = startTimestamp;
|
startTimestamp = time(nullptr);
|
||||||
rpc.details = "Idle";
|
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) {
|
Discord_UpdatePresence(&rpc);
|
||||||
DiscordRichPresence rpc{};
|
}
|
||||||
|
|
||||||
rpc.details = "Playing";
|
void RPC::setStatusPlaying(const std::string& game_name, const std::string& game_id) {
|
||||||
rpc.state = game_name.c_str();
|
DiscordRichPresence rpc{};
|
||||||
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);
|
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
|
} // namespace DiscordRPCHandler
|
||||||
|
|
|
@ -70,7 +70,7 @@ 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
|
// Initialize Discord RPC
|
||||||
discordRPC.init();
|
discordRPC.init();
|
||||||
discordRPC.setStatusIdling();
|
discordRPC.setStatusIdling();
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#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"
|
||||||
#include "qt_gui/discord_rpc_handler.h"
|
|
||||||
#include "elf_viewer.h"
|
#include "elf_viewer.h"
|
||||||
#include "emulator.h"
|
#include "emulator.h"
|
||||||
#include "game_grid_frame.h"
|
#include "game_grid_frame.h"
|
||||||
|
@ -22,6 +21,7 @@
|
||||||
#include "main_window_themes.h"
|
#include "main_window_themes.h"
|
||||||
#include "main_window_ui.h"
|
#include "main_window_ui.h"
|
||||||
#include "pkg_viewer.h"
|
#include "pkg_viewer.h"
|
||||||
|
#include "qt_gui/discord_rpc_handler.h"
|
||||||
|
|
||||||
class GameListFrame;
|
class GameListFrame;
|
||||||
|
|
||||||
|
@ -95,7 +95,6 @@ private:
|
||||||
QTranslator* translator;
|
QTranslator* translator;
|
||||||
|
|
||||||
DiscordRPCHandler::RPC discordRPC;
|
DiscordRPCHandler::RPC discordRPC;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject* obj, QEvent* event) override;
|
bool eventFilter(QObject* obj, QEvent* event) override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue