Skip to content

Commit

Permalink
Rewrite icons
Browse files Browse the repository at this point in the history
  • Loading branch information
GuglioIsStupid committed May 10, 2024
1 parent cc648b5 commit 7233dae
Show file tree
Hide file tree
Showing 47 changed files with 200 additions and 215 deletions.
Binary file added src/love/images/png/icons/icon-bf-christmas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-bf-old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-bf-pixel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-bf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-dad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-darnell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-face.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-gf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-mom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-monster.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-parents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-pico.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-senpai.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-spirit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-spooky.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/love/images/png/icons/icon-tankman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 13 additions & 25 deletions src/love/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,12 @@ function love.load()
Object = require "lib.classic"
xml = require "lib.xml"
lovefftINST = require "lib.fft.lovefft"
lovefftBFVOCALS = require "lib.fft.lovefft"
lovefftENEMYVOCALS = require "lib.fft.lovefft"

-- Load modules
status = require "modules.status"
audio = require "modules.audio"
graphics = require "modules.graphics"
icon = require "modules.Icon"
camera = require "modules.camera"
beatHandler = require "modules.beatHandler"
util = require "modules.util"
Expand All @@ -189,7 +188,7 @@ function love.load()

playMenuMusic = true

-- disable vsync
-- disable vsy
love.window.setVSync(0)

graphics.setImageType(settings.setImageType)
Expand Down Expand Up @@ -259,6 +258,7 @@ function love.load()

-- Load week data
weekData = {
[0] = require "weeks.test",
require "weeks.tutorial",
require "weeks.week1",
require "weeks.week2",
Expand All @@ -270,8 +270,6 @@ function love.load()
require "weeks.weekend1"
}

testData = require "weeks.test"

require "modules.deprecated"

__VERSION__ = love.filesystem.getInfo("version.txt") and love.filesystem.read("version.txt") or "vUnknown"
Expand All @@ -289,6 +287,12 @@ function love.load()
}

weekMeta = { -- Add/remove weeks here
[0] = {
"Test",
{
"Test"
}
},
{
"Tutorial",
{
Expand Down Expand Up @@ -351,10 +355,6 @@ function love.load()
"Cocoa",
"Eggnog",
"Winter Horrorland"
},
{
"Cocoa",
"Eggnog"
}
},
{
Expand Down Expand Up @@ -384,7 +384,8 @@ function love.load()
"Darnell",
"Lit Up",
"2hot",
"Blazin"
"Blazin",
{"Cutscene", false}
}
}
}
Expand Down Expand Up @@ -450,6 +451,8 @@ function love.load()
Gamestate.switch(menu)

love.setFpsCap(settings.fpsCap)

DO_SAVE_DATA = true
end

function love.resize(width, height)
Expand Down Expand Up @@ -497,21 +500,6 @@ function love.keypressed(key)
end)
elseif key == "7" and not love.keyboard.isDown("lalt") then
Gamestate.switch(debugMenu)
elseif key == "7" and love.keyboard.isDown("lalt") then
status.setLoading(true)
graphics:fadeOutWipe(
0.7,
function()
_psychmod = false
storyMode = false

music:stop()

Gamestate.switch(testData, songNum)

status.setLoading(false)
end
)
elseif key == "`" and love.keyboard.isDown("lalt") then
status.setLoading(true)
graphics:fadeOutWipe(
Expand Down
1 change: 0 additions & 1 deletion src/love/modules/Checkbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ function Checkbox:new(x,y,checked)

self:setGraphicSize(math.floor(0.9 * self.width))

--self.daValue = checked
self:set_daValue(checked)

return self
Expand Down
74 changes: 74 additions & 0 deletions src/love/modules/Icon.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
return {
imagePath = function(path)
return graphics.imagePath("icons/icon-" .. path)
end,
newIcon = function(path, scale)
if not graphics.cache[path] then
graphics.cache[path] = love.graphics.newImage(path)
end
local img = graphics.cache[path]
local frameData = {
{x = 0, y = 0, width = img:getWidth()/2, height = img:getHeight(), offsetX = 0, offsetY = 0, offsetWidth = img:getWidth()/2, offsetHeight = img:getHeight(), rotated = false},
{x = img:getWidth()/2, y = 0, width = img:getWidth(), height = img:getHeight(), offsetX = 0, offsetY = 0, offsetWidth = img:getWidth()/2, offsetHeight = img:getHeight(), rotated = false}
}
local image, width, height
local frames = {}
local frame
local anims = {}
local quads = {}
for i, frame in ipairs(frameData) do
quads[i] = love.graphics.newQuad(frame.x, frame.y, frame.width, frame.height, img:getDimensions())
end
frame = quads[1]
local curFrame = 1
-- 2 frames, width = img:getWidth()/2, height = img:getHeight()
--{x = 212, y = 0, width = 68, height = 196, offsetX = 0, offsetY = 0, offsetWidth = 0, offsetHeight = 0, rotated = false}, -- <- example frame data

local object = {
x = 0,
y = 0,
orientation = 0,
sizeX = 1,
sizeY = 1,
offsetX = 0,
offsetY = 0,
shearX = 0,
shearY = 0,
scale = scale or 1,

scrollFactor = {x=1,y=1},

clipRect = nil,
stencilInfo = nil,

alpha = 1,

flipX = false,
visible = true,

setFrame = function(self, frameNum)
curFrame = frameNum
frame = quads[frameNum]
end,

getCurFrame = function(self)
return curFrame
end,

update = function(self, dt)

end,

draw = function(self)
if not self.visible then return end

local ox = frameData[curFrame].offsetWidth/2 + frameData[curFrame].offsetX
local oy = frameData[curFrame].offsetHeight/2 + frameData[curFrame].offsetY

love.graphics.draw(img, frame, self.x, self.y, self.orientation, self.sizeX * self.scale, self.sizeY * self.scale, ox, oy)
end
}

return object
end,
}
2 changes: 0 additions & 2 deletions src/love/modules/beatHandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ function beatHandler.update(dt)
beatHandler.isBeatHit = false
beatHandler.curBeat = math.abs(math.floor((musicTime / 1000) * (beatHandler.bpm / 60)))



if math.floor((musicTime / 1000) * (beatHandler.bpm / 60)) > 0 then
if beatHandler.curBeat > beatHandler.lastBeat then
beatHandler.isBeatHit = true
Expand Down
2 changes: 0 additions & 2 deletions src/love/modules/camera.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ camera.points = {}

camera.mustHit = true

-- e stands for extra

function camera:moveToMain(time, x, y)
if camTimer then
Timer.cancel(camTimer)
Expand Down
6 changes: 2 additions & 4 deletions src/love/modules/graphics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ return {
clipRect = nil,
stencilInfo = nil,

optionsTable = optionsTable or {},

alpha = 1,

icon = optionsTable and optionsTable.icon or "boyfriend",
Expand Down Expand Up @@ -524,15 +526,11 @@ return {
love.graphics.draw(
sheet,
frames[self.curFrame],
--[[ (frameData[self.curFrame].rotated and y or x),
(frameData[self.curFrame].rotated and x or y), ]]
x,
y,
self.orientation + (frameData[self.curFrame].rotated and -math.rad(90) or 0),
self.sizeX * (self.flipX and -1 or 1),
self.sizeY,
--[[ (frameData[self.curFrame].rotated and oy or ox),
(frameData[self.curFrame].rotated and ox or oy), ]]
ox,
oy,
self.shearX,
Expand Down
2 changes: 1 addition & 1 deletion src/love/sprites/characters/bfAndGF.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,6 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "boyfriend"
icon = "bf"
}
)
3 changes: 2 additions & 1 deletion src/love/sprites/characters/boyfriend-car.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ return graphics.newSprite(
false,
{
sing_duration = 4,
isCharacter = true
isCharacter = true,
icon = "bf"
}
)
2 changes: 1 addition & 1 deletion src/love/sprites/characters/boyfriend-christmas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,6 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "boyfriend"
icon = "bf",
}
)
3 changes: 2 additions & 1 deletion src/love/sprites/characters/boyfriend-pixel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "boyfriend (pixel)"
icon = "bf-pixel",
scale = 5
}
)
2 changes: 1 addition & 1 deletion src/love/sprites/characters/boyfriend.lua
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,6 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "boyfriend"
icon = "bf"
}
)
2 changes: 1 addition & 1 deletion src/love/sprites/characters/dearest-duo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "dearest duo"
icon = "parents-christmas"
}
)
2 changes: 1 addition & 1 deletion src/love/sprites/characters/mommy-mearest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,6 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "mommy mearest"
icon = "mom"
}
)
3 changes: 2 additions & 1 deletion src/love/sprites/characters/senpai-angry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "senpai"
icon = "senpai",
scale = 5
}
)
3 changes: 2 additions & 1 deletion src/love/sprites/characters/senpai.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "senpai"
icon = "senpai",
scale = 5
}
)
2 changes: 1 addition & 1 deletion src/love/sprites/characters/skid-and-pump.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "skid and pump"
icon = "spooky"
}
)
3 changes: 2 additions & 1 deletion src/love/sprites/characters/spirit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ return graphics.newSprite(
{
sing_duration = 4,
isCharacter = true,
icon = "spirit"
icon = "spirit",
scale = 5
}
)
Loading

0 comments on commit 7233dae

Please sign in to comment.