Peoplemon  0.1.0
Peoplemon 3 game source documentation
TrainerEditorWindow.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_TRAINEREDITORWINDOW_HPP
2 #define EDITOR_COMPONENTS_TRAINEREDITORWINDOW_HPP
3 
4 #include <BLIB/Interfaces/GUI.hpp>
11 #include <functional>
12 
13 namespace editor
14 {
15 namespace component
16 {
24 public:
26  using SelectCb = std::function<void(const std::string& file)>;
27 
29  using CloseCb = std::function<void()>;
30 
37  TrainerEditorWindow(const SelectCb& cb, const CloseCb& closeCb);
38 
45  void show(bl::gui::GUI* parent, const std::string& file);
46 
51  void hide();
52 
53 private:
54  const SelectCb selectCb;
55  const CloseCb closeCb;
56  bool clean;
57  bl::gui::GUI* parent;
58  bl::gui::Window::Ptr window;
59  bl::gui::Button::Ptr saveBut;
60  bl::gui::Label::Ptr fileLabel;
61  bl::gui::TextEntry::Ptr nameEntry;
62  bl::gui::Label::Ptr animLabel;
63  bl::gui::Label::Ptr bbLabel;
64  bl::gui::Label::Ptr abLabel;
65  bl::gui::TextEntry::Ptr loseLineEntry;
66  bl::gui::ComboBox::Ptr visionRangeEntry;
67  bl::gui::TextEntry::Ptr payoutEntry;
68 
69  core::item::Id curItem;
70  bl::gui::SelectBox::Ptr itemSelectBox;
71  ItemSelector::Ptr itemSelector;
72  std::vector<core::item::Id> items;
73 
74  bl::gui::SelectBox::Ptr pplBox;
75  std::vector<core::pplmn::OwnedPeoplemon> peoplemon;
76  OwnedPeoplemonWindow pplWindow;
77  std::optional<unsigned int> editPplIndex;
78 
79  bl::gui::FilePicker filePicker;
80  bool makingNew;
81  void onChooseFile(const std::string& file);
82 
83  AnimationWindow animWindow;
84  void onChooseAnimation(const std::string& anim);
85 
86  BehaviorEditor behaviorEditor;
87 
88  ConversationWindow conversationWindow;
89  bool selectingBB;
90  void onChooseConversation(const std::string& conv);
91 
92  void forceWindowOnTop();
93 
94  void makeDirty();
95  void makeClean();
96  void reset();
97  void load(const std::string& file);
98  bool validate(bool saving) const;
99  bool confirmDiscard() const;
100 };
101 
102 } // namespace component
103 } // namespace editor
104 
105 #endif
Id
Represents an item in its simplist form.
Definition: Id.hpp:24
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::shared_ptr< ItemSelector > Ptr
Pointer to this component.
Window for editing owned Peoplemon.
void show(bl::gui::GUI *parent, const std::string &file)
Opens the trainer editor.
TrainerEditorWindow(const SelectCb &cb, const CloseCb &closeCb)
Construct a new Trainer Editor Window.
std::function< void(const std::string &file)> SelectCb
Callback for when a trainer file is selected.
void hide()
Hides the window and all created child windows.
std::function< void()> CloseCb
Called when the window is closed.