added further fixes, and upgrades

This commit is contained in:
2026-03-01 20:51:39 +01:00
parent 769bbd4261
commit f859288689
16 changed files with 937 additions and 24 deletions

View File

@@ -2,6 +2,7 @@
#include "BehaviourScriptRegistry.hpp"
#include "elements/ShaderRegistry.hpp"
#include "BehaviourScripts/Camera.hpp"
#include "windows/HirearchieView.hpp"
#include <algorithm>
namespace TSE::EDITOR
@@ -581,7 +582,7 @@ namespace TSE::EDITOR
ImGui::Text("Editor Camera can't be main camera");
}
ImGui::Separator();
ImGui::Separator();
// Render Scale
float renderScale = element->GetRenderScale();
if (ImGui::DragFloat("Render Scale", &renderScale, 0.1f))
@@ -612,6 +613,56 @@ namespace TSE::EDITOR
if (ImGui::DragFloat("Field of View (deg)", &fov, 0.1f))
element->SetFov(fov);
if (!isPerspective) ImGui::EndDisabled();
Scene* curScene = HirearchieView::currentScene;
ImGui::SeparatorText("Layers To Render");
if (curScene == nullptr)
{
ImGui::TextDisabled("No active scene available.");
return;
}
if (ImGui::BeginChild("LayersToRender", ImVec2(0, 170), ImGuiChildFlags_Borders))
{
const int layerCount = curScene->GetLayerCount();
if (layerCount <= 0)
{
ImGui::TextDisabled("Scene has no layers.");
}
else
{
for (int i = 0; i < layerCount; i++)
{
Layer* layer = curScene->GetLayerAt(i);
if (layer == nullptr) continue;
if (!layer->IsVisual()) continue;
const uuids::uuid& layerID = layer->GetID();
auto it = std::find(element->layersNotToRender.begin(), element->layersNotToRender.end(), layerID);
bool shouldRenderLayer = (it == element->layersNotToRender.end());
const std::string checkBoxLabel = layer->GetName() + "##layer_to_render_" + std::to_string(i);
if (ImGui::Checkbox(checkBoxLabel.c_str(), &shouldRenderLayer))
{
if (shouldRenderLayer)
{
auto removeIt = std::find(element->layersNotToRender.begin(), element->layersNotToRender.end(), layerID);
if (removeIt != element->layersNotToRender.end())
{
element->layersNotToRender.erase(removeIt);
}
}
else if (it == element->layersNotToRender.end())
{
element->layersNotToRender.push_back(layerID);
}
}
}
}
}
ImGui::EndChild();
}
void ElementDrawer::Draw(ParticleSystem *element, const bool &debug)
{
@@ -836,6 +887,7 @@ namespace TSE::EDITOR
{
chunk.SetOrdering(element->order);
}
element->DirtyAll();
}
ImGui::BeginDisabled();

View File

@@ -17,9 +17,8 @@ namespace TSE::EDITOR
RenamingTransformable = 3,
RenamingScene = 4
};
Scene* currentScene;
uuids::uuid selected = uuids::uuid();
bool openPopUpNamingLayer = false;
bool activatePopUpNamingLayer = false;
char inputBuffer[128] = "";
@@ -27,8 +26,9 @@ namespace TSE::EDITOR
NamingPopUpPorPuse inputPurpose = Nothing;
Transformable* tmpHolder1 = nullptr;
Layer* tmpHolder2 = nullptr;
public:
inline static Scene* currentScene = nullptr;
HirearchieView(Scene* s);
void SetScene(Scene* s);
void Define() override;