Peoplemon  0.1.0
Peoplemon 3 game source documentation
NPCEditorWindow.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_NPCEDITORWINDOW_HPP
2 #define EDITOR_COMPONENTS_NPCEDITORWINDOW_HPP
3 
4 #include <BLIB/Interfaces/GUI.hpp>
8 #include <functional>
9 
10 namespace editor
11 {
12 namespace component
13 {
21 public:
23  using SelectCb = std::function<void(const std::string& file)>;
24 
26  using CloseCb = std::function<void()>;
27 
34  NpcEditorWindow(const SelectCb& cb, const CloseCb& closeCb);
35 
42  void show(bl::gui::GUI* parent, const std::string& file);
43 
48  void hide();
49 
50 private:
51  const SelectCb selectCb;
52  const CloseCb closeCb;
53  bool clean;
54  bl::gui::GUI* parent;
55  bl::gui::Window::Ptr window;
56  bl::gui::Button::Ptr saveBut;
57  bl::gui::Label::Ptr fileLabel;
58  bl::gui::TextEntry::Ptr nameEntry;
59  bl::gui::Label::Ptr animLabel;
60  bl::gui::Label::Ptr convLabel;
61 
62  bl::gui::FilePicker filePicker;
63  bool makingNew;
64  void onChooseFile(const std::string& file);
65 
66  AnimationWindow animWindow;
67  void onChooseAnimation(const std::string& anim);
68 
69  BehaviorEditor behaviorEditor;
70 
71  ConversationWindow conversationWindow;
72  void onChooseConversation(const std::string& conv);
73 
74  void forceWindowOnTop();
75 
76  void makeDirty();
77  void makeClean();
78  void reset();
79  void load(const std::string& file);
80  bool validate(bool saving) const;
81  bool confirmDiscard() const;
82 };
83 
84 } // namespace component
85 } // namespace editor
86 
87 #endif
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
A basic window to choose and view animations.
Inline GUI elements with openable window for editing behaviors.
A window for choosing and editing conversations.
std::function< void(const std::string &file)> SelectCb
Callback for when an NPC file is selected.
void hide()
Hides the window and all created child windows.
NpcEditorWindow(const SelectCb &cb, const CloseCb &closeCb)
Construct a new Npc Editor Window.
void show(bl::gui::GUI *parent, const std::string &file)
Opens the NPC editor.
std::function< void()> CloseCb
Called when the window is closed.