38#include "../../Editor/ConditionPreset/ConditionPreset.h"
39#include "../../Editor/ConditionPreset/ConditionPresetRegistry.h"
255 std::map<std::string, std::vector<std::string>>
m_refMap;
ComponentTypeID GetComponentTypeID_Static()
ImGui panel for creating, editing, duplicating, and deleting global condition presets.
void RenderReferenceAnalysis(const std::string &presetID)
std::vector< ConditionPreset > GetFilteredPresets() const
Returns filtered presets based on the current search filter.
bool m_showDeleteConfirmation
void RenderPresetItem(const std::string &presetID, const ConditionPreset &preset)
std::string m_selectedPresetID
Highlighted preset ID.
ConditionPresetLibraryPanel & operator=(const ConditionPresetLibraryPanel &)=delete
std::string m_searchFilter
Current search text.
void SetSelectedPresetID(const std::string &id)
Selects the preset with the given ID.
void Close()
Closes the panel window.
~ConditionPresetLibraryPanel()=default
ConditionPresetLibraryPanel(const ConditionPresetLibraryPanel &)=delete
std::string OnDuplicatePresetClicked(const std::string &presetID)
Handles the "Duplicate" button for a preset.
void OnPresetSelected(const std::string &presetID)
Selects a preset (highlights it in the list).
void OnDeleteCancelled()
Cancels the pending deletion and hides the confirmation dialog.
const std::string & GetPresetToDelete() const
Returns the ID of the preset pending deletion confirmation.
std::map< std::string, std::vector< std::string > > m_refMap
External reference map: nodeID -> list of preset IDs that node references.
ConditionPresetRegistry & m_registry
Global preset registry.
void SetSearchFilter(const std::string &filter)
Sets the search filter string (case-insensitive substring).
void SetReferenceMap(const std::map< std::string, std::vector< std::string > > &refMap)
Sets the reference analysis map (nodeID -> list of preset IDs used).
void OnDeletePresetClicked(const std::string &presetID)
Handles the "Delete" button for a preset.
const std::string & GetSelectedPresetID() const
Returns the currently selected preset ID (empty if none).
bool IsOpen() const
Returns true if the panel window is open.
void OnDeleteConfirmed(const std::string &presetID)
Confirms the pending deletion.
void RenderDeleteConfirmationDialog()
std::function< void(const std::string &)> OnPresetModified
Invoked after an existing preset is modified.
std::function< void(const std::string &)> OnPresetDeleted
Invoked after a preset is deleted.
std::string OnAddPresetClicked()
Handles the "Add Preset" button.
void Open()
Opens the panel window.
bool IsDeleteConfirmationVisible() const
Returns true if the delete confirmation dialog is currently shown.
ConditionPresetRegistry & GetRegistry()
Returns a reference to the registry managed by this panel.
void Render()
Renders the full panel window using ImGui.
std::string m_presetToDelete
ID queued for deletion.
const std::string & GetSearchFilter() const
Returns the current search filter string.
std::function< void(const std::string &)> OnPresetCreated
Invoked after a new preset is added.
std::vector< std::string > GetReferencingNodes(const std::string &presetID) const
Returns a list of node IDs that reference the given preset.
Manages the global pool of ConditionPreset objects.
< Provides AssetID and INVALID_ASSET_ID
A globally-stored, reusable condition expression.