* Translated using Weblate (English (United States)) Currently translated at 100.0% (316 of 316 strings) Translation: Playlet/Playlet Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/en_US/ * Translated using Weblate (German) Currently translated at 100.0% (316 of 316 strings) Translation: Playlet/Playlet Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/de/ * Translated using Weblate (French (Canada)) Currently translated at 98.7% (312 of 316 strings) Translation: Playlet/Playlet Translate-URL: https://hosted.weblate.org/projects/playlet/playlet/fr_CA/ * Fix case * remove "unfinished" attribute * UI Refactor (#394) * Setting category refactor * tweak * Wip navbar * profile icon support * screen offset * Nav bar animation * Flexible navbar * initial focus fix * Fix settings * changelog * comment * Lint fix --------- Co-authored-by: Lacey Anaya <yecakeh263@anawalls.com> Co-authored-by: github-action linter <githubaction@githubaction.com>
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
Plaintext
import "pkg:/source/utils/StringUtils.bs"
|
|
import "pkg:/source/utils/Types.bs"
|
|
|
|
function Init()
|
|
m.buttonIcon = m.top.findNode("buttonIcon")
|
|
m.circlePoster = m.top.findNode("circlePoster")
|
|
m.circlePosterInner = m.top.findNode("circlePosterInner")
|
|
m.letterLabel = m.top.findNode("letterLabel")
|
|
|
|
profilesService = m.top.getScene().findNode("ProfilesService")
|
|
if profilesService <> invalid
|
|
m.profilesService = profilesService
|
|
profilesService.observeField("currentProfile", FuncName(OnCurrentProfile))
|
|
OnCurrentProfile()
|
|
end if
|
|
end function
|
|
|
|
function OnCurrentProfile() as void
|
|
currentProfile = m.profilesService.currentProfile
|
|
if currentProfile = invalid
|
|
m.circlePoster.visible = false
|
|
m.buttonIcon.visible = true
|
|
return
|
|
end if
|
|
|
|
username = currentProfile.username
|
|
if not StringUtils.IsNullOrEmpty(username)
|
|
m.letterLabel.text = UCase(username.Left(1))
|
|
else
|
|
m.letterLabel.text = ""
|
|
end if
|
|
m.circlePosterInner.blendColor = currentProfile.color
|
|
|
|
m.circlePoster.visible = true
|
|
m.buttonIcon.visible = false
|
|
end function
|