MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / addFunctionParameters

Method addFunctionParameters

Simulator/ScriptObject.cpp:87–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void ScriptObject::addFunctionParameters()
88{
89 auto functions = Embedded::getCurrent()->getFunctions();
90 int counter = 1;
91 for (auto iter = functions.begin(); iter != functions.end(); iter++)
92 {
93 std::string command_name = *iter;
94 std::string name = "embedded_function_" + std::to_string(counter);
95 auto tmp = createFunctionParameter(name, command_name, [&, command_name]() {
96 if (m_scriptLoaded)
97 Embedded::getCurrent()->exec_fct(m_scriptModule, command_name);
98 });
99 //setHotKey(tmp, "x");
100 setGroup(tmp, "Scripts");
101 setDescription(tmp, "Execute a function in the script.");
102 counter++;
103 }
104}
105
106void ScriptObject::removeFunctionParameters()
107{

Callers

nothing calls this directly

Calls 4

exec_fctMethod · 0.80
to_stringFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected