added view only flag.
This commit is contained in:
parent
4a95028fe8
commit
d6941fd1bf
@ -189,7 +189,7 @@ h1 {
|
||||
|
||||
}
|
||||
|
||||
#enterXR.inactive a {
|
||||
div.overlay div.inactive a {
|
||||
background-color: #222222;
|
||||
color: #555555;
|
||||
border-color: #222222;
|
||||
|
||||
@ -19,6 +19,7 @@ import {DiagramObject} from "../diagram/diagramObject";
|
||||
import {snapAll} from "./functions/snapAll";
|
||||
import {MeshTypeEnum} from "../diagram/types/meshTypeEnum";
|
||||
import {getMeshType} from "./functions/getMeshType";
|
||||
import {viewOnly} from "../util/functions/getPath";
|
||||
|
||||
const CLICK_TIME = 300;
|
||||
|
||||
@ -101,6 +102,9 @@ export class Base {
|
||||
protected initClicker(trigger: WebXRControllerComponent) {
|
||||
this._logger.debug("initTrigger");
|
||||
trigger.onButtonStateChangedObservable.add(() => {
|
||||
if (viewOnly()) {
|
||||
return;
|
||||
}
|
||||
if (trigger.changes.pressed) {
|
||||
if (trigger.pressed) {
|
||||
if (this.diagramManager.diagramMenuManager.scaleMenu.mesh == this._meshUnderPointer) {
|
||||
@ -140,7 +144,7 @@ export class Base {
|
||||
|
||||
private grab() {
|
||||
let mesh = this._meshUnderPointer
|
||||
if (!mesh) {
|
||||
if (!mesh || viewOnly()) {
|
||||
return;
|
||||
}
|
||||
this.grabbedMesh = mesh;
|
||||
|
||||
@ -12,6 +12,7 @@ import {DiagramEventObserverMask} from "./types/diagramEventObserverMask";
|
||||
import {ConnectionPreview} from "../menus/connectionPreview";
|
||||
import {ScaleMenu2} from "../menus/ScaleMenu2";
|
||||
import {CameraMenu} from "../menus/cameraMenu";
|
||||
import {viewOnly} from "../util/functions/getPath";
|
||||
|
||||
|
||||
export class DiagramMenuManager {
|
||||
@ -38,7 +39,11 @@ export class DiagramMenuManager {
|
||||
});
|
||||
this.toolbox = new Toolbox();
|
||||
this.scaleMenu = new ScaleMenu2(this._notifier);
|
||||
|
||||
if (viewOnly()) {
|
||||
this.toolbox.handleMesh.setEnabled(false);
|
||||
//this.scaleMenu.handleMesh.setEnabled(false)
|
||||
this.configMenu.handleMesh.setEnabled(false);
|
||||
}
|
||||
controllers.controllerObservable.add((event: ControllerEvent) => {
|
||||
if (event.type == ControllerEventType.B_BUTTON) {
|
||||
if (event.value > .8) {
|
||||
|
||||
@ -1,17 +1,30 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import {uploadImage} from "./functions/uploadImage";
|
||||
import {viewOnly} from "../util/functions/getPath";
|
||||
|
||||
function MainMenu({onClick}) {
|
||||
if (viewOnly()) {
|
||||
return (
|
||||
<div className="overlay mini" id="main">
|
||||
<img height="120" src="/assets/ddd.svg" width="320"/>
|
||||
<div id="enterXR" className="inactive"><a href="#" id="enterVRLink">Enter VR</a></div>
|
||||
<QuestLink/>
|
||||
<div id="download"><a href="#" id="downloadLink">Download Model</a></div>
|
||||
</div>)
|
||||
} else {
|
||||
return (
|
||||
<div className="overlay mini" id="main">
|
||||
<img height="120" src="/assets/ddd.svg" width="320"/>
|
||||
<div id="enterXR" className="inactive"><a href="#" id="enterVRLink">Enter VR</a></div>
|
||||
<QuestLink/>
|
||||
|
||||
<div id="diagrams"><a href="#" id="diagramsLink" onClick={onClick}>Diagrams</a></div>
|
||||
<div id="imageUpload"><a href="#" id="imageUploadLink" onClick={onClick}>Upload Image</a></div>
|
||||
<div id="download"><a href="#" id="downloadLink">Download Model</a></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function CreateMenu({display, toggleCreateMenu}) {
|
||||
|
||||
@ -6,3 +6,12 @@ export function getPath(): string {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export function getParameter(name: string) {
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
return searchParams.get(name);
|
||||
}
|
||||
|
||||
export function viewOnly(): boolean {
|
||||
return getParameter('viewonly') == 'true';
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user