fix bug with photos not working from itemgrid

This commit is contained in:
Charles Ewert 2023-11-11 20:25:22 -05:00
parent fade06a703
commit 11608e6e2c

View File

@ -801,14 +801,11 @@ function onKeyEvent(key as string, press as boolean) as boolean
m.loadItemsTask.control = "stop" m.loadItemsTask.control = "stop"
return true return true
end if end if
else if key = "play" else if key = "OK"
markupGrid = m.top.findNode("itemGrid") markupGrid = m.top.findNode("itemGrid")
itemToPlay = getItemFocused() itemToPlay = getItemFocused()
if itemToPlay <> invalid if itemToPlay <> invalid and itemToPlay.type = "Photo"
m.top.quickPlayNode = itemToPlay
return true
else if itemToPlay <> invalid and itemToPlay.type = "Photo"
' Spawn photo player task ' Spawn photo player task
photoPlayer = CreateObject("roSgNode", "PhotoDetails") photoPlayer = CreateObject("roSgNode", "PhotoDetails")
photoPlayer.items = markupGrid photoPlayer.items = markupGrid
@ -816,6 +813,13 @@ function onKeyEvent(key as string, press as boolean) as boolean
m.global.sceneManager.callfunc("pushScene", photoPlayer) m.global.sceneManager.callfunc("pushScene", photoPlayer)
return true return true
end if end if
else if key = "play"
itemToPlay = getItemFocused()
if itemToPlay <> invalid
m.top.quickPlayNode = itemToPlay
return true
end if
else if key = "left" and topGrp.isinFocusChain() else if key = "left" and topGrp.isinFocusChain()
m.top.alphaActive = true m.top.alphaActive = true
topGrp.setFocus(false) topGrp.setFocus(false)