Peoplemon  0.1.0
Peoplemon 3 game source documentation
Classes | Public Types | Public Member Functions | List of all members
editor::page::Layers Class Reference

Provides controls to add, move, remove, and toggle visibility for layers. More...

#include <Layers.hpp>

Public Types

using AppendCb = std::function< void(unsigned int level)>
 
using DeleteCb = std::function< void(unsigned int level, unsigned int layer)>
 
using ShiftCb = std::function< void(unsigned int level, unsigned int layer, bool up)>
 
using RenderFilterCb = std::function< void(unsigned int level, unsigned int layer, bool visible)>
 

Public Member Functions

 Layers (const AppendCb &bottomAddCb, const AppendCb &ysortAddCb, const AppendCb &topAddCb, const DeleteCb &delCb, const ShiftCb &shiftCb, const RenderFilterCb &filterCb)
 Construct a new Layers subpage. More...
 
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. More...
 
bl::gui::Box::Ptr getContent ()
 Returns the GUI content to pack. More...
 
void pack ()
 Packs the GUI content. More...
 
void unpack ()
 Hides the GUI content. Good for saving space when not active. More...
 

Detailed Description

Provides controls to add, move, remove, and toggle visibility for layers.

Definition at line 17 of file Layers.hpp.

Member Typedef Documentation

◆ AppendCb

using editor::page::Layers::AppendCb = std::function<void(unsigned int level)>

Definition at line 19 of file Layers.hpp.

◆ DeleteCb

using editor::page::Layers::DeleteCb = std::function<void(unsigned int level, unsigned int layer)>

Definition at line 20 of file Layers.hpp.

◆ RenderFilterCb

using editor::page::Layers::RenderFilterCb = std::function<void(unsigned int level, unsigned int layer, bool visible)>

Definition at line 22 of file Layers.hpp.

◆ ShiftCb

using editor::page::Layers::ShiftCb = std::function<void(unsigned int level, unsigned int layer, bool up)>

Definition at line 21 of file Layers.hpp.

Constructor & Destructor Documentation

◆ Layers()

editor::page::Layers::Layers ( const AppendCb bottomAddCb,
const AppendCb ysortAddCb,
const AppendCb topAddCb,
const DeleteCb delCb,
const ShiftCb shiftCb,
const RenderFilterCb filterCb 
)

Construct a new Layers subpage.

Parameters
bottomAddCbCalled when a new bottom layer should be created
ysortAddCbCalled when a new ysort layer should be created
topAddCbCalled when a new top layer should be created
delCbCalled when a layer should be deleted
shiftCbCalled when a layer should be shifted
filterCbCalled when layer visibility changes

Definition at line 11 of file Layers.cpp.

Member Function Documentation

◆ getContent()

Box::Ptr editor::page::Layers::getContent ( )

Returns the GUI content to pack.

Definition at line 40 of file Layers.cpp.

◆ pack()

void editor::page::Layers::pack ( )

Packs the GUI content.

Definition at line 42 of file Layers.cpp.

◆ sync()

void editor::page::Layers::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.

Parameters
levelsThe levels in the map
filterThe current render filter

Definition at line 25 of file Layers.cpp.

◆ unpack()

void editor::page::Layers::unpack ( )

Hides the GUI content. Good for saving space when not active.

Definition at line 44 of file Layers.cpp.


The documentation for this class was generated from the following files: