3 #include <BLIB/Interfaces/Utilities.hpp>
13 using namespace bl::gui;
16 const std::pair<std::string, LevelTransition> source[] = {
17 {
"EditorResources/LevelTransitions/horUpLeft.png", LevelTransition::HorizontalRightDown},
18 {
"EditorResources/LevelTransitions/horUpRight.png", LevelTransition::HorizontalRightUp},
19 {
"EditorResources/LevelTransitions/vertUpDown.png", LevelTransition::VerticalTopDown},
20 {
"EditorResources/LevelTransitions/vertUpUp.png", LevelTransition::VerticalTopUp}};
21 const std::size_t sourceN = std::size(source);
25 content = Box::create(LinePacker::create(LinePacker::Vertical, 8.f));
28 Label::create(
"Walking in the direction of the arrow on a transition makes the "
29 "player go up a level. Walking opposite the arrow makes the player "
30 "go down a level. Walking perpendicular has no effect.");
31 help->setTextWrapping(bl::gui::Label::WrapToAcquisition);
32 content->pack(help,
true,
false);
34 RadioButton::Ptr noneBut = RadioButton::create(
"Flat",
"flat");
35 noneBut->getSignal(Event::LeftClicked)
37 content->pack(noneBut);
39 Box::Ptr row = Box::create(LinePacker::create(LinePacker::Horizontal, 4));
40 row->setHorizontalAlignment(RenderSettings::Left);
42 RadioButton::Group* group = noneBut->getRadioGroup();
43 for (
unsigned int i = 0; i < sourceN; ++i) {
44 const auto& pair = source[i];
45 auto txtr = ImageManager::load(pair.first);
46 Image::Ptr img = Image::create(txtr);
47 img->scaleToSize({64, 64});
50 but->getSignal(Event::LeftClicked)
51 .willAlwaysCall(std::bind(&LevelTransitions::update,
this, pair.second));
52 row->pack(but,
false,
true);
54 content->pack(row,
true,
false);
55 row = Box::create(LinePacker::create(LinePacker::Horizontal, 4));
56 row->setHorizontalAlignment(RenderSettings::Left);
59 content->pack(row,
true,
false);
LevelTransition
Represents a level transition in a map. Level transitions are applied when an entity moves either ont...
All classes and functionality used for implementing the game editor.
static Ptr create(bl::gui::Element::Ptr child, bl::gui::RadioButton::Group *group=nullptr)
Creates a new HighlightRadioButton.
std::shared_ptr< HighlightRadioButton > Ptr
Pointer to a HighlightRadioButton.
LevelTransitions()
Construct a new Level Transitions GUI page.
core::map::LevelTransition getActive() const
Returns the currently selected level transition type.
bl::gui::Element::Ptr getContent()
Returns a packable GUI element to add this page to the GUI.