1 #ifndef EDITOR_PAGES_SUBPAGES_LAYERS_HPP
2 #define EDITOR_PAGES_SUBPAGES_LAYERS_HPP
4 #include <BLIB/Interfaces/GUI.hpp>
19 using AppendCb = std::function<void(
unsigned int level)>;
20 using DeleteCb = std::function<void(
unsigned int level,
unsigned int layer)>;
21 using ShiftCb = std::function<void(
unsigned int level,
unsigned int layer,
bool up)>;
23 std::function<void(
unsigned int level,
unsigned int layer,
bool visible)>;
44 void sync(
const std::vector<core::map::LayerSet>& levels,
45 const std::vector<std::vector<bool>>& filter);
67 using VisibleCb = std::function<void(
unsigned int layer,
bool visible)>;
68 using DeleteCb = std::function<void(
unsigned int layer)>;
69 using ShiftCb = std::function<void(
unsigned int layer,
bool up)>;
71 bl::gui::Box::Ptr row;
72 bl::gui::Label::Ptr name;
73 bl::gui::CheckButton::Ptr visibleToggle;
74 bl::gui::Button::Ptr upBut;
75 bl::gui::Button::Ptr downBut;
76 bl::gui::Button::Ptr delBut;
79 LayerRow(
unsigned int i,
bool canUp,
bool canDown,
bool visible,
const VisibleCb& visibleCb,
84 std::vector<LayerRow> items;
87 bl::gui::ScrollArea::Ptr page;
88 bl::gui::Box::Ptr bottomBox;
89 bl::gui::Box::Ptr ysortBox;
90 bl::gui::Box::Ptr topBox;
105 bl::gui::Box::Ptr contentWrapper;
106 bl::gui::Notebook::Ptr content;
108 std::vector<LevelTab> pages;
All classes and functionality used for implementing the game editor.
Encapsulates a set of layers for a given map height. Maps have one LayerSet per height level,...
Provides controls to add, move, remove, and toggle visibility for layers.
std::function< void(unsigned int level, unsigned int layer)> DeleteCb
void unpack()
Hides the GUI content. Good for saving space when not active.
std::function< void(unsigned int level)> AppendCb
void pack()
Packs the GUI content.
void sync(const std::vector< core::map::LayerSet > &levels, const std::vector< std::vector< bool >> &filter)
Syncs the GUI elements with the map layers that exist.
std::function< void(unsigned int level, unsigned int layer, bool visible)> RenderFilterCb
bl::gui::Box::Ptr getContent()
Returns the GUI content to pack.
std::function< void(unsigned int level, unsigned int layer, bool up)> ShiftCb
Layers(const AppendCb &bottomAddCb, const AppendCb &ysortAddCb, const AppendCb &topAddCb, const DeleteCb &delCb, const ShiftCb &shiftCb, const RenderFilterCb &filterCb)
Construct a new Layers subpage.