mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 19:23:58 +02:00
add support for an HMD script debug log window
This commit is contained in:
parent
0c9ff87feb
commit
1e5e6a12db
2 changed files with 60 additions and 0 deletions
25
scripts/developer/debugging/debugWindow.js
Normal file
25
scripts/developer/debugging/debugWindow.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
//
|
||||
// debugWindow.js
|
||||
//
|
||||
// Brad Hefta-Gaub, created on 12/19/2016.
|
||||
// Copyright 2016 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
|
||||
// Set up the qml ui
|
||||
var qml = Script.resolvePath('debugWindow.qml');
|
||||
var window = new OverlayWindow({
|
||||
title: 'Debug Window',
|
||||
source: qml,
|
||||
width: 400, height: 900,
|
||||
});
|
||||
window.setPosition(25, 50);
|
||||
window.closed.connect(function() { Script.stop(); });
|
||||
|
||||
// Demonstrate sending a message to the QML window
|
||||
ScriptDiscoveryService.printedMessage.connect(function(message, scriptFileName) {
|
||||
window.sendToQml("[" + scriptFileName + "] " + message);
|
||||
});
|
35
scripts/developer/debugging/debugWindow.qml
Normal file
35
scripts/developer/debugging/debugWindow.qml
Normal file
|
@ -0,0 +1,35 @@
|
|||
//
|
||||
// InfoView.qml
|
||||
//
|
||||
// Created by Bradley Austin Davis on 27 Apr 2015
|
||||
// Copyright 2015 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
import Hifi 1.0 as Hifi
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
width: parent ? parent.width : 100
|
||||
height: parent ? parent.height : 100
|
||||
|
||||
property var channel;
|
||||
|
||||
TextArea {
|
||||
id: textArea
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
text:""
|
||||
}
|
||||
|
||||
function fromScript(message) {
|
||||
textArea.text += message + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue