#pragma once

#include "UI/base/GuiWindow.h"
#include "uuid.h"
#include "elements/Scene.hpp"

namespace TSE::EDITOR
{
    class HirearchieView : public GuiWindow
    {
    private:
        enum NamingPopUpPorPuse
        {
            Nothing = 0,
            LayerCreation = 1,
            RenamingLayer = 2,
            RenamingTransformable = 3,
            RenamingScene = 4
        };
        uuids::uuid selected = uuids::uuid();
        
        bool openPopUpNamingLayer = false;
        bool activatePopUpNamingLayer = false;
        char inputBuffer[128] = "";
        bool inputConfirmed = false;
        NamingPopUpPorPuse inputPurpose = Nothing;
        Transformable* tmpHolder1 = nullptr;
        Layer* tmpHolder2 = nullptr;
        
    public:
        inline static Scene* currentScene = nullptr;
        HirearchieView(Scene* s);
        void SetScene(Scene* s);
        void Define() override;
        void MenuBar();
        void DisplayLayer(Layer* l);
        void DisplayObj(Transformable* t, Layer* l);
        void HandleDropping(Layer* target, Transformable* payload);
        void HandleDropping(Transformable* target, Transformable* payload);
        void AddMenu(Transformable* t, Layer* l);
        void MoveUpLayer(Layer* t);
        void MoveDownLayer(Layer* t);
        void CreateEmpty(Transformable* parent);
        void CreateEmpty(Layer* parent);
        void CreateLayer();
    };
} // namespace TSE::EDITOR
