jf-roku/components/JFScene.bs

48 lines
1.3 KiB
Plaintext
Raw Normal View History

import "pkg:/source/utils/misc.bs"
2019-10-13 19:33:14 +00:00
sub init()
2021-07-09 20:08:32 +00:00
m.top.backgroundColor = "#262626" '"#101010"
m.top.backgroundURI = ""
m.spinner = m.top.findNode("spinner")
end sub
' Triggered when the isLoading boolean component field is changed
sub isLoadingChanged()
2023-11-22 13:38:16 +00:00
m.spinner.visible = m.top.isLoading
end sub
' Triggered when the disableRemote boolean component field is changed
sub disableRemoteChanged()
if m.top.disableRemote
dialog = createObject("roSGNode", "ProgressDialog")
dialog.id = "invisibiledialog"
dialog.visible = false
dialog.opacity = 0
m.top.dialog = dialog
else
if isValid(m.top.dialog)
m.top.dialog.close = true
end if
end if
2019-10-13 19:33:14 +00:00
end sub
function onKeyEvent(key as string, press as boolean) as boolean
2021-07-09 20:08:32 +00:00
if not press then return false
2019-10-13 19:33:14 +00:00
2021-07-09 20:08:32 +00:00
if key = "back"
m.global.sceneManager.callFunc("popScene")
2021-07-09 20:08:32 +00:00
return true
else if key = "options"
group = m.global.sceneManager.callFunc("getActiveScene")
2022-12-23 17:37:44 +00:00
if isValid(group) and isValid(group.optionsAvailable) and group.optionsAvailable
group.lastFocus = group.focusedChild
panel = group.findNode("options")
panel.visible = true
panel.findNode("panelList").setFocus(true)
end if
2021-07-09 20:08:32 +00:00
return true
end if
2019-10-13 19:33:14 +00:00
2021-07-09 20:08:32 +00:00
return false
2019-10-13 19:33:14 +00:00
end function