#ifndef EDITSCENE_STATICGEOMETRYMEMBEREDITOR_HPP
#define EDITSCENE_STATICGEOMETRYMEMBEREDITOR_HPP
#pragma once

#include "ComponentEditor.hpp"
#include "../components/StaticGeometryMember.hpp"
#include <OgreSceneManager.h>
#include <flecs.h>
#include <vector>
#include <string>

/**
 * Editor for StaticGeometryMemberComponent
 */
class StaticGeometryMemberEditor : public ComponentEditor<StaticGeometryMemberComponent> {
public:
	StaticGeometryMemberEditor(Ogre::SceneManager *sceneMgr = nullptr);
	bool renderComponent(flecs::entity entity, StaticGeometryMemberComponent &member) override;
	const char *getName() const override { return "StaticGeometry Member"; }

private:
	void renderRegionSelector(flecs::entity entity, StaticGeometryMemberComponent& member);
	void renderLodSettingsSelector(flecs::entity entity, StaticGeometryMemberComponent& member);
	void renderMeshBrowser(StaticGeometryMemberComponent &member);
	void scanMeshFiles();
	bool matchesSearch(const std::string &meshName, const std::string &search);
	
	Ogre::SceneManager *m_sceneMgr;
	std::vector<std::string> m_meshFiles;
	bool m_meshesScanned = false;
	bool m_showMeshBrowser = false;
	char m_searchBuffer[256] = {};
};

#endif // EDITSCENE_STATICGEOMETRYMEMBEREDITOR_HPP
