Removed some unused stuff

This commit is contained in:
entar 2025-08-11 09:01:36 +07:00
parent c5320c46de
commit d582985c8f
2 changed files with 12 additions and 25 deletions

View File

@ -1,8 +1,8 @@
local logging = require("modules.logging")
---@class engine.button
---@field _position engine.vector2
---@field _size engine.vector2
---@field position engine.vector2
---@field size engine.vector2
local ButtonClass = {}
ButtonClass.__index = ButtonClass
@ -24,18 +24,18 @@ end
---@param enabled boolean
function ButtonClass:SetEnabled(enabled)
self._enabled = enabled
self.enabled = enabled
end
---@param position engine.vector2
function ButtonClass:SetPosition(position)
-- print(logging.dump(position))
self._position = position
self.position = position
end
---@param size engine.vector2
function ButtonClass:SetSize(size)
self._size = size
self.size = size
end
function ButtonClass:Destroy()
@ -78,7 +78,7 @@ function buttons.processMouse(x, y)
end
else
rect = {x = Button._position.x, y = Button._position.y, width = Button._size.x, height = Button._size.y}
rect = {x = Button.position.x, y = Button.position.y, width = Button.size.x, height = Button.size.y}
end
local pressed = isPointInRectangle(x, y, rect.x, rect.y, rect.width, rect.height)
@ -105,11 +105,11 @@ end
function Button(position, size, callback, enabled)
local newButton = setmetatable({
---@protected
_position = position or Vector2(),
position = position or Vector2(),
---@protected
_size = size or Vector2(50, 50),
size = size or Vector2(50, 50),
---@protected
_callback = callback,
callback = callback,
---@protected
_enabled = callback and true
}, ButtonClass)
@ -124,9 +124,9 @@ function SpriteButton(sprite, callback, enabled)
print("Spritebutton")
sprite.__index = SpriteButtonClass
sprite.DestroySpriteButton = SpriteButtonClass.DestroySpriteButton
sprite._callback = callback
sprite._enabled = enabled or callback ~= nil
sprite._spriteButton = true
sprite.callback = callback
sprite.enabled = enabled or callback ~= nil
sprite.spriteButton = true
Buttons[#Buttons + 1] = sprite
print("Added spritebutton")

View File

@ -146,11 +146,9 @@ local function state(songName, songDifficulty, show)
local data = love.filesystem.getSaveDirectory()
local ui = {
timebar = true,
healthIcons = true, -- If halth is false it wont render either way
health = true,
score = true,
ratings = true,
}
local settings = {}
@ -206,7 +204,6 @@ local function state(songName, songDifficulty, show)
--- @field canStart boolean
--- @field screenSize engine.vector2
--- @field canvasSize engine.vector2
--- @field singVectors table<engine.vector2>
--- @field settings table
--- @field receptors table<engine.sprite>
--- @field splashes table<engine.sprite>
@ -220,16 +217,6 @@ local function state(songName, songDifficulty, show)
canStart = true,
screenSize = Vector2(1280, 720),
canvasSize = Vector2(3840, 2160),
singVectors = {
singLEFT = Vector2(20, 0),
singDOWN = Vector2(0, -20),
singUP = Vector2(0, 20),
singRIGHT = Vector2(-20, 0),
["singLEFT-alt"] = Vector2(20, 0), -- alt anims need to be here too
["singDOWN-alt"] = Vector2(0, -20),
["singUP-alt"] = Vector2(0, 20),
["singRIGHT-alt"] = Vector2(-20, 0)
},
settings = settings,
receptors = receptors,
splashes = splashes,