mirror of
https://github.com/Ed94/Cog.git
synced 2026-07-30 11:20:07 +00:00
First Submit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Modules/ModuleInterface.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
class ICogDebugEditorModule : public IModuleInterface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
static inline ICogDebugEditorModule& Get() { return FModuleManager::LoadModuleChecked<ICogDebugEditorModule>("CogDebugEditor"); }
|
||||
|
||||
static inline bool IsAvailable() { return FModuleManager::Get().IsModuleLoaded("CogDebugEditor"); }
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "CogDebugGraphPanelPinFactory.h"
|
||||
#include "CogDebugLogCategory.h"
|
||||
#include "EdGraphSchema_K2.h"
|
||||
#include "EdGraphUtilities.h"
|
||||
#include "SCogDebugLogCategoryGraphPin.h"
|
||||
#include "SGraphPin.h"
|
||||
#include "Widgets/DeclarativeSyntaxSupport.h"
|
||||
|
||||
class FCogGraphPanelPinFactory : public FGraphPanelPinFactory
|
||||
{
|
||||
virtual TSharedPtr<class SGraphPin> CreatePin(class UEdGraphPin* InPin) const override
|
||||
{
|
||||
if (InPin->PinType.PinCategory == UEdGraphSchema_K2::PC_Struct && InPin->PinType.PinSubCategoryObject == FCogLogCategory::StaticStruct())
|
||||
{
|
||||
return SNew(SCogLogCategoryGraphPin, InPin);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "IPropertyTypeCustomization.h"
|
||||
#include "Layout/Visibility.h"
|
||||
#include "PropertyEditorModule.h"
|
||||
#include "Widgets/SWidget.h"
|
||||
|
||||
class FCogLogCategoryDetails : public IPropertyTypeCustomization
|
||||
{
|
||||
public:
|
||||
static TSharedRef<IPropertyTypeCustomization> MakeInstance();
|
||||
|
||||
/** IPropertyTypeCustomization interface */
|
||||
virtual void CustomizeHeader(TSharedRef<class IPropertyHandle> StructPropertyHandle, class FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
|
||||
virtual void CustomizeChildren(TSharedRef<class IPropertyHandle> StructPropertyHandle, class IDetailChildrenBuilder& StructBuilder, IPropertyTypeCustomizationUtils& StructCustomizationUtils) override;
|
||||
|
||||
private:
|
||||
|
||||
TSharedPtr<IPropertyHandle> NameProperty;
|
||||
TArray<TSharedPtr<FString>> PropertyOptions;
|
||||
|
||||
void OnLogCategoryChanged(FName SelectedName);
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Widgets/DeclarativeSyntaxSupport.h"
|
||||
#include "Widgets/SWidget.h"
|
||||
#include "SGraphPin.h"
|
||||
|
||||
class SCogLogCategoryGraphPin : public SGraphPin
|
||||
{
|
||||
public:
|
||||
SLATE_BEGIN_ARGS(SCogLogCategoryGraphPin) {}
|
||||
SLATE_END_ARGS()
|
||||
|
||||
void Construct(const FArguments& InArgs, UEdGraphPin* InGraphPinObj);
|
||||
|
||||
//~ Begin SGraphPin Interface
|
||||
virtual TSharedRef<SWidget> GetDefaultValueWidget() override;
|
||||
//~ End SGraphPin Interface
|
||||
|
||||
void OnLogCategoryChanged(FName SelectedName);
|
||||
|
||||
FName LastSelectedName;
|
||||
|
||||
private:
|
||||
bool GetDefaultValueIsEnabled() const
|
||||
{
|
||||
return !GraphPinObj->bDefaultValueIsReadOnly;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Widgets/SWidget.h"
|
||||
#include "Widgets/SCompoundWidget.h"
|
||||
#include "Widgets/DeclarativeSyntaxSupport.h"
|
||||
#include "Widgets/Input/SComboButton.h"
|
||||
|
||||
class SCogLogCategoryWidget : public SCompoundWidget
|
||||
{
|
||||
public:
|
||||
DECLARE_DELEGATE_OneParam(FOnLogCategoryChanged, FName)
|
||||
|
||||
SLATE_BEGIN_ARGS(SCogLogCategoryWidget)
|
||||
: _FilterMetaData()
|
||||
, _DefaultName()
|
||||
{}
|
||||
SLATE_ARGUMENT(FString, FilterMetaData)
|
||||
SLATE_ARGUMENT(FName, DefaultName)
|
||||
SLATE_EVENT(FOnLogCategoryChanged, OnLogCategoryChanged)
|
||||
SLATE_END_ARGS()
|
||||
|
||||
void Construct(const FArguments& InArgs);
|
||||
|
||||
private:
|
||||
TSharedRef<SWidget> GenerateLogCategoryPicker();
|
||||
FText GetSelectedValueAsText() const;
|
||||
void OnItemPicked(FName Name);
|
||||
|
||||
FOnLogCategoryChanged OnLogCategoryChanged;
|
||||
FString FilterMetaData;
|
||||
FName SelectedName;
|
||||
TSharedPtr<class SComboButton> ComboButton;
|
||||
};
|
||||
Reference in New Issue
Block a user