Peoplemon  0.1.0
Peoplemon 3 game source documentation
ConversationTreeComponent.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_RENDER_CONVERSATIONTREECOMPONENT_HPP
2 #define EDITOR_COMPONENTS_RENDER_CONVERSATIONTREECOMPONENT_HPP
3 
4 #include <BLIB/Graphics/BatchCircle.hpp>
5 #include <BLIB/Graphics/BatchIcon.hpp>
6 #include <BLIB/Graphics/BatchedShapes2D.hpp>
7 #include <BLIB/Graphics/Rectangle.hpp>
8 #include <BLIB/Graphics/Text.hpp>
9 #include <BLIB/Interfaces/GUI/Renderer/Component.hpp>
10 #include <memory>
11 #include <vector>
12 
13 namespace editor
14 {
15 namespace component
16 {
17 namespace rdr
18 {
24 class ConversationTreeComponent : public bl::gui::rdr::Component {
25 public:
26  struct TreeCamera {
27  glm::vec2 center; // in virtual coords
28  glm::vec2 acqSize;
29  float zoom;
30  };
31 
36 
40  virtual ~ConversationTreeComponent() = default;
41 
42 private:
43  bl::gfx::Rectangle background;
44  bl::gfx::BatchedShapes2D shapeBatch;
45  std::vector<bl::gfx::BatchCircle> nodeCircles;
46  std::vector<bl::gfx::BatchIcon> nodeArrows;
47  std::vector<std::unique_ptr<bl::gfx::Text>> nodeLabels;
48 
49  bl::engine::Engine* enginePtr;
50  bl::rc::Overlay* currentOverlay;
51  unsigned int lastTreeVersion;
52  TreeCamera* uniform;
53 
54  virtual void setVisible(bool visible) override;
55  virtual void onElementUpdated() override;
56  virtual void onRenderSettingChange() override;
57  virtual bl::ecs::Entity getEntity() const override;
58  virtual void doCreate(bl::engine::Engine& engine, bl::gui::rdr::Renderer& renderer) override;
59  virtual void doSceneAdd(bl::rc::Overlay* overlay) override;
60  virtual void doSceneRemove() override;
61  virtual void handleAcquisition() override;
62  virtual void handleMove() override;
63 };
64 } // namespace rdr
65 } // namespace component
66 } // namespace editor
67 
68 #endif
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
GUI renderer component for the conversation tree.
virtual ~ConversationTreeComponent()=default
Destroys the component.