--- a/freespace2/freespace.cpp +++ b/freespace2/freespace.cpp @@ -84,7 +84,6 @@ #include "io/timer.h" #include "jumpnode/jumpnode.h" #include "lab/labv2.h" -#include "libs/discord/discord.h" #include "libs/ffmpeg/FFmpeg.h" #include "lighting/lighting.h" #include "lighting/lighting_profiles.h" @@ -1987,9 +1986,6 @@ #ifdef WITH_FFMPEG libs::ffmpeg::initialize(); #endif - if (Discord_presence) { - libs::discord::init(); - } } mod_table_post_process(); --- a/code/source_groups.cmake +++ b/code/source_groups.cmake @@ -706,11 +706,6 @@ libs/antlr/ErrorListener.h ) -add_file_folder("Libs\\\\Discord" - libs/discord/discord.cpp - libs/discord/discord.h -) - if (FSO_BUILD_WITH_FFMPEG) add_file_folder("Libs\\\\FFmpeg" libs/ffmpeg/FFmpeg.cpp --- a/code/mod_table/mod_table.h +++ b/code/mod_table/mod_table.h @@ -124,7 +124,6 @@ } Shadow_disable_overrides; extern float Thruster_easing; extern bool Always_use_distant_firepoints; -extern bool Discord_presence; extern bool Hotkey_always_hide_hidden_ships; extern bool Use_weapon_class_sounds_for_hits_to_player; extern bool SCPUI_loads_hi_res_animations; --- a/code/mod_table/mod_table.cpp +++ b/code/mod_table/mod_table.cpp @@ -12,7 +12,6 @@ #include "globalincs/version.h" #include "graphics/shadows.h" #include "localization/localize.h" -#include "libs/discord/discord.h" #include "mission/missioncampaign.h" #include "mission/missionload.h" #include "mission/missionmessage.h" @@ -139,7 +138,6 @@ leadIndicatorBehavior Lead_indicator_behavior; shadow_disable_overrides Shadow_disable_overrides {false, false, false, false}; float Thruster_easing; bool Always_use_distant_firepoints; -bool Discord_presence; bool Hotkey_always_hide_hidden_ships; bool Use_weapon_class_sounds_for_hits_to_player; bool SCPUI_loads_hi_res_animations; @@ -156,29 +154,6 @@ bool Lua_API_returns_nil_instead_of_invalid_object; bool Dont_show_callsigns_in_escort_list; bool Fix_scripted_velocity; -static auto DiscordOption __UNUSED = options::OptionBuilder("Game.Discord", - std::pair{"Discord Presence", 1754}, - std::pair{"Toggle Discord Rich Presence", 1755}) - .category(std::make_pair("Game", 1824)) - .default_val(Discord_presence) - .level(options::ExpertLevel::Advanced) - .importance(55) - .change_listener([](bool val, bool) { - if(Discord_presence){ - if (!val) { - Discord_presence = false; - libs::discord::shutdown(); - } - } else { - if (val) { - Discord_presence = true; - libs::discord::init(); - } - } - return true; - }) - .finish(); - void mod_table_set_version_flags(); void parse_mod_table(const char *filename) @@ -1372,10 +1347,6 @@ void parse_mod_table(const char *filename) stuff_boolean(&Always_use_distant_firepoints); } - if (optional_string("$Enable Discord rich presence:")) { - stuff_boolean(&Discord_presence); - } - if (optional_string("$Always hide hidden ships in hotkey list:")) { stuff_boolean(&Hotkey_always_hide_hidden_ships); } @@ -1595,7 +1566,6 @@ void mod_table_reset() Lead_indicator_behavior = leadIndicatorBehavior::DEFAULT; Thruster_easing = 0; Always_use_distant_firepoints = false; - Discord_presence = true; Hotkey_always_hide_hidden_ships = false; Use_weapon_class_sounds_for_hits_to_player = false; SCPUI_loads_hi_res_animations = true; --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -33,8 +33,6 @@ include(FFmpeg.cmake) endif() -add_subdirectory(discord) - include(libRocket.cmake) add_subdirectory(libpcp) --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -44,8 +44,6 @@ target_link_libraries(code PUBLIC md5) -target_link_libraries(code PUBLIC discord-rpc) - target_link_libraries(code PUBLIC libRocket) target_link_libraries(code PUBLIC pcp) --- a/code/scripting/api/libs/base.cpp +++ b/code/scripting/api/libs/base.cpp @@ -8,7 +8,6 @@ #include "freespace.h" #include "gamesequence/gamesequence.h" -#include "libs/discord/discord.h" #include "mission/missiontraining.h" #include "network/multi.h" #include "parse/parselo.h" @@ -754,31 +753,6 @@ } -ADE_FUNC(setDiscordPresence, - l_Base, - "string DisplayText, [boolean Gameplay]", - "Sets the Discord presence to a specific string. If Gameplay is true then the string is ignored and presence will " - "be set as if the player is in-mission. The latter will fail if the player is not in a mission.", - nullptr, - "nothing") -{ - const char* text; - bool gp = false; - if (!ade_get_args(L, "s|b", &text, &gp)) { - return ADE_RETURN_NIL; - } - - if (gp) { - if ((Game_mode & GM_IN_MISSION) != 0){ - libs::discord::set_presence_gameplay(); - } - } else { - libs::discord::set_presence_string(text); - } - - return ADE_RETURN_NIL; -} - ADE_FUNC(hasFocus, l_Base, nullptr, "Returns if the game engine has focus or not", "boolean", "True if the game has focus, false if it has been lost") { return ade_set_args(L, "b", os_foreground());