From be24a19c8f3ca4adf4a2bc9e7f510065ef2a64ba Mon Sep 17 00:00:00 2001 From: JD Layman Date: Mon, 13 Sep 2021 21:03:32 -0500 Subject: [PATCH] Add groups to stack to manage active group for main scene --- components/JFScene.brs | 10 +- components/JFScene.xml | 6 +- components/data/GroupStack.brs | 144 ++++++++++++++++++++++ components/data/GroupStack.xml | 9 ++ source/Main.brs | 219 +++++---------------------------- source/ShowScenes.brs | 10 ++ source/VideoPlayer.brs | 27 ++-- source/utils/sceneManager.brs | 14 +++ 8 files changed, 229 insertions(+), 210 deletions(-) create mode 100755 components/data/GroupStack.brs create mode 100755 components/data/GroupStack.xml create mode 100755 source/utils/sceneManager.brs diff --git a/components/JFScene.brs b/components/JFScene.brs index 77bac9ff..a78c908d 100644 --- a/components/JFScene.brs +++ b/components/JFScene.brs @@ -7,10 +7,16 @@ function onKeyEvent(key as string, press as boolean) as boolean if not press then return false if key = "back" - m.top.backPressed = true + m.global.groupStack.callFunc("pop") return true else if key = "options" - m.top.optionsPressed = true + group = m.global.groupStack.callFunc("peek") + if group.optionsAvailable + group.lastFocus = group.focusedChild + panel = group.findNode("options") + panel.visible = true + panel.findNode("panelList").setFocus(true) + end if return true end if diff --git a/components/JFScene.xml b/components/JFScene.xml index 1b252cbc..3bf905da 100644 --- a/components/JFScene.xml +++ b/components/JFScene.xml @@ -1,8 +1,10 @@ + + + - - +