16#ifndef OLYMPE_HEADLESS
17# include "../../third_party/imgui/imgui.h"
138std::vector<ConditionPreset>
141 std::vector<ConditionPreset> result;
149 result.push_back(*
p);
158 result.push_back(*
p);
171#ifndef OLYMPE_HEADLESS
175 ImGui::OpenPopup(
"Edit Conditions##NodeConditionsEditModal");
178 if (ImGui::BeginPopupModal(
"Edit Conditions##NodeConditionsEditModal",
182 ImGui::TextColored(
ImVec4(0.0f, 0.8f, 1.0f, 1.0f),
"Edit Conditions");
185 ImGui::Text(
"Conditions:");
186 ImGui::BeginChild(
"ConditionsList",
ImVec2(0.f, 200.f),
true);
207#ifndef OLYMPE_HEADLESS
208 ImGui::PushID(
static_cast<int>(
index));
213 ImGui::TextDisabled(
" ");
217 const char*
ops[] = {
"And",
"Or" };
219 ImGui::SetNextItemWidth(60.f);
229 ImGui::TextColored(
ImVec4(0.0f, 1.0f, 0.0f, 1.0f),
230 "[%s] %s",
preset->name.c_str(),
preset->GetPreview().c_str());
232 ImGui::TextColored(
ImVec4(1.f, 0.3f, 0.3f, 1.f),
233 "(missing: %s)",
ref.presetID.c_str());
238 if (ImGui::SmallButton(
"^"))
244 if (ImGui::SmallButton(
"v"))
250 if (ImGui::SmallButton(
"X"))
259#ifndef OLYMPE_HEADLESS
260 if (ImGui::Button(
"+ Add Condition"))
272 const std::string label =
preset.name +
" " +
preset.GetPreview();
273 if (ImGui::Selectable(label.c_str()))
283 ImGui::TextDisabled(
"No presets found.");
290#ifndef OLYMPE_HEADLESS
291 if (ImGui::Button(
"Apply",
ImVec2(150.f, 24.f)))
296 if (ImGui::Button(
"Cancel",
ImVec2(150.f, 24.f)))
ComponentTypeID GetComponentTypeID_Static()
Dedicated modal dialog for editing a NodeBranch's condition list (Phase 24-REFONTE).
Manages the global pool of ConditionPreset objects.
std::vector< std::string > GetAllPresetIDs() const
Returns all preset UUIDs in display order.
std::vector< std::string > FindPresetsByName(const std::string &substring) const
Returns UUIDs of all presets whose name contains a substring.
ConditionPreset * GetPreset(const std::string &id)
Returns a mutable pointer to the preset, or nullptr if not found.
std::string m_dropdownFilter
Preset-picker search filter.
std::vector< ConditionRef > m_workingCopyOperandRefs
Phase 24: Operand data.
void RenderAddConditionPicker()
bool m_pickerOpen
Whether the add-preset picker is open.
std::function< void()> OnApply
Optional callback fired when the user clicks "Apply" (Confirm).
void AddCondition(const std::string &presetID)
Appends a new condition for the given preset to the working copy.
void RemoveCondition(size_t index)
Removes the condition at the given index from the working copy.
void RenderConditionRow(size_t index, const NodeConditionRef &ref)
std::vector< NodeConditionRef > m_workingCopy
Editable in-progress copy.
const std::vector< NodeConditionRef > & GetConditionRefs() const
Returns the edited condition ref list.
size_t GetConditionCount() const
Returns the number of conditions in the working copy.
void NormalizeLogicalOps()
Ensures the first condition's logicalOp is always Start.
const std::vector< ConditionRef > & GetConditionOperandRefs() const
Returns the edited operand ref list (Phase 24).
void Render()
Renders the modal dialog using ImGui.
void Confirm()
Programmatically confirms the modal (equivalent to clicking Apply).
void SetDropdownFilter(const std::string &filter)
Sets the search filter for the "Add Condition" preset picker.
std::vector< ConditionPreset > GetFilteredPresetsForDropdown() const
Returns presets matching the current dropdown filter.
void MoveConditionUp(size_t index)
Moves the condition at index one position earlier (swap with index-1).
void Open(const std::vector< NodeConditionRef > ¤tRefs, const std::vector< ConditionRef > &operandRefs=std::vector< ConditionRef >())
Opens the modal, loading the given condition refs for editing.
void MoveConditionDown(size_t index)
Moves the condition at index one position later (swap with index+1).
NodeConditionsEditModal(ConditionPresetRegistry ®istry)
Constructs the modal bound to a global preset registry.
void RenderFooterButtons()
ConditionPresetRegistry & m_registry
Shared global registry.
void Close()
Closes the modal without confirming changes.
void SetLogicalOp(size_t index, LogicalOp op)
Sets the logical operator for the condition at the given index.
< Provides AssetID and INVALID_ASSET_ID
LogicalOp
How this condition is combined with the one preceding it.
@ Start
First condition in the list (no logical combinator)
A globally-stored, reusable condition expression.
One entry in a NodeBranch's conditions list.