nw::Dialog

struct Dialog

Public Functions

Dialog()
explicit Dialog(const GffStruct archive)
explicit Dialog(const nlohmann::json &archive)
Dialog(const Dialog&) = delete
Dialog &operator=(const Dialog&) = delete
DialogPtr *add()

Adds empty Dialog Pointer and Node.

void add_node_internal(DialogNode *node, DialogNodeType type)

Adds a node to the iternal node lists

Warning

This should be considered for internal use and not client code

DialogPtr *add_ptr(DialogPtr *ptr, bool is_link = false)

Adds Dialog Pointer, if is_link is false no new pointer or node is created. if is_link is true a new pointer will created with the node copied from input pointer.

DialogPtr *add_string(String value, nw::LanguageID lang = nw::LanguageID::english, bool feminine = false)

Adds Dialog Pointer and Node with string value set.

DialogNode *create_node(DialogNodeType type)

Creates a new Dialog Node.

DialogPtr *create_ptr()

Creates a new Dialog Pointer.

void delete_node(DialogNode *node)

Deletes a dialog node

Warning

This should be considered for internal use and not client code

void delete_ptr(DialogPtr *ptr)

Deletes a dialog pointer

Warning

ptr should be removed from / not added to a dialog prior to deletion

size_t node_index(DialogNode *node, DialogNodeType type) const

Get Node index.

void remove_node_internal(DialogNode *node, DialogNodeType type)

Removes a node to the iternal node lists

Warning

This should be considered for internal use and not client code

void remove_ptr(DialogPtr *ptr)

Removes Dialog Ptr from underlying node.

inline bool valid() const noexcept

Checks id dialog was successfully parsed.

Public Members

Vector<DialogNode*> entries
Vector<DialogNode*> replies
Resref script_abort
Resref script_end
Vector<DialogPtr*> starts
uint32_t delay_entry = 0
uint32_t delay_reply = 0
uint32_t word_count = 0
bool prevent_zoom = false

Public Static Attributes

static constexpr int json_archive_version = 1
static constexpr ResourceType::type restype = ResourceType::dlg