// ©2023 Batty Bovine Productions, LLC. All Rights Reserved.

#pragma once

#include "CoreMinimal.h"

#include "SGraphNode.h"
#include "Settings\ComboActionGraphEditorSettings.h"


class SEdComboActionGraphNode : public SGraphNode
{
public:
	SLATE_BEGIN_ARGS(SEdComboActionGraphNode) {}
	SLATE_END_ARGS()

	void Construct(const FArguments &InArgs, class UEdComboActionGraphNode *InNode);

	virtual void OnMouseEnter(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override;
	virtual void OnMouseLeave(const FPointerEvent &MouseEvent) override;

	const FSlateBrush *GetIndexBrush() const;
	
	virtual void UpdateGraphNode() override;
	virtual void CreatePinWidgets() override;
	virtual void AddPin(const TSharedRef<SGraphPin> &PinToAdd) override;
	virtual bool IsNameReadOnly() const override;

	void OnNameTextCommitted(const FText &InText, ETextCommit::Type CommitInfo);
	
	virtual const FSlateBrush *GetNodeTypeBrush () const;
	virtual const FSlateBrush *GetTextNodeTypeBrush () const;
	virtual FSlateColor GetBorderBackgroundColor() const;
	virtual FSlateColor GetBorderFrontColor() const;
	virtual FSlateColor GetNodeTitleBackgroundColor() const;
	virtual FSlateColor GetDecoratorsBackgroundColor() const;

	virtual FSlateColor GetPinsDockColor() const;
	
	virtual EVisibility GetDragOverMarkerVisibility() const;

	virtual const FSlateBrush *GetNameIcon() const;

	const FSlateBrush *GetBulletPointImageBrush() const;

	virtual FText GetIndexOverlayTooltipText() const;
	virtual FText GetIndexText() const;
	EVisibility GetIndexSlotVisibility() const;
	FVector2D GetIndexSlotOffset() const;
	FVector2D GetIndexSlotSize() const;
	
	virtual void OnIndexHoverStateChanged(bool bArg) const;
	virtual FSlateColor GetOverlayWidgetBackgroundColor(bool bArg) const;
	
	EVisibility ShowImplementsOnlySlot_Unified() const;
	EVisibility ShowImplementsOnlySlot_Stack() const;
	EVisibility ShowInheritsDecoratorsSlot_Stack() const;
	EVisibility ShowAllDecorators() const;
	EVisibility ShowDecoratorsBottomPadding() const;
	
	virtual EComboActionDecoratorsInfoStyle GetDecoratorsStyle() const;
	EVisibility GetResponseStackVisibility() const;

	FText GetTooltipText() const;

	FText GetComboInputName() const;
	FText GetComboInputTriggerActionName() const;

protected:
	TSharedPtr<SBorder> NodeBody;
	TSharedPtr<SHorizontalBox> OutputPinBox;

	class UComboActionGraphEditorSettings *GraphEditorSettings = nullptr;

	FLinearColor NodeInnerColor;
	FLinearColor PinsDockColor;
};
