From e19dd22d8c778d40216b4ead70ddc8c9b1192216 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 6 Jan 2022 14:35:34 +0100 Subject: [PATCH] chore: remove old common menu --- .../scenes/menus/commons/menu.lua | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 sonic-radiance.love/scenes/menus/commons/menu.lua diff --git a/sonic-radiance.love/scenes/menus/commons/menu.lua b/sonic-radiance.love/scenes/menus/commons/menu.lua deleted file mode 100644 index e5da981..0000000 --- a/sonic-radiance.love/scenes/menus/commons/menu.lua +++ /dev/null @@ -1,76 +0,0 @@ -local menu = {} - -local RadianceListMenu = require "game.modules.menus.fancy" -local defTransitions = require "birb.modules.transitions" - -menu.MainMenu = RadianceListMenu.FancyMenu:extend() -menu.DebugMenu = RadianceListMenu.FancyMenu:extend() -menu.SceneWidget = RadianceListMenu.BaseWidget:extend() - -local CONST = {} -CONST.MENU = {} -CONST.MENU.X = 16 -CONST.MENU.Y = 48 -CONST.MENU.W = 424/2 -CONST.MENU.ITEM_NUMBER = 8 - --- Basic menu structure -function menu.MainMenu:new(scene, name) - local x, y = CONST.MENU.X, CONST.MENU.Y - local w = CONST.MENU.W / 1.5 - local itemNumber = CONST.MENU.ITEM_NUMBER - menu.MainMenu.super.new(self, scene, name, x, y, w, itemNumber, false) -end - -function menu.DebugMenu:new(scene, name) - local x, y = CONST.MENU.X, CONST.MENU.Y - local w = CONST.MENU.W - local itemNumber = CONST.MENU.ITEM_NUMBER - menu.DebugMenu.super.new(self, scene, name, x, y, w, itemNumber, false) -end - -function menu.DebugMenu:setPanel(panel, panelArgument) - self.panel = panel - self.panelArgument = panelArgument -end - -function menu.DebugMenu:activationAction() - if (self.panel ~= nil) then - self.scene.panel = self.panel(self.panelArgument) - end -end - -function menu.DebugMenu:clone(name) - return menu.DebugMenu(self.scene, name) -end - -function menu.DebugMenu:draw() - love.graphics.setColor(0, 0, 0, 0.5) - love.graphics.rectangle("fill", self.x, self.y, self.w, self.h) - utils.graphics.resetColor() - menu.DebugMenu.super.draw(self) -end - --- SceneWidget -function menu.SceneWidget:new(scene, menuName, newScene, newSceneName, sceneArgument) - menu.SceneWidget.super.new(self, scene, menuName, newSceneName, "") - self.newScene = newScene - self.sceneArgument = sceneArgument -end - -function menu.SceneWidget:action() - self.scene.assets:playSFX("mSelect") - self.scene:flushKeys() - if (self.sceneArgument ~= nil) then - core.screen:startTransition(defTransitions.default, defTransitions.default, - function() self.newScene(self.sceneArgument) end, - 0, 0) - else - core.screen:startTransition(defTransitions.default, defTransitions.default, - function() self.newScene() end, - 0, 0) - end -end - - -return menu