jf-roku/source/Main.brs

65 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-01-30 04:19:27 +00:00
sub Main()
2019-02-11 04:40:07 +00:00
m.port = CreateObject("roMessagePort")
2019-01-30 04:19:27 +00:00
if get_setting("server") = invalid then
2019-02-11 04:40:07 +00:00
print "Moving to server select"
2019-02-10 20:47:24 +00:00
ShowServerSelect()
end if
2019-02-10 20:47:24 +00:00
print("WE MOVED ON")
' if get_setting("active_user") = invalid then
' screen = CreateObject("roSGScreen")
' screen.setMessagePort(m.port)
2019-02-10 20:47:24 +00:00
' screen.CreateScene("UserSignIn")
' screen.show()
' TODO - sign in here
' await_response()
' screen.close()
' end if
2019-02-10 20:47:24 +00:00
screen = CreateObject("roSGScreen")
screen.setMessagePort(m.port)
first_scene = "Library"
2019-01-30 14:59:27 +00:00
'Create a scene and load a component'
m.scene = screen.CreateScene(first_scene)
2019-01-30 04:19:27 +00:00
screen.show()
libs = LibraryList().items
librow = m.scene.findNode("LibrarySelect")
'librow.GetRowListContent()
print 1 + "halt" ' Mixed types stops the debugger
2019-02-10 20:47:24 +00:00
2019-01-30 04:19:27 +00:00
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
2019-02-11 04:40:07 +00:00
if msg.isScreenClosed() then exit while
2019-01-30 04:19:27 +00:00
end if
end while
end sub
2019-02-10 20:47:24 +00:00
sub ShowServerSelect()
screen = CreateObject("roSGScreen")
screen.setMessagePort(m.port)
2019-02-11 04:40:07 +00:00
scene = screen.CreateScene("ServerSelection")
2019-02-10 20:47:24 +00:00
screen.show()
2019-01-31 04:56:15 +00:00
await_response()
2019-02-10 20:47:24 +00:00
end sub
2019-01-31 04:56:15 +00:00
2019-02-10 20:47:24 +00:00
sub await_response()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
else
print(msgType)
2019-02-10 20:47:24 +00:00
end if
end while
end sub