/**
 * Copyright 2022-2025 Theai, Inc. dba Inworld AI
 */
#pragma once

#include "CoreMinimal.h"
#include "SGraphNode.h"
#include "SNodePanel.h"
#include "Styling/SlateColor.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SWidget.h"
#include "Runtime/Launch/Resources/Version.h"

class SToolTip;
class UEdNode_InworldGraphEdge;

class INWORLDRUNTIMEEDITOR_API SEdNode_InworldGraphEdge : public SGraphNode
{
public:
	SLATE_BEGIN_ARGS(SEdNode_InworldGraphEdge)
	{
	}
	SLATE_END_ARGS()

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

	virtual bool RequiresSecondPassLayout() const override;
	virtual void PerformSecondPassLayout(const TMap<UObject*, TSharedRef<SNode>>& NodeToWidgetLookup) const override;
	virtual void UpdateGraphNode() override;

protected:
	FSlateColor GetEdgeColor() const;
	FText GetEdgeToolTip() const;

	const FSlateBrush* GetEdgeImage() const;

	EVisibility GetEdgeImageVisibility() const;
	EVisibility GetEdgeTitleVisbility() const;

private:
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION < 6
	FVector2D GetWarningSlotOffset() const;
#else
	FVector2f GetWarningSlotOffset2f() const;
#endif
	EVisibility GetWarningVisibility() const;
	TSharedPtr<STextEntryPopup> TextEntryWidget;
};
