page management code refactor

This commit is contained in:
Hersi 2022-04-27 12:29:54 +02:00
parent badbaabe2b
commit 4feb6a8645
24 changed files with 35 additions and 35 deletions

View File

@ -1,5 +1,5 @@
require("common.class")
local Field = require("components.pager.field")
local Field = require("api.page.field")
---@class ContainerField: Field
---@field content Field[]

View File

@ -1,5 +1,5 @@
require("common.class")
local Field = require("components.pager.field")
local Field = require("api.page.field")
---@class LinkField: Field
---@field link Page

View File

@ -1,7 +1,7 @@
local Dim = require("common.dimensions")
local Wallpaper = require("components.wallpaper")
local BootPage = require("titlescreen.pages.boot.bootpage")
local PageView = require("components.pager.pageview")
local PageView = require("api.page.pageview")
local bootpage = BootPage.new()
local pageview = PageView.new(bootpage)

View File

@ -1,6 +1,6 @@
require("common.class")
local Util = require("common.util")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ServiceField = require("titlescreen.components.servicefield")
---@class CheckUpdateField: ServiceField
---@field onUpdateAvailable nil|fun(url: string, version: string)

View File

@ -1,6 +1,6 @@
require("common.class")
local Util = require("common.util")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ServiceField = require("titlescreen.components.servicefield")
---@class ColorGradientField: ServiceField
local ColorGradientField = {

View File

@ -1,5 +1,5 @@
require("common.class")
local ContainerField = require("components.pager.containerfield")
local ContainerField = require("api.page.containerfield")
---@class DialogField: ContainerField
---@field _symbolMargin number

View File

@ -1,5 +1,5 @@
require("common.class")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ServiceField = require("titlescreen.components.servicefield")
---@class InputButtonField: ServiceField
---@field button integer

View File

@ -1,6 +1,6 @@
require("common.class")
local Util = require("common.util")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ServiceField = require("titlescreen.components.servicefield")
---@class InputKnobField: ServiceField
---@field knob integer

View File

@ -1,6 +1,6 @@
require("common.class")
local ContainerField = require("components.pager.containerfield")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ContainerField = require("api.page.containerfield")
local ServiceField = require("titlescreen.components.servicefield")
---@class ListField: ContainerField, ServiceField
---@field selectedIndex integer

View File

@ -1,6 +1,6 @@
require("common.class")
local Util = require("common.util")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ServiceField = require("titlescreen.components.servicefield")
---@class SelfTestStatusEnum
SelfTestStatusEnum = {

View File

@ -1,6 +1,6 @@
require("common.class")
local Dim = require("common.dimensions")
local Field = require("components.pager.field")
local Field = require("api.page.field")
---@class ServiceFieldState
ServiceFieldState = {

View File

@ -1,6 +1,6 @@
require("common.class")
local LinkField = require("components.pager.linkfield")
local ServiceField = require("titlescreen.fields.service.servicefield")
local LinkField = require("api.page.linkfield")
local ServiceField = require("titlescreen.components.servicefield")
---@class ServiceLinkField: LinkField, ServiceField
local ServiceLinkField = {

View File

@ -1,5 +1,5 @@
require("common.class")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ServiceField = require("titlescreen.components.servicefield")
---@class UpdateField: ServiceField
---@field _timer number

View File

@ -2,11 +2,11 @@ require("common.class")
require("common.filereader")
local Dim = require("common.dimensions")
local Version = require("common.version")
local Page = require("components.pager.page")
local Page = require("api.page.page")
local CheckUpdatePage = require("titlescreen.pages.boot.checkupdatepage")
local ServiceField = require("titlescreen.fields.service.servicefield")
local ListField = require("titlescreen.fields.service.listfield")
local SelfTestField = require("titlescreen.fields.boot.selftestfield")
local ServiceField = require("titlescreen.components.servicefield")
local ListField = require("titlescreen.components.listfield")
local SelfTestField = require("titlescreen.components.selftestfield")
---@class BootPage: Page
local BootPage = {

View File

@ -1,8 +1,8 @@
require("common.class")
local Dim = require("common.dimensions")
local Page = require("components.pager.page")
local CheckUpdateField = require("titlescreen.fields.boot.checkupdatefield")
local DialogField = require("titlescreen.fields.boot.dialogfield")
local Page = require("api.page.page")
local CheckUpdateField = require("titlescreen.components.checkupdatefield")
local DialogField = require("titlescreen.components.dialogfield")
---@class CheckUpdatePage: Page
---@field _focusedField CheckUpdateField

View File

@ -1,7 +1,7 @@
require("common.class")
local ServicePage = require("titlescreen.pages.service.servicepage")
local ListField = require("titlescreen.fields.service.listfield")
local ColorGradientField = require("titlescreen.fields.service.colorgradientfield")
local ListField = require("titlescreen.components.listfield")
local ColorGradientField = require("titlescreen.components.colorgradientfield")
---@class ColorCheckPage: ServicePage
local ColorCheckPage = {

View File

@ -1,8 +1,8 @@
require("common.class")
local ServicePage = require("titlescreen.pages.service.servicepage")
local InputButtonField = require("titlescreen.fields.service.inputbuttonfield")
local InputKnobField = require("titlescreen.fields.service.inputknobfield")
local ListField = require("titlescreen.fields.service.listfield")
local InputButtonField = require("titlescreen.components.inputbuttonfield")
local InputKnobField = require("titlescreen.components.inputknobfield")
local ListField = require("titlescreen.components.listfield")
---@class InputCheckPage: ServicePage
local InputCheckPage = {

View File

@ -4,8 +4,8 @@ local InputCheckPage = require("titlescreen.pages.service.inputcheckpage")
local ScreenCheckPage = require("titlescreen.pages.service.screencheckpage")
local ColorCheckPage = require("titlescreen.pages.service.colorcheckpage")
local VersionInfoPage = require("titlescreen.pages.service.versioninfopage")
local ServiceLinkField = require("titlescreen.fields.service.servicelinkfield")
local ListField = require("titlescreen.fields.service.listfield")
local ServiceLinkField = require("titlescreen.components.servicelinkfield")
local ListField = require("titlescreen.components.listfield")
---@class MainMenuPage: ServicePage
local MainMenuPage = {

View File

@ -1,8 +1,8 @@
require("common.class")
local Dim = require("common.dimensions")
local Util = require("common.util")
local Page = require("components.pager.page")
local ServiceField = require("titlescreen.fields.service.servicefield")
local Page = require("api.page.page")
local ServiceField = require("titlescreen.components.servicefield")
---@class ServicePage: Page
---@field title string|string[]

View File

@ -3,9 +3,9 @@ require("common.filereader")
require("common.gameconfig")
local Version = require("common.version")
local ServicePage = require("titlescreen.pages.service.servicepage")
local ServiceField = require("titlescreen.fields.service.servicefield")
local UpdateField = require("titlescreen.fields.service.updatefield")
local ListField = require("titlescreen.fields.service.listfield")
local ServiceField = require("titlescreen.components.servicefield")
local UpdateField = require("titlescreen.components.updatefield")
local ListField = require("titlescreen.components.listfield")
local function getGameLogValue(prefix, str)
local pattern = prefix .. ":%s*([^\r\n]*)"

View File

@ -1,7 +1,7 @@
local Dim = require("common.dimensions")
local Wallpaper = require("components.wallpaper")
local PageView = require("components.pager.pageview")
local PageView = require("api.page.pageview")
local MainMenuPage = require("titlescreen.pages.service.mainmenupage")
--[[ WIP: REIMPLEMENTATION