mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 23:12:16 +02:00
Script messaging fix
This commit is contained in:
parent
dfbc1d8865
commit
d75efdb4ca
3 changed files with 7 additions and 2 deletions
|
@ -251,7 +251,7 @@ signals:
|
|||
* Triggered when any script generates an information message or {@link console.info} is called.
|
||||
* @function ScriptDiscoveryService.infoMessage
|
||||
* @param {string} message - The information message.
|
||||
* @param {string} scriptName - The name of the script that generated the informaton message.
|
||||
* @param {string} scriptName - The name of the script that generated the information message.
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void infoMessage(const QString& message, const QString& engineName);
|
||||
|
|
|
@ -1317,7 +1317,7 @@ QUrl ScriptManager::resourcesPath() const {
|
|||
}
|
||||
|
||||
void ScriptManager::print(const QString& message) {
|
||||
emit printedMessage(message, getFilename());
|
||||
emit scriptPrintedMessage(message, getFilename(), engine()->currentContext()->currentLineNumber());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@ QJsonObject ScriptMessage::toJson() {
|
|||
}
|
||||
|
||||
bool ScriptMessage::fromJson(const QJsonObject &object) {
|
||||
if (object.isEmpty()) {
|
||||
qDebug() << "ScriptMessage::fromJson object is empty";
|
||||
return false;
|
||||
}
|
||||
if (!object["message"].isString()
|
||||
|| !object["lineNumber"].isDouble()
|
||||
|| !object["fileName"].isString()
|
||||
|
@ -40,4 +44,5 @@ bool ScriptMessage::fromJson(const QJsonObject &object) {
|
|||
_entityID = QUuid::fromString(object["entityID"].toString());
|
||||
_scriptType = static_cast<ScriptMessage::ScriptType>(object["type"].toInt());
|
||||
_severity = static_cast<ScriptMessage::Severity>(object["severity"].toInt());
|
||||
return true;
|
||||
}
|
Loading…
Reference in a new issue