1 #ifndef EDITOR_PAGES_SUBPAGES_TOWNS_HPP
2 #define EDITOR_PAGES_SUBPAGES_TOWNS_HPP
4 #include <BLIB/Interfaces/GUI.hpp>
41 void setGUI(bl::gui::GUI* gui);
51 static sf::Color
getColor(std::uint8_t index);
59 bl::engine::Engine& engine;
64 bl::gui::Box::Ptr content;
65 bl::gui::ScrollArea::Ptr scrollRegion;
66 bl::gui::RadioButton::Ptr noTownBut;
70 bl::gui::Window::Ptr window;
71 bl::gui::TextEntry::Ptr nameEntry;
72 bl::gui::TextEntry::Ptr descEntry;
73 bl::gui::Label::Ptr playlistLabel;
76 bl::gui::ComboBox::Ptr spawnSelect;
78 bl::rc::SceneRef scene;
79 bl::rc::res::TextureRef flymapTxtr;
80 bl::gfx::Sprite flyMap;
81 bl::gfx::Circle townCircle;
82 bl::gui::Canvas::Ptr mapPosCanvas;
85 void refreshSpawns(std::uint16_t spawn);
86 void onPlaylistPick(
const std::string& plst);
91 void editTown(std::uint8_t i);
93 void removeTown(std::uint8_t i);
94 bl::gui::Box::Ptr makeRow(std::uint8_t i,
const std::string& town);
96 void setMapPos(
const bl::gui::Event& click);
97 void refreshFlymapCanvas();
All classes and functionality used for implementing the game editor.
Wrapper over the core::Map class that is directly usable in a bl::gui::GUI.
The playlist editor and chooser.
std::shared_ptr< WeatherSelect > Ptr
Pointer to the weather selector.
Section of the map area with the map itself and related controls.
Subpage for creating, editing, deleting, and placing towns in maps.
bl::gui::Element::Ptr getContent()
Returns the GUI element to pack.
void refresh()
Refreshes the list of towns in the page.
void setGUI(bl::gui::GUI *gui)
Set the primary GUI object.
static sf::Color getColor(std::uint8_t index)
Returns the color to use for the given town.
std::uint8_t selected() const
Returns the currently selected town index.
Towns(bl::engine::Engine &engine, MapArea &map)
Creates the towns subpage and GUI elements.