scenes/mainmenu: refactor the listmenu file
This commit is contained in:
parent
f3d6da0271
commit
1ba8d6d251
|
@ -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
|
|
|
@ -1,12 +1,32 @@
|
||||||
local menu = {}
|
local menu = {}
|
||||||
local menuParent = require "scenes.debugmenu.menuobject"
|
local ListBox = require "core.modules.menusystem.listbox"
|
||||||
|
local MenuObject = ListBox:extend()
|
||||||
|
|
||||||
menu.Main = menuParent:extend()
|
function MenuObject:new(scene, name)
|
||||||
menu.Debug = menuParent:extend()
|
local screenwidth, screenheight = core.screen:getDimensions()
|
||||||
menu.Levels = menuParent:extend()
|
local height, width, x, y
|
||||||
menu.Bonus = menuParent:extend()
|
height = screenheight - (88 + 24)
|
||||||
menu.Pigs = menuParent:extend()
|
width = 240
|
||||||
menu.Options = menuParent:extend()
|
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"
|
local widgets = require "scenes.debugmenu.widgets"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue