Native Linux compile working and works on steam deck

This commit is contained in:
Jordon Brooks 2024-06-06 21:11:12 +01:00
parent e5cca6b23f
commit 6ba25c1b0d
Signed by: jordon
GPG key ID: DBD9758CD53E786A
8 changed files with 137 additions and 52 deletions

View file

@ -25,29 +25,45 @@ public:
// Checks if the game is running under Wine.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static bool IsWine();
static bool IsWine(bool bForce = false);
// Checks if the operating system is Linux.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static bool IsLinux();
static bool IsLinux(bool bForce = false);
// Checks if the game is running on a Steam Deck.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static bool IsSteamDeck();
static bool IsSteamDeck(bool bForce = false);
// Retrieves information about the CPU of the current device.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static FCPUInfo GetCPUInfo();
static FCPUInfo GetCPUInfo(bool bForce = false);
// Retrieves information about the current device.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static FDevice GetDeviceInfo();
static FDevice GetDeviceInfo(bool bForce = false);
// Retrieves information about the operating system of the current device.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static FOSVerInfo GetOSInfo();
static FOSVerInfo GetOSInfo(bool bForce = false);
// Retrieves the current battery status of the device.
UFUNCTION(BlueprintCallable, BlueprintPure, Category="HarmonyLink")
static FBattery GetBatteryStatus();
private:
static bool bIsWineCached;
static bool bIsWine;
static bool bIsLinuxCached;
static bool bIsLinux;
static bool bIsSteamDeckCached;
static bool bIsSteamDeck;
static bool bCPUInfoCached;
static bool bDeviceInfoCached;
static bool bOSInfoCached;
static FCPUInfo CachedCPUInfo;
static FDevice CachedDeviceInfo;
static FOSVerInfo CachedOSInfo;
};

View file

@ -6,7 +6,7 @@
#include "Enums/Profile.h"
#include "Structs/SettingsProfile.h"
#include "UObject/Object.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HarmonyLinkGraphics.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnProfileChanged, EProfile, Profile);
@ -17,7 +17,7 @@ DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnBatteryLevelChanged, int32, Batte
*
*/
UCLASS(Blueprintable, config="HarmonyLink")
class HARMONYLINK_API UHarmonyLinkGraphics : public UObject
class HARMONYLINK_API UHarmonyLinkGraphics : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
@ -390,7 +390,7 @@ private:
*
* @note Uses UE_LOG for logging errors and informational messages.
*/
void OnPostWorldInitialization(UWorld* World, UWorld::InitializationValues IVS);
static void OnPostWorldInitialization(UWorld* World, UWorld::InitializationValues IVS);
/**
* @brief Handles actions to be performed when the world ends.
@ -406,7 +406,7 @@ private:
*
* @note Uses UE_LOG for logging errors and informational messages.
*/
void OnWorldEnd(UWorld* World);
static void OnWorldEnd(UWorld* World);
/**
* @brief Resets the singleton instance of the UHarmonyLinkGraphics settings.