Skip to content

Commit

Permalink
some more funcs and f ixes
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed Jul 2, 2024
1 parent fdb39cf commit 9e995e4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/love/modules/Icon.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
return {
imagePath = function(path)
return graphics.imagePath("icons/icon-" .. path)
return graphics.imagePath("icons/icon-" .. (path or "bf"))
end,
newIcon = function(path, scale)
if not graphics.cache[path] then
Expand Down
1 change: 1 addition & 0 deletions src/love/modules/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ camera.zooming = true
camera.locked = false
camera.camBopIntensity = 1
camera.camBopInterval = 4
camera.lockedMoving = false

camera.esizeX = 1
camera.esizeY = 1
Expand Down
41 changes: 29 additions & 12 deletions src/love/modules/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ return {
scrollY = 1,

visible = true,
alpha = 1,

setImage = function(self, image)
image = image
Expand All @@ -131,6 +132,10 @@ return {
return height
end,

setScale = function(self, scale)
self.sizeX, self.sizeY = scale, scale
end,

draw = function(self)
local x = self.x
local y = self.y
Expand All @@ -140,6 +145,9 @@ return {
y = math.floor(y)
end

local lastColor = {love.graphics.getColor()}
graphics.setColor(lastColor[1], lastColor[2], lastColor[3], lastColor[4] * self.alpha)

if self.visible then
love.graphics.draw(
image,
Expand All @@ -154,6 +162,8 @@ return {
self.shearY
)
end

love.graphics.setColor(lastColor[1], lastColor[2], lastColor[3])
end,

udraw = function(self, sx, sy)
Expand All @@ -167,18 +177,25 @@ return {
y = math.floor(y)
end

love.graphics.draw(
image,
self.x,
self.y,
self.orientation,
sx,
sy,
math.floor(width / 2) + self.offsetX,
math.floor(height / 2) + self.offsetY,
self.shearX,
self.shearY
)
local lastColor = {love.graphics.getColor()}
graphics.setColor(lastColor[1], lastColor[2], lastColor[3], lastColor[4] * self.alpha)

if self.visible then
love.graphics.draw(
image,
self.x,
self.y,
self.orientation,
sx,
sy,
math.floor(width / 2) + self.offsetX,
math.floor(height / 2) + self.offsetY,
self.shearX,
self.shearY
)
end

love.graphics.setColor(lastColor[1], lastColor[2], lastColor[3])
end
}

Expand Down
2 changes: 1 addition & 1 deletion src/love/states/weeks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ return {

for i, event in ipairs(songEvents) do
if event.time <= absMusicTime then
if event.name == "FocusCamera" then
if event.name == "FocusCamera" and camera.lockedMoving then
if type(event.value) == "number" then
if event.value == 0 then -- Boyfriend
camera:moveToPoint(1.25, "boyfriend")
Expand Down

0 comments on commit 9e995e4

Please sign in to comment.