1 #ifndef EDITOR_PAGES_SUBPAGES_MAPAREA_HPP
2 #define EDITOR_PAGES_SUBPAGES_MAPAREA_HPP
16 class MapArea :
public bl::event::Listener<event::MapRenderCompleted, event::MapRenderStarted> {
50 bl::gui::Box::Ptr content;
51 bl::gui::Label::Ptr positionLabel;
52 bl::gui::Button::Ptr undoBut;
53 bl::gui::Button::Ptr redoBut;
54 bl::gui::CheckButton::Ptr enableBut;
55 bl::gui::CheckButton::Ptr dragBut;
57 sf::Vector2i lastDragTile;
59 void refreshButtons();
60 void onMouseOver(
const sf::Vector2f& pixels,
const sf::Vector2i& tiles);
All classes and functionality used for implementing the game editor.
Owns all primary systems and a reference to the engine.
Wrapper over the core::Map class that is directly usable in a bl::gui::GUI.
std::function< void(const sf::Vector2f &pixels, const sf::Vector2i &tiles)> PositionCb
Called when the map is clicked.
std::function< void()> ActionCb
Called on various event types.
std::shared_ptr< EditMap > Ptr
Pointer to an EditMap.
Fired when a map rendering is started.
Fired when a map rendering is complete.
Section of the map area with the map itself and related controls.
bl::gui::Element::Ptr getContent()
Returns the GUI element to pack.
void enableControls()
Enables the map controls.
MapArea(const component::EditMap::PositionCb &clickCb, const component::EditMap::ActionCb &syncCb, core::system::Systems &systems)
Construct a new Map Area.
component::EditMap & editMap()
Returns the contained map.
void disableControls()
Disables the map controls when a dialog is opened or the map tab is inactive.