mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 21:33:00 +02:00
Merge pull request #11653 from vladest/fix_sriptslog_multiply_window
Fix scriptslog multiply window
This commit is contained in:
commit
f7eb57a54c
1 changed files with 11 additions and 0 deletions
|
@ -10,13 +10,24 @@
|
|||
|
||||
(function() { // BEGIN LOCAL_SCOPE
|
||||
|
||||
//check if script already running.
|
||||
var scriptData = ScriptDiscoveryService.getRunning();
|
||||
var scripts = scriptData.filter(function (datum) { return datum.name === 'debugWindow.js'; });
|
||||
if (scripts.length >= 2) {
|
||||
//2nd instance of the script is too much
|
||||
ScriptDiscoveryService.stopScript(scripts[1].url);
|
||||
return;
|
||||
}
|
||||
|
||||
// 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(); });
|
||||
|
||||
|
|
Loading…
Reference in a new issue