set default backdrop color to prevent crash

This commit is contained in:
Charles Ewert 2024-01-12 20:55:48 -05:00
parent 404019c9da
commit 353fdf275e

View File

@ -21,9 +21,17 @@ sub init()
m.showProgressBarField = m.top.findNode("showProgressBarField")
' 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")
posterBackgrounds = m.global.constants.poster_bg_pallet
m.backdrop.color = posterBackgrounds[rnd(posterBackgrounds.count()) - 1]
m.backdrop.color = backdropColor
end sub