This commit is contained in:
Isuru Samarathunga
2025-11-11 09:24:14 +05:30
parent 67cb23d589
commit 9d6f525b81
33 changed files with 654 additions and 285 deletions

View File

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include <Editor.hpp>
#include <UI/View/AssetBrowser.hpp>
namespace ia::iae
@ -51,8 +52,15 @@ namespace ia::iae
for (const auto &t : m_assetDirectoryFiles)
{
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 1.75f);
if (ImGui::Selectable(t.IconAndName.c_str()) && t.IsDirectory)
ChangeCurrentOpenDirectory(t.Path);
if (ImGui::Selectable(t.IconAndName.c_str()))
{
if (t.IsDirectory)
{
ChangeCurrentOpenDirectory(t.Path);
break;
}
OpenAsset(t.Path);
}
}
}
ImGui::EndChild();
@ -84,6 +92,14 @@ namespace ia::iae
PostRender();
}
VOID View_AssetBrowser::Update()
{
}
VOID View_AssetBrowser::OnEvent(IN SDL_Event *event)
{
}
VOID View_AssetBrowser::ChangeCurrentOpenDirectory(IN CONST std::filesystem::path &path)
{
m_currentOpenDirectoryPath = path;
@ -131,6 +147,6 @@ namespace ia::iae
VOID View_AssetBrowser::OpenAsset(IN CONST std::filesystem::path &path)
{
Editor::Instance().OpenAsset(path);
}
} // namespace ia::iae