40#include "../ConditionPreset/ConditionPreset.h"
41#include "../../TaskSystem/LocalBlackboard.h"
190 void SetName(
const std::string& name);
ComponentTypeID GetComponentTypeID_Static()
Modal dialog for creating or editing a single ConditionPreset.
void SetLocalVariables(const std::vector< BlackboardEntry > &localVars)
Sets the list of local variables from EntityBlackboard.
bool IsConfirmed() const
Returns true if the user pressed "Save" / "OK".
void SetOperator(const std::string &op)
Sets the comparison operator.
void SetName(const std::string &name)
Sets the display name of the working preset.
void Close()
Closes the dialog without confirming.
bool IsOpen() const
Returns true if the dialog is open.
ConditionPresetEditDialog()
Constructs the dialog in Create mode with a blank preset.
ConditionPreset m_workingCopy
In-progress edits.
bool Confirm()
Confirms the dialog programmatically (equivalent to pressing Save).
ConditionPreset GetResult() const
Returns a copy of the working preset (contains the current form state).
static bool IsValidOperator(const std::string &op)
Returns true if the given operator string is recognised.
void SetRightVariable(const std::string &varName)
Sets the right variable name.
void SetRightPin(const std::string &pinRef)
Sets the right pin reference (relevant when rightMode == "Pin").
std::vector< BlackboardEntry > m_localVariables
Local variables from entity (Phase 24)
void Open()
Opens the dialog.
~ConditionPresetEditDialog()=default
static bool IsOperandFilled(const Operand &operand)
Returns true if the operand is sufficiently filled.
static bool IsValidMode(const std::string &mode)
Returns true if the given mode string is recognised.
const Operand & GetRightOperand() const
Returns the current right operand.
void RenderOperatorSelector()
ComparisonOp GetOperator() const
Returns the current comparison operator.
void SetLeftPin(const std::string &pinRef)
Sets the left pin reference.
std::string GetPreview() const
Returns a live preview string of the current condition.
const Operand & GetLeftOperand() const
Returns the current left operand.
void RenderOperandSelector(const char *label, bool isLeft)
void RenderConfirmButtons()
void SetLeftVariable(const std::string &varName)
Sets the left variable name (relevant when leftMode == "Variable").
void SetLeftConst(double value)
Sets the left constant value.
bool IsValid() const
Returns true if the current condition is valid and can be saved.
void Render()
Renders the modal dialog using ImGui.
Mode
Whether the dialog creates a new preset or edits an existing one.
@ Create
New preset (form starts empty)
@ Edit
Existing preset (form pre-populated)
Mode GetMode() const
Returns the dialog mode (Create or Edit).
void SetRightMode(const std::string &mode)
Sets the right operand mode.
void SetLeftMode(const std::string &mode)
Sets the left operand mode.
void SetRightConst(double value)
Sets the right constant value.
< Provides AssetID and INVALID_ASSET_ID
ComparisonOp
The relational operator used in a ConditionPreset.
A globally-stored, reusable condition expression.
One side of a ConditionPreset comparison expression.