![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Wrapper over ComboBox that allows selection of any item in the item database. More...
#include <ItemSelector.hpp>
Public Types | |
using | Ptr = std::shared_ptr< ItemSelector > |
Pointer to this component. More... | |
using | ChangeCb = std::function< void(core::item::Id)> |
Called when the item changes. More... | |
Public Member Functions | |
core::item::Id | currentItem () const |
Returns the current selected item. More... | |
void | setItem (core::item::Id item) |
Set the current item. More... | |
void | refresh () |
Refreshes the items from the item database. More... | |
Static Public Member Functions | |
static Ptr | create (const ChangeCb &cb=[](core::item::Id) {}) |
Creates a new ItemSelector. More... | |
Wrapper over ComboBox that allows selection of any item in the item database.
Definition at line 17 of file ItemSelector.hpp.
using editor::component::ItemSelector::ChangeCb = std::function<void(core::item::Id)> |
Called when the item changes.
Definition at line 23 of file ItemSelector.hpp.
using editor::component::ItemSelector::Ptr = std::shared_ptr<ItemSelector> |
Pointer to this component.
Definition at line 20 of file ItemSelector.hpp.
|
static |
Creates a new ItemSelector.
cb | The function to call when the item is changed |
Definition at line 9 of file ItemSelector.cpp.
core::item::Id editor::component::ItemSelector::currentItem | ( | ) | const |
Returns the current selected item.
Definition at line 21 of file ItemSelector.cpp.
void editor::component::ItemSelector::refresh | ( | ) |
Refreshes the items from the item database.
Definition at line 30 of file ItemSelector.cpp.
void editor::component::ItemSelector::setItem | ( | core::item::Id | item | ) |
Set the current item.
Definition at line 26 of file ItemSelector.cpp.