* update dependencies * Lint fix --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
77 lines
2.7 KiB
Plaintext
77 lines
2.7 KiB
Plaintext
'import "pkg:/components/Dialog/DialogUtils.bs"
|
|
'import "pkg:/components/EcpArgs.bs"
|
|
'import "pkg:/components/parts/AutoBind/AutoBind.part.bs"
|
|
'import "pkg:/components/parts/AutoBind/OnNodeReadyNoOp.bs"
|
|
'import "pkg:/source/utils/LoadingScreen.bs"
|
|
'import "pkg:/source/utils/Locale.bs"
|
|
|
|
function Init()
|
|
InitializeBindings() ' auto-generated!
|
|
m.scene = m.top.getScene()
|
|
SetScenePalette(m.scene)
|
|
' At this point, the "MainScene" node is not yet added to the scene, and does not have a parent yet.
|
|
' Let's wait until it has one.
|
|
m.MainSceneContainer = m.scene.findNode("MainSceneContainer")
|
|
m.MainSceneContainer.ObserveField("change", FuncName(MainSceneContainerChanged))
|
|
end function
|
|
|
|
function SetScenePalette(scene as object) as void
|
|
palette = scene.palette
|
|
if palette <> invalid
|
|
return
|
|
end if
|
|
palette = CreateObject("roSGNode", "RSGPalette")
|
|
palette.colors = {
|
|
DialogBackgroundColor: "#242424FF"
|
|
DialogFocusColor: "#CECECEFF"
|
|
DialogFocusItemColor: "#202020FF"
|
|
DialogSecondaryTextColor: "#EBEBEBFF"
|
|
DialogSecondaryItemColor: "#FF1C30FF"
|
|
DialogTextColor: "#EBEBEBFF"
|
|
}
|
|
scene.palette = palette
|
|
end function
|
|
|
|
function MainSceneContainerChanged()
|
|
AutoBindSceneGraph()
|
|
StartWebServer()
|
|
HideLoadingScreen()
|
|
InitEcpArgs()
|
|
m.scene.signalBeacon("AppLaunchComplete")
|
|
CopyLoadingMessagesToCache()
|
|
end function
|
|
|
|
function StartWebServer()
|
|
m.loungeService = m.top.findNode("LoungeService")
|
|
m.loungeService.callfunc("StartService", invalid)
|
|
m.webServer = m.top.findNode("WebServer")
|
|
m.webServer.callfunc("StartServer", invalid)
|
|
m.dialServer = m.top.findNode("DialServer")
|
|
m.dialServer.callfunc("StartServer", invalid)
|
|
end function
|
|
|
|
function ShowAnnouncement() as void
|
|
dialog = DialogUtils_ShowDialogOnce({
|
|
messageId: "1736288537"
|
|
title: "Announcement - Playlet backend"
|
|
message: [
|
|
"An experimental built-in backend has been added to Playlet."
|
|
"This allows you to access YouTube content without the need for an Invidious instance."
|
|
"To use it, go to the Settings > Invidious > Instance and set the field to empty (Edit, and delete the url)."
|
|
"Please note that it's missing some features and may not work as expected."
|
|
"Thank you for using Playlet!"
|
|
]
|
|
alwaysOnTop: true
|
|
marginWidth: 180
|
|
})
|
|
if dialog = invalid
|
|
return
|
|
end if
|
|
m.scene.signalBeacon("AppDialogInitiate")
|
|
m.top.observeField("wasClosed", FuncName(OnAnnouncementDialogClosed))
|
|
end function
|
|
|
|
function OnAnnouncementDialogClosed()
|
|
m.scene.signalBeacon("AppDialogComplete")
|
|
end function
|
|
'//# sourceMappingURL=./MainScene.brs.map |