Renderer for generic configuration sections. More...
#include <section_renderer.h>
Public Member Functions | |
SectionRenderer (ConfigUI *configUI, const std::vector< std::string > &orderedKeys) | |
Constructs a SectionRenderer instance. | |
void | render (const std::string §ionName, nlohmann::json §ionData, bool &isCapturing, std::string &capturingKeyName, ImGuiFileDialog *fileDialog, bool defaultOpen=false, bool &isDialogOpen= *(new bool(false)), std::string &dialogKey= *(new std::string())) |
Renders a configuration section in the UI. | |
Additional Inherited Members | |
![]() | |
void | renderBool (const std::string &key, nlohmann::json &value, const std::string §ionName) |
void | renderFloat (const std::string &key, nlohmann::json &value, const std::string §ionName, float minVal=0.0f, float maxVal=1.0f, const char *format="%.2f") |
void | renderInt (const std::string &key, nlohmann::json &value, const std::string §ionName, int minVal=0, int maxVal=10000) |
void | renderString (const std::string &key, nlohmann::json &value, const std::string §ionName) |
void | renderColor (const std::string &key, nlohmann::json &value, const std::string §ionName) |
void | renderRotation (const std::string &key, nlohmann::json &value, const std::string §ionName) |
void | renderKeybind (const std::string &key, nlohmann::json &value, const std::string §ionName, bool &isCapturing, std::string &capturingKeyName) |
void | renderPathOrExecutable (const std::string &key, nlohmann::json &value, const std::string §ionName, ImGuiFileDialog *fileDialog, bool &isDialogOpen, std::string &dialogKey) |
int | snapToStep (int value) |
Renderer for generic configuration sections.
This class implements the ISectionRenderer interface to render configuration sections with ordered keys, grouped fields, and reset-to-default functionality. It leverages BaseSectionRenderer utilities and integrates with ConfigUI for section management.
|
inline |
Constructs a SectionRenderer instance.
Initializes the renderer with a ConfigUI instance and a vector of ordered keys.
configUI | Pointer to the ConfigUI instance for section management. |
orderedKeys | Vector of keys defining the rendering order. |
|
virtual |
Renders a configuration section in the UI.
Renders the specified section with its JSON data, handling key capture, file dialogs, grouped fields, and reset functionality.
sectionName | The name of the configuration section to render. |
sectionData | Reference to the JSON data for the section. |
isCapturing | Reference to a flag indicating if a key is being captured. |
capturingKeyName | Reference to the name of the key being captured. |
fileDialog | Pointer to the ImGuiFileDialog instance for file selection. |
defaultOpen | Optional flag to open the section by default (default: false). |
isDialogOpen | Reference to a flag indicating if a file dialog is open (default: new bool(false)). |
dialogKey | Reference to the key associated with the open dialog (default: new std::string()). |
Implements ISectionRenderer.