2022-04-03 19:43:50 +02:00
|
|
|
require("common.class")
|
2022-04-05 17:31:02 +02:00
|
|
|
local ServicePage = require("titlescreen.pages.service.servicepage")
|
|
|
|
local InputButtonField = require("titlescreen.fields.service.inputbuttonfield")
|
|
|
|
local InputKnobField = require("titlescreen.fields.service.inputknobfield")
|
2022-04-03 04:59:43 +02:00
|
|
|
|
|
|
|
---@class InputCheckPage: ServicePage
|
2022-04-05 23:53:19 +02:00
|
|
|
local InputCheckPage = {
|
|
|
|
__tostring = function () return "InputCheckPage" end,
|
|
|
|
}
|
2022-04-03 04:59:43 +02:00
|
|
|
|
|
|
|
---Create a new InputCheckPage instance
|
|
|
|
---
|
|
|
|
---Inherits from ServicePage
|
2022-04-03 19:43:50 +02:00
|
|
|
---@param o ServicePage
|
2022-04-03 04:59:43 +02:00
|
|
|
---@return InputCheckPage
|
|
|
|
function InputCheckPage:new(o)
|
2022-04-03 19:43:50 +02:00
|
|
|
o = Inherit(self, ServicePage, o)
|
2022-04-03 04:59:43 +02:00
|
|
|
|
2022-04-03 19:43:50 +02:00
|
|
|
o.title = o.title or "INPUT CHECK"
|
|
|
|
o.footer = o.footer or "BACK = RETURN TO LAST PAGE"
|
2022-04-03 04:59:43 +02:00
|
|
|
|
|
|
|
o:addField(InputButtonField:new{label="START BUTTON", button=game.BUTTON_STA})
|
|
|
|
o:addField(InputButtonField:new{label="A BUTTON", button=game.BUTTON_BTA})
|
|
|
|
o:addField(InputButtonField:new{label="B BUTTON", button=game.BUTTON_BTB})
|
|
|
|
o:addField(InputButtonField:new{label="C BUTTON", button=game.BUTTON_BTC})
|
|
|
|
o:addField(InputButtonField:new{label="D BUTTON", button=game.BUTTON_BTD})
|
|
|
|
o:addField(InputButtonField:new{label="FX L BUTTON", button=game.BUTTON_FXL})
|
|
|
|
o:addField(InputButtonField:new{label="FX R BUTTON", button=game.BUTTON_FXR})
|
|
|
|
o:addField(InputKnobField:new{label="ANALOG VOLUME L", knob=0})
|
|
|
|
o:addField(InputKnobField:new{label="ANALOG VOLUME R", knob=1})
|
|
|
|
|
|
|
|
return o
|
|
|
|
end
|
|
|
|
|
2022-04-03 19:43:50 +02:00
|
|
|
function InputCheckPage:handleButtonInput(button)
|
|
|
|
local stop_processing = false
|
|
|
|
local field = self.content[self.selectedIndex]
|
|
|
|
if field and field.handleButtonInput then
|
|
|
|
stop_processing = field:handleButtonInput(button)
|
|
|
|
end
|
|
|
|
|
|
|
|
if not stop_processing then
|
|
|
|
if button == game.BUTTON_BCK then
|
|
|
|
if self.viewHandler then
|
|
|
|
self.viewHandler:back()
|
|
|
|
end
|
|
|
|
return
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-04-05 23:53:19 +02:00
|
|
|
return InputCheckPage
|