sonic-radiance/sonic-radiance.love/scenes/overworld/screens/mainmenu/character/pageparent.lua
2021-04-23 10:21:54 +02:00

46 lines
904 B
Lua

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)
end
return PageParent