#ifndef EDITSCENE_ANIMATIONTREEREGISTRYEDITOR_HPP
#define EDITSCENE_ANIMATIONTREEREGISTRYEDITOR_HPP
#pragma once

#include "../systems/AnimationTreeRegistry.hpp"
#include "AnimationTreeNodeEditor.hpp"
#include <Ogre.h>
#include <string>

/**
 * Editor window for the global Animation Tree Registry.
 *
 * Accessible from Tools -> Animation Tree Registry.  Allows creating,
 * renaming, deleting and editing named animation trees.  Each tree can
 * optionally select a skeleton source from the Characters resource group
 * to populate animation-name dropdowns.
 */
class AnimationTreeRegistryEditor {
public:
	AnimationTreeRegistryEditor();

	void render(bool *open);

	/* Ask the editor to select a specific tree on next render. */
	void selectTree(const Ogre::String &name);

private:
	void renderMenuBar();
	void renderListPane();
	void renderEditPane();

	AnimationTreeNodeEditor m_nodeEditor;
	Ogre::String m_selectedTreeName;
	char m_newNameBuf[256];
	bool m_pendingSelect = false;
	Ogre::String m_pendingSelectName;
};

#endif // EDITSCENE_ANIMATIONTREEREGISTRYEDITOR_HPP
