Skip to content

Commit 7a02edc

Browse files
committed
- Split the single .zip to one for each OS.
- Use global strings for program name, make the latest GitHub release URL a private member. - Add a new, permanent Discord invite URL for SocialSDK. - Fix erroneous spaces before angle brackets in a couple of places.
1 parent c5eb6ae commit 7a02edc

File tree

9 files changed

+17
-11
lines changed

9 files changed

+17
-11
lines changed
-93.4 MB
Binary file not shown.
43.3 MB
Binary file not shown.
38.2 MB
Binary file not shown.
11.9 MB
Binary file not shown.

SerialPrograms/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ if (WIN32)
24642464
)
24652465

24662466
file(ARCHIVE_EXTRACT
2467-
INPUT ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/discord_social_sdk.zip
2467+
INPUT ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/discord_social_sdk_win.zip
24682468
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/
24692469
)
24702470
endif()
@@ -2525,10 +2525,10 @@ if (WIN32)
25252525
)
25262526

25272527
add_library(discord_lib IMPORTED UNKNOWN)
2528-
target_include_directories(SerialPrograms SYSTEM PRIVATE ../3rdParty/discord_social_sdk/)
2528+
target_include_directories(SerialPrograms SYSTEM PRIVATE ../3rdParty/discord_social_sdk_win/)
25292529
set_target_properties(discord_lib PROPERTIES
2530-
IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/discord_social_sdk/lib/release/discord_partner_sdk.lib
2531-
IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/discord_social_sdk/lib/debug/discord_partner_sdk.lib)
2530+
IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/discord_social_sdk_win/lib/release/discord_partner_sdk.lib
2531+
IMPORTED_LOCATION_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../3rdPartyBinaries/discord_social_sdk_win/lib/debug/discord_partner_sdk.lib)
25322532
set_target_properties(discord_lib PROPERTIES
25332533
MAP_IMPORTED_CONFIG_DEBUG DEBUG
25342534
MAP_IMPORTED_CONFIG_RELEASE RELEASE
@@ -2803,7 +2803,7 @@ add_custom_command(
28032803
TARGET SerialPrograms
28042804
POST_BUILD
28052805
COMMAND ${CMAKE_COMMAND} -E copy
2806-
$<IF:$<CONFIG:Debug>,"${PROJECT_ROOT_DIR}/3rdPartyBinaries/discord_social_sdk/bin/debug/discord_partner_sdk.dll","${PROJECT_ROOT_DIR}/3rdPartyBinaries/discord_social_sdk/bin/release/discord_partner_sdk.dll">
2806+
$<IF:$<CONFIG:Debug>,"${PROJECT_ROOT_DIR}/3rdPartyBinaries/discord_social_sdk_win/bin/debug/discord_partner_sdk.dll","${PROJECT_ROOT_DIR}/3rdPartyBinaries/discord_social_sdk_win/bin/release/discord_partner_sdk.dll">
28072807
$<TARGET_FILE_DIR:SerialPrograms>/Binaries64/discord_partner_sdk.dll
28082808
COMMENT "Copying Discord SDK DLL to Binaries64"
28092809
)

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ const std::string DISCORD_LINK_URL_PROGRAM = "https://discord.gg/BSjDp27";
7070
// URL to use in the Discord notifications/embeds.
7171
const std::string DISCORD_LINK_URL_EMBED = "https://discord.gg/xMJcveK";
7272

73+
// URL to use in the DiscordSocialSDK integration.
74+
const std::string DISCORD_LINK_URL_SDK = "https://discord.gg/gn9YEyjjAV";
75+
7376

7477

7578
#if 0

SerialPrograms/Source/CommonFramework/Globals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ extern const std::string GITHUB_LINK_URL;
3131
extern const std::string DISCORD_LINK_TEXT;
3232
extern const std::string DISCORD_LINK_URL_PROGRAM;
3333
extern const std::string DISCORD_LINK_URL_EMBED;
34+
extern const std::string DISCORD_LINK_URL_SDK;
3435

3536
extern const std::string COMPILER_VERSION;
3637

SerialPrograms/Source/Integrations/DiscordSocial/DiscordSocial.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "CommonFramework/Logging/Logger.h"
77
#include "Integrations/ProgramTracker.h"
88
#include "../../CommonFramework/GlobalSettingsPanel.h"
9+
#include "../../CommonFramework/Globals.h"
910

1011
using namespace discordpp;
1112
namespace PokemonAutomation{
@@ -70,10 +71,10 @@ void DiscordSocial::update_rich_presence(){
7071

7172
discordpp::ActivityAssets assets{};
7273
assets.SetLargeImage("rotom");
73-
assets.SetLargeText("Pok\u00E9mon Automation");
74+
assets.SetLargeText(PROGRAM_NAME);
7475

7576
for (const auto& item : ProgramTracker::instance().all_programs()){
76-
switch (item.second.state) {
77+
switch (item.second.state){
7778
case ProgramState::RUNNING:{
7879
assets.SetSmallImage("running");
7980
assets.SetSmallText("Running");
@@ -86,7 +87,7 @@ void DiscordSocial::update_rich_presence(){
8687
state = "Stopped";
8788
m_activity.SetAssets(assets); break;
8889
}
89-
default: {
90+
default:{
9091
assets.SetSmallImage("idle");
9192
assets.SetSmallText("Idle");
9293
state = "Idle";
@@ -146,17 +147,17 @@ Activity DiscordSocial::create_activity(){
146147

147148
ActivityButton button1{};
148149
button1.SetLabel("Download from GitHub");
149-
button1.SetUrl("https://github.com/PokemonAutomation/ComputerControl/releases/latest");
150+
button1.SetUrl(m_github_release_latest);
150151
activity.AddButton(button1);
151152

152153
ActivityButton button2{};
153154
button2.SetLabel("Join our Discord");
154-
button2.SetUrl("https://discord.gg/pokemonautomation");
155+
button2.SetUrl(DISCORD_LINK_URL_SDK);
155156
activity.AddButton(button2);
156157

157158
discordpp::ActivityAssets assets{};
158159
assets.SetLargeImage("rotom");
159-
assets.SetLargeText("Pok\u00E9mon Automation");
160+
assets.SetLargeText(PROGRAM_NAME);
160161
assets.SetSmallImage("idle");
161162
assets.SetSmallText("Idle");
162163
activity.Assets().emplace(assets);

SerialPrograms/Source/Integrations/DiscordSocial/DiscordSocial.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ namespace DiscordSocialSDK{
3434
discordpp::Activity m_activity;
3535
discordpp::ActivityTimestamps m_timestamps{};
3636
discordpp::LoggingSeverity m_log_level = discordpp::LoggingSeverity::Error;
37+
const std::string m_github_release_latest = "https://github.com/PokemonAutomation/ComputerControl/releases/latest";
3738
};
3839
}
3940
}

0 commit comments

Comments
 (0)