Skip to content

Commit

Permalink
Fix for late loading libraries causing class error issues
Browse files Browse the repository at this point in the history
  • Loading branch information
roboyeti committed Feb 2, 2023
1 parent ee95ed0 commit 68ce8f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions fx/overfx.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ class OverFx {
to_front(zindex=this.config.z_index) { this.engine.canvas.style.zIndex = zindex; this.engine.canvas.focus(); }
to_back(zindex=(this.config.z_index*-1)) { this.engine.canvas.style.zIndex = zindex; this.engine.canvas.blur(); }

volume(vol=null) {
if (vol >= 0) {
this.engine.sound.volume = this.config.volume = vol
}
return this.engine.sound.volume;
}

audio_on() {
this.config.audio_on = true;
this.engine.sound.volume = this.config.volume
Expand Down Expand Up @@ -132,7 +139,7 @@ class OverFx {
}

run_fx(name,config={},myf=function(){}) {
if (!this.loaded[name]) { this.load_fx(name,()=>{ this.run_scene(name); }) }
if (!this.loaded[name]) { this.load_fx(name,()=>{ this.run_scene(name); this.loaded[name] = true; }) }
else { this.run_scene(name); }
}

Expand All @@ -143,7 +150,7 @@ class OverFx {
document.body.append(script);
script.onload = onload;
this.config.debug && console.log(`${name} loaded.`)
this.loaded[name] = true;

}

_stop_pass() {
Expand Down

0 comments on commit 68ce8f5

Please sign in to comment.