ASAPCabinetFE
 
Loading...
Searching...
No Matches
ConfigUI Class Reference

Manages the ImGui-based configuration UI. More...

#include <config_ui.h>

+ Collaboration diagram for ConfigUI:

Public Member Functions

 ConfigUI (IConfigService *configService, IKeybindProvider *keybindProvider, IAssetManager *assets, size_t *currentIndex, std::vector< TableData > *tables, IAppCallbacks *appCallbacks, bool &showConfig, bool standaloneMode=false)
 Constructs a ConfigUI instance.
 
void drawGUI ()
 Draws the configuration UI.
 
void handleEvent (const SDL_Event &event)
 Handles an SDL event for keybinding capture.
 
void saveConfig ()
 Saves the current configuration.
 
bool shouldClose () const
 Checks if the UI should close.
 
bool isStandalone () const
 Checks if the UI is in standalone mode.
 
void resetSectionToDefault (const std::string &sectionName)
 Resets a section to its default values.
 
void refreshUIState ()
 

Detailed Description

Manages the ImGui-based configuration UI.

Class for runtime configuration UI (forward declaration).

This class provides the main interface for rendering and managing the configuration UI in ASAPCabinetFE. It supports standalone and integrated modes, handles keybinding capture, file dialogs, and section-specific rendering, and triggers reloads based on configuration changes.

Constructor & Destructor Documentation

◆ ConfigUI()

ConfigUI::ConfigUI ( IConfigService configService,
IKeybindProvider keybindProvider,
IAssetManager assets,
size_t *  currentIndex,
std::vector< TableData > *  tables,
IAppCallbacks appCallbacks,
bool &  showConfig,
bool  standaloneMode = false 
)

Constructs a ConfigUI instance.

Initializes the configuration UI with the specified dependencies and mode.

Parameters
configServicePointer to the IConfigService instance for configuration management.
keybindProviderPointer to the IKeybindProvider instance for keybinding management.
assetsPointer to the IAssetManager instance for asset handling.
currentIndexPointer to the current table index (unused in this implementation).
tablesPointer to the vector of table data (unused in this implementation).
appCallbacksPointer to the IAppCallbacks instance for application callbacks.
showConfigReference to a flag indicating if the UI should be shown.
standaloneModeOptional flag for standalone mode (default: false).
+ Here is the call graph for this function:

Member Function Documentation

◆ drawGUI()

void ConfigUI::drawGUI ( )

Draws the configuration UI.

Renders the ImGui window with all configuration sections and buttons.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleEvent()

void ConfigUI::handleEvent ( const SDL_Event &  event)

Handles an SDL event for keybinding capture.

Processes SDL events to capture key or joystick inputs during keybinding setup.

Parameters
eventThe SDL event to handle.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isStandalone()

bool ConfigUI::isStandalone ( ) const
inline

Checks if the UI is in standalone mode.

Returns
True if the UI is in standalone mode, false otherwise.
+ Here is the caller graph for this function:

◆ resetSectionToDefault()

void ConfigUI::resetSectionToDefault ( const std::string &  sectionName)

Resets a section to its default values.

Restores the specified section to its default configuration.

Parameters
sectionNameThe name of the section to reset.
+ Here is the caller graph for this function:

◆ saveConfig()

void ConfigUI::saveConfig ( )

Saves the current configuration.

Applies changes to the configuration service and triggers necessary reloads.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ shouldClose()

bool ConfigUI::shouldClose ( ) const
inline

Checks if the UI should close.

Returns
True if the UI should close, based on the showConfig_ flag.

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