diff options
author | 2021-11-08 11:51:29 +1100 | |
---|---|---|
committer | 2021-11-08 11:51:29 +1100 | |
commit | 7cc983601728fa852386f04cb7d85d93421d3dbb (patch) | |
tree | 69356b03ab9d9b85f2682c5e667ddfcc2429c169 /plugins | |
parent | ac9d1301cbe2c59ef81f975d682c9a16935f38bd (diff) |
plugins: Work around menu not remembering selection when ref is nullptr.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/timer/init.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/timer/init.lua b/plugins/timer/init.lua index d39243da730..e7d7155b4c1 100644 --- a/plugins/timer/init.lua +++ b/plugins/timer/init.lua @@ -17,6 +17,7 @@ function timer.startplugin() local reference = 0 local lastupdate + local highlight -- hacky - workaround for the menu not remembering the selected item if its ref is nullptr local function sectohms(time) @@ -38,7 +39,7 @@ function timer.startplugin() { _p("plugin-timer", "Current time"), sectohms(time), "off" }, { _p("plugin-timer", "Total time"), sectohms(total), "off" }, { _p("plugin-timer", "Play Count"), play_count, "off" } }, - nil, + highlight, "idle" end @@ -47,6 +48,7 @@ function timer.startplugin() reference = reference ~ 1 return true end + highlight = index return os.time() > lastupdate end |