// Copyright (c) 2026 CelestiaDominance. All rights reserved.

#pragma once

#include "CoreMinimal.h"
#include "UObject/SoftObjectPath.h"
#include "UObject/Object.h"
#include "BlueprintGraphThemeSelectorSettings.generated.h"

UENUM(BlueprintType)
enum class EBlueprintGraphVisualTheme : uint8
{
    Default UMETA(DisplayName = "Default (UE Style)"),
    Dark UMETA(DisplayName = "Dark"),
    LowOpacity UMETA(DisplayName = "Low Opacity"),
    Light UMETA(DisplayName = "Light"),
    Neon UMETA(DisplayName = "Neon"),
    Custom UMETA(DisplayName = "Custom")
};

UENUM(BlueprintType)
enum class EBlueprintGraphBackgroundImageMovement : uint8
{
    Static UMETA(DisplayName = "Static (Screen Space)"),
    FollowGraph UMETA(DisplayName = "Follow Graph (Tiled)")
};

UCLASS(Config = EditorPerProjectUserSettings, DefaultConfig)
class UBlueprintGraphThemeSelectorSettings : public UObject
{
    GENERATED_BODY()

public:
    UBlueprintGraphThemeSelectorSettings();

    UPROPERTY(EditAnywhere, Config, Category = "Theme")
    EBlueprintGraphVisualTheme ThemePreset;

    UPROPERTY(EditAnywhere, Config, Category = "Theme|Opacity", meta = (ClampMin = "0.02", ClampMax = "1.0"))
    float LowOpacityAmount;

    UPROPERTY(EditAnywhere, Config, Category = "Theme|Custom", meta = (EditCondition = "ThemePreset == EBlueprintGraphVisualTheme::Custom", EditConditionHides))
    FLinearColor CustomNodeColor;

    UPROPERTY(EditAnywhere, Config, Category = "Theme|Custom", meta = (EditCondition = "ThemePreset == EBlueprintGraphVisualTheme::Custom", EditConditionHides))
    FLinearColor CustomWireColor;

    UPROPERTY(EditAnywhere, Config, Category = "Theme|Custom", meta = (ClampMin = "0.5", ClampMax = "4.0", EditCondition = "ThemePreset == EBlueprintGraphVisualTheme::Custom", EditConditionHides))
    float CustomWireThickness;

    UPROPERTY(EditAnywhere, Config, Category = "Graph Background")
    bool bUseCustomBackgroundImage;

    UPROPERTY(EditAnywhere, Config, Category = "Graph Background", meta = (EditCondition = "bUseCustomBackgroundImage", EditConditionHides, FilePathFilter = "Image files (*.png;*.jpg;*.jpeg;*.bmp;*.tga)|*.png;*.jpg;*.jpeg;*.bmp;*.tga"))
    FFilePath BackgroundImagePath;

    UPROPERTY(EditAnywhere, Config, Category = "Graph Background", meta = (ClampMin = "0.0", ClampMax = "1.0", EditCondition = "bUseCustomBackgroundImage", EditConditionHides))
    float BackgroundImageOpacity;

    UPROPERTY(EditAnywhere, Config, Category = "Graph Background", meta = (EditCondition = "bUseCustomBackgroundImage", EditConditionHides))
    EBlueprintGraphBackgroundImageMovement BackgroundImageMovementMode;

    UPROPERTY(EditAnywhere, Config, Category = "Graph Background", meta = (EditCondition = "bUseCustomBackgroundImage", EditConditionHides))
    bool bHideGridWhenUsingCustomBackground;

#if WITH_EDITOR
    virtual void PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent) override;
#endif
};
