DeerEngine/roe/editor/properties/properties_pannel.as

74 lines
1.6 KiB
ActionScript

class PropertiesPannel : DockPanel {
float slider = 0;
vec3 slid;
vec3 slid2;
void onRender() {
Entity entity = activeEntity;
// NAME
// -------
// Id:0 [+ add component]
title(entity.name);
if (!entity.isRoot)
contextItemPopup("##MenuOptions", any(entity), ReciverFunc(this.renameEntityMenu));
separator();
textColor(0.5, 0.5, 0.5f, "Id : " + entity.id);
// We don't want to change root options
if (entity.isRoot)
return;
sameLine();
if (buttonEnd("Add Component")) {
openPopup("ADD_COMPONENT", any(entity));
}
space();
componentNode("Transform Component", any(entity), renderTransformComponent);
componentNode("Transform Component 2", any(entity), renderTransformComponent);
space();
separator();
if (buttonCenter("Add Component##2")) {
openPopup("ADD_COMPONENT", any(entity));
}
simplePopup("ADD_COMPONENT", ReciverFunc(this.addComponentPopup));
modalPopup("Rename entity", renameEntity);
}
void addComponentPopup(any@ data) {
titleCenter("Component");
separator();
if (menuItem("Mesh Render Component")) {
}
if (menuItem("Camera Component")) {
}
if (menuItem("Script Component")) {
}
}
void renameEntityMenu(any@ data) {
Entity entity;
data.retrieve(entity);
if (!entity.isRoot) {
if (menuItem("Rename")) {
openPopup("Rename entity", data);
}
}
}
}