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/
# Cache files for the editor to use
DerivedDataCache/*
DerivedDataCache/

View file

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

View file

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

View file

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

View file

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