Merge pull request #1645 from cewert/fix-homeitem-crash

This commit is contained in:
Charles Ewert 2024-01-13 19:37:08 -05:00 committed by GitHub
commit 5be021e662
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,9 +21,17 @@ sub init()
m.showProgressBarField = m.top.findNode("showProgressBarField") m.showProgressBarField = m.top.findNode("showProgressBarField")
' Randomize the background colors ' Randomize the background colors
backdropColor = "#00a4db" ' set default in case global var is invalid
localGlobal = m.global
if isValid(localGlobal) and isValid(localGlobal.constants) and isValid(localGlobal.constants.poster_bg_pallet)
posterBackgrounds = localGlobal.constants.poster_bg_pallet
backdropColor = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
end if
' update the backdrop node
m.backdrop = m.top.findNode("backdrop") m.backdrop = m.top.findNode("backdrop")
posterBackgrounds = m.global.constants.poster_bg_pallet m.backdrop.color = backdropColor
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
end sub end sub