23#include "../system/system_utils.h"
24#include "../system/system_consts.h"
25#include "../third_party/imgui/imgui.h"
26#include "../third_party/imnodes/imnodes.h"
59 [](
const BlackboardEntry&
e) {
61 SYSTEM_LOG <<
"[VSEditor] ValidateAndClean: removing entry with empty key\n";
65 SYSTEM_LOG <<
"[VSEditor] ValidateAndClean: removing entry '"
66 << e.Key <<
"' with VariableType::None\n";
77 <<
" invalid blackboard entries\n";
95void VisualScriptEditorPanel::CommitPendingBlackboardEdits()
97 for (std::unordered_map<int, std::string>::iterator
it = m_pendingBlackboardEdits.begin();
98 it != m_pendingBlackboardEdits.end(); ++
it)
101 if (
idx >= 0 &&
idx <
static_cast<int>(m_template.Blackboard.size()))
103 m_template.Blackboard[
static_cast<size_t>(
idx)].
Key =
it->second;
106 m_pendingBlackboardEdits.clear();
131void VisualScriptEditorPanel::ResetViewportBeforeSave()
133 SYSTEM_LOG <<
"[VSEditor] ResetViewportBeforeSave: saving current panning\n";
135 m_viewportResetDone =
true;
141 ImNodes::EditorContextResetPanning(
ImVec2(0.0f, 0.0f));
142 SYSTEM_LOG <<
"[VSEditor] ResetViewportBeforeSave: panning reset to (0,0) "
143 <<
"(was " << m_lastViewportPanning.x <<
"," << m_lastViewportPanning.y <<
")\n";
159void VisualScriptEditorPanel::AfterSave()
161 if (!m_viewportResetDone)
165 ImNodes::EditorContextResetPanning(m_lastViewportPanning.ToImVec2());
166 m_viewportResetDone =
false;
167 SYSTEM_LOG <<
"[VSEditor] AfterSave: viewport panning restored to ("
168 << m_lastViewportPanning.x <<
"," << m_lastViewportPanning.y <<
")\n";
226std::vector<BlackboardEntry> VisualScriptEditorPanel::GetVariablesByType(
227 const std::vector<BlackboardEntry>&
allVars,
228 VariableType expectedType)
230 std::vector<BlackboardEntry>
filtered;
233 if (
allVars[
i].Type == expectedType)
257 const std::string&
key,
273 for (
size_t i = 0;
i < m_template.Blackboard.size(); ++
i)
278 if (m_template.Blackboard[
i].Key ==
key)
287 if (isGlobal &&
key.find(
':') == std::string::npos)
290 result.
WarningMessage =
"Global key should follow 'scope:key' format";
307 if (
entry.Key.empty())
309 if (
entry.Type == VariableType::None)
ComponentTypeID GetComponentTypeID_Static()
ImNodes-based graph editor for ATS Visual Script graphs (Phase 5).
std::vector< BlackboardEntry > Blackboard
Local blackboard declared in this graph.
TaskGraphTemplate m_template
The template currently being edited.
void ValidateAndCleanBlackboardEntries()
Removes blackboard entries with empty keys or VariableType::None.
static Vector FromImVec2(const ImVec2 &v)
< Provides AssetID and INVALID_ASSET_ID
@ None
Uninitialized / empty value.
Single entry in the graph's declared blackboard schema (local or global).
Result of blackboard key validation (Phase 26).
std::string WarningMessage
Set if validation succeeded but has warnings.
std::string ErrorMessage
Set if validation failed.