From 983e6dca49f6e82de211afe4b340e7b615e7b4fb Mon Sep 17 00:00:00 2001 From: GuglioIsStupid Date: Wed, 15 May 2024 21:59:27 -0400 Subject: [PATCH] Fix weekend1 from crashing, fix countdown, fix hold covers --- src/love/modules/Cover.lua | 6 ++++++ src/love/states/weeks.lua | 10 +++++++++- src/love/weeks/weekend1.lua | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/love/modules/Cover.lua b/src/love/modules/Cover.lua index 099def33..fa28712a 100644 --- a/src/love/modules/Cover.lua +++ b/src/love/modules/Cover.lua @@ -34,9 +34,14 @@ function cover:update(dt) end end +function cover:getVisibility(id, plr) + return self.covers[plr][id].hiding +end + -- 1 = boyfriend, 2 = enemy function cover:show(id, plr) if not self.covers[plr][id].visible then + self.covers[plr][id].hiding = false self.covers[plr][id].visible = true self.covers[plr][id]:animate(CONSTANTS.WEEKS.NOTE_LIST[id] .. " start", false, function() self.covers[plr][id]:animate(CONSTANTS.WEEKS.NOTE_LIST[id], true) @@ -45,6 +50,7 @@ function cover:show(id, plr) end function cover:hide(id, plr) + self.covers[plr][id].hiding = true self.covers[plr][id]:animate(CONSTANTS.WEEKS.NOTE_LIST[id] .. " end", false, function() self.covers[plr][id].visible = false end) diff --git a/src/love/states/weeks.lua b/src/love/states/weeks.lua index 4a547903..cdbf2477 100644 --- a/src/love/states/weeks.lua +++ b/src/love/states/weeks.lua @@ -392,6 +392,8 @@ return { if not stepCrochet then stepCrochet = crochet / 4 end end + if not bpm then bpm = 120 end + local sprites = { sprites.leftArrow, sprites.downArrow, @@ -486,7 +488,9 @@ return { setupCountdown = function(self, countNumVal) local countNumVal = countNumVal or 4 lastReportedPlaytime = 0 - musicTime = ((60*4) / bpm) * -1000 -- countdown is 4 beats long + if countNumVal == 4 then + musicTime = ((60*4) / bpm) * -1000 -- countdown is 4 beats long + end musicThres = 0 countingDown = true @@ -1042,6 +1046,10 @@ return { table.remove(boyfriendNote, 1) end + if not input:down(curInput) and not HoldCover:getVisibility(i, 1) then + HoldCover:hide(i, 1) + end + if input:released(curInput) then boyfriendArrow:animate(CONSTANTS.WEEKS.NOTE_LIST[i], false) end diff --git a/src/love/weeks/weekend1.lua b/src/love/weeks/weekend1.lua index 6239eba1..bfe55448 100644 --- a/src/love/weeks/weekend1.lua +++ b/src/love/weeks/weekend1.lua @@ -30,7 +30,7 @@ return { stages["streets"]:enter() - song = 5 + song = songNum difficulty = songAppend erectMode = isErect