Unravel Engine C++ Reference
Loading...
Searching...
No Matches
content_browser_panel.h
Go to the documentation of this file.
1#pragma once
4
5#include <base/basetypes.hpp>
6#include <context/context.hpp>
7
8namespace unravel
9{
10class imgui_panels;
11
35
36
38{
39public:
41
42 void init(rtti::context& ctx);
43 void deinit(rtti::context& ctx);
44
45 void on_frame_ui_render(rtti::context& ctx, const char* name);
46private:
47 void draw(rtti::context& ctx);
48 void draw_details(rtti::context& ctx, const fs::path& root_path);
49
50 void draw_as_explorer(rtti::context& ctx, const fs::path& root_path);
51 void context_menu(rtti::context& ctx, bool use_context_item, const fs::path& target_path);
52 void context_create_menu(rtti::context& ctx, const fs::path& target_path);
53 void set_cache_path(const fs::path& path);
54 void handle_external_drop(rtti::context& ctx);
55 void import(rtti::context& ctx, const fs::path& target_path);
56 void on_import(rtti::context& ctx, const std::vector<std::string>& paths, const fs::path& target_path);
57 void handle_window_empty_click(rtti::context& ctx) const;
58
59 // Helper method to avoid MSVC ICE with complex template lambdas
60 template<typename AssetType>
61 void setup_asset_item(rtti::context& ctx, content_browser_item& item,
62 const fs::path& absolute_path,
63 const std::string& relative,
64 const std::string& file_ext);
65
66 // Reusable member functions for consistent behavior
67 template<typename EntryType>
68 void setup_delete_handler(content_browser_item& item, const std::string& relative,
69 const fs::path& absolute_path, const EntryType& entry, rtti::context& ctx);
70 void setup_rename_handler(content_browser_item& item, const fs::path& absolute_path,
71 const std::string& file_ext);
72 void prompt_delete_asset(const std::string& name, const std::function<void()>& on_delete);
73
75
76 ImGuiTextFilter filter_;
77 fs::path root_;
78 int refresh_{};
79 float scale_ = 0.65f;
80
81 int focus_frames_{};
82
83 imgui_panels* parent_{};
84
85};
86} // namespace unravel
void on_frame_ui_render(rtti::context &ctx, const char *name)
std::string name
Definition hub.cpp:27
Definition cache.hpp:225
content_browser_item(const fs::directory_cache::cache_entry &e)
const fs::directory_cache::cache_entry & entry
std::function< void(const std::string &)> on_rename_t