Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Panels.lua
  • Loading branch information
cadin committed Dec 2, 2023
2 parents c9cfef1 + ac1f3e1 commit 71306bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions Panels.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- Panels version 1.7.1
-- Panels version 1.7.2
-- https://cadin.github.io/panels/

import "CoreLibs/object"
Expand Down Expand Up @@ -40,6 +40,7 @@ local pdEaseInOutQuad = playdate.easingFunctions.inOutQuad
local pdButtonJustPressed = playdate.buttonJustPressed

local sequenceDidStart = false
local sequenceIsFinishing = false

local currentSeqIndex = 1
local sequences = nil
Expand Down Expand Up @@ -199,7 +200,7 @@ end

local function drawButtonIndicators(offset)
if transitionOutAnimator == nil then
if lastPanelIsShowing() and sequenceDidStart then
if lastPanelIsShowing() and sequenceDidStart and not sequenceIsFinishing then
for key, button in pairs(buttonIndicators) do
button:show()
end
Expand Down Expand Up @@ -645,6 +646,7 @@ local function updateSequenceTransition()
scrollPos = transitionInAnimator:currentValue()
if transitionInAnimator:ended() then
sequenceDidStart = true
sequenceIsFinishing = false
transitionInAnimator = nil
shouldFadeBG = false
end
Expand Down Expand Up @@ -694,6 +696,7 @@ end

local function checkInputs()
local p = panels[panelNum]
if sequenceIsFinishing then return end
if lastPanelIsShowing() then
if p.advanceFunction == nil then
for i, button in ipairs(buttonIndicators) do
Expand All @@ -703,6 +706,7 @@ local function checkInputs()
end
button:press()
hideOtherAdvanceControls(i)
sequenceIsFinishing = true
if p.advanceDelay then
p:exit()
playdate.timer.performAfterDelay(p.advanceDelay, finishSequence)
Expand Down Expand Up @@ -866,6 +870,7 @@ end
local function loadGameData()
local data = playdate.datastore.read()
if data then
currentSeqIndex = data.sequence
Panels.unlockedSequences = data.unlockedSequences or {}
gameDidFinish = data.gameDidFinish
Panels.vars = data.vars or {}
Expand Down
6 changes: 3 additions & 3 deletions modules/Panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ function Panels.Panel.new(data)
end

if layer.pixelLock then
xPos = math.floor((xPos + offset.x) / layer.pixelLock) * layer.pixelLock - offset.x + self.frame.margin
yPos = math.floor((yPos + offset.y) / layer.pixelLock) * layer.pixelLock - offset.y + self.frame.margin
xPos = math.floor((xPos + offset.x) / layer.pixelLock) * layer.pixelLock - offset.x
yPos = math.floor((yPos + offset.y) / layer.pixelLock) * layer.pixelLock - offset.y
end

if layer.effect then
Expand Down Expand Up @@ -707,7 +707,7 @@ function Panels.Panel.new(data)
end

function panel:updateAdvanceButton()
if self.advanceButton.state == "hidden" then
if self.advanceButton.state == "hidden" and not self.didFinish then

if self.advanceControlPosition and self.advanceControlPosition.delay and self.advanceControlTimer == nil then
self.advanceControlTimer = playdate.timer.new(self.advanceControlPosition.delay, nil)
Expand Down

0 comments on commit 71306bd

Please sign in to comment.