Skip to content

Commit

Permalink
Merge pull request #5 from veu/next
Browse files Browse the repository at this point in the history
Version 1.2.1
  • Loading branch information
veu authored May 31, 2022
2 parents dff1b0e + aa02eed commit fb75f6a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/constants.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "1.2.0"
VERSION = "1.2.1"

CELL = 16
TOP_NUMBER_HEIGHT = 14
Expand Down
23 changes: 14 additions & 9 deletions src/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function showPuzzleKeyboard()
playdate.keyboard.show(text)
end

function switch(newScreen, newSidebar, selected, out)
function switch(newScreen, newSidebar, selected, out, onReady)
playdate.inputHandlers.push(noopInputHandler, true)
if newScreen then
context.screen:leave()
Expand All @@ -178,6 +178,9 @@ function switch(newScreen, newSidebar, selected, out)
newScreen:enter(context)
end
playdate.inputHandlers.pop()
if onReady then
onReady()
end
end
context.sidebar:leave(context)
context.sidebar = newSidebar
Expand Down Expand Up @@ -247,8 +250,9 @@ end
createAvatarSidebar.onSave = function()
context.player:setAvatar(createAvatarPreview(context.puzzle))

switch(titleScreen, namePlayerSidebar, PLAYER_ID_SHOW_NAME)
showPlayerKeyboard(PLAYER_ID_SHOW_NAME)
switch(titleScreen, namePlayerSidebar, PLAYER_ID_SHOW_NAME, nil, function()
showPlayerKeyboard(PLAYER_ID_SHOW_NAME)
end)
end

createPuzzleSidebar.onAbort = function()
Expand Down Expand Up @@ -302,8 +306,9 @@ optionsSidebar.onDelete = function ()
end

optionsSidebar.onRename = function ()
switch(nil, namePlayerSidebar, PLAYER_ID_SHOW_RENAME)
showPlayerKeyboard(PLAYER_ID_SHOW_RENAME)
switch(nil, namePlayerSidebar, PLAYER_ID_SHOW_RENAME, nil, function()
showPlayerKeyboard(PLAYER_ID_SHOW_RENAME)
end)
end

optionsSidebar.onResetProgress = function ()
Expand Down Expand Up @@ -392,8 +397,9 @@ end
selectAvatarSidebar.onSelected = function(avatar)
context.player:setAvatar(imgAvatars:getImage(avatar))

switch(nil, namePlayerSidebar, PLAYER_ID_SHOW_NAME)
showPlayerKeyboard(PLAYER_ID_SHOW_NAME)
switch(nil, namePlayerSidebar, PLAYER_ID_SHOW_NAME, nil, function()
showPlayerKeyboard(PLAYER_ID_SHOW_NAME)
end)
end

selectCreatorSidebar.onAbort = function()
Expand Down Expand Up @@ -553,8 +559,7 @@ testPuzzleSidebar.onResetGrid = function()
end

testPuzzleSidebar.onSave = function ()
switch(nil, namePuzzleSidebar)
showPuzzleKeyboard()
switch(nil, namePuzzleSidebar, nil, nil, showPuzzleKeyboard)
end

titleSidebar.onPlay = function ()
Expand Down
4 changes: 2 additions & 2 deletions src/pdxinfo
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ author=RDK
description=A nonogram game you sketch yourself
bundleID=net.monometric.sketch-share-solve
imagePath=launcherAssets/
version=1.2.0
buildNumber=102000
version=1.2.1
buildNumber=102011

0 comments on commit fb75f6a

Please sign in to comment.