From 23a2a002532647a3a37e3fa4bbea8bbe5566b6d3 Mon Sep 17 00:00:00 2001 From: Tom H <6784890+Auroriax@users.noreply.github.com> Date: Fri, 23 Dec 2022 23:54:36 +0100 Subject: [PATCH] Build (1732) --- .build/buildnumber.txt | 2 +- src/standalone_inlined.txt | 138 +++++++++++++++++++++++++------------ 2 files changed, 95 insertions(+), 45 deletions(-) diff --git a/.build/buildnumber.txt b/.build/buildnumber.txt index cfc3b26d4..f9247955e 100644 --- a/.build/buildnumber.txt +++ b/.build/buildnumber.txt @@ -1 +1 @@ -1731 \ No newline at end of file +1732 \ No newline at end of file diff --git a/src/standalone_inlined.txt b/src/standalone_inlined.txt index 109617705..ab50e1ab6 100644 --- a/src/standalone_inlined.txt +++ b/src/standalone_inlined.txt @@ -6510,6 +6510,44 @@ function RebuildLevelArrays() { var messagetext=""; var currentMovedEntities = {}; var newMovedEntities = {}; + +function applyDiff(diff, level_objects) { + + var index=0; + + while (index 0) { + // This is for the case that diffs break the undo buffer for real-time games + // ( c f https://github.com/increpare/PuzzleScript/pull/796 ), + // because realtime ticks are ignored when the user presses undo and the backup + // array reflects this structure. + backups[backups.length - 1] = unconsolidateDiff(backups[backups.length - 1], bak); } modified=true; updateCameraPositionTarget(); @@ -10260,27 +10293,34 @@ var codeMirrorFn = function() { } return 'GOTO_VERB'; } else { - var line = stream.match(reg_notcommentstart, false)[0].trim(); - state.tokenIndex = 2; - var lastlevel = state.levels[state.levels.length - 1]; - if (lastlevel[0] == '\n') { - state.levels.push([state.lineNumber, state.currentSection, line]); + var matches = stream.match(reg_notcommentstart, false); + if (matches===null || matches.length===0){ + logError("Detected a comment where I was expecting a level. Oh gosh; if this is to do with you using '(' as a character in the legend, please don't do that ^^",state.lineNumber); + state.commentLevel++; + stream.skipToEnd(); + return 'comment'; } else { - if (lastlevel.length==0) - { - lastlevel.push(state.lineNumber); - lastlevel.push(state.currentSection); + var line = matches[0].trim(); + state.tokenIndex = 2; + var lastlevel = state.levels[state.levels.length - 1]; + if (lastlevel[0] == '\n') { + state.levels.push([state.lineNumber, state.currentSection, line]); + } else { + if (lastlevel.length==0) + { + lastlevel.push(state.lineNumber); + lastlevel.push(state.currentSection); } - lastlevel.push(line); + lastlevel.push(line); - if (lastlevel.length>2) - { - if (line.length!=lastlevel[2].length) { - logWarning("Maps must be rectangular, yo (In a level, the length of each row must be the same).",state.lineNumber); + if (lastlevel.length>2) + { + if (line.length!=lastlevel[2].length) { + logWarning("Maps must be rectangular, yo (In a level, the length of each row must be the same).",state.lineNumber); + } } } } - } } else { if (state.tokenIndex == 1) { @@ -12299,7 +12339,7 @@ function rulesToMask(state) { if ( (i>0 && state.rules[i-1].lineNumber===ln) || ( (i+1= 1){ + canvasX = event.touches[0].pageX - totalOffsetX; canvasY = event.touches[0].pageY - totalOffsetY; - + } else if (event.changedTouches != null && event.changedTouches.length >= 1) { + canvasX = event.changedTouches[0].pageX - totalOffsetX; + canvasY = event.changedTouches[0].pageY - totalOffsetY; + } else { + canvasX = event.pageX - totalOffsetX; + canvasY = event.pageY - totalOffsetY; } return {x:canvasX, y:canvasY} @@ -15791,7 +15840,8 @@ Mobile.debugDot = function (event) { height: "100%", overflow: "hidden", position: "fixed", - width: "100%" + width: "100%", + margin: 0 } var styleString = "";