31 ImGui::SetWindowSize({300,100}, ImGuiCond_FirstUseEver);
35 ImGui::BeginDisabled(1);
39 ImGui::BeginDisabled(0);
42 if (ImGui::Button(ICON_FK_ARROW_UP))
55 if (ImGui::Button(
"Open resources folder"))
58 ShellExecuteA(NULL,
"open", SAMURAI_RESOURCES_PATH, NULL, NULL, SW_RESTORE);
63 std::string root = SAMURAI_RESOURCES_PATH;
64 std::string enginePath =
"SAMURAI_RESOURCES_PATH/";
65 if (longPath.size() > root.size())
67 enginePath += (longPath.c_str() + root.size());
70 for (
char &c : enginePath)
78 ImGui::Text(enginePath.c_str());
82 float contentW = ImGui::GetContentRegionAvail().x;
83 const float size = 160;
84 const float padding = 10;
86 ImGui::Columns( std::max(1, (
int)(contentW / (size + padding))), 0,
false);
89 auto displayItem = [&](
const std::filesystem::directory_entry &p) ->
bool
91 if (ImGui::BeginChild(p.path().filename().string().c_str(), {size, size + 40},
false,
92 ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse))
95 ImFontAtlas *atlas = ImGui::GetIO().Fonts;
97 ImGui::PushFont(atlas->Fonts[1]);
102 if (ImGui::Button(ICON_FK_FOLDER_O, {size ,size}))
115 if (ImGui::Button(ICON_FK_FILE_O, {size ,size}))
117 auto it = currentDll.containerExtensionsSupport.find(p.path().filename().extension().string());
118 if (it != currentDll.containerExtensionsSupport.end())
121 containerManager.
createContainer(it->second, currentDll, logManager, imguiIDsManager, p.path().string());
128 ImGui::Text(p.path().filename().string().c_str());
130 if (ImGui::BeginPopupContextWindow())
132 if (ImGui::Button(
"reveal in explorer"))
136 if (p.is_directory())
138 ShellExecuteA(NULL,
"open", p.path().string().c_str(), NULL, NULL, SW_RESTORE);
142 auto path = p.path().parent_path().string();
143 ShellExecuteA(NULL,
"open", path.c_str(), NULL, NULL, SW_RESTORE);
146 ImGui::CloseCurrentPopup();
149 if (ImGui::Button(
"copy file location"))
151 ImGui::SetClipboardText(p.path().string().c_str());
152 ImGui::CloseCurrentPopup();
155 if (ImGui::Button(
"copy file location for engine"))
157 std::string s =
"SAMURAI_RESOURCES_PATH \"" + p.path().filename().string() +
"\"";
159 ImGui::SetClipboardText(s.c_str());
160 ImGui::CloseCurrentPopup();
163 if (!p.is_directory())
165 if (ImGui::Button(
"open file"))
168 ShellExecuteA(NULL,
"open", p.path().string().c_str(), NULL, NULL, SW_RESTORE);
170 ImGui::CloseCurrentPopup();
176 auto it = currentDll.containerExtensionsSupport.find(p.path().filename().extension().string());
177 if (it != currentDll.containerExtensionsSupport.end())
180 if (ImGui::Button(
"Open In engine"))
182 containerManager.
createContainer(it->second, currentDll, logManager, imguiIDsManager, p.path().string());
201 for (
auto &p : std::filesystem::directory_iterator(
currentPath))
215 for (
auto &p : std::filesystem::recursive_directory_iterator(SAMURAI_RESOURCES_PATH))
217 if (p.is_regular_file())
219 auto rez = p.path().filename().string();
221 if (rez.find(
searchText) != std::string::npos)