forked from EXT/VR180-Web-Player
This commit is contained in:
@@ -3,9 +3,9 @@ import {
|
||||
setVrPanelOpacity,
|
||||
type VrControlPanel
|
||||
} from './vr-control-panel.js';
|
||||
import { DEFAULT_MENU_AUTO_HIDE_DELAY_MS } from '../utils/control-panel-timing.js';
|
||||
|
||||
const FADE_DURATION_MS = 200;
|
||||
const AUTO_HIDE_DELAY_MS = 10000;
|
||||
|
||||
export class VrPanelVisibility {
|
||||
private hideTimeout: number | undefined;
|
||||
@@ -28,15 +28,15 @@ export class VrPanelVisibility {
|
||||
this.hideImmediately();
|
||||
}
|
||||
|
||||
show(): void {
|
||||
this.showWithAutoHide(true);
|
||||
show(autoHideDelayMs = DEFAULT_MENU_AUTO_HIDE_DELAY_MS): void {
|
||||
this.showWithAutoHide(true, autoHideDelayMs);
|
||||
}
|
||||
|
||||
showPersistent(): void {
|
||||
this.showWithAutoHide(false);
|
||||
this.showWithAutoHide(false, DEFAULT_MENU_AUTO_HIDE_DELAY_MS);
|
||||
}
|
||||
|
||||
private showWithAutoHide(shouldAutoHide: boolean): void {
|
||||
private showWithAutoHide(shouldAutoHide: boolean, autoHideDelayMs: number): void {
|
||||
if (this.panel) this.panel.group.visible = true;
|
||||
this.clearHideTimeout();
|
||||
|
||||
@@ -46,7 +46,7 @@ export class VrPanelVisibility {
|
||||
}
|
||||
|
||||
if (shouldAutoHide) {
|
||||
this.hideTimeout = window.setTimeout(() => this.hide(), AUTO_HIDE_DELAY_MS);
|
||||
this.hideTimeout = window.setTimeout(() => this.hide(), autoHideDelayMs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user