diff --git a/Editor/src/ComponentsPanel/AudioEmitterPanel.h b/Editor/src/ComponentsPanel/AudioEmitterPanel.h deleted file mode 100644 index f7449ab6..00000000 --- a/Editor/src/ComponentsPanel/AudioEmitterPanel.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "ComponentPanel.h" - -#include "src/FileSystem/FileSystem.h" -#include -#include -#include - - -class AudioEmitterPanel : ComponentPanel -{ -public: - AudioEmitterPanel() = default; - ~AudioEmitterPanel() = default; - - void Draw(Nuake::Entity entity) override - { - - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/ParticleEmitterPanel.h b/Editor/src/ComponentsPanel/ParticleEmitterPanel.h deleted file mode 100644 index 02bbfc47..00000000 --- a/Editor/src/ComponentsPanel/ParticleEmitterPanel.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include "ComponentPanel.h" - -#include "src/FileSystem/FileSystem.h" -#include -#include -#include -#include "MaterialEditor.h" -#include -#include - -class ParticleEmitterPanel : ComponentPanel -{ -public: - Scope _modelInspector; - - ParticleEmitterPanel() {} - - void Draw(Nuake::Entity entity) override - { - - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/QuakeMapPanel.h b/Editor/src/ComponentsPanel/QuakeMapPanel.h deleted file mode 100644 index 56546b70..00000000 --- a/Editor/src/ComponentsPanel/QuakeMapPanel.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once -#include "ComponentPanel.h" -#include -#include "src/Scene/Systems/QuakeMapBuilder.h" -#include "src/FileSystem/FileSystem.h" -#include -#include - -class QuakeMapPanel : ComponentPanel { - -public: - QuakeMapPanel() {} - - void Draw(Nuake::Entity entity) override - { - // using namespace Nuake; - // - // if (!entity.HasComponent()) - // return; - // - // Nuake::QuakeMapComponent& component = entity.GetComponent(); - // BeginComponentTable(QUAKEMAP, Nuake::QuakeMapComponent); - // { - // { - // ImGui::Text("Map"); - // ImGui::TableNextColumn(); - // - // std::string path = component.Path; - // ImGui::Button(component.Path.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0)); - // if (ImGui::BeginDragDropTarget()) - // { - // if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("_Map")) - // { - // char* file = (char*)payload->Data; - // std::string fullPath = std::string(file, 256); - // path = Nuake::FileSystem::AbsoluteToRelative(fullPath); - // - // component.Path = path; - // } - // ImGui::EndDragDropTarget(); - // } - // - // ImGui::TableNextColumn(); - // - // ComponentTableReset(component.Path, ""); - // } - // ImGui::TableNextColumn(); - // { - // ImGui::Text("Collision"); - // ImGui::TableNextColumn(); - // - // ImGui::Checkbox("##Collison", &component.HasCollisions); - // ImGui::TableNextColumn(); - // ComponentTableReset(component.HasCollisions, true); - // } - // ImGui::TableNextColumn(); - // { - // ImGui::Text("Auto Rebuild"); - // ImGui::TableNextColumn(); - // - // ImGui::Checkbox("##AutoRebuild", &component.AutoRebuild); - // ImGui::TableNextColumn(); - // ComponentTableReset(component.AutoRebuild, false); - // } - // ImGui::TableNextColumn(); - // { - // ImGui::Text("Build"); - // ImGui::TableNextColumn(); - // - // if (UI::SecondaryButton("Build Geometry")) - // { - // Nuake::QuakeMapBuilder builder; - // builder.BuildQuakeMap(entity, component.HasCollisions); - // } - // } - // } - // EndComponentTable(); - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/RigidbodyPanel.h b/Editor/src/ComponentsPanel/RigidbodyPanel.h deleted file mode 100644 index 89a10b30..00000000 --- a/Editor/src/ComponentsPanel/RigidbodyPanel.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include "ComponentPanel.h" -#include -#include "src/FileSystem/FileSystem.h" - -class RigidbodyPanel : ComponentPanel { - -public: - RigidbodyPanel() {} - - void Draw(Nuake::Entity entity) override - { - if (!entity.HasComponent()) - return; - - auto& component = entity.GetComponent(); - BeginComponentTable(RIGIDBODY, Nuake::RigidBodyComponent); - { - { - ImGui::Text("Mass"); - ImGui::TableNextColumn(); - - ImGui::DragFloat("##Mass", &component.Mass, 0.01f, 0.1f); - component.Mass = std::max(component.Mass, 0.0f); - ImGui::TableNextColumn(); - ComponentTableReset(component.Mass, 0.0f); - } - ImGui::TableNextColumn(); - { - ImGui::Text("Lock X axis"); - ImGui::TableNextColumn(); - - ImGui::Checkbox("##lockx", &component.LockX); - - ImGui::TableNextColumn(); - ComponentTableReset(component.LockX, false); - } - ImGui::TableNextColumn(); - { - ImGui::Text("Lock Y axis"); - ImGui::TableNextColumn(); - - ImGui::Checkbox("##locky", &component.LockY); - - ImGui::TableNextColumn(); - ComponentTableReset(component.LockY, false); - } - ImGui::TableNextColumn(); - { - ImGui::Text("Lock Z axis"); - ImGui::TableNextColumn(); - - ImGui::Checkbox("##lockz", &component.LockZ); - - ImGui::TableNextColumn(); - ComponentTableReset(component.LockZ, false); - } - ImGui::TableNextColumn(); - } - EndComponentTable(); - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/SkinnedModelPanel.h b/Editor/src/ComponentsPanel/SkinnedModelPanel.h deleted file mode 100644 index 482c2cbc..00000000 --- a/Editor/src/ComponentsPanel/SkinnedModelPanel.h +++ /dev/null @@ -1,172 +0,0 @@ -#pragma once -#include -#include "ComponentPanel.h" -#include "ModelResourceInspector.h" - -#include -#include - -#include -#include - -class SkinnedModelPanel : ComponentPanel -{ -private: - Scope m_ModelInspector; - bool m_Expanded = false; - std::string m_QueuedModelPath; - -public: - SkinnedModelPanel() - { - CreateScope(); - } - - void Draw(Nuake::Entity entity) override - { - // using namespace Nuake; - // if (!entity.HasComponent()) - // return; - // - // SkinnedModelComponent& component = entity.GetComponent(); - // BeginComponentTable(SKINNED MESH, SkinnedModelComponent); - // { - // ImGui::Text("Model"); - // ImGui::TableNextColumn(); - // - // std::string label = "None"; - // - // const bool isModelNone = component.ModelResource == nullptr; - // if (!isModelNone) - // { - // label = std::to_string(component.ModelResource->ID); - // } - // - // if (ImGui::Button(label.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0))) - // { - // } - // - // if (m_Expanded) - // { - // m_ModelInspector->Draw(); - // } - // - // if (ImGui::BeginDragDropTarget()) - // { - // if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("_Model")) - // { - // char* file = (char*)payload->Data; - // std::string fullPath = std::string(file, 256); - // fullPath = Nuake::FileSystem::AbsoluteToRelative(fullPath); - // - // if (Nuake::String::EndsWith(fullPath, ".model")) - // { - // - // } - // else - // { - // m_QueuedModelPath = fullPath; - // ImGui::OpenPopup("Create Skeleton"); - // } - // } - // ImGui::EndDragDropTarget(); - // } - // - // if (ImGui::BeginPopupModal("Create Skeleton", NULL, ImGuiWindowFlags_AlwaysAutoResize)) - // { - // ImGui::SetItemDefaultFocus(); - // ImGui::Text("Would you like to create the skeleton structure in the scene tree?"); - // ImGui::Separator(); - // - // if (ImGui::Button("OK", ImVec2(120, 0))) - // { - // component.ModelPath = m_QueuedModelPath; - // component.LoadModel(); - // - // Scene* scene = entity.GetScene(); - // scene->CreateSkeleton(entity); - // - // ImGui::CloseCurrentPopup(); - // } - // - // ImGui::SetItemDefaultFocus(); - // ImGui::SameLine(); - // - // if (ImGui::Button("Cancel", ImVec2(120, 0))) - // { - // ImGui::CloseCurrentPopup(); - // } - // - // ImGui::EndPopup(); - // } - // - // ImGui::TableNextColumn(); - // ComponentTableReset(component.ModelPath, ""); - // - // if (component.ModelResource) - // { - // auto& model = component.ModelResource; - // ImGui::TableNextColumn(); - // - // { - // ImGui::Text("Playing"); - // ImGui::TableNextColumn(); - // - // ImGui::Checkbox("##playing", &model->IsPlaying); - // - // ImGui::TableNextColumn(); - // ComponentTableReset(model->IsPlaying, true); - // ImGui::TableNextColumn(); - // } - // - // if(model->GetCurrentAnimation()) - // { - // ImGui::Text("Animation"); - // ImGui::TableNextColumn(); - // - // uint32_t animIndex = model->GetCurrentAnimationIndex(); - // uint32_t oldAnimIndex = animIndex; - // auto animations = model->GetAnimations(); - // if (ImGui::BeginCombo("Type", model->GetCurrentAnimation()->GetName().c_str())) - // { - // for (uint32_t n = 0; n < model->GetAnimationsCount(); n++) - // { - // bool is_selected = (animIndex == n); - // std::string animName = animations[n]->GetName(); - // - // if (animName.empty()) - // { - // animName = "Empty"; - // } - // - // if (ImGui::Selectable(animName.c_str(), is_selected)) - // { - // animIndex = n; - // } - // - // if (is_selected) - // ImGui::SetItemDefaultFocus(); - // } - // ImGui::EndCombo(); - // } - // - // if (animIndex != oldAnimIndex) - // { - // model->PlayAnimation(animIndex); - // } - // - // ImGui::TableNextColumn(); - // ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); - // std::string resetLabel = std::string(ICON_FA_UNDO) + "##ResetAnimId"; - // if (ImGui::Button(resetLabel.c_str())) - // { - // model->PlayAnimation(0); - // } - // ImGui::PopStyleColor(); - // } - // } - // - // } - // EndComponentTable(); - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/SphereColliderPanel.h b/Editor/src/ComponentsPanel/SphereColliderPanel.h deleted file mode 100644 index 6374df31..00000000 --- a/Editor/src/ComponentsPanel/SphereColliderPanel.h +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -#include "ComponentPanel.h" -#include -#include "src/FileSystem/FileSystem.h" -#include - -class SphereColliderPanel : ComponentPanel { -public: - SphereColliderPanel() {} - - void Draw(Nuake::Entity entity) override - { - if (!entity.HasComponent()) - return; - - auto& component = entity.GetComponent(); - BeginComponentTable(SPHERE COLLIDER, Nuake::SphereColliderComponent); - { - { - ImGui::Text("Size"); - ImGui::TableNextColumn(); - ImGui::DragFloat("##Radius", &component.Radius, 0.01f, 0.001f); - - component.Radius = std::max(component.Radius, 0.001f); - ImGui::TableNextColumn(); - ComponentTableReset(component.Radius, 0.5f); - } - ImGui::TableNextColumn(); - { - ImGui::Text("Is Trigger"); - ImGui::TableNextColumn(); - - ImGui::Checkbox("##isTrigger", &component.IsTrigger); - ImGui::TableNextColumn(); - ComponentTableReset(component.IsTrigger, false); - } - } - EndComponentTable(); - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/SpritePanel.h b/Editor/src/ComponentsPanel/SpritePanel.h deleted file mode 100644 index bc03e632..00000000 --- a/Editor/src/ComponentsPanel/SpritePanel.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include "ComponentPanel.h" - -#include "src/FileSystem/FileSystem.h" -#include -#include -#include - - -class SpritePanel : ComponentPanel -{ -public: - SpritePanel() = default; - ~SpritePanel() = default; - - void Draw(Nuake::Entity entity) override - { - - } -}; \ No newline at end of file diff --git a/Editor/src/ComponentsPanel/UIPanel.h b/Editor/src/ComponentsPanel/UIPanel.h deleted file mode 100644 index 0f4b48fc..00000000 --- a/Editor/src/ComponentsPanel/UIPanel.h +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once -#include "ComponentPanel.h" - -#include "src/FileSystem/FileSystem.h" -#include -#include -#include - - -class UIPanel : ComponentPanel -{ -public: - UIPanel() = default; - ~UIPanel() = default; - - void Draw(Nuake::Entity entity) override - { - // using namespace Nuake; - // - // if (!entity.HasComponent()) - // return; - // - // auto& component = entity.GetComponent(); - // BeginComponentTable(UI EMITTER, UIComponent); - // { - // { - // ImGui::Text("HTML File"); - // ImGui::TableNextColumn(); - // - // std::string path = component.UIFilePath; - // ImGui::Button(component.UIFilePath.c_str(), ImVec2(ImGui::GetContentRegionAvail().x, 0)); - // if (ImGui::BeginDragDropTarget()) - // { - // if (const ImGuiPayload* payload = ImGui::AcceptDragDropPayload("_UIFile")) - // { - // char* file = (char*)payload->Data; - // std::string fullPath = std::string(file, 256); - // path = Nuake::FileSystem::AbsoluteToRelative(fullPath); - // component.UIFilePath = path; - // } - // ImGui::EndDragDropTarget(); - // } - // - // ImGui::TableNextColumn(); - // - // ComponentTableReset(component.UIFilePath, ""); - // } - // ImGui::TableNextColumn(); - // { - // ImGui::Text("Worldspace"); - // ImGui::TableNextColumn(); - // - // ImGui::Checkbox("##WorldSpace", &component.IsWorldSpace); - // ImGui::TableNextColumn(); - // - // ComponentTableReset(component.IsWorldSpace, false); - // } - // } - // EndComponentTable(); - } -}; \ No newline at end of file diff --git a/Editor/src/Windows/EditorSelectionPanel.cpp b/Editor/src/Windows/EditorSelectionPanel.cpp index 2f6a7525..0e66433d 100644 --- a/Editor/src/Windows/EditorSelectionPanel.cpp +++ b/Editor/src/Windows/EditorSelectionPanel.cpp @@ -159,25 +159,25 @@ void EditorSelectionPanel::DrawEntity(Nuake::Entity entity) // Draw each component properties panels. - // mLightPanel.Draw(entity); - // mScriptPanel.Draw(entity); - // mNetScriptPanel.Draw(entity); + mLightPanel.Draw(entity); + mScriptPanel.Draw(entity); + mNetScriptPanel.Draw(entity); // mAudioEmitterPanel.Draw(entity); // mParticleEmitterPanel.Draw(entity); - // mSpritePanel.Draw(entity); - // mMeshPanel.Draw(entity); + // mSpritePanel.Draw(entity); + mMeshPanel.Draw(entity); // mSkinnedModelPanel.Draw(entity); - // mBonePanel.Draw(entity); - // mQuakeMapPanel.Draw(entity); - // mCameraPanel.Draw(entity); - // mRigidbodyPanel.Draw(entity); - // mBoxColliderPanel.Draw(entity); - // mSphereColliderPanel.Draw(entity); - // mCapsuleColliderPanel.Draw(entity); - // mCylinderColliderPanel.Draw(entity); - // mMeshColliderPanel.Draw(entity); - // mCharacterControllerPanel.Draw(entity); - // mNavMeshVolumePanel.Draw(entity); + mBonePanel.Draw(entity); + // mQuakeMapPanel.Draw(entity); + mCameraPanel.Draw(entity); + // mRigidbodyPanel.Draw(entity); + mBoxColliderPanel.Draw(entity); + // mSphereColliderPanel.Draw(entity); + mCapsuleColliderPanel.Draw(entity); + mCylinderColliderPanel.Draw(entity); + mMeshColliderPanel.Draw(entity); + mCharacterControllerPanel.Draw(entity); + mNavMeshVolumePanel.Draw(entity); // mUiPanel.Draw(entity); using namespace Nuake; diff --git a/Editor/src/Windows/EditorSelectionPanel.h b/Editor/src/Windows/EditorSelectionPanel.h index acc7b2a8..8788ff56 100644 --- a/Editor/src/Windows/EditorSelectionPanel.h +++ b/Editor/src/Windows/EditorSelectionPanel.h @@ -9,23 +9,16 @@ #include "../ComponentsPanel/LightPanel.h" #include "../ComponentsPanel/ScriptPanel.h" #include "../ComponentsPanel/MeshPanel.h" -#include "../ComponentsPanel/QuakeMapPanel.h" #include "../ComponentsPanel/CameraPanel.h" -#include "../ComponentsPanel/RigidbodyPanel.h" #include "../ComponentsPanel/BoxColliderPanel.h" #include "../ComponentsPanel/CapsuleColliderPanel.h" #include "../ComponentsPanel/CylinderColliderPanel.h" #include "../ComponentsPanel/SphereColliderPanel.h" #include "../ComponentsPanel/MeshColliderPanel.h" #include "../ComponentsPanel/CharacterControllerPanel.h" -#include "../ComponentsPanel/SpritePanel.h" -#include "../ComponentsPanel/ParticleEmitterPanel.h" -#include "../ComponentsPanel/SkinnedModelPanel.h" #include "../ComponentsPanel/BonePanel.h" -#include "../ComponentsPanel/AudioEmitterPanel.h" #include "../ComponentsPanel/NetScriptPanel.h" #include "../ComponentsPanel/NavMeshVolumePanel.h" -#include "../ComponentsPanel/UIPanel.h" #include #include @@ -46,22 +39,14 @@ private: ScriptPanel mScriptPanel; NetScriptPanel mNetScriptPanel; MeshPanel mMeshPanel; - SkinnedModelPanel mSkinnedModelPanel; - QuakeMapPanel mQuakeMapPanel; CameraPanel mCameraPanel; - RigidbodyPanel mRigidbodyPanel; BoxColliderPanel mBoxColliderPanel; - SphereColliderPanel mSphereColliderPanel; MeshColliderPanel mMeshColliderPanel; CapsuleColliderPanel mCapsuleColliderPanel; CylinderColliderPanel mCylinderColliderPanel; - SpritePanel mSpritePanel; CharacterControllerPanel mCharacterControllerPanel; - ParticleEmitterPanel mParticleEmitterPanel; BonePanel mBonePanel; - AudioEmitterPanel mAudioEmitterPanel; NavMeshVolumePanel mNavMeshVolumePanel; - UIPanel mUiPanel; Ref currentFile; Ref selectedResource;