Skip to content

Commit

Permalink
fix: 複数回呼ばれては困るハンドラを一度しか呼ばれないように
Browse files Browse the repository at this point in the history
  • Loading branch information
teramotodaiki committed Dec 31, 2018
1 parent ed09422 commit 39c7749
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hackforplay/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ logFunc.setHeight(180);

// MODs
game.on('awake', stopOnBlur);
game.on('load', coordinate);
game.once('load', coordinate);

// patch to FireFox space key page down
window.onkeydown = event => !(event.key === ' ');
Expand Down
4 changes: 4 additions & 0 deletions src/hackforplay/rpg-kit-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ function createDefaultKeyboard() {
});
}

let _initialized = false;
game.onawake = () => {
if (_initialized) return;
_initialized = true;
game.onawake = () => {};
// マウス座標
let mouseX = null;
let mouseY = null;
Expand Down

0 comments on commit 39c7749

Please sign in to comment.