Files
Plugin/Source/SenseGloveSettings/Public/SGSettings/SGSettings.h
T

108 lines
3.0 KiB
C++
Raw Normal View History

2023-03-20 23:14:07 +01:00
/**
* @file
*
* @author Mamadou Babaei <mamadou@senseglove.com>
*
* @section LICENSE
*
* (The MIT License)
*
2024-02-03 04:39:36 +01:00
* Copyright (c) 2020 - 2024 SenseGlove
2023-03-20 23:14:07 +01:00
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* @section DESCRIPTION
*
*
*/
#pragma once
2023-03-21 17:28:45 +01:00
#include "Math/Color.h"
#include "Math/Rotator.h"
#include "Math/Vector.h"
#include "Subsystems/EngineSubsystem.h"
2023-03-20 23:14:07 +01:00
#include "Templates/UniquePtr.h"
#include "UObject/ObjectMacros.h"
2024-06-06 14:30:02 +02:00
#include "SGSettings/SGGameUserSettingSettings.h"
#include "SGSettings/SGTrackingSettings.h"
2023-03-20 23:14:07 +01:00
#include "SGSettings.generated.h"
/**
* Implements the settings for the SenseGlove Unreal Engine Plugin.
*/
2023-03-20 23:14:07 +01:00
UCLASS(config = SenseGloveSettings)
class SENSEGLOVESETTINGS_API USGSettings : public UEngineSubsystem
2023-03-20 23:14:07 +01:00
{
GENERATED_BODY()
public:
static USGSettings* GetInstance();
2023-03-20 23:14:07 +01:00
private:
struct FImpl;
struct FImplDeleter
{
void operator()(const FImpl* P) const;
};
TUniquePtr<FImpl, FImplDeleter> Pimpl;
FImplDeleter PimplDeleter;
private:
2024-06-06 14:30:02 +02:00
UPROPERTY(Config, EditDefaultsOnly, Category = "SenseGlove")
FSGGameUserSettingSettings GameUserSettings;
UPROPERTY(Config, EditDefaultsOnly, Category = "SenseGlove")
FSGTrackingSettings TrackingSettings;
2023-03-21 17:28:45 +01:00
2024-04-29 11:16:51 +02:00
private:
2023-03-21 15:01:44 +01:00
USGSettings();
2023-03-21 13:47:11 +01:00
public:
2024-06-06 14:30:02 +02:00
FORCEINLINE const FSGGameUserSettingSettings& GetGameUserSettings() const
{
return GameUserSettings;
}
void SetGameUserSettings(const FSGGameUserSettingSettings& InGameUserSettings)
{
GameUserSettings = InGameUserSettings;
}
FORCEINLINE const FSGTrackingSettings& GetTrackingSettings() const
2023-03-21 13:47:11 +01:00
{
return TrackingSettings;
2023-03-21 13:47:11 +01:00
}
void SetTrackingSettings(const FSGTrackingSettings& InTrackingSettings)
2023-03-21 13:47:11 +01:00
{
TrackingSettings = InTrackingSettings;
2023-03-21 13:47:11 +01:00
}
public:
virtual bool ShouldCreateSubsystem(UObject* Outer) const override;
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
2023-03-20 23:14:07 +01:00
};