jf-roku/components/data/OptionsData.bs

41 lines
954 B
Plaintext
Raw Normal View History

import "pkg:/source/utils/config.bs"
2019-05-03 12:48:59 +00:00
sub init()
m.top.value_index = 0
end sub
sub update_title()
if m.top.choices.count() = 0
m.top.title = m.top.base_title + ": <none>"
return
end if
2021-07-09 20:08:32 +00:00
for i = 0 to m.top.choices.count() - 1
2019-05-03 12:48:59 +00:00
if m.top.choices[i].value = m.top.value
m.top.value_index = i
exit for
end if
end for
m.top.title = m.top.base_title + ": " + m.top.choices[m.top.value_index].display
end sub
sub press()
max_opt = m.top.choices.count()
i = m.top.value_index + 1
while i >= max_opt
i = i - max_opt
end while
m.top.value_index = i
m.top.value = m.top.choices[m.top.value_index].value
if m.top.config_key = "" or m.top.config_key = invalid
return
end if
if m.top.global_setting
set_setting(m.top.config_key, m.top.value)
else
set_user_setting(m.top.config_key, m.top.value)
end if
2022-05-30 12:57:40 +00:00
end sub