mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 05:37:17 +02:00
in progress
This commit is contained in:
parent
804f82f2f1
commit
1a7887520d
5 changed files with 17 additions and 22 deletions
|
@ -27,7 +27,7 @@ Script.include([
|
||||||
"libraries/entityCameraTool.js",
|
"libraries/entityCameraTool.js",
|
||||||
"libraries/gridTool.js",
|
"libraries/gridTool.js",
|
||||||
"libraries/entityList.js",
|
"libraries/entityList.js",
|
||||||
"particle_explorer/particleExplorerTool.js",
|
"particle_explorer/particleExplorerTool.js?v1" + Math.random(),
|
||||||
"libraries/lightOverlayManager.js",
|
"libraries/lightOverlayManager.js",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@ EntityListTool = function(opts) {
|
||||||
title: 'Entities', source: url, toolWindow: true
|
title: 'Entities', source: url, toolWindow: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var searchRadius = 100;
|
var searchRadius = 100;
|
||||||
|
|
||||||
var visible = false;
|
var visible = false;
|
||||||
|
@ -71,31 +73,14 @@ EntityListTool = function(opts) {
|
||||||
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
that.enableParticleTab = function(entityID) {
|
|
||||||
var data = {
|
|
||||||
type: "enableParticleTab",
|
|
||||||
entity: entityID
|
|
||||||
};
|
|
||||||
webView.eventBridge.emitScriptEvent(JSON.stringify(data));
|
|
||||||
}
|
|
||||||
|
|
||||||
webView.eventBridge.webEventReceived.connect(function(data) {
|
webView.eventBridge.webEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.type == "selectionUpdate") {
|
if (data.type == "selectionUpdate") {
|
||||||
print("EBL CLICKED ON SOME SHIT " + JSON.stringify(data))
|
|
||||||
var ids = data.entityIds;
|
var ids = data.entityIds;
|
||||||
var entityIDs = [];
|
var entityIDs = [];
|
||||||
for (var i = 0; i < ids.length; i++) {
|
for (var i = 0; i < ids.length; i++) {
|
||||||
entityIDs.push(ids[i]);
|
entityIDs.push(ids[i]);
|
||||||
}
|
|
||||||
if (entityIDs.length === 1) {
|
|
||||||
//We selected just one entity, so see if that entity is a particle entity
|
|
||||||
var type = Entities.getEntityProperties(entityIDs[0], "type").type;
|
|
||||||
if (type === "ParticleEffect") {
|
|
||||||
that.enableParticleTab(entityIDs[0]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
selectionManager.setSelections(entityIDs);
|
selectionManager.setSelections(entityIDs);
|
||||||
if (data.focus) {
|
if (data.focus) {
|
||||||
|
|
|
@ -339,6 +339,7 @@ function writeVec3ToInterface(obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function listenForSettingsUpdates() {
|
function listenForSettingsUpdates() {
|
||||||
|
console.log("EBL sLISTENING FOR EVENTS")
|
||||||
EventBridge.scriptEventReceived.connect(function(data) {
|
EventBridge.scriptEventReceived.connect(function(data) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
if (data.messageType === 'initial_settings') {
|
if (data.messageType === 'initial_settings') {
|
||||||
|
@ -349,8 +350,8 @@ function listenForSettingsUpdates() {
|
||||||
|
|
||||||
loadGUI();
|
loadGUI();
|
||||||
}
|
}
|
||||||
|
console.log("EBL RECIEVED EVENT - " + JSON.stringify(data));
|
||||||
if (date.type === "enableParticleTab") {
|
if (data.type === "enableParticleTab") {
|
||||||
console.log("EBL JUST GOT AN ENABLE MESSAGE!");
|
console.log("EBL JUST GOT AN ENABLE MESSAGE!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<script type="text/javascript" src="underscore-min.js"></script>
|
<script type="text/javascript" src="underscore-min.js"></script>
|
||||||
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
<script type="text/javascript" src="qrc:///qtwebchannel/qwebchannel.js"></script>
|
||||||
<script type="text/javascript" src="../html/eventBridgeLoader.js"></script>
|
<script type="text/javascript" src="../html/eventBridgeLoader.js"></script>
|
||||||
<script type="text/javascript" src="main.js?1234"></script>
|
<script type="text/javascript" src="main.js?132112"></script>
|
||||||
<script>
|
<script>
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html');
|
var PARTICLE_EXPLORER_HTML_URL = Script.resolvePath('particleExplorer.html?v1' + Math.random());
|
||||||
|
|
||||||
ParticleExplorerTool = function() {
|
ParticleExplorerTool = function() {
|
||||||
var that = {};
|
var that = {};
|
||||||
|
@ -11,10 +11,19 @@ ParticleExplorerTool = function() {
|
||||||
var visible = false;
|
var visible = false;
|
||||||
webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
|
|
||||||
|
webView.eventBridge.webEventReceived.connect(function(data) {
|
||||||
|
|
||||||
|
print("EBL GOT AN EVENT!");
|
||||||
|
});
|
||||||
|
|
||||||
that.setVisible = function(newVisible) {
|
that.setVisible = function(newVisible) {
|
||||||
visible = newVisible;
|
visible = newVisible;
|
||||||
webView.setVisible(visible);
|
webView.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
that.getWebView = function() {
|
||||||
|
return webView;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue