3 #include "../../debug_ui.h"
44 ImGui::Begin(
"Discord Rich Presence Tester", &
show, ImGuiWindowFlags_AlwaysAutoResize);
46 static char state[127] =
"Forge World";
47 static char details[127] =
"Using the Forge";
48 static char large_img_key[31] =
"infinity_icon_for_discord_rpc";
49 static char small_img_key[31] =
"blam_icon3";
50 static char large_img_tooltip[127] =
"sample tooltip for infinity icon";
52 static char party_id[127] =
"derp";
53 static char join_secret[127] =
"4b2fdce12f639de8bfa7e3591b71a0d679d7c93f";
54 static char spectate_secret[127] =
"e7eb30d2ee025ed05c71ea495f770b76454ee4e0";
55 static int player_count = 1;
56 static int max_players = 8;
57 static int instance = 1;
58 static int64_t time_start = time(0);
59 static int time_end = 60;
60 static bool use_start_time =
true;
61 static bool use_end_time =
false;
64 ImGui::Text(
"This tool is used to manually update Discord Rich Presence for testing purposes.\n");
66 ImGui::InputText(
"State", state, IM_ARRAYSIZE(state));
68 ImGui::InputText(
"Large Image Key", large_img_key, IM_ARRAYSIZE(large_img_key));
69 ImGui::InputText(
"Small Image Key", small_img_key, IM_ARRAYSIZE(small_img_key));
70 ImGui::InputText(
"Large Image Tooltip", large_img_key, IM_ARRAYSIZE(large_img_tooltip));
71 ImGui::InputText(
"Small Image Tooltip", small_img_key, IM_ARRAYSIZE(small_img_tooltip));
72 ImGui::InputText(
"Party ID", party_id, IM_ARRAYSIZE(party_id));
73 ImGui::InputText(
"Join Secret", join_secret, IM_ARRAYSIZE(join_secret));
74 ImGui::InputText(
"Spectate Secret", spectate_secret, IM_ARRAYSIZE(spectate_secret));
75 ImGui::InputInt(
"Player Count", &player_count);
76 ImGui::InputInt(
"Max Players", &max_players);
77 ImGui::Checkbox(
"Use Start Time", &use_start_time);
78 ImGui::Checkbox(
"Use End Time", &use_end_time);
79 ImGui::InputInt(
"End Time (seconds)", &time_end);
80 ImGui::InputInt(
"Instance", &instance);
84 if (ImGui::Button(
"Update", ImVec2(120, 0)))
86 DiscordRichPresence presence;
87 memset(&presence, 0,
sizeof(presence));
89 presence.state = state;
93 presence.startTimestamp = time(0);
97 presence.endTimestamp = time(0) + time_end;
99 presence.largeImageKey = large_img_key;
100 presence.smallImageKey = small_img_key;
101 presence.largeImageText = large_img_tooltip;
102 presence.smallImageText = small_img_tooltip;
103 presence.partyId = party_id;
104 presence.partySize = player_count;
105 presence.partyMax = max_players;
106 presence.joinSecret = join_secret;
107 presence.spectateSecret = spectate_secret;
108 presence.instance = instance;
113 if (ImGui::Button(
"DiscordReady", ImVec2(120, 0)))
118 if (ImGui::Button(
"DiscordError", ImVec2(120, 0)))
123 if (ImGui::Button(
"DiscordDisconnected", ImVec2(120, 0)))
128 if (ImGui::Button(
"DiscordJoinGame", ImVec2(120, 0)))
133 if (ImGui::Button(
"DiscordSpectateGame", ImVec2(120, 0)))
138 if (ImGui::Button(
"DiscordJoinRequest", ImVec2(120, 0)))