-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from jmorton06/dev
Dev
- Loading branch information
Showing
166 changed files
with
3,763 additions
and
2,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
#include "AssetManagerPanel.h" | ||
|
||
#include <Lumos/Core/Application.h> | ||
#include <Lumos/Scene/SceneManager.h> | ||
#include <Lumos/Scene/Scene.h> | ||
#include <Lumos/Utilities/AssetManager.h> | ||
|
||
#include "Editor.h" | ||
|
||
#include <Lumos/Core/Engine.h> | ||
#include <Lumos/Core/OS/Window.h> | ||
#include <Lumos/Graphics/Renderers/RenderPasses.h> | ||
#include <Lumos/ImGui/ImGuiUtilities.h> | ||
#include <Lumos/Utilities/StringUtilities.h> | ||
#include <imgui/imgui.h> | ||
#include <imgui/Plugins/implot/implot.h> | ||
|
||
namespace Lumos | ||
{ | ||
AssetManagerPanel::AssetManagerPanel() | ||
{ | ||
m_Name = "AssetManagerPanel###AssetManagerPanel"; | ||
m_SimpleName = "Asset Manager"; | ||
} | ||
|
||
void AssetManagerPanel::OnImGui() | ||
{ | ||
auto flags = ImGuiWindowFlags_NoCollapse; | ||
if(ImGui::Begin(m_Name.c_str(), &m_Active, flags)) | ||
{ | ||
ImGuiUtilities::PushID(); | ||
|
||
enum MyItemColumnID | ||
{ | ||
MyItemColumnID_ID, | ||
MyItemColumnID_Name, | ||
MyItemColumnID_Type, | ||
MyItemColumnID_Accessed | ||
}; | ||
|
||
if(ImGui::BeginTable("Asset Registry", 4, ImGuiTableFlags_NoSavedSettings | ImGuiTableFlags_Borders | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg)) | ||
{ | ||
ImGui::TableSetupColumn("ID", ImGuiTableColumnFlags_NoSort | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_ID); | ||
ImGui::TableSetupColumn("Name", ImGuiTableColumnFlags_NoSort | ImGuiTableColumnFlags_WidthFixed, 0.0f, MyItemColumnID_Name); | ||
ImGui::TableSetupColumn("Type", ImGuiTableColumnFlags_NoSort, 0.0f, MyItemColumnID_Type); | ||
ImGui::TableSetupColumn("Last Accessed", ImGuiTableColumnFlags_NoSort, 0.0f, MyItemColumnID_Accessed); | ||
|
||
ImGui::TableSetupScrollFreeze(0, 1); | ||
|
||
ImGui::TableHeadersRow(); | ||
ImGui::TableNextRow(); | ||
Lumos::AssetRegistry& registry = m_Editor->GetAssetManager()->GetAssetRegistry(); | ||
|
||
auto DrawEntry = [®istry](AssetMetaData& metaData, uint64_t ID) | ||
{ | ||
{ | ||
ImGui::TableNextColumn(); | ||
ImGui::TextUnformatted(fmt::format("{0}", ID).c_str()); //"%lld", ID); | ||
|
||
ImGui::TableNextColumn(); | ||
std::string name = "Unnamed"; | ||
#ifndef LUMOS_PRODUCTION | ||
registry.GetName(ID, name); | ||
#endif | ||
ImGui::TextUnformatted(name.c_str()); | ||
|
||
ImGui::TableNextColumn(); | ||
ImGui::TextUnformatted(AssetTypeToString(metaData.Type)); | ||
|
||
ImGui::TableNextColumn(); | ||
ImGui::Text("%.2f", metaData.lastAccessed); | ||
|
||
ImGui::TableNextRow(); | ||
} | ||
}; | ||
|
||
for(auto& current : registry) | ||
{ | ||
DrawEntry(current.second, current.first); | ||
} | ||
|
||
ImGui::EndTable(); | ||
} | ||
ImGuiUtilities::PopID(); | ||
} | ||
ImGui::End(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include "EditorPanel.h" | ||
|
||
namespace Lumos | ||
{ | ||
class AssetManagerPanel : public EditorPanel | ||
{ | ||
public: | ||
AssetManagerPanel(); | ||
~AssetManagerPanel() = default; | ||
|
||
void OnImGui() override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.