Files
Editor2D/include/Editor/LayerView.hpp

42 lines
1.1 KiB
C++

#pragma once
#include <JUI/Widgets/Window.hpp>
#include <JUI/Widgets/Button.hpp>
#include <JUI/Widgets/ScrollingRect.hpp>
#include <JUI/Widgets/ListLayout.hpp>
#include <JUI/Widgets/Checkbox.hpp>
#include <Format/Level.hpp>
using namespace JUI::UDimLiterals;
class LayerView : public JUI::Window
{
public:
float layer_entry_height = 30;
Event<std::string, bool> LayerVisibilityToggled;
Event<std::string> ActiveLayerSelected;
Event<std::string> MoveLayerUp;
Event<std::string> MoveLayerDown;
/// Constructs a new LayerView by assigning it to a child of the given `parent` Widget.
explicit LayerView(Widget* parent);
/// The base constructor initializes the core elements that are persistent in the layer view.
/// This constructor is to be called in a chain from the other constructors.
LayerView();
///
void UpdateComponents(const Level* level);
void ClearComponents();
protected:
/// The transient components that will be re-generated when UpdateComponents is called.
std::vector<Widget*> entry_elements;
JUI::ScrollingRect* scroller = nullptr;
JUI::VerticalListLayout* layout = nullptr;
const Level* stored_level_data;
};