summaryrefslogtreecommitdiff
path: root/games-engines/fs2_open/files/fs2_open-24.2.0-disable-discord.patch
blob: b59ef21a3f0f7ea10827e9040784f4ed2f106e7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
--- 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<bool>("Game.Discord",
-                     std::pair<const char*, int>{"Discord Presence", 1754},
-                     std::pair<const char*, int>{"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());