mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 04:10:11 +02:00
Merge pull request #9953 from fayeli/edit-export-entities
Adding Export Entities Functionality in Tablet Edit
This commit is contained in:
commit
8988110c3b
3 changed files with 16 additions and 4 deletions
|
@ -24,7 +24,7 @@
|
||||||
<input type="button" id="locked" class="glyph" value="" />
|
<input type="button" id="locked" class="glyph" value="" />
|
||||||
<input type="button" id="visible" class="glyph" value="" />
|
<input type="button" id="visible" class="glyph" value="" />
|
||||||
</div>
|
</div>
|
||||||
<input type="button" id="teleport" value="Jump To Selection" />
|
<input type="button" id="export" value="Export Selection" />
|
||||||
<input type="button" id="pal" class="glyph" value="" />
|
<input type="button" id="pal" class="glyph" value="" />
|
||||||
<input type="button" class="red" id="delete" value="Delete" />
|
<input type="button" class="red" id="delete" value="Delete" />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -39,7 +39,7 @@ function loaded() {
|
||||||
elFilter = document.getElementById("filter");
|
elFilter = document.getElementById("filter");
|
||||||
elInView = document.getElementById("in-view")
|
elInView = document.getElementById("in-view")
|
||||||
elRadius = document.getElementById("radius");
|
elRadius = document.getElementById("radius");
|
||||||
elTeleport = document.getElementById("teleport");
|
elExport = document.getElementById("export");
|
||||||
elPal = document.getElementById("pal");
|
elPal = document.getElementById("pal");
|
||||||
elEntityTable = document.getElementById("entity-table");
|
elEntityTable = document.getElementById("entity-table");
|
||||||
elInfoToggle = document.getElementById("info-toggle");
|
elInfoToggle = document.getElementById("info-toggle");
|
||||||
|
@ -273,8 +273,8 @@ function loaded() {
|
||||||
elToggleVisible.onclick = function () {
|
elToggleVisible.onclick = function () {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'toggleVisible' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'toggleVisible' }));
|
||||||
}
|
}
|
||||||
elTeleport.onclick = function () {
|
elExport.onclick = function() {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'teleport' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'export'}));
|
||||||
}
|
}
|
||||||
elPal.onclick = function () {
|
elPal.onclick = function () {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({ type: 'pal' }));
|
EventBridge.emitWebEvent(JSON.stringify({ type: 'pal' }));
|
||||||
|
|
|
@ -128,6 +128,18 @@ EntityListTool = function(opts) {
|
||||||
if (selectionManager.hasSelection()) {
|
if (selectionManager.hasSelection()) {
|
||||||
MyAvatar.position = selectionManager.worldPosition;
|
MyAvatar.position = selectionManager.worldPosition;
|
||||||
}
|
}
|
||||||
|
} else if (data.type == "export") {
|
||||||
|
if (!selectionManager.hasSelection()) {
|
||||||
|
Window.notifyEditError("No entities have been selected.");
|
||||||
|
} else {
|
||||||
|
var filename = Window.save("Select Where to Save", "", "*.json");
|
||||||
|
if (filename) {
|
||||||
|
var success = Clipboard.exportEntities(filename, selectionManager.selections);
|
||||||
|
if (!success) {
|
||||||
|
Window.notifyEditError("Export failed.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (data.type == "pal") {
|
} else if (data.type == "pal") {
|
||||||
var sessionIds = {}; // Collect the sessionsIds of all selected entitities, w/o duplicates.
|
var sessionIds = {}; // Collect the sessionsIds of all selected entitities, w/o duplicates.
|
||||||
selectionManager.selections.forEach(function (id) {
|
selectionManager.selections.forEach(function (id) {
|
||||||
|
|
Loading…
Reference in a new issue