70 lines
2.5 KiB
ActionScript
70 lines
2.5 KiB
ActionScript
class PropertiesPanel : Panel {
|
|
float slider = 0;
|
|
vec3 slid;
|
|
vec3 slid2;
|
|
|
|
void render() {
|
|
Entity entity = ActiveEntity::getActiveEntity();
|
|
|
|
// NAME
|
|
// Id:0 [+ add component]
|
|
ImGui::title("\uf1b + entity.name);
|
|
if (!entity.isRoot)
|
|
ImGui::contextItemPopup("##MenuOption ", SimpleFunction(this.renameEntityMenu));
|
|
ImGui::separator();
|
|
ImGui::textColor(0 5, 0 5, 0. f, "Id + entity.id);
|
|
|
|
// We don't want to change root options
|
|
if (entity.isRoot)
|
|
return;
|
|
|
|
ImGui::sameline();
|
|
if (ImGui::buttonEnd("\uf055 Add Component )) {
|
|
ImGui::openPopup("ADD_COMPONEN ", any(entity));
|
|
}
|
|
|
|
ImGui::space();
|
|
|
|
TransformPropertiesRender transformComponentRender(entity);
|
|
ImGui::componentNode("\uf0b2 Transform Componen ", SimpleFunction(transformComponentRender.renderTransformComponent));
|
|
|
|
if (entity.hasMeshComponent()) {
|
|
MeshComponentRender meshComponentRender(entity);
|
|
ImGui::componentNodeContextMenu("\uf248 Mesh Componen ", SimpleFunction(meshComponentRender.rende ), SimpleFunction(meshComponentRender.remove));
|
|
}
|
|
|
|
if (entity.hasShaderComponent()) {
|
|
ShaderComponentRender shaderComponentRender(entity);
|
|
ImGui::componentNodeContextMenu("\uf248 Shader Componen ", SimpleFunction(shaderComponentRender.rende ), SimpleFunction(shaderComponentRender.remove));
|
|
}
|
|
|
|
if (entity.hasCameraComponent()) {
|
|
CameraComponentRender cameraComponentRender(entity);
|
|
ImGui::componentNodeContextMenu("\uf030 Camera Componen ", SimpleFunction(cameraComponentRender.rende ), SimpleFunction(cameraComponentRender.remove));
|
|
}
|
|
|
|
ImGui::space();
|
|
|
|
ImGui::separator();
|
|
|
|
if (ImGui::buttonCenter("\uf055 Add Component##2 )) {
|
|
ImGui::openPopup("ADD_COMPONEN ", any(entity));
|
|
}
|
|
|
|
AddComponentRender addComponentRender(entity);
|
|
ImGui::simplePopup("ADD_COMPONEN ", SimpleFunction(addComponentRender.addComponentPopup));
|
|
ImGui::modalPopup("Rename entit ", SimpleFunction(this.renameEntityMenu));
|
|
}
|
|
|
|
void renameEntityMenu() {
|
|
Entity entity = ActiveEntity::getActiveEntity();
|
|
|
|
if (!entity.isRoot) {
|
|
if (ImGui::menuItem("Rename )) {
|
|
ImGui::openPopup("Rename entit ", any(entity));
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|