mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-03 14:49:22 +00:00
fix 2/2
This commit is contained in:
parent
f161453af9
commit
b3f914ed4e
1 changed files with 7 additions and 9 deletions
|
@ -15,24 +15,22 @@ bool mpn_update_discord()
|
||||||
if (CurrentState.Scenes != NULL && CurrentState.Scene != NULL)
|
if (CurrentState.Scenes != NULL && CurrentState.Scene != NULL)
|
||||||
RichPresence.state = CurrentState.Scene->Name.c_str();
|
RichPresence.state = CurrentState.Scene->Name.c_str();
|
||||||
|
|
||||||
DiscordRichPresence discord_presence = {};
|
|
||||||
|
|
||||||
if (CurrentState.Addresses != NULL)
|
if (CurrentState.Addresses != NULL)
|
||||||
{
|
{
|
||||||
char Details[128] = "";
|
char Details[128] = "";
|
||||||
|
|
||||||
if (CurrentState.Boards && CurrentState.Board)
|
if (CurrentState.Boards && CurrentState.Board)
|
||||||
{
|
{
|
||||||
if (discord_presence.partySize > 0)
|
if (RichPresence.partySize > 0)
|
||||||
{
|
{
|
||||||
snprintf(Details, sizeof(Details), "Players: %d/4 Turn: %d/%d", discord_presence.partySize,
|
snprintf(Details, sizeof(Details), "Players: %d/4 Turn: %d/%d", RichPresence.partySize,
|
||||||
mpn_read_value(CurrentState.Addresses->CurrentTurn, 1),
|
mpn_read_value(CurrentState.Addresses->CurrentTurn, 1),
|
||||||
mpn_read_value(CurrentState.Addresses->TotalTurns, 1));
|
mpn_read_value(CurrentState.Addresses->TotalTurns, 1));
|
||||||
|
|
||||||
RichPresence.smallImageKey = CurrentState.Board->Icon.c_str();
|
RichPresence.smallImageKey = CurrentState.Board->Icon.c_str();
|
||||||
RichPresence.smallImageText = CurrentState.Board->Name.c_str();
|
RichPresence.smallImageText = CurrentState.Board->Name.c_str();
|
||||||
}
|
}
|
||||||
else if (discord_presence.partySize = 0)
|
else
|
||||||
{
|
{
|
||||||
snprintf(Details, sizeof(Details), "Players: 1/4 Turn: %d/%d",
|
snprintf(Details, sizeof(Details), "Players: 1/4 Turn: %d/%d",
|
||||||
mpn_read_value(CurrentState.Addresses->CurrentTurn, 1),
|
mpn_read_value(CurrentState.Addresses->CurrentTurn, 1),
|
||||||
|
@ -44,20 +42,20 @@ bool mpn_update_discord()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (discord_presence.partySize > 0)
|
if (RichPresence.partySize > 0)
|
||||||
{
|
{
|
||||||
snprintf(Details, sizeof(Details), "Players: %d/4", discord_presence.partySize);
|
snprintf(Details, sizeof(Details), "Players: %d/4", RichPresence.partySize);
|
||||||
RichPresence.smallImageKey = "";
|
RichPresence.smallImageKey = "";
|
||||||
RichPresence.smallImageText = "";
|
RichPresence.smallImageText = "";
|
||||||
}
|
}
|
||||||
else if (discord_presence.partySize = 0)
|
else
|
||||||
{
|
{
|
||||||
snprintf(Details, sizeof(Details), "Players: 1/4");
|
snprintf(Details, sizeof(Details), "Players: 1/4");
|
||||||
RichPresence.smallImageKey = "";
|
RichPresence.smallImageKey = "";
|
||||||
RichPresence.smallImageText = "";
|
RichPresence.smallImageText = "";
|
||||||
}
|
}
|
||||||
RichPresence.details = Details;
|
|
||||||
}
|
}
|
||||||
|
RichPresence.details = Details;
|
||||||
}
|
}
|
||||||
|
|
||||||
RichPresence.startTimestamp = std::time(nullptr);
|
RichPresence.startTimestamp = std::time(nullptr);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue