1 #ifndef EDITOR_COMPONENTS_CONVERSATIONWINDOW_HPP
2 #define EDITOR_COMPONENTS_CONVERSATIONWINDOW_HPP
4 #include <BLIB/Interfaces/GUI.hpp>
21 using SelectCb = std::function<void(
const std::string&)>;
40 void open(bl::gui::GUI* parent,
const std::string& current);
43 enum struct FilePickerMode { MakeNew, OpenExisting, SetFile } filePickerMode;
48 unsigned int currentNode;
51 bl::gui::Window::Ptr window;
52 bl::gui::Box::Ptr nodeBox;
55 bl::gui::FilePicker filePicker;
58 bl::gui::Label::Ptr fileLabel;
59 bl::gui::Button::Ptr saveBut;
64 bool validate()
const;
65 bool confirmDiscard()
const;
66 void setSelected(
unsigned int i);
All classes and functionality used for implementing the game editor.
Stores a conversation that an NPC or trainer can have with the player.
Helper component for editing individual conversation nodes.
std::shared_ptr< ConversationTree > Ptr
A window for choosing and editing conversations.
std::function< void(const std::string &)> SelectCb
Callback for when a conversation is chosen.
std::function< void()> CancelCb
Callback for when the window is closed with no choice made.
ConversationWindow(const SelectCb &onSelect, const CancelCb &onCancel)
Initialize a new conversation window.
void open(bl::gui::GUI *parent, const std::string ¤t)
Actually opens the window and initializes with a conversation.