More plugin

This commit is contained in:
Chris Marsh 2017-08-09 14:35:52 -07:00
parent 70cd486e13
commit ff24776107
6 changed files with 17 additions and 18 deletions

View file

@ -72,4 +72,4 @@ Saved/*
Intermediate/ Intermediate/
# Cache files for the editor to use # Cache files for the editor to use
DerivedDataCache/* DerivedDataCache/

View file

@ -6,6 +6,9 @@ AppliedTargetedHardwareClass=Desktop
DefaultGraphicsPerformance=Maximum DefaultGraphicsPerformance=Maximum
AppliedDefaultGraphicsPerformance=Maximum AppliedDefaultGraphicsPerformance=Maximum
[/Script/Engine.EndUserSettings]
bSendAnonymousUsageDataToEpic=False
[/Script/Engine.PhysicsSettings] [/Script/Engine.PhysicsSettings]
DefaultGravityZ=-980.000000 DefaultGravityZ=-980.000000
DefaultTerminalVelocity=4000.000000 DefaultTerminalVelocity=4000.000000
@ -45,6 +48,7 @@ SyncSceneSmoothingFactor=0.000000
AsyncSceneSmoothingFactor=0.990000 AsyncSceneSmoothingFactor=0.990000
InitialAverageFrameRate=0.016667 InitialAverageFrameRate=0.016667
[/Script/Engine.EndUserSettings] [/Script/EngineSettings.GameMapsSettings]
bSendAnonymousUsageDataToEpic=False EditorStartupMap=/Game/ShowTheUILevel.ShowTheUILevel
GameDefaultMap=/Game/ShowTheUILevel.ShowTheUILevel

View file

@ -5,8 +5,6 @@
#include "ModuleManager.h" #include "ModuleManager.h"
#include "IPluginManager.h" #include "IPluginManager.h"
#define DISCORD_DYNAMIC_LIB
//#include "../../../../../../../include/discord-rpc.h"
#include "discord-rpc.h" #include "discord-rpc.h"
#define LOCTEXT_NAMESPACE "FdiscordrpcModule" #define LOCTEXT_NAMESPACE "FdiscordrpcModule"
@ -26,15 +24,11 @@ void FdiscordrpcModule::StartupModule()
LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/discordrpcLibrary/Mac/Release/libdiscord-rpc.dylib")); LibraryPath = FPaths::Combine(*BaseDir, TEXT("Source/ThirdParty/discordrpcLibrary/Mac/Release/libdiscord-rpc.dylib"));
#endif // PLATFORM_WINDOWS #endif // PLATFORM_WINDOWS
ExampleLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr; DiscordLibraryHandle = !LibraryPath.IsEmpty() ? FPlatformProcess::GetDllHandle(*LibraryPath) : nullptr;
if (ExampleLibraryHandle) if (!DiscordLibraryHandle)
{ {
Discord_Initialize("344609418631053312", nullptr, false); FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load discord-rpc library"));
}
else
{
FMessageDialog::Open(EAppMsgType::Ok, LOCTEXT("ThirdPartyLibraryError", "Failed to load example third party library"));
} }
} }
@ -44,8 +38,8 @@ void FdiscordrpcModule::ShutdownModule()
// we call this function before unloading the module. // we call this function before unloading the module.
// Free the dll handle // Free the dll handle
FPlatformProcess::FreeDllHandle(ExampleLibraryHandle); FPlatformProcess::FreeDllHandle(DiscordLibraryHandle);
ExampleLibraryHandle = nullptr; DiscordLibraryHandle = nullptr;
} }
#undef LOCTEXT_NAMESPACE #undef LOCTEXT_NAMESPACE

View file

@ -14,5 +14,5 @@ public:
private: private:
/** Handle to the test dll we will load */ /** Handle to the test dll we will load */
void* ExampleLibraryHandle; void* DiscordLibraryHandle;
}; };

View file

@ -6,6 +6,7 @@ public class discordrpc : ModuleRules
{ {
public discordrpc(ReadOnlyTargetRules Target) : base(Target) public discordrpc(ReadOnlyTargetRules Target) : base(Target)
{ {
Definitions.Add("DISCORD_DYNAMIC_LIB=1");
PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs;
PublicIncludePaths.AddRange( PublicIncludePaths.AddRange(
@ -26,7 +27,7 @@ public class discordrpc : ModuleRules
PublicLibraryPaths.AddRange( PublicLibraryPaths.AddRange(
new string[] { new string[] {
"Binaries/ThirdParty/discordrpcLibrary/Win64", System.IO.Path.Combine(ModuleDirectory, "../../Binaries/ThirdParty/discordrpcLibrary/", Target.Platform.ToString()),
} }
); );