Peoplemon  0.1.0
Peoplemon 3 game source documentation
AnimationWindow.hpp
Go to the documentation of this file.
1 #ifndef EDITOR_COMPONENTS_ANIMATIONWINDOW_HPP
2 #define EDITOR_COMPONENTS_ANIMATIONWINDOW_HPP
3 
4 #include <BLIB/Graphics.hpp>
5 #include <BLIB/Interfaces/GUI.hpp>
6 #include <functional>
7 #include <optional>
8 
9 namespace editor
10 {
11 namespace component
12 {
19 public:
21  using ChooseCb = std::function<void(const std::string&)>;
22 
24  using CloseCb = std::function<void()>;
25 
33  AnimationWindow(bool characterMode, const ChooseCb& chooseCb, const CloseCb& closeCb);
34 
42  void open(bl::gui::GUI* parent, const std::string& path, const std::string& file);
43 
47  void hide();
48 
49 private:
50  const bool characterMode;
51  const ChooseCb chooseCb;
52  const CloseCb closeCb;
53  std::string path;
54  bl::gui::Window::Ptr window;
55  bl::gui::GUI* parent;
56  bl::gui::Label::Ptr fileLabel;
57  bl::gui::Animation::Ptr animation;
58  bl::resource::Ref<bl::gfx::a2d::AnimationData> animSrc;
59  std::optional<bl::gui::FilePicker> filePicker;
60 
61  void packAnim(const std::string& f);
62 };
63 
64 } // namespace component
65 } // namespace editor
66 
67 #endif
All classes and functionality used for implementing the game editor.
Definition: Tile.hpp:11
A basic window to choose and view animations.
std::function< void()> CloseCb
Called when the window is closed.
std::function< void(const std::string &)> ChooseCb
Called when an animation is chosen.
AnimationWindow(bool characterMode, const ChooseCb &chooseCb, const CloseCb &closeCb)
Construct a new Animation Window.
void open(bl::gui::GUI *parent, const std::string &path, const std::string &file)
Opens the animation picker window.
void hide()
Removes the window from view.