Peoplemon  0.1.0
Peoplemon 3 game source documentation
Classes | Public Types | Public Member Functions | List of all members
editor::component::ConversationNode Class Reference

Helper component for editing individual conversation nodes. More...

#include <ConversationNode.hpp>

Public Types

using NotifyCb = std::function< void()>
 Called when the node value is modified. More...
 
using CreateNode = std::function< unsigned int(unsigned int)>
 Called when a new node should be created. More...
 
using SelectCb = std::function< void(unsigned int)>
 Called when a node is jumped to. More...
 
using FocusCb = std::function< void(bool)>
 

Public Member Functions

 ConversationNode (const FocusCb &focusCb, const NotifyCb &editCb, const NotifyCb &deleteCb, const NotifyCb &regenTree, const CreateNode &createNode, const SelectCb &selectCb, bl::gui::Box::Ptr &container, const std::vector< core::file::Conversation::Node > *nodes)
 Construct a new Conversation Node editor. More...
 
void update (unsigned int i, const core::file::Conversation::Node &node)
 Update the node editor content with the given node value. More...
 
const core::file::Conversation::NodegetValue () const
 Get the current node value. More...
 
void setParent (bl::gui::GUI *parent)
 Set the parent GUI object. More...
 

Detailed Description

Helper component for editing individual conversation nodes.

Definition at line 18 of file ConversationNode.hpp.

Member Typedef Documentation

◆ CreateNode

using editor::component::ConversationNode::CreateNode = std::function<unsigned int(unsigned int)>

Called when a new node should be created.

Definition at line 24 of file ConversationNode.hpp.

◆ FocusCb

using editor::component::ConversationNode::FocusCb = std::function<void(bool)>

Definition at line 30 of file ConversationNode.hpp.

◆ NotifyCb

using editor::component::ConversationNode::NotifyCb = std::function<void()>

Called when the node value is modified.

Definition at line 21 of file ConversationNode.hpp.

◆ SelectCb

using editor::component::ConversationNode::SelectCb = std::function<void(unsigned int)>

Called when a node is jumped to.

Definition at line 27 of file ConversationNode.hpp.

Constructor & Destructor Documentation

◆ ConversationNode()

editor::component::ConversationNode::ConversationNode ( const FocusCb focusCb,
const NotifyCb editCb,
const NotifyCb deleteCb,
const NotifyCb regenTree,
const CreateNode createNode,
const SelectCb selectCb,
bl::gui::Box::Ptr &  container,
const std::vector< core::file::Conversation::Node > *  nodes 
)

Construct a new Conversation Node editor.

Parameters
focusCbCalled when the parent window should force focus or not
editCbCallback for when the node is modified
deleteCbCallback for when the node is deleted
regenTreeCalled when the conversation tree should be re-rendered
createNodeCalled when a new conversation node should be created
selectCbCalled when a node is jumped to
containerThe gui element to pack into
nodesA pointer to all nodes

Definition at line 30 of file ConversationNode.cpp.

Member Function Documentation

◆ getValue()

const Conversation::Node & editor::component::ConversationNode::getValue ( ) const

Get the current node value.

Returns
const core::file::Conversation::Node& The current node value

Definition at line 309 of file ConversationNode.cpp.

◆ setParent()

void editor::component::ConversationNode::setParent ( bl::gui::GUI *  parent)

Set the parent GUI object.

Definition at line 195 of file ConversationNode.cpp.

◆ update()

void editor::component::ConversationNode::update ( unsigned int  i,
const core::file::Conversation::Node node 
)

Update the node editor content with the given node value.

Parameters
iThe index of the current node
nodeValue to populate the gui with

Definition at line 197 of file ConversationNode.cpp.


The documentation for this class was generated from the following files: