Skip to content
Snippets Groups Projects
Commit 7fb300a7 authored by Brian Peiris's avatar Brian Peiris
Browse files

refactor querystring check

parent a321dbd3
No related branches found
No related tags found
No related merge requests found
...@@ -128,6 +128,7 @@ AFRAME.registerInputActivator("pressedmove", PressedMove); ...@@ -128,6 +128,7 @@ AFRAME.registerInputActivator("pressedmove", PressedMove);
AFRAME.registerInputActivator("reverseY", ReverseY); AFRAME.registerInputActivator("reverseY", ReverseY);
AFRAME.registerInputMappings(inputConfig, true); AFRAME.registerInputMappings(inputConfig, true);
const isBotMode = qsTruthy("bot");
const concurrentLoadDetector = new ConcurrentLoadDetector(); const concurrentLoadDetector = new ConcurrentLoadDetector();
concurrentLoadDetector.start(); concurrentLoadDetector.start();
...@@ -303,7 +304,7 @@ const onReady = async () => { ...@@ -303,7 +304,7 @@ const onReady = async () => {
return; return;
}); });
if (qsTruthy("bot")) { if (isBotMode) {
playerRig.setAttribute("avatar-replay", { playerRig.setAttribute("avatar-replay", {
camera: "#player-camera", camera: "#player-camera",
leftController: "#player-left-controller", leftController: "#player-left-controller",
...@@ -371,7 +372,7 @@ const onReady = async () => { ...@@ -371,7 +372,7 @@ const onReady = async () => {
initialEnvironmentEl.addEventListener("bundleloaded", () => { initialEnvironmentEl.addEventListener("bundleloaded", () => {
remountUI({ initialEnvironmentLoaded: true }); remountUI({ initialEnvironmentLoaded: true });
// We never want to stop the render loop when were running in "bot" mode. // We never want to stop the render loop when were running in "bot" mode.
if (!qsTruthy("bot")) { if (!isBotMode) {
// Stop rendering while the UI is up. We restart the render loop in enterScene. // Stop rendering while the UI is up. We restart the render loop in enterScene.
// Wait a tick plus some margin so that the environments actually render. // Wait a tick plus some margin so that the environments actually render.
setTimeout(() => scene.renderer.animate(null), 100); setTimeout(() => scene.renderer.animate(null), 100);
...@@ -380,7 +381,7 @@ const onReady = async () => { ...@@ -380,7 +381,7 @@ const onReady = async () => {
environmentRoot.appendChild(initialEnvironmentEl); environmentRoot.appendChild(initialEnvironmentEl);
const setRoom = (janusRoomId, hubName) => { const setRoom = (janusRoomId, hubName) => {
if (qsTruthy("bot")) { if (isBotMode) {
const enterSceneImmediately = () => enterScene(new MediaStream(), false, janusRoomId); const enterSceneImmediately = () => enterScene(new MediaStream(), false, janusRoomId);
if (scene.hasLoaded) { if (scene.hasLoaded) {
enterSceneImmediately(); enterSceneImmediately();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment