9ea2e659d3
Fixes #96 Fixes #95
47 lines
946 B
Lua
47 lines
946 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)
|
|
self.scene.assets.sfx["mBeep"]:play()
|
|
end
|
|
|
|
return PageParent
|