mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 19:34:02 +02:00
Merge pull request #2612 from Atlante45/fix_editVoxels_inspect_conflict
Fix for editVoxels/inspect conflict
This commit is contained in:
commit
db1a622040
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 previewLineWidth = 1.5;
|
||||
|
||||
var inspectJsIsRunning = false;
|
||||
var isAdding = false;
|
||||
var isExtruding = false;
|
||||
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
|
||||
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 addSound3 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel+create+4.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+3.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 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;
|
||||
moveTools();
|
||||
}
|
||||
if (event.text == "ALT") {
|
||||
inspectJsIsRunning = true;
|
||||
}
|
||||
showPreviewGuides();
|
||||
}
|
||||
|
||||
|
@ -739,6 +743,10 @@ function trackKeyReleaseEvent(event) {
|
|||
showPreviewGuides();
|
||||
Audio.playSound(clickSound, audioOptions);
|
||||
}
|
||||
|
||||
if (event.text == "ALT") {
|
||||
inspectJsIsRunning = false;
|
||||
}
|
||||
|
||||
if (editToolsOn) {
|
||||
if (event.text == "ESC") {
|
||||
|
@ -777,11 +785,13 @@ function trackKeyReleaseEvent(event) {
|
|||
}
|
||||
|
||||
function mousePressEvent(event) {
|
||||
|
||||
// if our tools are off, then don't do anything
|
||||
if (!editToolsOn) {
|
||||
return;
|
||||
}
|
||||
if (inspectJsIsRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
var clickedOnSomething = false;
|
||||
var clickedOverlay = Overlays.getOverlayAtPoint({x: event.x, y: event.y});
|
||||
|
@ -1061,7 +1071,9 @@ function mouseMoveEvent(event) {
|
|||
if (!editToolsOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (inspectJsIsRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMovingSlider) {
|
||||
thumbX = (event.x - thumbClickOffsetX) - sliderX;
|
||||
|
@ -1121,7 +1133,10 @@ function mouseReleaseEvent(event) {
|
|||
if (!editToolsOn) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (inspectJsIsRunning) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMovingSlider) {
|
||||
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 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.keyPressEvent.connect(keyPressEvent);
|
||||
Controller.keyReleaseEvent.connect(keyReleaseEvent);
|
||||
Controller.touchBeginEvent.connect(touchBeginEvent);
|
||||
Controller.touchUpdateEvent.connect(touchUpdateEvent);
|
||||
Controller.touchEndEvent.connect(touchEndEvent);
|
||||
Controller.captureKeyEvents({ text: "+" });
|
||||
Controller.captureKeyEvents({ text: "-" });
|
||||
|
||||
|
|
Loading…
Reference in a new issue