73 lines
2.0 KiB
C++
73 lines
2.0 KiB
C++
#pragma once
|
|
#include "../../YoggieEngine/src/YoggieEngine.h"
|
|
#include "EditorWindow.h"
|
|
#include "AssetManagement/AssetManager.h"
|
|
|
|
class AssetFinder : EditorWindow {
|
|
public:
|
|
AssetFinder() : EditorWindow("Assets"),
|
|
folderIcon ("rsc/FolderIcon.png"),
|
|
assetIcon ("rsc/AssetIcon.png")
|
|
{}
|
|
|
|
void Draw() override {
|
|
ImGui::DragInt("IconSize", &iconSize, 1, 30, 90);
|
|
ImGui::DragInt("Maximum Columns", &maxColumns, 1, 1, 6);
|
|
if (ImGui::BeginTable("##resources", 3))
|
|
{
|
|
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.f, 0.f, 0.f, 0.f));
|
|
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.f, 0.f, 0.f, 0.f));
|
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(1.f, 1.f, 1.f, 0.2f));
|
|
|
|
|
|
/*
|
|
int row = 0;
|
|
int column = 0;
|
|
for (auto& asset : AssetManager::assets) {
|
|
if (column % 3 == 0) {
|
|
ImGui::TableNextRow();
|
|
column = 0;
|
|
row++;
|
|
}
|
|
|
|
ImGui::TableSetColumnIndex(column);
|
|
|
|
if (asset.isFolder) {
|
|
ImGui::ImageButton(
|
|
(ImTextureID)folderIcon.GetID(),
|
|
ImVec2{ (float)iconSize,(float)iconSize });
|
|
ImGui::Text(asset.GetName(), row);
|
|
|
|
}
|
|
else {
|
|
ImGui::ImageButton(
|
|
(ImTextureID)assetIcon.GetID(),
|
|
ImVec2{ (float)iconSize, (float)iconSize });
|
|
ImGui::Text(asset.GetName(), row);
|
|
|
|
}
|
|
|
|
|
|
column++;
|
|
}
|
|
*/
|
|
|
|
|
|
ImGui::PopStyleColor(3);
|
|
ImGui::EndTable();
|
|
const GLuint textures[2]{ assetIcon.GetID(), folderIcon.GetID() };
|
|
glDeleteTextures(2, textures);
|
|
|
|
}
|
|
}
|
|
|
|
private:
|
|
int iconSize = 60;
|
|
int maxColumns = 3;
|
|
|
|
YoggieEngine::Texture folderIcon;
|
|
YoggieEngine::Texture assetIcon;
|
|
|
|
};
|
|
|