TDME2  1.9.200
TextEditorTabView.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 #include <unordered_map>
6 
7 #include <tdme/tdme.h>
20 
21 using std::string;
22 using std::to_string;
23 using std::unique_ptr;
24 using std::unordered_map;
25 
41 
42 /**
43  * Text editor tab view
44  * @author Andreas Drewke
45  */
47  : public TabView
48  , public ContextMenuScreenController::MiniScriptMethodSelectionListener
49 {
50 protected:
51  unique_ptr<Engine> engine;
52 
53 private:
54  static constexpr int MINISCRIPT_SCRIPTIDX_STRUCTURE { -1 };
55 
56  EditorView* editorView { nullptr };
57  string tabId;
58  PopUps* popUps { nullptr };
59  unique_ptr<TextEditorTabController> textEditorTabController;
61  GUIScreenNode* screenNode { nullptr };
62  string fileName;
63  string extension;
65  unique_ptr<GUIMoveListener> guiMoveListener;
66  unique_ptr<GUIStyledTextNodeController::ChangeListener> textNodeChangeListener;
67  unique_ptr<GUIStyledTextNodeController::CodeCompletionListener> textNodeCodeCompletionListener;
68  unique_ptr<const TextFormatter::CodeCompletion> codeCompletion;
69 
73  string display;
74  string name;
75  vector<string> parameters;
76  string returnValue;
77  };
78 
80 
81  float scrollX { 0.0f };
82  float scrollY { 0.0f };
83 
84  unique_ptr<DynamicColorTexture> linesTexture;
86 
87  struct Node {
89  string id;
91  string value;
92  EngineMiniScript::ScriptVariableType returnValueType;
93  int left;
94  int top;
95  };
96 
97  struct Connection {
100  string srcNodeId;
101  string dstNodeId;
102  uint8_t red;
103  uint8_t green;
104  uint8_t blue;
105  uint8_t alpha;
106  int x1;
107  int y1;
108  int x2;
109  int y2;
110  };
111 
113  string name;
114  EngineMiniScript::ScriptSyntaxTreeNode* conditionSyntaxTree { nullptr };
115  vector<EngineMiniScript::ScriptSyntaxTreeNode*> syntaxTreeNodes;
116  };
117 
118  unordered_map<string, string> methodOperatorMap;
119  unordered_map<string, Node> nodes;
126  };
127  /**
128  * @return Returns the create connection mode name
129  */
131  switch (createConnectionMode) {
132  case CREATECONNECTIONMODE_FLOW_OUT: return "Flow Output";
133  case CREATECONNECTIONMODE_FLOW_IN: return "Flow Input";
134  case CREATECONNECTIONMODE_ARGUMENT_OUT: return "Argument Output";
135  case CREATECONNECTIONMODE_ARGUMENT_IN: return "Argument Input";
136  case CREATECONNECTIONMODE_NONE: return "None";
137  default: return "Invalid";
138  }
139  }
142  vector<Connection> connections;
143  bool visualEditor { false };
144  bool visualCodingEnabled { false };
145 
147  bool countEnabled { false };
148 
149  int nodeIdx;
150 
151  /**
152  * @return start node which is the node with a flow output but no flow input
153  */
154  inline const string getStartNodeId() {
155  // we only look for flow node ids
156  vector<string> flowNodeIds;
157  for (const auto& [nodeId, node]: nodes) {
158  if (node.type != Node::NODETYPE_FLOW) continue;
159  flowNodeIds.push_back(node.id);
160  }
161  // iterate over node ids
162  // iterate over connections
163  // check if a flow connection exists from any node to current node id
164  // if so its not the start node :D
165  for (const auto& nodeId: flowNodeIds) {
166  auto flowNodeId = nodeId + "_fi";
167  auto foundFlowInput = false;
168  for (const auto& connection: connections) {
169  if (connection.type != Connection::CONNECTIONTYPE_FLOW) continue;
170  if (connection.dstNodeId == flowNodeId) {
171  foundFlowInput = true;
172  }
173  }
174  if (foundFlowInput == false) return nodeId;
175  }
176  return string();
177  }
178 
179  /**
180  * Find next node
181  * @param nodeId node id to find next node to
182  * @return next node id
183  */
184  inline const string getNextNodeId(const string& nodeId) {
185  auto flowNodeId = nodeId + "_fo";
186  for (const auto& connection: connections) {
187  if (connection.type != Connection::CONNECTIONTYPE_FLOW) continue;
188  if (connection.srcNodeId == flowNodeId) {
189  //
190  auto separatorIdx = connection.dstNodeId.find('_');
191  return StringTools::substring(connection.dstNodeId, 0, separatorIdx == string::npos?connection.dstNodeId.size():separatorIdx);
192  }
193  }
194  return string();
195  }
196 
197  /**
198  * Create argument node id
199  * @param nodeId node id
200  * @param argumentIdx argument index
201  * @return argument node id
202  */
203  inline const string getArgumentNodeId(const string& nodeId, int argumentIdx) {
204  return nodeId + "_a" + to_string(argumentIdx);
205  }
206 
207  /**
208  * Find argument node id
209  * @param nodeId node id
210  * @param argumentIdx argument index
211  * @return argument node id
212  */
213  inline const string getConnectedArgumentNodeId(const string& nodeId, int argumentIdx) {
214  auto argumentNodeId = getArgumentNodeId(nodeId, argumentIdx);
215  for (const auto& connection: connections) {
216  if (connection.type != Connection::CONNECTIONTYPE_ARGUMENT) continue;
217  if (connection.srcNodeId == argumentNodeId) {
218  //
219  auto separatorIdx = connection.dstNodeId.find('_');
220  return StringTools::substring(connection.dstNodeId, 0, separatorIdx == string::npos?connection.dstNodeId.size():separatorIdx);
221  }
222  }
223  return string();
224  }
225 
226  /**
227  * Create condition node id
228  * @param nodeId node id
229  * @param conditionIdx condition index
230  * @return condition node id
231  */
232  inline const string getConditionNodeId(const string& nodeId, int conditionIdx) {
233  return nodeId + "_c" + to_string(conditionIdx);
234  }
235 
236  /**
237  * Find condition node id
238  * @param nodeId node id
239  * @param conditionIdx condition index
240  * @return condition node id
241  */
242  inline const string getConnectedConditionNodeId(const string& nodeId, int conditionIdx) {
243  auto conditionNodeId = getConditionNodeId(nodeId, conditionIdx);
244  for (const auto& connection: connections) {
245  if (connection.type != Connection::CONNECTIONTYPE_ARGUMENT) continue;
246  if (connection.srcNodeId == conditionNodeId) {
247  //
248  auto separatorIdx = connection.dstNodeId.find('_');
249  return StringTools::substring(connection.dstNodeId, 0, separatorIdx == string::npos?connection.dstNodeId.size():separatorIdx);
250  }
251  }
252  return string();
253  }
254 
255  /**
256  * Create branch node id
257  * @param nodeId node id
258  * @param branchIdx branch index
259  * @return branch node id
260  */
261  inline const string getBranchNodeId(const string& nodeId, int branchIdx) {
262  return nodeId + "_b" + to_string(branchIdx);
263  }
264 
265  /**
266  * Find branch node id
267  * @param nodeId node id
268  * @param branchIdx branch index
269  * @return branch node id
270  */
271  inline const string getConnectedBranchNodeId(const string& nodeId, int branchIdx) {
272  auto branchNodeId = getBranchNodeId(nodeId, branchIdx);
273  for (const auto& connection: connections) {
274  if (connection.type != Connection::CONNECTIONTYPE_FLOW) continue;
275  if (connection.srcNodeId == branchNodeId) {
276  //
277  auto separatorIdx = connection.dstNodeId.find('_');
278  return StringTools::substring(connection.dstNodeId, 0, separatorIdx == string::npos?connection.dstNodeId.size():separatorIdx);
279  }
280  }
281  return string();
282  }
283 
284  /**
285  * Get node by id
286  * @param nodeId node id
287  * @return node
288  */
289  inline Node* getNodeById(const string& nodeId) {
290  auto nodeIt = nodes.find(nodeId);
291  if (nodeIt != nodes.end()) return &nodeIt->second;
292  return nullptr;
293  }
294 
295  /**
296  * Get script variable type pin color
297  * @param type type
298  * @return string with color property name from theme
299  */
300  inline const string getScriptVariableTypePinColor(EngineMiniScript::ScriptVariableType type) {
301  switch (type) {
302  case EngineMiniScript::ScriptVariableType::TYPE_BOOLEAN:
303  return string("color.pintype_boolean");
304  case EngineMiniScript::ScriptVariableType::TYPE_INTEGER:
305  return string("color.pintype_integer");
306  case EngineMiniScript::ScriptVariableType::TYPE_FLOAT:
307  return string("color.pintype_float");
308  case EngineMiniScript::ScriptVariableType::TYPE_STRING:
309  return string("color.pintype_string");
310  case EngineMiniScript::TYPE_VECTOR2:
311  case EngineMiniScript::TYPE_VECTOR3:
312  case EngineMiniScript::TYPE_VECTOR4:
313  return string("color.pintype_vector");
314  case EngineMiniScript::TYPE_QUATERNION:
315  case EngineMiniScript::TYPE_MATRIX3x3:
316  case EngineMiniScript::TYPE_MATRIX4x4:
317  case EngineMiniScript::TYPE_TRANSFORM:
318  return string("color.pintype_transform");
319  case EngineMiniScript::ScriptVariableType::TYPE_ARRAY:
320  case EngineMiniScript::ScriptVariableType::TYPE_MAP:
321  case EngineMiniScript::ScriptVariableType::TYPE_SET:
322  case EngineMiniScript::ScriptVariableType::TYPE_PSEUDO_MIXED:
323  case EngineMiniScript::ScriptVariableType::TYPE_NULL:
324  return string("color.pintype_undefined");
325  case EngineMiniScript::ScriptVariableType::TYPE_PSEUDO_NUMBER:
326  return string("color.pintype_float");
327  }
328  return string("color.pintype_undefined");
329  }
330 
331  const array<string, 6> flowControlNodes = {
332  "if",
333  "elseif",
334  "else",
335  "forTime",
336  "forCondition",
337  "end",
338  };
339 
340  const array<string, 12> mathNodes = {
341  "int",
342  "float",
343  "math",
344  "vec2",
345  "vec3",
346  "vec4",
347  "mat3",
348  "mat4",
349  "quaternion",
350  "mat3",
351  "mat4",
352  "transform"
353  };
354 
355 public:
356  // forbid class copy
358 
359  /**
360  * Public constructor
361  * @param editorView editor view
362  * @param tabId tab id
363  * @param screenNode screenNode
364  * @param fileName file name
365  */
367 
368  /**
369  * Destructor
370  */
372 
373  /**
374  * @return file name
375  */
376  inline const string& getFileName() {
377  return fileName;
378  }
379 
380  /**
381  * @return lower case extension
382  */
383  inline const string& getExtension() {
384  return extension;
385  }
386 
387  /**
388  * Save file
389  * @param pathName path name
390  * @param fileName file name
391  */
392  void saveFile(const string& pathName, const string& fileName);
393 
394  /**
395  * @return code completion
396  * TODO: maybe move me into controller
397  */
398  const TextFormatter::CodeCompletion* getCodeCompletion() {
399  return codeCompletion.get();
400  }
401 
402  /**
403  * @return editor view
404  */
406  return editorView;
407  }
408 
409  /**
410  * @return tab screen node
411  */
413  return screenNode;
414  }
415 
416  /**
417  * @return associated tab controller
418  */
419  inline TabController* getTabController() override {
420  return textEditorTabController.get();
421  }
422 
423  /**
424  * @return pop up views
425  */
426  inline PopUps* getPopUps() {
427  return popUps;
428  }
429 
430  /**
431  * @return is showing visual editor
432  */
433  inline bool isVisualEditor() {
434  return visualEditor;
435  }
436 
437  /**
438  * Set visual editor
439  */
440  void setVisualEditor();
441 
442  /**
443  * Set code editor
444  */
445  void setCodeEditor();
446 
447  /**
448  * Create EngineMiniScript node
449  * @param methodName method name
450  * @param id id
451  * @param x x
452  * @param y y
453  */
454  void createMiniScriptNode(const string& methodName, int x, int y);
455 
456  /**
457  * Get EngineMiniScript node flattened id from hierarchical id
458  * @param hierarchicalId hierarchical id
459  * @return flattened id
460  */
461  inline const string getMiniScriptNodeFlattenedId(unordered_map<string, string>& idMapping, const string& hierarchicalId) {
462  auto idMappingIt = idMapping.find(hierarchicalId);
463  if (idMappingIt != idMapping.end()) {
464  return idMappingIt->second;
465  }
466  auto flattenedId = to_string(idMapping.size());
467  idMapping[hierarchicalId] = flattenedId;
468  return flattenedId;
469  }
470 
471  /**
472  * Adds a delta X value to UI node with given id and all nodes down the statement syntax tree
473  * @param idMapping id mapping
474  * @param id id
475  * @param syntaxTreeNode syntax tree node
476  * @param deltaX delta X
477  */
478  void addMiniScriptNodeDeltaX(unordered_map<string, string>& idMapping, const string& id, const EngineMiniScript::ScriptSyntaxTreeNode& syntaxTreeNode, int deltaX);
479 
480  /**
481  * Create UI nodes for EngineMiniScript script node syntax tree, which matches a event or function in EngineMiniScript
482  * @param idMapping id mapping
483  * @param id id
484  * @param scriptType script type
485  * @param condition condition
486  * @param readableName readableName
487  * @param conditionSyntaxTreeNode condition syntax tree node
488  * @param x x
489  * @param y y
490  * @param width width
491  * @param height height
492  * @param createdNodeIds created node ids
493  */
494  void createMiniScriptScriptNode(unordered_map<string, string>& idMapping, const string& id, EngineMiniScript::Script::ScriptType scriptType, const string& condition, const string& readableName, const EngineMiniScript::ScriptSyntaxTreeNode* conditionSyntaxTreeNode, int x, int y, int& width, int& height);
495 
496  /**
497  * Create UI nodes for given statement syntax tree, which matches a statement in miniscript
498  * @param idMapping id mapping
499  * @param id id
500  * @param syntaxTreeNodeIdx syntax tree node index
501  * @param syntaxTreeNodeCount syntax tree node count
502  * @param syntaxTreeNode syntax tree node
503  * @param nodeType node type
504  * @param x x
505  * @param y y
506  * @param width width
507  * @param height height
508  * @oaram createdNodeIds created node ids
509  * @param depth depth
510  */
511  void createMiniScriptNodes(unordered_map<string, string>& idMapping, const string& id, int syntaxTreeNodeIdx, int syntaxTreeNodeCount, const EngineMiniScript::ScriptSyntaxTreeNode* syntaxTreeNode, Node::NodeType nodeType, int x, int y, int& width, int& height, vector<string>& createdNodeIds, int depth = 0);
512 
513  /**
514  * Create UI nodes for branch nodes like if, elseif, else, end; forTime, end; forCondition, end
515  * @param idMapping id mapping
516  * @param id id
517  * @param syntaxTreeNodeIdx syntax tree node index
518  * @param syntaxTreeNodeCount syntax tree node count
519  * @param syntaxTreeNode syntax tree node
520  * @param nodeType node type
521  * @param branches branches
522  * @param x x
523  * @param y y
524  * @param width width
525  * @param height height
526  * @oaram createdNodeIds created node ids
527  * @param depth depth
528  */
529  void createMiniScriptBranchNodes(unordered_map<string, string>& idMapping, const string& id, int syntaxTreeNodeIdx, int syntaxTreeNodeCount, const EngineMiniScript::ScriptSyntaxTreeNode* syntaxTreeNode, Node::NodeType nodeType, const vector<MiniScriptBranch>& branches, int x, int y, int& width, int& height, vector<string>& createdNodeIds, int depth = 0);
530 
531  /**
532  * @return EngineMiniScript script index
533  */
534  inline int getMiniScriptScriptIdx() {
535  return miniScriptScriptIdx;
536  }
537 
538  /**
539  * Set method -> operator map
540  * @param methodOperatorMap method operator map
541  */
542  inline void setMiniScriptMethodOperatorMap(const unordered_map<string, string>& methodOperatorMap) {
543  this->methodOperatorMap = methodOperatorMap;
544  }
545 
546  /**
547  * Handle EngineMiniScript branch
548  * @param idMapping id mapping
549  * @param idPrefix id prefix
550  * @param syntaxTree syntax tree
551  * @param i iterator
552  * @param x x
553  * @param y y
554  * @param width width
555  * @param height height
556  * @oaram createdNodeIds created node ids
557  */
558  bool handleMiniScriptBranch(unordered_map<string, string>& idMapping, const string& idPrefix, const vector<EngineMiniScript::ScriptSyntaxTreeNode*>& syntaxTree, int& i, int x, int y, int& width, int& height, vector<string>& createdNodeIds);
559 
560  /**
561  * Update miniscript syntax tree
562  * @param miniScriptScriptIdx EngineMiniScript script index
563  */
565 
566  /**
567  * Create miniscript connections
568  */
570 
571  // overridden methods
572  void handleInputEvents() override;
573  void display() override;
574  inline const string& getTabId() override {
575  return tabId;
576  }
577  void initialize() override;
578  void dispose() override;
579  Engine* getEngine() override;
580  void activate() override;
581  void deactivate() override;
582  void reloadOutliner() override;
583  inline bool hasFixedSize() override{ return false; };
584  void updateRendering() override;
585  void onMethodSelection(const string& methodName);
586 
587  /**
588  * @return text index
589  */
590  int getTextIndex();
591 
592  /**
593  * Find string
594  * @param findString find string
595  * @param matchCase only find string that also matches case in find string
596  * @param wholeWord only find whole worlds
597  * @param selection only find in selection
598  * @param firstSearch first search
599  * @param index index
600  * @return success
601  */
602  bool find(const string& findString, bool matchCase, bool wholeWord, bool selection, bool firstSearch, int& index);
603 
604  /**
605  * Count string
606  * @param findString find string
607  * @param matchCase only find string that also matches case in find string
608  * @param wholeWord only find whole worlds
609  * @param selection only find in selection
610  */
611  int count(const string& findString, bool matchCase, bool wholeWord, bool selection);
612 
613  /**
614  * Replace string
615  * @param findString find string
616  * @param replaceString replace string
617  * @param matchCase only find string that also matches case in find string
618  * @param wholeWord only find whole worlds
619  * @param selection only find in selection
620  * @param index index
621  * @return success
622  */
623  bool replace(const string& findString, const string& replaceString, bool matchCase, bool wholeWord, bool selection, int& index);
624 
625  /**
626  * Replace all string
627  * @param findString find string
628  * @param replaceString replace string
629  * @param matchCase only find string that also matches case in find string
630  * @param wholeWord only find whole worlds
631  * @param selection only find in selection
632  * @return success
633  */
634  bool replaceAll(const string& findString, const string& replaceString, bool matchCase, bool wholeWord, bool selection);
635 
636  /**
637  * Cancel find
638  */
639  void cancelFind();
640 
641  /**
642  * Redo
643  */
644  void redo();
645 
646  /**
647  * Redo
648  */
649  void undo();
650 
651  /**
652  * Select all
653  */
654  void selectAll();
655 
656  /**
657  * Cut
658  */
659  void cut();
660 
661  /**
662  * Copy
663  */
664  void copy();
665 
666  /**
667  * Paste
668  */
669  void paste();
670 
671  /**
672  * Delete
673  */
674  void delete_();
675 
676  /**
677  * Create source code from nodes
678  * @param sourceCode source code
679  * @param node node
680  * @param depth depth
681  */
682  void createSourceCodeFromNodes(string& sourceCode, const Node* node, int depth = 0);
683 
684  /**
685  * Create source code from node
686  * @param sourceCode source code
687  * @param node node
688  * @param depth depth
689  */
690  void createSourceCodeFromNode(string& sourceCode, const Node* node, int depth = 0);
691 
692  /**
693  * Delete connection
694  * @param nodeId node id
695  */
696  void deleteConnection(const string& nodeId);
697 
698  /**
699  * Delete node
700  * @param nodeId node id
701  */
702  void deleteNode(const string& nodeId);
703 
704  /**
705  * Returns if creating a connection currently
706  * @return if creating a connection currently
707  */
708  inline bool isCreatingConnection() {
710  }
711 
712  /**
713  * Create connection with given start or end node id
714  * @param guiNodeId GUI node id
715  */
716  void createConnection(const string& guiNodeId);
717 
718  /**
719  * Finish creating connection
720  * @param mouseX mouse X
721  * @param mouseY mouse Y
722  */
723  void finishCreateConnection(int mouseX, int mouseY);
724 
725  /**
726  * Set up context menu
727  */
728  void setupContextMenu();
729 };
Engine main class.
Definition: Engine.h:131
GUI parent node base class thats supporting child nodes.
Definition: GUIParentNode.h:42
GUI screen node that represents a screen that can be rendered via GUI system.
Definition: GUIScreenNode.h:72
Pop ups controller accessor class.
Definition: PopUps.h:29
void saveFile(const string &pathName, const string &fileName)
Save file.
const string getConnectedBranchNodeId(const string &nodeId, int branchIdx)
Find branch node id.
const string getScriptVariableTypePinColor(EngineMiniScript::ScriptVariableType type)
Get script variable type pin color.
void finishCreateConnection(int mouseX, int mouseY)
Finish creating connection.
bool hasFixedSize() override
If this viewport framebuffer has a fixed size.
unique_ptr< GUIStyledTextNodeController::CodeCompletionListener > textNodeCodeCompletionListener
const string getNextNodeId(const string &nodeId)
Find next node.
void createSourceCodeFromNodes(string &sourceCode, const Node *node, int depth=0)
Create source code from nodes.
TextEditorTabView(EditorView *editorView, const string &tabId, GUIScreenNode *screenNode, const string &fileName)
Public constructor.
bool replace(const string &findString, const string &replaceString, bool matchCase, bool wholeWord, bool selection, int &index)
Replace string.
void setMiniScriptMethodOperatorMap(const unordered_map< string, string > &methodOperatorMap)
Set method -> operator map.
void initialize() override
Initiates the view.
static const string getCreateConnectionModeName(CreateConnectionMode createConnectionMode)
Node * getNodeById(const string &nodeId)
Get node by id.
void handleInputEvents() override
Handle input events that have not yet been processed.
void createSourceCodeFromNode(string &sourceCode, const Node *node, int depth=0)
Create source code from node.
void deleteConnection(const string &nodeId)
Delete connection.
bool handleMiniScriptBranch(unordered_map< string, string > &idMapping, const string &idPrefix, const vector< EngineMiniScript::ScriptSyntaxTreeNode * > &syntaxTree, int &i, int x, int y, int &width, int &height, vector< string > &createdNodeIds)
Handle EngineMiniScript branch.
const string getBranchNodeId(const string &nodeId, int branchIdx)
Create branch node id.
unique_ptr< const TextFormatter::CodeCompletion > codeCompletion
bool isCreatingConnection()
Returns if creating a connection currently.
unique_ptr< TextEditorTabController > textEditorTabController
const TextFormatter::CodeCompletion * getCodeCompletion()
void createMiniScriptNode(const string &methodName, int x, int y)
Create EngineMiniScript node.
const string getMiniScriptNodeFlattenedId(unordered_map< string, string > &idMapping, const string &hierarchicalId)
Get EngineMiniScript node flattened id from hierarchical id.
unordered_map< string, string > methodOperatorMap
void addMiniScriptNodeDeltaX(unordered_map< string, string > &idMapping, const string &id, const EngineMiniScript::ScriptSyntaxTreeNode &syntaxTreeNode, int deltaX)
Adds a delta X value to UI node with given id and all nodes down the statement syntax tree.
void createMiniScriptBranchNodes(unordered_map< string, string > &idMapping, const string &id, int syntaxTreeNodeIdx, int syntaxTreeNodeCount, const EngineMiniScript::ScriptSyntaxTreeNode *syntaxTreeNode, Node::NodeType nodeType, const vector< MiniScriptBranch > &branches, int x, int y, int &width, int &height, vector< string > &createdNodeIds, int depth=0)
Create UI nodes for branch nodes like if, elseif, else, end; forTime, end; forCondition,...
void createConnection(const string &guiNodeId)
Create connection with given start or end node id.
const string getConnectedConditionNodeId(const string &nodeId, int conditionIdx)
Find condition node id.
void deleteNode(const string &nodeId)
Delete node.
int count(const string &findString, bool matchCase, bool wholeWord, bool selection)
Count string.
unique_ptr< GUIStyledTextNodeController::ChangeListener > textNodeChangeListener
bool find(const string &findString, bool matchCase, bool wholeWord, bool selection, bool firstSearch, int &index)
Find string.
void createMiniScriptConnections()
Create miniscript connections.
void updateMiniScriptSyntaxTree(int miniScriptScriptIdx)
Update miniscript syntax tree.
void updateRendering() override
Update rendering.
void createMiniScriptScriptNode(unordered_map< string, string > &idMapping, const string &id, EngineMiniScript::Script::ScriptType scriptType, const string &condition, const string &readableName, const EngineMiniScript::ScriptSyntaxTreeNode *conditionSyntaxTreeNode, int x, int y, int &width, int &height)
Create UI nodes for EngineMiniScript script node syntax tree, which matches a event or function in En...
const string getArgumentNodeId(const string &nodeId, int argumentIdx)
Create argument node id.
unique_ptr< DynamicColorTexture > linesTexture
void createMiniScriptNodes(unordered_map< string, string > &idMapping, const string &id, int syntaxTreeNodeIdx, int syntaxTreeNodeCount, const EngineMiniScript::ScriptSyntaxTreeNode *syntaxTreeNode, Node::NodeType nodeType, int x, int y, int &width, int &height, vector< string > &createdNodeIds, int depth=0)
Create UI nodes for given statement syntax tree, which matches a statement in miniscript.
const string getConditionNodeId(const string &nodeId, int conditionIdx)
Create condition node id.
bool replaceAll(const string &findString, const string &replaceString, bool matchCase, bool wholeWord, bool selection)
Replace all string.
const string getConnectedArgumentNodeId(const string &nodeId, int argumentIdx)
Find argument node id.
String tools class.
Definition: StringTools.h:22
GUI move listener interface.
Tab controller, which connects UI with logic.
Definition: TabController.h:34
vector< EngineMiniScript::ScriptSyntaxTreeNode * > syntaxTreeNodes
EngineMiniScript::ScriptVariableType returnValueType
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6