Skip to content

Commit

Permalink
Update for v-24g02
Browse files Browse the repository at this point in the history
  • Loading branch information
david-pfx committed Aug 2, 2024
1 parent 2dec1a6 commit 102618c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .build/buildnumber.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1790
1791
37 changes: 29 additions & 8 deletions src/standalone_inlined.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8406,7 +8406,7 @@ function generateLevelSelectScreen(hoverLine, scrollIncrement, selectLine) {

const showLines = lines.slice(levelSelectScrollPos,levelSelectScrollPos + amountOfLevelsOnScreen);
const screen = getLevelSelectScreen(showLines);
if (debugSwitch.includes('menu')) console.log(screen, levelSelectScrollPos, levelHighlightLine, hoverLine, selectLine, titleSelection);
if (debugSwitch.includes('menu')) console.log(`generateLevelSelectScreen2 titleSelection=${titleSelection}`, `levelSelectScrollPos=${levelSelectScrollPos}`, screen);
titleImage = fillAndHighlight(screen, levelHighlightLine, hoverLine, selectLine);

titleImage[0] = (hoverLine == 0 ? "[ ESC:Back ]" : " [ ESC:Back ] ").padEnd(TITLE_WIDTH);
Expand Down Expand Up @@ -9258,11 +9258,13 @@ function consolidateDiff(before,after){
dat : result,
width : before.width,
height : before.height,
oldflickscreendat: before.oldflickscreendat
oldflickscreendat: before.oldflickscreendat,
metadata: before.metadata,
}
}

function addUndoState(bak){
if (debugSwitch.includes('undo')) console.log(`addUndoState length=${backups.length} bak=`, bak);
backups.push(bak);
if(backups.length>2 && !backups[backups.length-1].hasOwnProperty("diff")){
backups[backups.length-3]=consolidateDiff(backups[backups.length-3],backups[backups.length-2]);
Expand Down Expand Up @@ -9335,6 +9337,7 @@ function DoUndo(force,ignoreDuplicates, resetTween = true, resetAutoTick = true,

if (backups.length>0) {
var torestore = backups[backups.length-1];
if (debugSwitch.includes('undo')) console.log(`DoUndo length=${backups.length} torestore=`, torestore);
restoreLevel(torestore, null, resetTween, resetAutoTick);
backups = backups.splice(0,backups.length-1);
// look for undo across link
Expand Down Expand Up @@ -18366,13 +18369,29 @@ function mouseAction(event,click,id) {
if (titleSelection)
titleButtonSelected();
} else if (titleMode===2) { //Level select
generateLevelSelectScreen(-1, 0, mouseCoordY);
if (mouseCoordY == 0) // dodgy but it works
generateLevelSelectScreen(mouseCoordY);
if (mouseCoordY == 0) { // ESC back
goToTitleScreen();
else if (titleSelection >= 0) {
titleSelected=true;
timer=0;
quittingTitleScreen=true;
tryPlayTitleSound();
} else if (mouseCoordY == 2) {
if (levelSelectScrollPos != 0) {
levelSelectScroll(-3)
}
} else if (mouseCoordY == 12) {
if (state.sections.length - amountOfLevelsOnScreen > levelSelectScrollPos) {
levelSelectScroll(3)
}
} else if (mouseCoordY > 2 && mouseCoordY < 12) {
const clickedLevel = mouseCoordY - 3 + levelSelectScrollPos;
if (clickedLevel < state.sections.length) {
generateLevelSelectScreen(-1, 0, mouseCoordY);
if (titleSelection != null) {
titleSelected=true;
messageselected=false;
timer=0;
quittingTitleScreen=true;
}
}
}
} else if (titleMode == 3) { // pause screen select
generatePauseScreen(mouseCoordY);
Expand Down Expand Up @@ -18974,6 +18993,8 @@ function checkKey(e,justPressed) {
if (e&&(e.ctrlKey || e.metaKey|| e.altKey)){
return;
}
if (e.keyCode >= 0x70 && e.keyCode <= 0x83) // function keys
return;

var inputdir=-1;
switch(e.keyCode) {
Expand Down

0 comments on commit 102618c

Please sign in to comment.