Begin work on server selection screen
This commit is contained in:
parent
f2358a1e42
commit
cf4554b7e6
9
components/ServerSelect.brs
Normal file
9
components/ServerSelect.brs
Normal file
|
@ -0,0 +1,9 @@
|
|||
sub init()
|
||||
print "HI"
|
||||
m.top.backgroundColor = "#000b35"
|
||||
r = m.top.findNode("theRect")
|
||||
print(r)
|
||||
m.top.visible = true
|
||||
print "HI"
|
||||
m.top.setFocus(true)
|
||||
end sub
|
21
components/ServerSelect.xml
Normal file
21
components/ServerSelect.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<component name="ServerSelect" extends="Scene">
|
||||
<children>
|
||||
<Rectangle
|
||||
id="theRect"
|
||||
color="#000b35"
|
||||
width="1920"
|
||||
height="1080"
|
||||
opacity=".6"
|
||||
translation="[0,0]" />
|
||||
|
||||
<label text="Connect to Server" translation="[150, 150]" />
|
||||
</children>
|
||||
|
||||
<interface>
|
||||
<field id="hostname" type="string" />
|
||||
<field id="port" type="string" />
|
||||
</interface>
|
||||
|
||||
<script type="text/brightscript" uri="pkg:/components/ServerSelect.brs"/>
|
||||
</component>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<component name="ServerSelect" extends="Scene">
|
||||
|
||||
<!-- BrightScript Portion -->
|
||||
<script type="text/brightscript" >
|
||||
<![CDATA[
|
||||
'**
|
||||
'** Example: Edit a Label size and color with BrightScript
|
||||
'**
|
||||
|
||||
function init()
|
||||
m.top.setFocus(true)
|
||||
|
||||
'**
|
||||
'** The full list of editable attributes can be located at:
|
||||
'** http://sdkdocs.roku.com/display/sdkdoc/Label#Label-Fields
|
||||
'**
|
||||
end function
|
||||
]]>
|
||||
</script>
|
||||
<!-- End of BrightScript Portion -->
|
||||
</component>
|
|
@ -1,25 +1,26 @@
|
|||
sub Main()
|
||||
'Indicate this is a Roku SceneGraph application'
|
||||
globals()
|
||||
|
||||
screen = CreateObject("roSGScreen")
|
||||
m.port = CreateObject("roMessagePort")
|
||||
screen.setMessagePort(m.port)
|
||||
|
||||
if get_setting("server") = invalid then
|
||||
set_setting("server", get_var("server"))
|
||||
screen.CreateScene("ServerSelect")
|
||||
screen.show()
|
||||
' TODO - Do server select logic here
|
||||
print("SERVER IS MISSING")
|
||||
ShowServerSelect()
|
||||
end if
|
||||
|
||||
print("WE MOVED ON")
|
||||
m.port = CreateObject("roMessagePort")
|
||||
if get_setting("active_user") = invalid then
|
||||
screen = CreateObject("roSGScreen")
|
||||
screen.setMessagePort(m.port)
|
||||
|
||||
screen.CreateScene("UserSignIn")
|
||||
screen.show()
|
||||
' TODO - sign in here
|
||||
get_token(get_var("username"), get_var("password"))
|
||||
await_response()
|
||||
screen.close()
|
||||
end if
|
||||
|
||||
screen = CreateObject("roSGScreen")
|
||||
screen.setMessagePort(m.port)
|
||||
|
||||
first_scene = "Library"
|
||||
'Create a scene and load a component'
|
||||
m.scene = screen.CreateScene(first_scene)
|
||||
|
@ -30,6 +31,8 @@ sub Main()
|
|||
|
||||
'librow.GetRowListContent()
|
||||
|
||||
print 1 + "halt"
|
||||
|
||||
while(true)
|
||||
msg = wait(0, m.port)
|
||||
msgType = type(msg)
|
||||
|
@ -39,8 +42,30 @@ sub Main()
|
|||
end while
|
||||
end sub
|
||||
|
||||
sub ShowServerSelect()
|
||||
screen = CreateObject("roSGScreen")
|
||||
m.port = CreateObject("roMessagePort")
|
||||
screen.setMessagePort(m.port)
|
||||
scene = screen.CreateScene("ServerSelect")
|
||||
screen.show()
|
||||
|
||||
function get_var(key as String)
|
||||
return GetGlobalAA().Lookup(key)
|
||||
end function
|
||||
while(true)
|
||||
msg = wait(0, m.port)
|
||||
msgType = type(msg)
|
||||
|
||||
if msgType = "roSGScreenEvent"
|
||||
if msg.isScreenClosed() then return
|
||||
end if
|
||||
|
||||
end while
|
||||
end sub
|
||||
|
||||
sub await_response()
|
||||
while(true)
|
||||
msg = wait(0, m.port)
|
||||
msgType = type(msg)
|
||||
if msgType = "roSGScreenEvent"
|
||||
if msg.isScreenClosed() then return
|
||||
end if
|
||||
end while
|
||||
end sub
|
||||
|
|
Loading…
Reference in New Issue
Block a user