More plugin
This commit is contained in:
parent
70cd486e13
commit
ff24776107
6 changed files with 17 additions and 18 deletions
2
examples/unrealstatus/.gitignore
vendored
2
examples/unrealstatus/.gitignore
vendored
|
@ -72,4 +72,4 @@ Saved/*
|
|||
Intermediate/
|
||||
|
||||
# Cache files for the editor to use
|
||||
DerivedDataCache/*
|
||||
DerivedDataCache/
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -14,5 +14,5 @@ public:
|
|||
|
||||
private:
|
||||
/** Handle to the test dll we will load */
|
||||
void* ExampleLibraryHandle;
|
||||
void* DiscordLibraryHandle;
|
||||
};
|
|
@ -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()),
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue