![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
ImGui modal dialog for selecting SubGraph blueprint files. More...
#include <SubGraphFilePickerModal.h>
Public Member Functions | |
| SubGraphFilePickerModal () | |
| ~SubGraphFilePickerModal ()=default | |
| void | Open (const std::string ¤tPath="") |
| Opens the modal with optional initial path. | |
| void | Close () |
| Closes the modal without confirming changes. | |
| void | Render () |
| Renders the modal UI. | |
| bool | IsOpen () const |
| Returns true if modal is currently visible. | |
| bool | IsConfirmed () const |
| Returns true if user clicked "Select" button. | |
| const std::string & | GetSelectedFile () const |
| Returns the selected file path (only valid if IsConfirmed() is true). | |
Private Member Functions | |
| void | RefreshFileList () |
| Scans current directory for .json blueprint files. | |
| void | RenderFileList () |
| Renders the file list with scrolling support. | |
| void | RenderActionButtons () |
| Renders action buttons (Select, Cancel). | |
| std::vector< std::string > | GetFilteredFiles () const |
| Filters file list by search term. | |
Private Attributes | |
| bool | m_isOpen = false |
| Is modal currently displayed. | |
| bool | m_confirmed = false |
| Did user click Select button. | |
| std::string | m_selectedFile = "" |
| The file path user selected. | |
| std::string | m_currentPath = "" |
| Current browse directory. | |
| std::vector< std::string > | m_blueprintFiles |
| .json files in current directory | |
| int | m_selectedIndex = -1 |
| Currently highlighted file (-1 = none) | |
| char | m_pathBuffer [512] = "" |
| Directory path input buffer. | |
| char | m_searchBuffer [128] = "" |
| Search filter text. | |
ImGui modal dialog for selecting SubGraph blueprint files.
Usage:
Definition at line 30 of file SubGraphFilePickerModal.h.
| Olympe::SubGraphFilePickerModal::SubGraphFilePickerModal | ( | ) |
Definition at line 22 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), m_currentPath, m_pathBuffer, and RefreshFileList().
Here is the call graph for this function:
|
default |
| void Olympe::SubGraphFilePickerModal::Close | ( | ) |
Closes the modal without confirming changes.
Definition at line 51 of file SubGraphFilePickerModal.cpp.
References m_confirmed, m_isOpen, and m_selectedFile.
|
private |
Filters file list by search term.
Definition at line 266 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), m_blueprintFiles, and m_searchBuffer.
Referenced by RenderFileList().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Returns the selected file path (only valid if IsConfirmed() is true).
Definition at line 73 of file SubGraphFilePickerModal.h.
References m_selectedFile.
|
inline |
Returns true if user clicked "Select" button.
Call this after modal closes to check if changes should be applied.
Definition at line 68 of file SubGraphFilePickerModal.h.
References m_confirmed.
|
inline |
Returns true if modal is currently visible.
Definition at line 62 of file SubGraphFilePickerModal.h.
References m_isOpen.
Opens the modal with optional initial path.
| currentPath | If non-empty, shows this path as selected initially |
Definition at line 34 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), m_confirmed, m_currentPath, m_isOpen, m_pathBuffer, m_searchBuffer, m_selectedFile, m_selectedIndex, and RefreshFileList().
Here is the call graph for this function:
|
private |
Scans current directory for .json blueprint files.
Populates m_blueprintFiles with file names.
Definition at line 152 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), m_blueprintFiles, m_currentPath, m_selectedIndex, and SYSTEM_LOG.
Referenced by Open(), Render(), and SubGraphFilePickerModal().
Here is the call graph for this function:
Here is the caller graph for this function:| void Olympe::SubGraphFilePickerModal::Render | ( | ) |
Renders the modal UI.
Call every frame while modal is open.
Definition at line 58 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), m_blueprintFiles, m_currentPath, m_isOpen, m_pathBuffer, m_searchBuffer, m_selectedIndex, RefreshFileList(), RenderActionButtons(), and RenderFileList().
Here is the call graph for this function:
|
private |
Renders action buttons (Select, Cancel).
Definition at line 234 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), m_blueprintFiles, m_confirmed, m_currentPath, m_isOpen, m_selectedFile, and m_selectedIndex.
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Renders the file list with scrolling support.
Definition at line 191 of file SubGraphFilePickerModal.cpp.
References GetComponentTypeID_Static(), GetFilteredFiles(), m_blueprintFiles, and m_selectedIndex.
Referenced by Render().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
.json files in current directory
Definition at line 89 of file SubGraphFilePickerModal.h.
Referenced by GetFilteredFiles(), RefreshFileList(), Render(), RenderActionButtons(), and RenderFileList().
Did user click Select button.
Definition at line 81 of file SubGraphFilePickerModal.h.
Referenced by Close(), IsConfirmed(), Open(), and RenderActionButtons().
|
private |
Current browse directory.
Definition at line 83 of file SubGraphFilePickerModal.h.
Referenced by Open(), RefreshFileList(), Render(), RenderActionButtons(), and SubGraphFilePickerModal().
Is modal currently displayed.
Definition at line 80 of file SubGraphFilePickerModal.h.
Referenced by Close(), IsOpen(), Open(), Render(), and RenderActionButtons().
|
private |
Directory path input buffer.
Definition at line 96 of file SubGraphFilePickerModal.h.
Referenced by Open(), Render(), and SubGraphFilePickerModal().
|
private |
Search filter text.
Definition at line 97 of file SubGraphFilePickerModal.h.
Referenced by GetFilteredFiles(), Open(), and Render().
|
private |
The file path user selected.
Definition at line 82 of file SubGraphFilePickerModal.h.
Referenced by Close(), GetSelectedFile(), Open(), and RenderActionButtons().
|
private |
Currently highlighted file (-1 = none)
Definition at line 90 of file SubGraphFilePickerModal.h.
Referenced by Open(), RefreshFileList(), Render(), RenderActionButtons(), and RenderFileList().