diff --git a/.build/buildnumber.txt b/.build/buildnumber.txt index 26cbce261..f6816323f 100644 --- a/.build/buildnumber.txt +++ b/.build/buildnumber.txt @@ -1 +1 @@ -1733 \ No newline at end of file +1735 \ No newline at end of file diff --git a/src/standalone_inlined.txt b/src/standalone_inlined.txt index 3697ec7f5..556d0862d 100644 --- a/src/standalone_inlined.txt +++ b/src/standalone_inlined.txt @@ -5552,9 +5552,13 @@ function generateTitleScreen() } if (IsMouseGameInputEnabled()) { - titleImage[10]=".................................."; - titleImage[11]=".MOUSE to interact................"; - titleImage[12]=".MMB to undo, R to restart........"; + if (state.metadata.mouse_drag !== undefined || state.metadata.mouse_rdrag !== undefined) { + titleImage[10]=".Click, Tap, or Drag to interact.."; + } else { + titleImage[10]=".Click or Tap to interact........."; + } + titleImage[11]=".Z or Middle Mouse Button to undo."; + titleImage[12]=".R to restart....................."; } for (var i=0;i 1) { - if ((timer/1000>0.5 || titleMode > 1) && !quittingTitleScreen) { + if ((timer/1000>0.5 || titleMode > 1) && !quittingTitleScreen && justPressed) { titleSelection = 0; @@ -15162,10 +15166,13 @@ function update() { } } -var looping=false; +var prevTimestamp; // Lights, camera…function! -var loop = function(){ - looping=true; +var loop = function(timestamp){ + if (prevTimestamp !== undefined) { + deltatime = timestamp - prevTimestamp + } + prevTimestamp = timestamp try { update(); } @@ -15173,22 +15180,13 @@ var loop = function(){ //Something went wrong, but it's more important that the loop doesn't crash during errors console.error(e); } - if (document.visibilityState==='hidden'){ - looping=false; - return; - }; - setTimeout(loop,deltatime); + // requestAnimationFrame will call loop() at the + // browser's refresh rate (generally 60fps) + // and will auto pause/unpause when the window is minimized + window.requestAnimationFrame(loop); } -document.addEventListener('visibilitychange', function logData() { - if (document.visibilityState === 'visible') { - if (looping===false){ - loop(); - } - } - }); - -loop();