Added marketplace stuff

This commit is contained in:
Jordon Brooks 2024-01-08 16:53:13 +00:00
parent 56aa126e8e
commit fb8a01915e
No known key found for this signature in database
GPG key ID: 83964894E5D98D57
16 changed files with 131 additions and 61 deletions

View file

@ -1,10 +1,12 @@
#pragma once
// Copyright (C) 2024 Jordon Brooks
#pragma once
#include "CoreMinimal.h"
#include "DeviceEnum.generated.h"
/**
*
/*
* Enum representing different operating system platforms.
*/
UENUM(BlueprintType)
enum class EDeviceEnum : uint8

View file

@ -1,10 +1,12 @@
#pragma once
// Copyright (C) 2024 Jordon Brooks
#pragma once
#include "CoreMinimal.h"
#include "Platform.generated.h"
/**
*
/*
* Enum representing different operating system platforms.
*/
UENUM(BlueprintType)
enum class EPlatform : uint8

View file

@ -1,41 +1,50 @@
// Copyright (C) 2023 Jordon Brooks
// Copyright (C) 2024 Jordon Brooks
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Structs/Battery.h"
#include "Structs/CPUInfo.h"
#include "Structs/Device.h"
#include "Structs/OSVerInfo.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HarmonyLinkLibrary.generated.h"
/**
*
* Library of static functions for accessing various system information, particularly for the HarmonyLink project.
*/
UCLASS()
class HARMONYLINK_API UHarmonyLinkLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
// Checks if the game is running under Wine.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static bool IsWine();
// Checks if the operating system is Linux.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static bool IsLinux();
// Checks if the game is running on a Steam Deck.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static bool IsSteamDeck();
// Retrieves information about the CPU of the current device.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FCPUInfo GetCPUInfo();
// Retrieves information about the current device.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FDevice GetDeviceInfo();
// Retrieves information about the operating system of the current device.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FOSVerInfo GetOSInfo();
// Retrieves the current battery status of the device.
UFUNCTION(BlueprintCallable, Category="HarmonyLink")
static FBattery GetBatteryStatus();
};

View file

@ -1,4 +1,4 @@
// Copyright (C) 2023 Jordon Brooks
// Copyright (C) 2024 Jordon Brooks
#pragma once
#include <HarmonyLinkLib.h>
@ -6,8 +6,8 @@
#include "CoreMinimal.h"
#include "Battery.generated.h"
/**
*
/*
* Represents the battery status and information of a device.
*/
USTRUCT(BlueprintType)
struct FBattery
@ -16,14 +16,19 @@ struct FBattery
FBattery() {}
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Indicates whether the device has a battery.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
bool HasBattery = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Indicates whether the device is connected to AC power.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
bool IsACConnected = false;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The current battery percentage of the device.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
int32 BatteryPercent = 0;
// Constructor that initializes the struct with information from an external battery source.
// @param battery Pointer to an external FBattery structure to copy data from.
FBattery(HarmonyLinkLib::FBattery* battery);
};

View file

@ -1,4 +1,4 @@
// Copyright (C) 2023 Jordon Brooks
// Copyright (C) 2024 Jordon Brooks
#pragma once
@ -7,8 +7,8 @@
#include "CoreMinimal.h"
#include "CPUInfo.generated.h"
/**
*
/*
* Represents information about the CPU of a device.
*/
USTRUCT(BlueprintType)
struct FCPUInfo
@ -17,20 +17,27 @@ struct FCPUInfo
FCPUInfo() {}
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The vendor identifier for the CPU.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString VendorID;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The model name of the CPU.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString ModelName;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The number of physical cores in the CPU.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
int32 PhysicalCores = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The number of logical cores in the CPU (may be different from physical cores).
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
int32 LogicalCores = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// A set of flags representing various features or capabilities of the CPU.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
TSet<FString> Flags;
// Constructor that initializes the struct with information from an external CPU info source.
// @param cpu_info Pointer to an external FCPUInfo structure to copy data from.
FCPUInfo(HarmonyLinkLib::FCPUInfo* cpu_info);
};

View file

@ -1,4 +1,6 @@
#pragma once
// Copyright (C) 2024 Jordon Brooks
#pragma once
#include "CoreMinimal.h"
#include "Enums/DeviceEnum.h"
@ -7,9 +9,7 @@
#include "Device.generated.h"
/**
*
*/
// Represents information about a specific device.
USTRUCT(BlueprintType)
struct FDevice
{
@ -17,14 +17,28 @@ struct FDevice
FDevice() {}
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The platform on which the device operates. Note: This can differ from the build platform.
// For example, if the device is identified as running on Wine, this will show Linux,
// regardless of the build being an executable for Windows.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
EPlatform Platform = EPlatform::WINDOWS;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The type of the device.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
EDeviceEnum Device = EDeviceEnum::DESKTOP;
// Constructor that initializes the struct with information from an external source.
// @param oldDevice Pointer to an external FDevice structure to copy data from.
FDevice(HarmonyLinkLib::FDevice* oldDevice);
private:
// Converts an external device enum to the internal EDeviceEnum type.
// @param Device External device enum to convert.
// @returns Converted EDeviceEnum value.
static EDeviceEnum Convert(HarmonyLinkLib::EDevice Device);
// Converts an external platform enum to the internal EPlatform type.
// @param Platform External platform enum to convert.
// @returns Converted EPlatform value.
static EPlatform Convert(HarmonyLinkLib::EPlatform Platform);
};

View file

@ -1,15 +1,12 @@
// Copyright (C) 2023 Jordon Brooks
// Copyright (C) 2024 Jordon Brooks
#pragma once
#include <HarmonyLinkLib.h>
#include "CoreMinimal.h"
#include <HarmonyLinkLib.h>
#include "OSVerInfo.generated.h"
/**
*
*/
// Represents information about an operating system version.
USTRUCT(BlueprintType)
struct FOSVerInfo
{
@ -17,26 +14,35 @@ struct FOSVerInfo
FOSVerInfo() {}
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// The name of the operating system.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString Name;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Numerical version of the operating system.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
int32 Version = 0;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Unique identifier for the operating system.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString ID;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Identifier for the specific version of the operating system.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString VersionID;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Codename for the operating system version.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString VersionCodename;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// User-friendly name for the operating system version.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString PrettyName;
UPROPERTY(BlueprintReadWrite, EditAnywhere)
// Variant identifier of the operating system.
UPROPERTY(BlueprintReadWrite, EditAnywhere, Category="HarmonyLink")
FString VariantID;
// Constructor that initializes the struct with information from an external source.
// @param oldInfo Pointer to an external FOSVerInfo structure to copy data from.
FOSVerInfo(HarmonyLinkLib::FOSVerInfo* oldInfo);
};