Files
sophia/editor/panels/inspector_panel.hpp
T

37 lines
942 B
C++

#pragma once
#include <sophia/entity.hpp>
#include <sophia/frame_info.hpp>
#include <sophia/handles.hpp>
#include <sophia/ui/panel.hpp>
#include <string>
#include <utility>
#include <vector>
#include "../editor_context.hpp"
class InspectorPanel : public sophia::Panel {
public:
// Stand-in for an asset browser: the textures a sprite can pick from.
using TextureList =
std::vector<std::pair<std::string, sophia::TextureHandle>>;
InspectorPanel(EditorContext& context, const TextureList& textures)
: Panel{{.name = "Inspector"}}, context{context}, textures{textures} {}
void onUpdate(const sophia::FrameInfo& frameInfo) override;
private:
void drawTag();
void drawTransform();
void drawCamera();
void drawSprite();
void drawMesh();
void drawAddComponent();
EditorContext& context;
// The selected entity, for the duration of onUpdate().
sophia::Entity selected;
const TextureList& textures;
};