| 85 | } |
| 86 | |
| 87 | void 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 | |
| 106 | void ScriptObject::removeFunctionParameters() |
| 107 | { |