moved service page and service field to page API
This commit is contained in:
parent
f543cd21f4
commit
a6a95cbd9c
|
@ -2,7 +2,7 @@ require("common.class")
|
|||
local Dim = require("common.dimensions")
|
||||
local Util = require("common.util")
|
||||
local Page = require("api.page.page")
|
||||
local ServiceField = require("titlescreen.components.servicefield")
|
||||
local ServiceField = require("api.page.servicefield")
|
||||
|
||||
---@class ServicePage: Page
|
||||
---@field title string|string[]
|
||||
|
@ -52,7 +52,7 @@ function ServicePage:refreshFields()
|
|||
if index == self.selectedIndex then
|
||||
field:focus()
|
||||
else
|
||||
field:deactivate()
|
||||
field:unfocus()
|
||||
end
|
||||
end
|
||||
Page.refreshFields(self)
|
||||
|
@ -72,9 +72,7 @@ function ServicePage:handleButtonInput(button)
|
|||
local direction = 0
|
||||
|
||||
if button == game.BUTTON_BCK then
|
||||
if self.viewHandler then
|
||||
self.viewHandler:back()
|
||||
end
|
||||
self:onInvalidation()
|
||||
return
|
||||
elseif button == game.BUTTON_BTA then
|
||||
direction = -1
|
||||
|
@ -83,7 +81,7 @@ function ServicePage:handleButtonInput(button)
|
|||
end
|
||||
|
||||
if direction ~= 0 then
|
||||
field:deactivate()
|
||||
field:unfocus()
|
||||
|
||||
self.selectedIndex = Util.modIndex(self.selectedIndex + direction, #self.content)
|
||||
|
Loading…
Reference in New Issue