sonic-bluestreak/sonic-bluestreak.love/scenes/overworld/screens/mainmenu/character/pageparent.lua

48 lines
946 B
Lua
Raw Permalink Normal View History

2021-11-25 10:57:13 +01:00
local PageParent = Object:extend()
local menu = require "game.modules.menus.fancy"
local Widget = menu.BaseWidget:extend()
function PageParent:new(view, character, menu)
self.view = view
self.character = game.characters.list[character]
self.menu = menu or {}
end
function PageParent:update(dt)
end
function PageParent:getMenuSize()
return #self.menu + 1
end
function PageParent:getMenuWidgets()
for index, name in ipairs(self.menu) do
Widget(self, name, index)
end
end
function PageParent:menuResponses(i)
end
function PageParent:getCustomMenus()
end
function PageParent:draw()
end
function PageParent:drawOverEverything()
end
function Widget:new(page, name, num)
self.num = num
self.page = page
Widget.super.new(self, self.page.view.scene, "menu", name, ">")
end
function Widget:action()
self.page:menuResponses(self.num)
self.scene.assets.sfx["mBeep"]:play()
end
return PageParent