2022-03-04 04:06:19 +01:00
|
|
|
local Dim = require("common.dimensions")
|
|
|
|
local Wallpaper = require("components.wallpaper")
|
|
|
|
|
2022-04-03 01:35:41 +02:00
|
|
|
local PageView = require("components.pager.pageview")
|
2022-04-05 17:31:02 +02:00
|
|
|
local MainMenuPage = require("titlescreen.pages.service.mainmenupage")
|
2022-04-03 01:35:41 +02:00
|
|
|
|
|
|
|
--[[ WIP: REIMPLEMENTATION
|
2021-12-20 00:39:38 +01:00
|
|
|
|
2021-12-20 01:34:41 +01:00
|
|
|
local rootMenu = {
|
2022-03-12 15:18:41 +01:00
|
|
|
{label = "IDOLS", children = {{label = "GRACEv6"}, {label = "NEARNOAHv6"}, {label = "IDKv6"}}},
|
2021-12-20 00:39:38 +01:00
|
|
|
{
|
2022-03-12 15:18:41 +01:00
|
|
|
label = "LASER COLORS",
|
2021-12-20 00:39:38 +01:00
|
|
|
children = {
|
|
|
|
{
|
2022-03-12 15:18:41 +01:00
|
|
|
label = "LEFT LASER",
|
2021-12-20 01:34:41 +01:00
|
|
|
children = {
|
2022-03-12 15:18:41 +01:00
|
|
|
{label = "BLUE", color = {0, 128, 255}},
|
|
|
|
{label = "PINK", color = {255, 0, 255}},
|
|
|
|
{label = "GREEN", color = {0, 255, 0}},
|
|
|
|
{label = "YELLOW", color = {255, 255, 0}},
|
|
|
|
},
|
2021-12-20 01:34:41 +01:00
|
|
|
},
|
2021-12-20 00:39:38 +01:00
|
|
|
{
|
2022-03-12 15:18:41 +01:00
|
|
|
label = "RIGHT LASER",
|
|
|
|
children = {{label = "BLUE"}, {label = "PINK"}, {label = "GREEN"}, {label = "YELLOW"}},
|
|
|
|
},
|
|
|
|
},
|
2021-12-20 00:39:38 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-04-03 01:35:41 +02:00
|
|
|
]]
|
|
|
|
|
2022-04-27 02:40:22 +02:00
|
|
|
local currentpage = MainMenuPage.new()
|
2022-04-03 04:59:43 +02:00
|
|
|
|
2022-04-27 02:40:22 +02:00
|
|
|
local pageview = PageView.new(currentpage)
|
2022-04-03 01:35:41 +02:00
|
|
|
|
|
|
|
local function reset()
|
2022-04-27 02:40:22 +02:00
|
|
|
pageview = PageView.new(currentpage)
|
2022-04-03 01:35:41 +02:00
|
|
|
end
|
2021-12-20 00:39:38 +01:00
|
|
|
|
2022-03-04 04:06:19 +01:00
|
|
|
local function render(deltaTime)
|
|
|
|
Dim.updateResolution()
|
|
|
|
|
|
|
|
Wallpaper.render()
|
|
|
|
|
|
|
|
Dim.transformToScreenSpace()
|
|
|
|
|
2022-04-03 01:35:41 +02:00
|
|
|
pageview:render(deltaTime)
|
|
|
|
|
2022-04-05 23:55:50 +02:00
|
|
|
--pageview will be empty when you `back()` out of the root page
|
|
|
|
if not pageview:get() then
|
2022-03-12 15:18:41 +01:00
|
|
|
return {eventType = "switch", toScreen = "splash"}
|
2021-12-20 00:39:38 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-04-03 01:35:41 +02:00
|
|
|
local function onButtonPressed(button)
|
2022-04-05 23:55:50 +02:00
|
|
|
pageview:get():handleButtonInput(button)
|
2021-12-20 00:39:38 +01:00
|
|
|
end
|
|
|
|
|
2022-04-03 01:35:41 +02:00
|
|
|
return {reset = reset, render = render, onButtonPressed = onButtonPressed}
|