set default backdrop color to prevent crash
This commit is contained in:
parent
404019c9da
commit
353fdf275e
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user