Initialize repo

This commit is contained in:
MrRobin
2023-10-28 02:46:42 +02:00
parent df5ab7bec8
commit 1a7c2f384b
10 changed files with 1100 additions and 0 deletions

View File

@ -0,0 +1,53 @@
// Copyright 2023 MrRobin. All Rights Reserved.
#pragma once
#include "IPropertyTypeCustomization.h"
#include "Internationalization/Text.h"
#include "Styling/SlateColor.h"
#include "Templates/SharedPointer.h"
#include "Types/SlateEnums.h"
class IPropertyHandle;
class SEditableTextBox;
/**
* Implements a details view customization for the FTimespan structure.
*/
class FMyDateTimeDetailCustomization
: public IPropertyTypeCustomization
{
public:
public:
/**
* Creates an instance of this class.
*
* @return The new instance.
*/
static TSharedRef<IPropertyTypeCustomization> MakeInstance()
{
return MakeShareable(new FMyDateTimeDetailCustomization());
}
public:
// IPropertyTypeCustomization interface
void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
private:
TOptional<int32> OnGetValue(int32 Index) const;
/** @return the value being observed by the Numeric Entry Box as a FText */
FText GetValueAsText(int32 Index) const;
void OnValueCommitted(int32 NewValue, ETextCommit::Type CommitType, int32 Index);
void OnValueChanged(int32 NewValue, int32 Index);
void OnBeginSliderMovement();
void OnEndSliderMovement(int32 NewValue);
private:
/** Holds a handle to the property being edited. */
TSharedPtr<IPropertyHandle> PropertyHandle;
/** True if a value is being changed by dragging a slider */
bool bIsUsingSlider;
};

View File

@ -0,0 +1,50 @@
// Copyright 2023 MrRobin. All Rights Reserved.
#pragma once
#include "IPropertyTypeCustomization.h"
#include "Internationalization/Text.h"
#include "Styling/SlateColor.h"
#include "Templates/SharedPointer.h"
#include "Types/SlateEnums.h"
class IPropertyHandle;
class SEditableTextBox;
/**
* Implements a details view customization for the FTimespan structure.
*/
class FMyTimespanDetailCustomization
: public IPropertyTypeCustomization
{
public:
/**
* Creates an instance of this class.
*
* @return The new instance.
*/
static TSharedRef<IPropertyTypeCustomization> MakeInstance()
{
return MakeShareable(new FMyTimespanDetailCustomization());
}
public:
// IPropertyTypeCustomization interface
void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
private:
TOptional<int32> OnGetValue(int32 Index) const;
void OnValueCommitted(int32 NewValue, ETextCommit::Type CommitType, int32 Index);
void OnValueChanged(int32 NewValue, int32 Index);
void OnBeginSliderMovement();
void OnEndSliderMovement(int32 NewValue);
private:
/** Holds a handle to the property being edited. */
TSharedPtr<IPropertyHandle> PropertyHandle;
/** True if a value is being changed by dragging a slider */
bool bIsUsingSlider;
};