44#include "../ConditionPreset/ConditionPreset.h"
45#include "../ConditionPreset/ConditionPresetRegistry.h"
46#include "../ConditionPreset/NodeConditionRef.h"
47#include "../ConditionPreset/DynamicDataPin.h"
48#include "../Modals/NodeConditionsEditModal.h"
49#include "../../BlueprintEditor/ConditionRef.h"
50#include "../../TaskSystem/LocalBlackboard.h"
339 std::vector<std::string>
Validate()
const;
ComponentTypeID GetComponentTypeID_Static()
Manages the global pool of ConditionPreset objects.
Modal dialog for adding, removing, and reordering conditions on a node.
ImGui sub-panel for managing the condition list of a single NodeBranch.
void RenderOperatorDropdown(ConditionRef &cref)
Renders the operator combo box (==, !=, <, <=, >, >=).
std::string m_nodeName
Node display name for title section.
std::vector< NodeConditionRef > m_conditionRefs
Current node's conditions.
void RenderTitleSection()
Section 1: title bar (blue background, node name).
~NodeConditionsPanel()=default
const std::vector< ConditionRef > & GetConditionOperandRefs() const
Returns the current inline operand list.
void SetConditionRefs(const std::vector< NodeConditionRef > &refs)
Replaces the panel's internal condition list.
void RemoveCondition(size_t index)
Removes the condition at the given index.
void ClearDirty()
Resets the dirty flag.
void RenderInlineConditionRow(size_t index, const NodeConditionRef &ref)
Renders a single condition row with edit/move/delete controls.
const std::string & GetDropdownFilter() const
Returns the current dropdown filter.
void SetNodeName(const std::string &name)
Sets the node name displayed in the title section.
void RenderConditionsPreview()
Section 3: read-only conditions preview (green text) + "Edit Conditions" button.
NodeConditionsEditModal m_editModal
Owned modal for condition editing.
std::vector< DynamicDataPin > m_dynamicPins
Read-only dynamic pins for display.
void NormalizeLogicalOps()
Fixes up the first condition's logicalOp to always be Start.
void RenderConditionList()
Renders all conditions inline as an editable list.
const std::vector< NodeConditionRef > & GetConditionRefs() const
Returns the current (possibly modified) condition list.
ConditionPresetRegistry & m_registry
Shared global registry.
bool m_dropdownOpen
Whether the add-dropdown is shown (legacy, kept for API compat)
bool IsEditModalRequested() const
Returns true if the "Edit Conditions" button was clicked this frame.
void RenderInlineConditionEditor()
Phase 24 UX Refactor: Renders condition editor inline (no modal popup).
void AddCondition(const std::string &presetID)
Appends a new condition reference with the given preset.
void RenderExecPinsSection()
Section 2: static exec pins (In / Then / Else, never editable).
std::vector< ConditionRef > m_conditionOperandRefs
Inline operand data (parallel to m_conditionRefs)
std::vector< std::string > Validate() const
Returns a list of error strings describing validation failures.
void RenderDynamicPinsSection()
Section 4: dynamic data pins (yellow, only when non-empty).
void SetConditionOperandRefs(const std::vector< ConditionRef > &refs)
Replaces the panel's inline operand list (parallel to conditionRefs).
bool IsValid() const
Returns true when every condition ref points to an existing preset.
void OnPresetDeleted(const std::string &deletedPresetID)
Should be called by the host when a preset is deleted from the registry.
bool m_dirty
Modification flag.
std::string m_dropdownFilter
Filter text for "Add Condition" dropdown.
NodeConditionsPanel & operator=(const NodeConditionsPanel &)=delete
bool m_editModalRequested
Set when Edit button is clicked.
std::function< void()> OnDynamicPinsNeedRegeneration
Fired after the edit modal is confirmed and condition refs are updated, signalling that dynamic pins ...
void SetDynamicPins(const std::vector< DynamicDataPin > &pins)
Provides the read-only list of dynamic pins for display.
const std::string & GetNodeName() const
Returns the current node name shown in the title bar.
void Render()
Renders the condition list and dynamic-pin display using ImGui.
std::vector< BlackboardEntry > m_localVariables
Local variables from entity (Phase 24)
void SetLocalVariables(const std::vector< BlackboardEntry > &localVars)
Sets the list of local variables from EntityBlackboard (Phase 24).
std::vector< ConditionPreset > GetFilteredPresetsForDropdown() const
Returns presets matching the current dropdown filter.
void SetLogicalOp(size_t index, LogicalOp op)
Changes the logical operator for the condition at the given index.
std::function< void(const std::string &)> OnPresetChanged
Fired when a preset is selected or changed.
NodeConditionsPanel(const NodeConditionsPanel &)=delete
void ClearEditModalRequest()
Resets the edit-modal request flag.
void RenderInlineAddCondition()
Renders the "Add Condition" button and preset picker inline.
size_t GetConditionCount() const
Returns the number of conditions currently in the list.
bool IsDirty() const
Returns true if the condition list has been modified since the last call to ClearDirty().
void SetDropdownFilter(const std::string &filter)
Sets the search/filter string used by the "Add Condition" dropdown.
bool m_pickerOpen
Phase 24: Inline preset picker visibility.
void RenderOperandDropdown(ConditionRef &cref, bool isLeft, const std::string &pinLabel="")
Renders the operand mode selector + value field for one operand.
< Provides AssetID and INVALID_ASSET_ID
LogicalOp
How this condition is combined with the one preceding it.
Stores the complete reference for one condition including operand-to-DynamicDataPin mapping.
One entry in a NodeBranch's conditions list.