From e1839b66cd72297cac447cc9495b7cc2651b770d Mon Sep 17 00:00:00 2001 From: Nick Bisby Date: Sat, 12 Oct 2019 16:23:44 -0500 Subject: [PATCH] Make back exit the library group --- source/Main.brs | 3 ++- source/ShowScenes.brs | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source/Main.brs b/source/Main.brs index d124a206..ae594daf 100644 --- a/source/Main.brs +++ b/source/Main.brs @@ -32,7 +32,8 @@ sub Main() else if isNodeEvent(msg, "backPressed") ' Pop a group off the stack and expose what's below n = m.scene.getChildCount() - 1 - if n = 0 + if n = 1 + ' Overhang + last scene... this is the end return end if m.scene.removeChildIndex(n) diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs index 2e475c29..4fbf8c91 100644 --- a/source/ShowScenes.brs +++ b/source/ShowScenes.brs @@ -106,18 +106,19 @@ end sub function CreateLibraryScene() ' Main screen after logging in. Shows the user's libraries - libscene = CreateObject("roSGNode", "Library") + group = CreateObject("roSGNode", "Library") libs = LibraryList() - libscene.libraries = libs - libscene.observeField("librarySelected", m.port) + group.libraries = libs + group.observeField("librarySelected", m.port) + group.observeField("backPressed", m.port) - library = libscene.findNode("LibrarySelect") + library = group.findNode("LibrarySelect") - search = libscene.findNode("search") + search = group.findNode("search") - sidepanel = libscene.findNode("options") + sidepanel = group.findNode("options") new_options = [] options_buttons = [ {"title": "Change server", "id": "change_server"}, @@ -146,7 +147,7 @@ function CreateLibraryScene() sidepanel.options = new_options - return libscene + return group end function function CreateMovieScene(library)