From d582985c8f5ef36419bdcf0132eab653b57854b8 Mon Sep 17 00:00:00 2001 From: entar Date: Mon, 11 Aug 2025 09:01:36 +0700 Subject: [PATCH] Removed some unused stuff --- modules/types/button.lua | 24 ++++++++++++------------ states/playstate.lua | 13 ------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/modules/types/button.lua b/modules/types/button.lua index 96c948d..6f8bdb9 100644 --- a/modules/types/button.lua +++ b/modules/types/button.lua @@ -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") diff --git a/states/playstate.lua b/states/playstate.lua index 9177c9a..3d38275 100644 --- a/states/playstate.lua +++ b/states/playstate.lua @@ -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 --- @field settings table --- @field receptors table --- @field splashes table @@ -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,