mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
Fix for editVoxels/inspect conflict
This commit is contained in:
parent
72d09a5cbe
commit
56b0583600
1 changed files with 20 additions and 26 deletions
|
@ -32,6 +32,7 @@ var MIN_PASTE_VOXEL_SCALE = .256;
|
||||||
var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting
|
var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting
|
||||||
var previewLineWidth = 1.5;
|
var previewLineWidth = 1.5;
|
||||||
|
|
||||||
|
var inspectJsIsRunning = false;
|
||||||
var isAdding = false;
|
var isAdding = false;
|
||||||
var isExtruding = false;
|
var isExtruding = false;
|
||||||
var extrudeDirection = { x: 0, y: 0, z: 0 };
|
var extrudeDirection = { x: 0, y: 0, z: 0 };
|
||||||
|
@ -62,9 +63,9 @@ var whichColor = -1; // Starting color is 'Copy' mode
|
||||||
|
|
||||||
// Create sounds for adding, deleting, recoloring voxels
|
// Create sounds for adding, deleting, recoloring voxels
|
||||||
var addSound1 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+2.raw");
|
var addSound1 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+2.raw");
|
||||||
var addSound2 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+3.raw");
|
var addSound2 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+4.raw");
|
||||||
var addSound3 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+4.raw");
|
|
||||||
|
|
||||||
|
var addSound3 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+3.raw");
|
||||||
var deleteSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+delete+2.raw");
|
var deleteSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+delete+2.raw");
|
||||||
var changeColorSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+edit+2.raw");
|
var changeColorSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+edit+2.raw");
|
||||||
var clickSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Switches+and+sliders/toggle+switch+-+medium.raw");
|
var clickSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Switches+and+sliders/toggle+switch+-+medium.raw");
|
||||||
|
@ -727,6 +728,9 @@ function trackKeyPressEvent(event) {
|
||||||
trackAsEyedropper = true;
|
trackAsEyedropper = true;
|
||||||
moveTools();
|
moveTools();
|
||||||
}
|
}
|
||||||
|
if (event.text == "ALT") {
|
||||||
|
inspectJsIsRunning = true;
|
||||||
|
}
|
||||||
showPreviewGuides();
|
showPreviewGuides();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -739,6 +743,10 @@ function trackKeyReleaseEvent(event) {
|
||||||
showPreviewGuides();
|
showPreviewGuides();
|
||||||
Audio.playSound(clickSound, audioOptions);
|
Audio.playSound(clickSound, audioOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.text == "ALT") {
|
||||||
|
inspectJsIsRunning = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (editToolsOn) {
|
if (editToolsOn) {
|
||||||
if (event.text == "ESC") {
|
if (event.text == "ESC") {
|
||||||
|
@ -777,11 +785,13 @@ function trackKeyReleaseEvent(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function mousePressEvent(event) {
|
function mousePressEvent(event) {
|
||||||
|
|
||||||
// if our tools are off, then don't do anything
|
// if our tools are off, then don't do anything
|
||||||
if (!editToolsOn) {
|
if (!editToolsOn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (inspectJsIsRunning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var clickedOnSomething = false;
|
var clickedOnSomething = false;
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
||||||
|
@ -1061,7 +1071,9 @@ function mouseMoveEvent(event) {
|
||||||
if (!editToolsOn) {
|
if (!editToolsOn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (inspectJsIsRunning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isMovingSlider) {
|
if (isMovingSlider) {
|
||||||
thumbX = (event.x - thumbClickOffsetX) - sliderX;
|
thumbX = (event.x - thumbClickOffsetX) - sliderX;
|
||||||
|
@ -1121,7 +1133,10 @@ function mouseReleaseEvent(event) {
|
||||||
if (!editToolsOn) {
|
if (!editToolsOn) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (inspectJsIsRunning) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isMovingSlider) {
|
if (isMovingSlider) {
|
||||||
isMovingSlider = false;
|
isMovingSlider = false;
|
||||||
}
|
}
|
||||||
|
@ -1214,24 +1229,6 @@ function moveTools() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function touchBeginEvent(event) {
|
|
||||||
if (!editToolsOn) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function touchUpdateEvent(event) {
|
|
||||||
if (!editToolsOn) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function touchEndEvent(event) {
|
|
||||||
if (!editToolsOn) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var lastFingerAddVoxel = { x: -1, y: -1, z: -1}; // off of the build-able area
|
var lastFingerAddVoxel = { x: -1, y: -1, z: -1}; // off of the build-able area
|
||||||
var lastFingerDeleteVoxel = { x: -1, y: -1, z: -1}; // off of the build-able area
|
var lastFingerDeleteVoxel = { x: -1, y: -1, z: -1}; // off of the build-able area
|
||||||
|
|
||||||
|
@ -1332,9 +1329,6 @@ Controller.mouseReleaseEvent.connect(mouseReleaseEvent);
|
||||||
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
Controller.mouseMoveEvent.connect(mouseMoveEvent);
|
||||||
Controller.keyPressEvent.connect(keyPressEvent);
|
Controller.keyPressEvent.connect(keyPressEvent);
|
||||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||||
Controller.touchBeginEvent.connect(touchBeginEvent);
|
|
||||||
Controller.touchUpdateEvent.connect(touchUpdateEvent);
|
|
||||||
Controller.touchEndEvent.connect(touchEndEvent);
|
|
||||||
Controller.captureKeyEvents({ text: "+" });
|
Controller.captureKeyEvents({ text: "+" });
|
||||||
Controller.captureKeyEvents({ text: "-" });
|
Controller.captureKeyEvents({ text: "-" });
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue