![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Special component that renders a clickable tree view of a conversation. More...
#include <ConversationTree.hpp>
Classes | |
struct | Edge |
struct | Node |
Public Types | |
using | Ptr = std::shared_ptr< ConversationTree > |
using | ClickCb = std::function< void(unsigned int)> |
Called when a node is clicked. More... | |
Public Member Functions | |
void | update (const std::vector< core::file::Conversation::Node > &nodes) |
Updates the rendered tree with the new nodes. More... | |
void | setSelected (unsigned int i) |
Set the selected node index. More... | |
const std::vector< Node > & | getNodes () const |
Used by the renderer component. More... | |
const std::vector< Edge > & | getEdges () const |
Used by the renderer component. More... | |
unsigned int | getSelectedNode () const |
Used by the renderer component. More... | |
unsigned int | getTreeVersion () const |
Used by the renderer component. More... | |
const glm::vec2 & | getCamCenter () const |
Used by the renderer component. More... | |
float | getCamZoom () const |
Used by the renderer component. More... | |
bool | shouldHighlightSelectedNode () const |
Used by the renderer component. More... | |
Static Public Member Functions | |
static Ptr | create (const ClickCb &clickCb) |
Construct a new Conversation Tree component. More... | |
Static Public Attributes | |
static constexpr float | NodeRadius = 60.f |
static constexpr float | NodeRadiusSquared = NodeRadius * NodeRadius |
static constexpr float | NodePadding = 100.f |
static constexpr float | Spacing = NodeRadius * 2.f + NodePadding |
Special component that renders a clickable tree view of a conversation.
Definition at line 18 of file ConversationTree.hpp.
using editor::component::ConversationTree::ClickCb = std::function<void(unsigned int)> |
Called when a node is clicked.
Definition at line 46 of file ConversationTree.hpp.
using editor::component::ConversationTree::Ptr = std::shared_ptr<ConversationTree> |
Definition at line 20 of file ConversationTree.hpp.
|
static |
Construct a new Conversation Tree component.
clickCb | Callback for when a node is clicked |
Definition at line 30 of file ConversationTree.cpp.
|
inline |
Used by the renderer component.
Definition at line 92 of file ConversationTree.hpp.
|
inline |
Used by the renderer component.
Definition at line 97 of file ConversationTree.hpp.
|
inline |
Used by the renderer component.
Definition at line 77 of file ConversationTree.hpp.
|
inline |
Used by the renderer component.
Definition at line 72 of file ConversationTree.hpp.
|
inline |
Used by the renderer component.
Definition at line 82 of file ConversationTree.hpp.
|
inline |
Used by the renderer component.
Definition at line 87 of file ConversationTree.hpp.
void editor::component::ConversationTree::setSelected | ( | unsigned int | i | ) |
Set the selected node index.
i | Index of the selected node |
Definition at line 75 of file ConversationTree.cpp.
|
inline |
Used by the renderer component.
Definition at line 102 of file ConversationTree.hpp.
void editor::component::ConversationTree::update | ( | const std::vector< core::file::Conversation::Node > & | nodes | ) |
Updates the rendered tree with the new nodes.
nodes | The new tree to render |
Definition at line 116 of file ConversationTree.cpp.
|
staticconstexpr |
Definition at line 24 of file ConversationTree.hpp.
|
staticconstexpr |
Definition at line 22 of file ConversationTree.hpp.
|
staticconstexpr |
Definition at line 23 of file ConversationTree.hpp.
|
staticconstexpr |
Definition at line 25 of file ConversationTree.hpp.