9#include "../../third_party/imgui/imgui.h"
10#include "../../system/system_consts.h"
11#include "../../system/system_utils.h"
41 if (!currentPath.empty())
67 ImGui::SetNextWindowSizeConstraints(
ImVec2(500.0f, 300.0f),
ImVec2(1200.0f, 800.0f));
72 ImGui::TextColored(
ImVec4(0.8f, 0.95f, 1.0f, 1.0f),
"Select a BehaviorTree file (.bt.json) to link with this component");
79 ImGui::TextDisabled(
"Path:");
81 ImGui::SetNextItemWidth(-100.0f);
89 if (ImGui::Button(
"Refresh##refresh",
ImVec2(90, 0)))
100 ImGui::TextDisabled(
"Filter:");
102 ImGui::SetNextItemWidth(-1.0f);
119 ImGui::TextDisabled(
"Selected:");
127 ImGui::TextColored(
ImVec4(1.0f, 0.5f, 0.5f, 1.0f),
"(none)");
144 ImGui::OpenPopup(
"Select BehaviorTree File##modal");
185 <<
" behavior tree files (.bt.json) in " <<
m_currentPath <<
"\n";
187 SYSTEM_LOG <<
"[BehaviorTreeFilePicker] Platform not supported (Windows only)\n";
195 ImGui::TextDisabled(
"Available BehaviorTrees:");
197 ImGui::BeginChild(
"##file_list",
ImVec2(0, 250),
true);
228 ImGui::TextDisabled(
"(no behavior tree files found)");
239 ImGui::BeginDisabled(
true);
241 if (ImGui::Button(
"Select##select",
ImVec2(100, 0)))
249 ImGui::CloseCurrentPopup();
254 ImGui::EndDisabled();
258 if (ImGui::Button(
"Cancel##cancel",
ImVec2(100, 0)))
262 ImGui::CloseCurrentPopup();
ImGui modal for selecting BehaviorTree files (Phase C).
ComponentTypeID GetComponentTypeID_Static()
std::string m_selectedFile
The file path user selected.
char m_searchBuffer[128]
Search filter text.
void Render()
Renders the modal UI.
char m_pathBuffer[512]
Directory path input buffer.
std::vector< std::string > m_behaviorTreeFiles
.bt.json files in current directory
BehaviorTreeFilePickerModal()
void RenderActionButtons()
Renders action buttons (Select, Cancel).
int m_selectedIndex
Currently highlighted file (-1 = none)
std::vector< std::string > GetFilteredFiles() const
Filters file list by search term.
void RenderFileList()
Renders the file list with scrolling support.
void Close()
Closes the modal without confirming changes.
bool m_isOpen
Is modal currently displayed.
void RefreshFileList()
Scans current directory for .bt.json behavior tree files.
bool m_confirmed
Did user click Select button.
std::string m_currentPath
Current browse directory.
void Open(const std::string ¤tPath="")
Opens the modal with optional initial path.
< Provides AssetID and INVALID_ASSET_ID