diff --git a/CHANGELOG.md b/CHANGELOG.md index 79f023e4..245fc7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- An announcement for the `This helps protect our community` error message + ### Fixed - Few optimizations with texture loading to improve memory usage diff --git a/playlet-lib/src/components/MainScene.bs b/playlet-lib/src/components/MainScene.bs index c49731db..aa50ab25 100644 --- a/playlet-lib/src/components/MainScene.bs +++ b/playlet-lib/src/components/MainScene.bs @@ -2,6 +2,7 @@ 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() m.scene = m.top.getScene() @@ -18,6 +19,7 @@ function MainSceneContainerChanged() InitEcpArgs() m.scene.signalBeacon("AppLaunchComplete") CopyLoadingMessagesToCache() + ShowAnnouncement() end function function StartWebServer() @@ -30,3 +32,28 @@ function StartWebServer() m.dialServer = m.top.findNode("DialServer") m.dialServer@.StartServer() end function + +function ShowAnnouncement() + title = "Announcement" + + message = [ + "Hello again!", + "Invidious servers are actively getting blocked by YouTube.", + `If you see the error message "This helps protect our community. Learn more" when playing a video, try changing the Invidious instance in the settings.`, + "This is a known issue and the Invidious dev team is working to fix it." + "See more information at https://github.com/iv-org/invidious/issues/4734" + "We apologize for the inconvenience." + ] + + buttons = [Tr(Locale.Buttons.OK)] + + dialog = CreateObject("roSGNode", "SimpleDialog") + dialog.title = title + dialog.message = message + dialog.buttons = buttons + deviceInfo = CreateObject("roDeviceInfo") + displaySize = deviceInfo.GetDisplaySize() + dialog.width = displaySize.w - 180 + + m.top.getScene().dialog = dialog +end function diff --git a/playlet-lib/src/components/MainScene.transpiled.brs b/playlet-lib/src/components/MainScene.transpiled.brs index 3cf9c0f9..3aa34cb1 100644 --- a/playlet-lib/src/components/MainScene.transpiled.brs +++ b/playlet-lib/src/components/MainScene.transpiled.brs @@ -2,6 +2,7 @@ '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! @@ -19,6 +20,7 @@ function MainSceneContainerChanged() InitEcpArgs() m.scene.signalBeacon("AppLaunchComplete") CopyLoadingMessagesToCache() + ShowAnnouncement() end function function StartWebServer() @@ -29,4 +31,27 @@ function StartWebServer() m.dialServer = m.top.findNode("DialServer") m.dialServer.callfunc("StartServer", invalid) end function + +function ShowAnnouncement() + title = "Announcement" + message = [ + "Hello again!" + "Invidious servers are actively getting blocked by YouTube." + "If you see the error message " + chr(34) + "This helps protect our community. Learn more" + chr(34) + " when playing a video, try changing the Invidious instance in the settings." + "This is a known issue and the Invidious dev team is working to fix it." + "See more information at https://github.com/iv-org/invidious/issues/4734" + "We apologize for the inconvenience." + ] + buttons = [ + Tr("OK") + ] + dialog = CreateObject("roSGNode", "SimpleDialog") + dialog.title = title + dialog.message = message + dialog.buttons = buttons + deviceInfo = CreateObject("roDeviceInfo") + displaySize = deviceInfo.GetDisplaySize() + dialog.width = displaySize.w - 180 + m.top.getScene().dialog = dialog +end function '//# sourceMappingURL=./MainScene.brs.map \ No newline at end of file