Fix ui flicker in dev player
This commit is contained in:
1 parent
5c215ca974
commit
ee8f7a05dd
4 files changed
+24
-3
No files matched your search
@@ -3,6 +3,7 @@ import "pkg:/source/utils/Types.bs"
|
||||
function Init()
|
||||
m.background = m.top.findNode("background")
|
||||
m.icon = m.top.findNode("icon")
|
||||
m.icon2 = m.top.findNode("icon2")
|
||||
|
||||
OnDisabledChange()
|
||||
|
||||
@@ -19,9 +20,11 @@ function OnButtonFocused()
|
||||
if buttonFocused
|
||||
m.background.blendColor = m.top.focusedBackgroundColor
|
||||
m.icon.blendColor = m.top.focusedIconColor
|
||||
m.icon2.blendColor = m.top.focusedIconColor
|
||||
else
|
||||
m.background.blendColor = m.top.backgroundColor
|
||||
m.icon.blendColor = m.top.iconColor
|
||||
m.icon2.blendColor = m.top.iconColor
|
||||
end if
|
||||
end function
|
||||
|
||||
@@ -31,6 +34,7 @@ function OnDisabledChange()
|
||||
if disabled
|
||||
m.background.blendColor = m.top.disabledBackgroundColor
|
||||
m.icon.blendColor = m.top.disabledIconColor
|
||||
m.icon2.blendColor = m.top.disabledIconColor
|
||||
else
|
||||
OnButtonFocused()
|
||||
end if
|
||||
@@ -52,3 +56,10 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
function OnToggleStateChange()
|
||||
toggleState = m.top.toggleState
|
||||
|
||||
m.icon.visible = toggleState
|
||||
m.icon2.visible = not toggleState
|
||||
end function
|
||||
Reference in new issue
Block a user