Peoplemon  0.1.0
Peoplemon 3 game source documentation
CharacterSpawnWindow.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_CHARACTERSPAWNWINDOW_HPP
2 #define EDITOR_COMPONENTS_CHARACTERSPAWNWINDOW_HPP
3 
4 #include <BLIB/Interfaces/GUI.hpp>
8 
9 namespace editor
10 {
11 namespace component
12 {
20 public:
22  using OnEdit =
23  std::function<void(const core::map::CharacterSpawn*, const core::map::CharacterSpawn&)>;
24 
30  CharacterSpawnWindow(const OnEdit& onEdit);
31 
40  void open(bl::gui::GUI* parent, unsigned int level, const sf::Vector2i& pos,
41  const core::map::CharacterSpawn* orig);
42 
43 private:
44  const OnEdit onEdit;
45  const core::map::CharacterSpawn* orig;
46  bl::gui::GUI* parent;
47  bl::gui::Window::Ptr window;
48  bl::gui::Label::Ptr fileLabel;
49  bl::gui::TextEntry::Ptr levelInput;
50  bl::gui::TextEntry::Ptr xInput;
51  bl::gui::TextEntry::Ptr yInput;
52  bl::gui::ComboBox::Ptr dirEntry;
53 
55  component::TrainerEditorWindow trainerEditor;
56  void onFilechoose(const std::string& file);
57  void closeAll();
58 };
59 
60 } // namespace component
61 } // namespace editor
62 
63 #endif
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
Represents a character to be spawned into a map on load.
Editing window for character spawns. Manages NPCs and trainers.
CharacterSpawnWindow(const OnEdit &onEdit)
Creates a new CharacterSpawnWindow.
void open(bl::gui::GUI *parent, unsigned int level, const sf::Vector2i &pos, const core::map::CharacterSpawn *orig)
Opens the spawn editing window.
std::function< void(const core::map::CharacterSpawn *, const core::map::CharacterSpawn &)> OnEdit
Callback for when spawns are created or edited.