mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Merge pull request #54 from antopilo/feature/NK-95-billboard-component
Feature/nk 95 billboard component
This commit is contained in:
@@ -14,13 +14,6 @@
|
||||
|
||||
EditorSelectionPanel::EditorSelectionPanel()
|
||||
{
|
||||
mTransformPanel = TransformPanel();
|
||||
mLightPanel = LightPanel();
|
||||
mScriptPanel = ScriptPanel();
|
||||
mQuakeMapPanel = QuakeMapPanel();
|
||||
mCameraPanel = CameraPanel();
|
||||
mRigidbodyPanel = RigidbodyPanel();
|
||||
mBoxColliderPanel = BoxColliderPanel();
|
||||
}
|
||||
|
||||
void EditorSelectionPanel::ResolveFile(Ref<Nuake::File> file)
|
||||
@@ -100,6 +93,7 @@ void EditorSelectionPanel::DrawEntity(Nuake::Entity entity)
|
||||
mTransformPanel.Draw(entity);
|
||||
mLightPanel.Draw(entity);
|
||||
mScriptPanel.Draw(entity);
|
||||
mSpritePanel.Draw(entity);
|
||||
mMeshPanel.Draw(entity);
|
||||
mQuakeMapPanel.Draw(entity);
|
||||
mCameraPanel.Draw(entity);
|
||||
@@ -129,6 +123,7 @@ void EditorSelectionPanel::DrawAddComponentMenu(Nuake::Entity entity)
|
||||
MenuItemComponent("Camera", Nuake::CameraComponent)
|
||||
MenuItemComponent("Light", Nuake::LightComponent)
|
||||
MenuItemComponent("Model", Nuake::ModelComponent)
|
||||
MenuItemComponent("Sprite", Nuake::SpriteComponent)
|
||||
ImGui::Separator();
|
||||
MenuItemComponent("Character Controller", Nuake::CharacterControllerComponent)
|
||||
MenuItemComponent("Rigid body", Nuake::RigidBodyComponent)
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "../ComponentsPanel/SphereColliderPanel.h"
|
||||
#include "../ComponentsPanel/MeshColliderPanel.h"
|
||||
#include "../ComponentsPanel/CharacterControllerPanel.h"
|
||||
#include "../ComponentsPanel/SpritePanel.h"
|
||||
|
||||
|
||||
class EditorSelectionPanel {
|
||||
private:
|
||||
@@ -33,7 +35,7 @@ private:
|
||||
MeshColliderPanel mMeshColliderPanel;
|
||||
CapsuleColliderPanel mCapsuleColliderPanel;
|
||||
CylinderColliderPanel mCylinderColliderPanel;
|
||||
|
||||
SpritePanel mSpritePanel;
|
||||
CharacterControllerPanel mCharacterControllerPanel;
|
||||
|
||||
Ref<Nuake::File> currentFile;
|
||||
|
||||
@@ -211,28 +211,42 @@ namespace Nuake
|
||||
{
|
||||
Editor->Selection = EditorSelection(file);
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::BeginDragDropSource())
|
||||
if (ImGui::BeginDragDropSource())
|
||||
{
|
||||
char pathBuffer[256];
|
||||
std::strncpy(pathBuffer, file->GetAbsolutePath().c_str(), sizeof(pathBuffer));
|
||||
std::string dragType;
|
||||
if (fileExtension == ".wren")
|
||||
{
|
||||
dragType = "_Script";
|
||||
}
|
||||
else if (fileExtension == ".map")
|
||||
{
|
||||
dragType = "_Map";
|
||||
}
|
||||
else if (fileExtension == ".obj" || fileExtension == ".mdl" || fileExtension == ".gltf" || fileExtension == ".md3" || fileExtension == ".fbx")
|
||||
{
|
||||
dragType = "_Model";
|
||||
}
|
||||
else if (fileExtension == ".interface")
|
||||
{
|
||||
dragType = "_Interface";
|
||||
}
|
||||
else if (fileExtension == ".prefab")
|
||||
{
|
||||
dragType = "_Prefab";
|
||||
}
|
||||
else if (fileExtension == ".png" || fileExtension == ".jpg")
|
||||
{
|
||||
dragType = "_Image";
|
||||
}
|
||||
|
||||
ImGui::SetDragDropPayload(dragType.c_str(), (void*)(pathBuffer), sizeof(pathBuffer));
|
||||
ImGui::Text(file->GetName().c_str());
|
||||
ImGui::EndDragDropSource();
|
||||
}
|
||||
}
|
||||
|
||||
const std::string hoverMenuId = std::string("item_hover_menu") + std::to_string(drawId);
|
||||
if (ImGui::IsItemHovered() && ImGui::IsMouseReleased(1))
|
||||
|
||||
Reference in New Issue
Block a user