After feedback from discord, add the client key into Variables.cmake.

Note to any other third party client, please obtain your own key for your client so you can customize the rich presence features.
master
Liny 2019-09-25 01:01:25 -07:00
parent 2d33bc29a9
commit d428d17aaa
9 changed files with 32 additions and 52 deletions

View File

@ -1,23 +1,17 @@
# -*- cmake -*-
if (DISCORD_API_KEY)
include(Prebuilt)
use_prebuilt_binary(discord-rpc)
set(DISCORD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/discord-rpc)
include(Prebuilt)
use_prebuilt_binary(discord-rpc)
set(DISCORD_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/discord-rpc)
if (WINDOWS)
if (ADDRESS_SIZE EQUAL 32)
set(DISCORD_LIBRARY discord-rpc)
else ()
set(DISCORD_LIBRARY discord-rpc_x64)
endif(ADDRESS_SIZE EQUAL 32)
elseif (LINUX)
set(DISCORD_LIBRARY discord-rpc)
elseif (DARWIN)
set(DISCORD_LIBRARY discord-rpc)
endif (WINDOWS)
add_definitions( -DDISCORD_API_KEY=\"${DISCORD_API_KEY}\")
add_definitions( -DHAS_DISCORD )
set(USE_DISCORD TRUE)
endif (DISCORD_API_KEY)
if (WINDOWS)
if (ADDRESS_SIZE EQUAL 32)
set(DISCORD_LIBRARY discord-rpc)
else ()
set(DISCORD_LIBRARY discord-rpc_x64)
endif(ADDRESS_SIZE EQUAL 32)
elseif (LINUX)
set(DISCORD_LIBRARY discord-rpc)
elseif (DARWIN)
set(DISCORD_LIBRARY discord-rpc)
endif (WINDOWS)

View File

@ -210,6 +210,9 @@ set(GRID agni CACHE STRING "Target Grid")
set(FLICKR_API_KEY "daaabff93a967e0f37fa18863bb43b29")
set(FLICKR_API_SECRET "846f0958020b553e")
# Discord client key.
set(DDISCORD_API_KEY "427641535253708801")
set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")

View File

@ -1632,10 +1632,15 @@ list(APPEND viewer_HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/exoflickrkeys.h)
# </exodus>
#<FS:LO> Discord rich presence
if (USE_DISCORD)
LIST(APPEND viewer_HEADER_FILES fsfloaterdiscord.h fsdiscordconnect.h)
LIST(APPEND viewer_SOURCE_FILES fsfloaterdiscord.cpp fsdiscordconnect.cpp)
endif (USE_DISCORD)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/fsdiscordkey.h.in
${CMAKE_CURRENT_BINARY_DIR}/fsdiscordkey.h
@ONLY
)
list(APPEND viewer_HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/fsdiscordkey.h)
LIST(APPEND viewer_HEADER_FILES fsfloaterdiscord.h fsdiscordconnect.h)
LIST(APPEND viewer_SOURCE_FILES fsfloaterdiscord.cpp fsdiscordconnect.cpp)
#</FS:LO>
# <FS:TS> Generate the version information header file.
@ -2438,9 +2443,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${GROWL_LIBRARY}
)
if( USE_DISCORD )
target_link_libraries(${VIEWER_BINARY_NAME} ${DISCORD_LIBRARY} )
endif()
target_link_libraries(${VIEWER_BINARY_NAME} ${DISCORD_LIBRARY} )
if (BUGSPLAT_DB)
target_link_libraries(${VIEWER_BINARY_NAME}

View File

@ -48,9 +48,7 @@
#include "boost/algorithm/string/case_conv.hpp"
#ifndef DISCORD_API_KEY
#define DISCORD_API_KEY ""
#endif
#include "fsdiscordkey.h"
boost::scoped_ptr<LLEventPump> FSDiscordConnect::sStateWatcher(new LLEventStream("DiscordConnectState"));
boost::scoped_ptr<LLEventPump> FSDiscordConnect::sInfoWatcher(new LLEventStream("DiscordConnectInfo"));

View File

@ -0,0 +1,4 @@
// THIS FILE IS AUTOGENERATED BY THE BUILD PROCESS
// You can either set the keys in Variables.cmake or at the autobuild command
#define DISCORD_API_KEY "@DDISCORD_API_KEY@"

View File

@ -179,9 +179,7 @@
#include "fsfloateravatarrendersettings.h"
#include "fsfloatercontacts.h"
#include "fsfloatercontactsetconfiguration.h"
#ifdef HAS_DISCORD
#include "fsfloaterdiscord.h"
#endif
#include "fsfloaterexport.h"
#include "fsfloaterblocklist.h"
#include "fsfloatergroup.h"
@ -465,9 +463,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("fs_blocklist", "floater_fs_blocklist.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterBlocklist>);
LLFloaterReg::add("fs_add_contact", "floater_fs_contact_add.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterAddToContactSet>);
LLFloaterReg::add("fs_contact_set_config", "floater_fs_contact_set_configuration.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterContactSetConfiguration>);
#ifdef HAS_DISCORD
LLFloaterReg::add("fs_discord", "floater_fs_discord.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterDiscord>);
#endif
LLFloaterReg::add("fs_group", "floater_fs_group.xml",&LLFloaterReg::build<FSFloaterGroup>);
LLFloaterReg::add("fs_group_titles", "floater_fs_group_titles.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterGroupTitles>);
LLFloaterReg::add("fs_export", "floater_fs_export.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<FSFloaterObjectExport>);

View File

@ -11125,17 +11125,6 @@ class FSObjectExportCollada : public view_listener_t
};
// </FS:CR>
// <FS:Ansariel> Discord integration
bool enable_discord_integration()
{
#if HAS_DISCORD
return true;
#else
return false;
#endif
}
// </FS:Ansariel>
// <FS:Zi> Make sure to call this before any of the UI is set up, so all text editors can
// pick up the menu properly.
void initialize_edit_menu()
@ -11854,7 +11843,4 @@ void initialize_menus()
view_listener_t::addMenu(new FSObjectExportCollada(), "Object.ExportCollada");
enable.add("Object.EnableExport", boost::bind(&enable_export_object));
// </FS:Techwolf Lupindo>
// <FS:Ansariel> Discord integration
enable.add("FSDiscordEnabled", std::bind(&enable_discord_integration));
}

View File

@ -130,9 +130,7 @@
#include "llsidepanelappearance.h"
#include "fsavatarrenderpersistence.h"
#ifdef HAS_DISCORD
#include "fsdiscordconnect.h" // <FS:LO> tapping a place that happens on landing in world to start up discord
#endif
extern F32 SPEED_ADJUST_MAX;
extern F32 SPEED_ADJUST_MAX_SEC;

View File

@ -604,8 +604,6 @@
<menu_item_call.on_click
function="Floater.Toggle"
parameter="fs_discord"/>
<menu_item_call.on_visible
function="FSDiscordEnabled"/>
</menu_item_call>
<menu_item_separator/>
<menu