Adding discord rich presence support for Windows64 (Early)#968
Draft
acth2 wants to merge 2 commits intosmartcmd:mainfrom
Draft
Adding discord rich presence support for Windows64 (Early)#968acth2 wants to merge 2 commits intosmartcmd:mainfrom
acth2 wants to merge 2 commits intosmartcmd:mainfrom
Conversation
|
would it be better to hook directly into the localised strings? |
|
Obviously this wont be a drop in replacement but just an example, static std::string s_detailsUtf8;
static std::string s_stateUtf8;
s_detailsUtf8 = app.GetString(IDS_DISCORD_DETAILS_PLAYING_LCE);
discordPresence.details = s_detailsUtf8.c_str();
switch (iVal) {
case CONTEXT_GAME_STATE_NETHER:
s_stateUtf8 = app.GetString(IDS_DISCORD_STATE_NETHER);
break;
...
default:
s_stateUtf8 = app.GetString(IDS_DISCORD_STATE_SURVIVING);
break;
}
discordPresence.state = s_stateUtf8.c_str();
Discord_UpdatePresence(&discordPresence); |
Contributor
Author
thx i'll do it now |
daf1ae1 to
e42a1f8
Compare
e42a1f8 to
2d246ed
Compare
Contributor
Author
It's done thx for the example btw! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reintroducing the Discord rich presence system, this idea come from #954
Changes
Previous Behavior
There were the functions for rich presence but no code inside of them: the code is still in an very early state but it works!

Root Cause
I needed to recode the discord rich presence but the system that tracks the players action and that permit me to modify what the rich presence says was already coded!
New Behavior
in Minecraft:Init i call ProfileManager.RichPresenceInit(...) and in Minecraft::tick i call player->updateRichPresence(); to constantly update the rich presence
Fix Implementation
Previously it looked like this:

void C_4JProfile::RichPresenceInit(int iPresenceCount, int iContextCount) {}void C_4JProfile::SetRichPresenceContextValue(int iPad, int iContextID, int iVal) {}i just called discord-rpc.h and followed instructions to make a rich presence from there:
It works but its ugly for now!
AI Use Disclosure
nop
Related Issues