Skip to content

Commit

Permalink
Tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
solcloud committed Jun 13, 2023
1 parent 3373db6 commit 87b2ae0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 1 addition & 4 deletions www/assets/js/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ let launchGame
setting.addUpdateCallback('sensitivity', (newValue) => pointerLock.pointerSpeed = parseFloat(newValue))
setting.addUpdateCallback('volume', (newValue) => world.volume = parseFloat(newValue))
connector.connect(url.hostname, url.port, loginCode, control)

if (window.nodeApi) {
window.addEventListener('beforeunload', () => connector.close());
}
window.addEventListener('beforeunload', () => connector.close());
}

function render() {
Expand Down
9 changes: 5 additions & 4 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ <h2>F<span class="emojis">🏉💣</span>tball</h2>
<script>
if (window.nodeApi) {
document.getElementById('join-url').value = 'udp://localhost:8080?map=default&code=acode'
} else {
window.addEventListener('beforeunload', (e) => {
e.preventDefault();
return "Are you sure to leave this page?"
});
}
if (window.location.search === '?dev-join') {
joinGameUrl(document.getElementById('join-url').value)
}
window.addEventListener('beforeunload', (e) => {
e.preventDefault();
return "Are you sure to leave this page?"
});
</script>
</body>
</html>

0 comments on commit 87b2ae0

Please sign in to comment.