Skip to content

Commit

Permalink
chore: remove global ARENA.sceneOptions.thing refs, consistantly use …
Browse files Browse the repository at this point in the history
…ARENA.thing for all scene-options
  • Loading branch information
mwfarb committed Jul 31, 2024
1 parent 5176571 commit 1e0eec3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/systems/armarker/armarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ AFRAME.registerSystem('armarker', {
// this.getARMArkersFromATLAS(true);

// init networkedLocationSolver flag from ARENA scene options
this.data.networkedLocationSolver = !!this.arena.sceneOptions.networkedLocationSolver;
this.data.networkedLocationSolver = !!this.arena.networkedLocationSolver;

// request camera access features
if (!ARENA.params.camFollow) {
Expand Down
5 changes: 1 addition & 4 deletions src/systems/core/arena.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,6 @@ AFRAME.registerSystem('arena-scene', {

const { sceneEl } = el;

let sceneOptions = {};

// we add all elements to our scene root
const sceneRoot = document.getElementById('sceneRoot');

Expand All @@ -673,7 +671,7 @@ AFRAME.registerSystem('arena-scene', {
if (sceneData) {
const options = sceneData.attributes;

sceneOptions = options['scene-options'];
const sceneOptions = options['scene-options'];
if (sceneOptions) {
// save scene-options
Object.entries(sceneOptions).forEach(([attribute, value]) => {
Expand Down Expand Up @@ -789,7 +787,6 @@ AFRAME.registerSystem('arena-scene', {
sceneRoot.appendChild(light);
sceneRoot.appendChild(light1);
}
this.sceneOptions = sceneOptions;
this.events.emit(ARENA_EVENTS.SCENE_OPT_LOADED, true);
},

Expand Down
2 changes: 1 addition & 1 deletion src/systems/ui/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ AFRAME.registerSystem('arena-side-menu-ui', {
const { sceneEl } = el;
const cameraEl = sceneEl.camera.el;

const speedMod = Number(this.arena.sceneOptions?.speedModifier) || 1;
const speedMod = Number(this.arena.speedModifier) || 1;
if (speedMod) {
// Set new initial speed if applicable
cameraEl.setAttribute('wasd-controls', { acceleration: 30 * speedMod });
Expand Down

0 comments on commit 1e0eec3

Please sign in to comment.