local Dim = require("common.dimensions") local Wallpaper = require("components.wallpaper") local PageView = require("components.pager.pageview") local MainMenuPage = require("titlescreen.pages.service.mainmenupage") --[[ WIP: REIMPLEMENTATION local triggerSplashScreen = false local updateUrl, updateVersion = game.UpdateAvailable() local updateTimer = 0 local updateFlickerTime = 0.5 --seconds ---Draw special slider field --- --- Tip: You can specify a background using the gfx.FillColor or gfx.FillPaint --- functions before calling this function ---@param x number ---@param y number ---@param w number ---@param h number ---@param val number ---@param max? number optional maximum value (default 1.0) ---@param min? number optional minimum value (default 0.0) local function drawSlider(x, y, w, h, val, max, min) max = max or 1.0 min = min or 0.0 -- draw background gfx.BeginPath() gfx.Rect(x, y, w, h) gfx.Fill() -- draw frame gfx.BeginPath() gfx.Rect(x, y, w, h) gfx.StrokeColor(255, 255, 255) gfx.StrokeWidth(2) gfx.Stroke() if max == min then return -- would be an error case end -- draw indicator local pos = x + (val - min) * ((x + w - x) / (max - min)) --lerp gfx.BeginPath() gfx.Rect(pos, y, 4, h) gfx.FillColor(0, 255, 0) gfx.Fill() end ---Draw special text field ---@param x number ---@param y number ---@param text string ---@param color? table optional {R, G, B} integer array ---@param fontSize? integer optional font size local function drawText(x, y, text, color, fontSize) gfx.BeginPath() if color then gfx.FillColor(color[1], color[2], color[3]) end if fontSize then gfx.FontSize(fontSize) end gfx.Text(text, x, y) end local rootMenu = { {label = "IDOLS", children = {{label = "GRACEv6"}, {label = "NEARNOAHv6"}, {label = "IDKv6"}}}, { label = "LASER COLORS", children = { { label = "LEFT LASER", children = { {label = "BLUE", color = {0, 128, 255}}, {label = "PINK", color = {255, 0, 255}}, {label = "GREEN", color = {0, 255, 0}}, {label = "YELLOW", color = {255, 255, 0}}, }, }, { label = "RIGHT LASER", children = {{label = "BLUE"}, {label = "PINK"}, {label = "GREEN"}, {label = "YELLOW"}}, }, }, }, {label = "BACK TO TITLE SCREEN", type = "back", handler = function() triggerSplashScreen = true end}, } local index = 1 ]] local currentpage = MainMenuPage:new() local pageview = PageView:new(currentpage) local function reset() pageview = PageView:new(currentpage) end local function render(deltaTime) Dim.updateResolution() Wallpaper.render() Dim.transformToScreenSpace() pageview:render(deltaTime) --[[ WIP: REIMPLEMENTATION gfx.BeginPath() gfx.FillColor(0, 0, 0, 255) gfx.Rect(0, 0, 1080, 1920) gfx.Fill() gfx.LoadSkinFont("dfmarugoth.ttf") gfx.FillColor(255, 255, 255, 255) gfx.TextAlign(gfx.TEXT_ALIGN_CENTER + gfx.TEXT_ALIGN_MIDDLE) gfx.FontSize(24) gfx.BeginPath() gfx.Text("SERIVCE MENU", 1080 / 2, 128) gfx.Text("BT-A/BT-B = UP/DOWN", 1080 / 2, 1920 - 256 - 28) gfx.Text("START = SELECT", 1080 / 2, 1920 - 256) gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) local yOffset = 256 for i, menuItem in ipairs(menu) do if menuItem.type == "back" then yOffset = yOffset + 28 * 2 else yOffset = yOffset + 28 end if (i == index) then if menuItem.color then gfx.FillColor(menuItem.color[1], menuItem.color[2], menuItem.color[3]) else gfx.FillColor(0, 255, 0, 255) end -- gfx.FillColor(0,128,255,255) else gfx.FillColor(255, 255, 255, 255) end gfx.BeginPath() gfx.Text(menuItem.label, 100, yOffset) end ]] if not pageview.pageStack[1] then return {eventType = "switch", toScreen = "splash"} end end local function onButtonPressed(button) pageview.pageStack[1]:handleButtonInput(button) end return {reset = reset, render = render, onButtonPressed = onButtonPressed}