7#include "../../third_party/imgui/imgui.h"
8#include "../../BlueprintEditor/ConditionRef.h"
9#include "../../BlueprintEditor/MathOpOperand.h"
69 ImGui::PopStyleColor();
75 const bool editorOpen = ImGui::CollapsingHeader(
77 ImGui::PopStyleColor();
84 ImGui::Text(
"Left Operand (A):");
92 ImGui::Text(
"Operator:");
100 ImGui::Text(
"Right Operand (B):");
109 const char*
modes[] = {
"Variable",
"Const",
"Pin" };
144 std::string label =
"Variable Name##var" +
operand.variableName;
153 ImGui::Text(
"(e.g., \"mSpeed\", \"mHealth\")");
161 std::string label =
"Constant Value##const" +
operand.constValue;
167 ImGui::Text(
"(e.g., \"5.0\", \"100\")");
172 ImGui::Text(
"Pin Selection:");
176 ImGui::Text(
"(No dynamic pins yet)");
179 std::string
pinLabel =
"Pin #" + std::to_string(
i) +
": " +
183 if (ImGui::Selectable(
pinLabel.c_str(), selected)) {
198 const char*
operators[] = {
"+",
"-",
"*",
"/",
"%",
"^" };
202 for (
int i = 0;
i < 6; ++
i) {
220 const bool pinsOpen = ImGui::CollapsingHeader(
"Dynamic Pins (Read-Only)");
221 ImGui::PopStyleColor();
228 ImGui::BulletText(
"%s (Pin ID: %s)",
ComponentTypeID GetComponentTypeID_Static()
UI Properties panel for a MathOp node – operand editor.
Manages the global pool of ConditionPreset objects.
Generates, tracks, and invalidates DynamicDataPin objects for a node.
bool m_dirty
Changed since last ClearDirty()
void SetNodeName(const std::string &name)
Sets the node name displayed in the title section.
void SetDynamicPins(const std::vector< DynamicDataPin > &pins)
Provides the read-only list of dynamic pins for display.
MathOpRef m_mathOpRef
Current operand configuration.
void RenderPinModeSelector(MathOpOperand &operand)
Helper to render Pin mode selector (list of available pins).
std::string m_nodeName
Node name for display.
void RenderVariableModeInput(MathOpOperand &operand)
Helper to render Variable mode input field.
void RenderOperatorSelector()
Renders the operator dropdown ("+", "-", "*", "/", "%", "^").
void SetMathOpRef(const MathOpRef &ref)
Sets the MathOpRef to edit.
void RenderTitleSection()
Renders the title section (node name in blue background).
void RenderDynamicPinsSection()
Renders the dynamic pins section (read-only display).
void RenderConstModeInput(MathOpOperand &operand)
Helper to render Const mode input field.
const MathOpRef & GetMathOpRef() const
Returns the current (possibly modified) MathOpRef.
void RenderInlineOperandEditor()
Renders the operand editor (collapsible section with 3 rows).
MathOpPropertyPanel(ConditionPresetRegistry ®istry, DynamicDataPinManager &dynamicPinMgr)
Constructs the panel bound to a preset registry.
void RenderOperandRow(int rowIndex, MathOpOperand &operand)
Renders one operand row with mode selector and value input.
std::vector< DynamicDataPin > m_dynamicPins
Read-only dynamic pins display.
std::function< void()> m_onOperandChange
Callback when operands change.
void Render()
Renders the panel into the current ImGui context.
< Provides AssetID and INVALID_ASSET_ID
Represents one arithmetic operand (left A, right B) in a MathOp node.
Mode
Discriminates the data source of this operand.
@ Variable
References a blackboard variable by name.
@ Const
Literal constant value.
@ Pin
External data-input pin on the owning node.
Complete reference for a MathOp node: left operand, operator, right operand.
MathOpOperand leftOperand
Left-hand side operand (A)
std::string mathOperator
Arithmetic operator: "+", "-", "*", "/", "%", "^".
MathOpOperand rightOperand
Right-hand side operand (B)