Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Olympe::SubGraphFilePickerModal Class Reference

ImGui modal dialog for selecting SubGraph blueprint files. More...

#include <SubGraphFilePickerModal.h>

Public Member Functions

 SubGraphFilePickerModal ()
 
 ~SubGraphFilePickerModal ()=default
 
void Open (const std::string &currentPath="")
 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.
 

Detailed Description

ImGui modal dialog for selecting SubGraph blueprint files.

Usage:

  1. Call Open(currentPath) to initialize and show modal
  2. Call Render() each frame (returns true if still open)
  3. Check IsConfirmed() after close to see if user applied changes
  4. Call GetSelectedFile() to get the chosen file path
  5. Call Close() to dismiss modal

Definition at line 30 of file SubGraphFilePickerModal.h.

Constructor & Destructor Documentation

◆ SubGraphFilePickerModal()

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:

◆ ~SubGraphFilePickerModal()

Olympe::SubGraphFilePickerModal::~SubGraphFilePickerModal ( )
default

Member Function Documentation

◆ Close()

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.

◆ GetFilteredFiles()

std::vector< std::string > Olympe::SubGraphFilePickerModal::GetFilteredFiles ( ) const
private

Filters file list by search term.

Returns
Filtered file list

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:

◆ GetSelectedFile()

const std::string & Olympe::SubGraphFilePickerModal::GetSelectedFile ( ) const
inline

Returns the selected file path (only valid if IsConfirmed() is true).

Definition at line 73 of file SubGraphFilePickerModal.h.

References m_selectedFile.

◆ IsConfirmed()

bool Olympe::SubGraphFilePickerModal::IsConfirmed ( ) const
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.

◆ IsOpen()

bool Olympe::SubGraphFilePickerModal::IsOpen ( ) const
inline

Returns true if modal is currently visible.

Definition at line 62 of file SubGraphFilePickerModal.h.

References m_isOpen.

◆ Open()

void Olympe::SubGraphFilePickerModal::Open ( const std::string &  currentPath = "")

Opens the modal with optional initial path.

Parameters
currentPathIf 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:

◆ RefreshFileList()

void Olympe::SubGraphFilePickerModal::RefreshFileList ( )
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:

◆ Render()

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:

◆ RenderActionButtons()

void Olympe::SubGraphFilePickerModal::RenderActionButtons ( )
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:

◆ RenderFileList()

void Olympe::SubGraphFilePickerModal::RenderFileList ( )
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:

Member Data Documentation

◆ m_blueprintFiles

std::vector<std::string> Olympe::SubGraphFilePickerModal::m_blueprintFiles
private

.json files in current directory

Definition at line 89 of file SubGraphFilePickerModal.h.

Referenced by GetFilteredFiles(), RefreshFileList(), Render(), RenderActionButtons(), and RenderFileList().

◆ m_confirmed

bool Olympe::SubGraphFilePickerModal::m_confirmed = false
private

Did user click Select button.

Definition at line 81 of file SubGraphFilePickerModal.h.

Referenced by Close(), IsConfirmed(), Open(), and RenderActionButtons().

◆ m_currentPath

std::string Olympe::SubGraphFilePickerModal::m_currentPath = ""
private

Current browse directory.

Definition at line 83 of file SubGraphFilePickerModal.h.

Referenced by Open(), RefreshFileList(), Render(), RenderActionButtons(), and SubGraphFilePickerModal().

◆ m_isOpen

bool Olympe::SubGraphFilePickerModal::m_isOpen = false
private

Is modal currently displayed.

Definition at line 80 of file SubGraphFilePickerModal.h.

Referenced by Close(), IsOpen(), Open(), Render(), and RenderActionButtons().

◆ m_pathBuffer

char Olympe::SubGraphFilePickerModal::m_pathBuffer[512] = ""
private

Directory path input buffer.

Definition at line 96 of file SubGraphFilePickerModal.h.

Referenced by Open(), Render(), and SubGraphFilePickerModal().

◆ m_searchBuffer

char Olympe::SubGraphFilePickerModal::m_searchBuffer[128] = ""
private

Search filter text.

Definition at line 97 of file SubGraphFilePickerModal.h.

Referenced by GetFilteredFiles(), Open(), and Render().

◆ m_selectedFile

std::string Olympe::SubGraphFilePickerModal::m_selectedFile = ""
private

The file path user selected.

Definition at line 82 of file SubGraphFilePickerModal.h.

Referenced by Close(), GetSelectedFile(), Open(), and RenderActionButtons().

◆ m_selectedIndex

int Olympe::SubGraphFilePickerModal::m_selectedIndex = -1
private

Currently highlighted file (-1 = none)

Definition at line 90 of file SubGraphFilePickerModal.h.

Referenced by Open(), RefreshFileList(), Render(), RenderActionButtons(), and RenderFileList().


The documentation for this class was generated from the following files: