Updated to use the new plugin
This commit is contained in:
parent
174a73d160
commit
509d6aab73
36 changed files with 788 additions and 753 deletions
17
Source/HarmonyLink/Public/Enums/Device.h
Normal file
17
Source/HarmonyLink/Public/Enums/Device.h
Normal 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")
|
||||
};
|
16
Source/HarmonyLink/Public/Enums/Platform.h
Normal file
16
Source/HarmonyLink/Public/Enums/Platform.h
Normal 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")
|
||||
};
|
14
Source/HarmonyLink/Public/HarmonyLink.h
Normal file
14
Source/HarmonyLink/Public/HarmonyLink.h
Normal 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;
|
||||
};
|
41
Source/HarmonyLink/Public/HarmonyLinkLibrary.h
Normal file
41
Source/HarmonyLink/Public/HarmonyLinkLibrary.h
Normal 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();
|
||||
};
|
29
Source/HarmonyLink/Public/Structs/Battery.h
Normal file
29
Source/HarmonyLink/Public/Structs/Battery.h
Normal 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);
|
||||
};
|
36
Source/HarmonyLink/Public/Structs/CPUInfo.h
Normal file
36
Source/HarmonyLink/Public/Structs/CPUInfo.h
Normal 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);
|
||||
};
|
22
Source/HarmonyLink/Public/Structs/FDevice.h
Normal file
22
Source/HarmonyLink/Public/Structs/FDevice.h
Normal 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;
|
||||
};
|
36
Source/HarmonyLink/Public/Structs/OSVerInfo.h
Normal file
36
Source/HarmonyLink/Public/Structs/OSVerInfo.h
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue