#ifndef EDITSCENE_PROCEDURALTEXTUREEDITOR_HPP
#define EDITSCENE_PROCEDURALTEXTUREEDITOR_HPP
#pragma once

#include "ComponentEditor.hpp"
#include "../components/ProceduralTexture.hpp"
#include <flecs.h>

/**
 * Editor for ProceduralTextureComponent
 * Shows a 10x10 grid of color pickers for each rectangle
 * Plus named rectangle management for texture atlas
 */
class ProceduralTextureEditor : public ComponentEditor<ProceduralTextureComponent> {
public:
	bool renderComponent(flecs::entity entity, ProceduralTextureComponent &texture) override;
	const char *getName() const override { return "Procedural Texture"; }

private:
	void renderColorGrid(flecs::entity entity, ProceduralTextureComponent &texture);
	void renderColorButton(int index, ProceduralTextureComponent &texture);
	void renderNamedRects(flecs::entity entity, ProceduralTextureComponent &texture);
	
	// Currently selected color for editing
	int m_selectedRect = -1;
	
	// Buffer for new rectangle name
	char m_nameBuffer[256] = {};
};

#endif // EDITSCENE_PROCEDURALTEXTUREEDITOR_HPP
