-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add FSO_BUILD_WITH_DISCORD cmake option #6482
Add FSO_BUILD_WITH_DISCORD cmake option #6482
Conversation
This should also remove the Discord Option from Options Manager entirely. The code will looks something like this
|
In my opinion, I think changes to the Discord options should be a separate PR as this PR's focus is the build option. Perhaps the Discord options should stay but be grayed out in the menu if there's no built-in support? I don't know. I'd personally want the Discord options to stay in the menu and config file even when there's no built-in support, in the case where I'm swapping different builds with and without support. Sounds like a decision for another PR to work through. |
Huh? I don't follow. If you build FSO without Discord enabled, then you should make sure the game doesn't display the Discord option in the Options menu. That's what the code I exampled will do. It doesn't make sense to have the option visible if the feature doesn't exist in the current build. |
There isn't just one way to communicate to the user that the Discord options aren't available. You suggested the options be removed. I suggested that the options be visible but grayed out, indicating that they aren't available for some reason. I don't feel strongly how the Discord options issue is solved. Whatever others want is fine. I just don't think it falls within the scope of this PR and should be addressed with a separate PR. The goal of this PR is to provide a cmake build option for Discord and not break the game when it's disabled. The OpenXR cmake build option ( |
I don't think you're understanding what I'm saying or maybe I'm not being clear. I am intimately familiar with the in-game options system and I wrote the Discord option feature itself. The code I provided is how OptionsManager works to effectively hide an option from players when it's not available. FSO doesn't grey out options, it hides them. That's just how it works here. FSO does the same thing for font scaling when there are no scaling-capable fonts defined in fonts.tbl. If you are creating a way to make builds that don't have Discord as a feature then you need to make sure the option is hidden in those builds because now it does nothing. That's part of this PR.. same as shutting down the Discord subsystem because now it does nothing. If this gets merged then another PR will have to be created because of this one just to hide the discord option because of the feature this PR adds. And it's like 3 lines of code. Just put the function somewhere and call it when you do the discord shutdown in discord.cpp. |
Yes, that would be helpful.
It sounds like you would be the best person to write, test, and create a separate PR to handle that well and do it exactly how you think is best. I'm not familiar with the in-game options system or the Discord integration, and it's not part of the cmake build system. |
Are you serious? The code's right here. This is all you need. Put it somewhere. Call it during your shutdown routine. Boom. Done.
|
7c277ab
to
642ff82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works, too, and is even easier. thank you.
Ok - after some private chatting with @MjnMixael, we got it worked out. I changed the PR so it doesn't compile the Discord menu option when Sorry for the above chatter folks. We settled on: --- a/code/mod_table/mod_table.cpp
+++ b/code/mod_table/mod_table.cpp
@@ -157,6 +157,8 @@ bool Dont_show_callsigns_in_escort_list;
bool Fix_scripted_velocity;
color Overhead_line_colors[MAX_SHIP_SECONDARY_BANKS];
+#ifdef WITH_DISCORD
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})
@@ -179,6 +181,7 @@ static auto DiscordOption __UNUSED = options::OptionBuilder<bool>("Game.Discord"
return true;
})
.finish();
+#endif
void mod_table_set_version_flags(); |
Provides the FSO_BUILD_WITH_DISCORD cmake option to enable/disable Discord support.
Defaults to
ON
.Example usage:
Related to #4826.
Closes #4113.