#pragma once
#include <guecs/ui.hpp>
#include "graphics/scene.hpp"

namespace gui {
  using namespace components;

  class SceneUI {
    public:
      std::string name;
      sf::RenderTexture $view_texture{{SCENE_VIEW_WIDTH, SCENE_VIEW_HEIGHT}};
      sf::Sprite $view_sprite{$view_texture.getTexture()};
      AnimatedScene $scene_data{load_scene(name)};
      scene::Engine $scene{$scene_data};
      bool has_buttons = false;
      guecs::UI $ui;

      AnimatedScene load_scene(const std::string& name);
      void create_buttons(nlohmann::json& buttons);

      void init();
      void render(sf::RenderTarget &target);
      void update();
      bool mouse(float x, float y, guecs::Modifiers mods);
  };
}
