mirror of
https://github.com/yuzu-emu/discord-rpc.git
synced 2024-12-22 20:35:43 +00:00
wip make plugin do stuff
This commit is contained in:
parent
9c6495ab3e
commit
63b467f81d
Binary file not shown.
|
@ -0,0 +1,30 @@
|
|||
|
||||
|
||||
#include "DiscordRpcBlueprint.h"
|
||||
|
||||
#include "discord-rpc.h"
|
||||
|
||||
DEFINE_LOG_CATEGORY(DiscordLogCategory)
|
||||
|
||||
/*static*/ void UDiscordRpcBlueprint::Initialize(const FString& applicationId, bool autoRegister)
|
||||
{
|
||||
DiscordEventHandlers handlers{};
|
||||
handlers.ready = []() {
|
||||
UE_LOG(DiscordLogCategory, Log, TEXT("Discord connected"));
|
||||
};
|
||||
handlers.disconnected = [](int errorCode, const char* message) {
|
||||
UE_LOG(DiscordLogCategory, Log, TEXT("Discord disconnected (%d): %s"), errorCode, message);
|
||||
};
|
||||
auto appId = StringCast<ANSICHAR>(*applicationId);
|
||||
Discord_Initialize((const char*)appId.Get(), &handlers, autoRegister);
|
||||
}
|
||||
|
||||
/*static*/ void UDiscordRpcBlueprint::Shutdown()
|
||||
{
|
||||
Discord_Shutdown();
|
||||
}
|
||||
|
||||
/*static*/ void UDiscordRpcBlueprint::RunCallbacks()
|
||||
{
|
||||
Discord_RunCallbacks();
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
#include "ModuleManager.h"
|
||||
#include "IPluginManager.h"
|
||||
|
||||
#include "discord-rpc.h"
|
||||
|
||||
#define LOCTEXT_NAMESPACE "FdiscordrpcModule"
|
||||
|
||||
void FdiscordrpcModule::StartupModule()
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Engine.h"
|
||||
#include "CoreMinimal.h"
|
||||
#include "DiscordRpcBlueprint.generated.h"
|
||||
|
||||
DECLARE_LOG_CATEGORY_EXTERN(DiscordLogCategory, Log, All);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class DISCORDRPC_API UDiscordRpcBlueprint : public UBlueprintFunctionLibrary
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Discord Initialize connection", Keywords = "Discord rpc"), Category = "Discord")
|
||||
static void Initialize(const FString& applicationId, bool autoRegister);
|
||||
|
||||
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Discord shut down connection", Keywords = "Discord rpc"), Category = "Discord")
|
||||
static void Shutdown();
|
||||
|
||||
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Discord check for callbacks", Keywords = "Discord rpc"), Category = "Discord")
|
||||
static void RunCallbacks();
|
||||
};
|
|
@ -35,7 +35,11 @@ public class discordrpc : ModuleRules
|
|||
PublicDependencyModuleNames.AddRange(
|
||||
new string[]
|
||||
{
|
||||
"Core",
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"Core",
|
||||
"discordrpcLibrary",
|
||||
"Projects"
|
||||
// ... add other public dependencies that you statically link with here ...
|
||||
|
|
Loading…
Reference in a new issue