Skip to content

Commit

Permalink
Merge pull request #1645 from cewert/fix-homeitem-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert authored Jan 14, 2024
2 parents 6edcf29 + 7527d40 commit 5be021e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions components/home/HomeItem.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 5be021e

Please sign in to comment.