Updated to use the new plugin

This commit is contained in:
Jordon Brooks 2024-01-07 23:46:48 +00:00
parent 174a73d160
commit 509d6aab73
No known key found for this signature in database
GPG key ID: 83964894E5D98D57
36 changed files with 788 additions and 753 deletions

View file

@ -0,0 +1,17 @@
#pragma once
#include "CoreMinimal.h"
#include "Device.generated.h"
/**
*
*/
UENUM(BlueprintType)
enum class EDevice : uint8
{
DESKTOP UMETA(DisplayName = "Desktop"),
LAPTOP UMETA(DisplayName = "Laptop"),
HANDHELD UMETA(DisplayName = "Handheld"),
STEAM_DECK UMETA(DisplayName = "Steam Deck")
};

View file

@ -0,0 +1,16 @@
#pragma once
#include "CoreMinimal.h"
#include "Platform.generated.h"
/**
*
*/
UENUM(BlueprintType)
enum class EPlatform : uint8
{
WINDOWS UMETA(DisplayName = "Windows"),
LINUX UMETA(DisplayName = "Linux"),
MAC UMETA(DisplayName = "Mac"),
UNIX UMETA(DisplayName = "Unix")
};

View file

@ -0,0 +1,14 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Modules/ModuleManager.h"
class FHarmonyLinkModule : public IModuleInterface
{
public:
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};

View file

@ -0,0 +1,41 @@
// Copyright (C) 2023 Jordon Brooks
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Structs/Battery.h"
#include "Structs/CPUInfo.h"
#include "Structs/FDevice.h"
#include "Structs/OSVerInfo.h"
#include "HarmonyLinkLibrary.generated.h"
/**
*
*/
UCLASS()
class HARMONYLINK_API UHarmonyLinkLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static bool IsWine();
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static bool IsLinux();
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static bool IsSteamDeck();
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FCPUInfo GetCPUInfo();
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FDevice GetDeviceInfo();
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FOSVerInfo GetOSInfo();
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FBattery GetBatteryStatus();
};

View file

@ -0,0 +1,29 @@
// Copyright (C) 2023 Jordon Brooks
#pragma once
#include <HarmonyLinkLib.h>
#include "CoreMinimal.h"
#include "Battery.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FBattery
{
GENERATED_BODY()
FBattery() {}
UPROPERTY(BlueprintReadWrite, EditAnywhere)
bool HasBattery = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
bool IsACConnected = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int32 BatteryPercent = 0;
FBattery(HarmonyLinkLib::FBattery* battery);
};

View file

@ -0,0 +1,36 @@
// Copyright (C) 2023 Jordon Brooks
#pragma once
#include <HarmonyLinkLib.h>
#include "CoreMinimal.h"
#include "CPUInfo.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FCPUInfo
{
GENERATED_BODY()
FCPUInfo() {}
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString VendorID;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString ModelName;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int32 PhysicalCores = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int32 LogicalCores = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
TSet<FString> Flags;
FCPUInfo(HarmonyLinkLib::FCPUInfo* cpu_info);
};

View file

@ -0,0 +1,22 @@
#pragma once
#include "CoreMinimal.h"
#include "Enums/Device.h"
#include "Enums/Platform.h"
#include "FDevice.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FDevice
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere)
EPlatform Platform = EPlatform::WINDOWS;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
EDevice Device = EDevice::DESKTOP;
};

View file

@ -0,0 +1,36 @@
// Copyright (C) 2023 Jordon Brooks
#pragma once
#include "CoreMinimal.h"
#include "OSVerInfo.generated.h"
/**
*
*/
USTRUCT(BlueprintType)
struct FOSVerInfo
{
GENERATED_BODY()
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString Name;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
int32 Version = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString ID;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString VersionID;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString VersionCodename;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString PrettyName;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
FString VariantID;
};