MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / loadCommandScript

Method loadCommandScript

plugins/script/ScriptingSystem.cpp:150–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150void ScriptingSystem::loadCommandScript(const std::string& scriptFilename)
151{
152 auto command = _pythonModule->createScriptCommand(_scriptPath, scriptFilename);
153
154 if (!command)
155 {
156 // The python module already emitted some errors to the log, just exit
157 return;
158 }
159
160 // Try to register this named command
161 auto result = _commands.emplace(command->getName(), command);
162
163 // Result.second is TRUE if the insert succeeded
164 if (result.second)
165 {
166 rMessage() << "Registered script file " << scriptFilename << " as " << command->getName() << std::endl;
167 }
168 else
169 {
170 rError() << "Error in " << scriptFilename << ": Script command "
171 << command->getName() << " has already been registered in "
172 << _commands[command->getName()]->getFilename() << std::endl;
173 }
174}
175
176void ScriptingSystem::reloadScripts()
177{

Callers

nothing calls this directly

Calls 5

rMessageFunction · 0.85
rErrorFunction · 0.85
createScriptCommandMethod · 0.80
getNameMethod · 0.45
getFilenameMethod · 0.45

Tested by

no test coverage detected