mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 17:17:58 +02:00
add support for an HMD script debug log window
This commit is contained in:
parent
df954cab10
commit
0c9ff87feb
3 changed files with 13 additions and 0 deletions
|
@ -5269,6 +5269,9 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri
|
||||||
auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>();
|
auto scriptingInterface = DependencyManager::get<controller::ScriptingInterface>();
|
||||||
scriptEngine->registerGlobalObject("Controller", scriptingInterface.data());
|
scriptEngine->registerGlobalObject("Controller", scriptingInterface.data());
|
||||||
UserInputMapper::registerControllerTypes(scriptEngine);
|
UserInputMapper::registerControllerTypes(scriptEngine);
|
||||||
|
|
||||||
|
// connect this script engines printedMessage signal to the global ScriptEngines onPrintedMessage
|
||||||
|
connect(scriptEngine, &ScriptEngine::printedMessage, DependencyManager::get<ScriptEngines>().data(), &ScriptEngines::onPrintedMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Application::canAcceptURL(const QString& urlString) const {
|
bool Application::canAcceptURL(const QString& urlString) const {
|
||||||
|
|
|
@ -32,6 +32,11 @@ ScriptsModel& getScriptsModel() {
|
||||||
return scriptsModel;
|
return scriptsModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptEngines::onPrintedMessage(const QString& message) {
|
||||||
|
auto scriptEngine = qobject_cast<ScriptEngine*>(sender());
|
||||||
|
emit printedMessage(message, scriptEngine->getFilename());
|
||||||
|
}
|
||||||
|
|
||||||
ScriptEngines::ScriptEngines()
|
ScriptEngines::ScriptEngines()
|
||||||
: _scriptsLocationHandle("scriptsLocation", DESKTOP_LOCATION)
|
: _scriptsLocationHandle("scriptsLocation", DESKTOP_LOCATION)
|
||||||
{
|
{
|
||||||
|
|
|
@ -74,10 +74,15 @@ signals:
|
||||||
void scriptCountChanged();
|
void scriptCountChanged();
|
||||||
void scriptsReloading();
|
void scriptsReloading();
|
||||||
void scriptLoadError(const QString& filename, const QString& error);
|
void scriptLoadError(const QString& filename, const QString& error);
|
||||||
|
void printedMessage(const QString& message, const QString& filename);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void onPrintedMessage(const QString& message);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void onScriptFinished(const QString& fileNameString, ScriptEngine* engine);
|
void onScriptFinished(const QString& fileNameString, ScriptEngine* engine);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class ScriptEngine;
|
friend class ScriptEngine;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue