scenes/mainmenu: refactor the listmenu file

This commit is contained in:
Kazhnuz 2019-03-09 17:58:07 +01:00
parent f3d6da0271
commit 1ba8d6d251
2 changed files with 27 additions and 32 deletions

View File

@ -1,25 +0,0 @@
local ListBox = require "core.modules.menusystem.listbox"
local MenuObject = ListBox:extend()
local Widgets = require "scenes.debugmenu.widgets"
function MenuObject:new(scene, name)
local screenwidth, screenheight = core.screen:getDimensions()
local height, width, x, y
height = screenheight - (88 + 24)
width = 240
x = screenwidth/2 - width/2
y = screenheight/2 - height/2 - 8
MenuObject.super.new(self, scene.menusystem, name, x, y, width, height, 5)
self.scene = scene
self.isActive = false
self.isVisible = false
end
function MenuObject:draw()
MenuObject.super.draw(self)
end
return MenuObject

View File

@ -1,12 +1,32 @@
local menu = {}
local menuParent = require "scenes.debugmenu.menuobject"
local ListBox = require "core.modules.menusystem.listbox"
local MenuObject = ListBox:extend()
menu.Main = menuParent:extend()
menu.Debug = menuParent:extend()
menu.Levels = menuParent:extend()
menu.Bonus = menuParent:extend()
menu.Pigs = menuParent:extend()
menu.Options = menuParent:extend()
function MenuObject:new(scene, name)
local screenwidth, screenheight = core.screen:getDimensions()
local height, width, x, y
height = screenheight - (88 + 24)
width = 240
x = screenwidth/2 - width/2
y = screenheight/2 - height/2 - 8
MenuObject.super.new(self, scene.menusystem, name, x, y, width, height, 5)
self.scene = scene
self.isActive = false
self.isVisible = false
end
function MenuObject:draw()
MenuObject.super.draw(self)
end
menu.Main = MenuObject:extend()
menu.Debug = MenuObject:extend()
menu.Levels = MenuObject:extend()
menu.Bonus = MenuObject:extend()
menu.Pigs = MenuObject:extend()
menu.Options = MenuObject:extend()
local widgets = require "scenes.debugmenu.widgets"