7#include <simplesquirrel/simplesquirrel.hpp>
55 bool selectClass(
const std::string&
name);
62 bool inspectObject(
const ssq::Object&
object);
72 void setPickScene(std::function<ssq::Object()> pickScene);
74 bool selectInstance(
int index);
76 void openNested(
const std::string& className,
const ssq::Object&
object);
85 return (selectedInstance_ >= 0 &&
86 size_t(selectedInstance_) < instances_.size())
87 ? instances_[size_t(selectedInstance_)].object
97 struct InstanceEntry {
102 std::string className;
106 Runtime* runtime()
const;
107 const ssq::Object* currentInstance()
const;
108 int currentClassIndex()
const;
109 void writeProperty(
const std::string&
name, ReflectedValue
value);
111 WidgetDesc propertyWidget(
const std::string& ownerClass,
112 const ReflectedMember& member,
113 const ReflectedValue&
value,
114 const ssq::Object& instance);
115 WidgetDesc arrayWidget(
const std::string& ownerClass,
const ReflectedMember& member,
116 const ssq::Object& instance);
117 WidgetDesc tableWidget(
const std::string& ownerClass,
const ReflectedMember& member,
118 const ssq::Object& instance);
120 std::vector<std::string> classNames_;
121 std::string selectedClass_;
122 std::vector<InstanceEntry> instances_;
123 std::vector<ReflectedMember> cachedMembers_;
124 std::vector<NestedEntry> navStack_;
125 std::function<ssq::Object()> pickScene_;
126 int selectedInstance_ = -1;
127 UIHost* host_ =
nullptr;
#define EVENGINE_API
宿主(eve / libmain)导出宏;插件从进程导入同一批符号。
Reflection-driven property inspector (DevTools phase C, MVVM).
UIHost * host() const
The mounted inspector host (nullptr until open()); for embedding.
Inspector & operator=(const Inspector &)=delete
int selectedIndex() const
Index of the selected instance; -1 when none.
ssq::Object selectedInstance() const
Live script object of the selected instance (empty when none).
Inspector(const Inspector &)=delete
const std::string & selectedClass() const
Name of the currently selected class ("" when none).
int instanceCount() const
Number of live instances of the selected class.
ECS mount point for one UI panel/screen. Subclass to attach UI to game entities, e....