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