BVB Source Codes

CRYENGINE Show FlowExecuteStringNode.cpp Source code

Return Download CRYENGINE: download FlowExecuteStringNode.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4.  
  5. #include <CryFlowGraph/IFlowBaseNode.h>
  6.  
  7. class CFlowNode_ExecuteString : public CFlowBaseNode<eNCT_Singleton>
  8. {
  9. public:
  10.         CFlowNode_ExecuteString(SActivationInfo* pActInfo) {}
  11.  
  12.         enum EInPorts
  13.         {
  14.                 SET = 0,
  15.                 STRING,
  16.                 NEXT_FRAME,
  17.         };
  18.  
  19.         virtual void GetConfiguration(SFlowNodeConfig& config)
  20.         {
  21.                 static const SInputPortConfig in_config[] = {
  22.                         InputPortConfig<SFlowSystemVoid>("Set", _HELP("Trigger to Set CVar's value")),
  23.                         InputPortConfig<string>("String",       _HELP("String you want to execute")),
  24.                         InputPortConfig<bool>("NextFrame",      false,                                _HELP("If true it will execute the command next frame")),
  25.                         { 0 }
  26.                 };
  27.                 static const SOutputPortConfig out_config[] = {
  28.                         { 0 }
  29.                 };
  30.                 config.sDescription = _HELP("Executes a string like when using the console");
  31.                 config.pInputPorts = in_config;
  32.                 config.pOutputPorts = out_config;
  33.                 config.SetCategory(EFLN_DEBUG);
  34.         }
  35.  
  36.         virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
  37.         {
  38.                 if (event == eFE_Activate)
  39.                 {
  40.                         const bool isSet = (IsPortActive(pActInfo, SET));
  41.                         if (isSet)
  42.                         {
  43.                                 const string& stringToExecute = GetPortString(pActInfo, STRING);
  44.                                 const bool nextFrame = GetPortBool(pActInfo, NEXT_FRAME);
  45.                                 gEnv->pConsole->ExecuteString(stringToExecute, true, nextFrame);
  46.                                 ;
  47.                         }
  48.                 }
  49.         }
  50.  
  51.         virtual void GetMemoryUsage(ICrySizer* s) const
  52.         {
  53.                 s->Add(*this);
  54.         }
  55. };
  56.  
  57. REGISTER_FLOW_NODE("Debug:ExecuteString", CFlowNode_ExecuteString);
  58.  
downloadFlowExecuteStringNode.cpp Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top