summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/timer
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/timer')
-rw-r--r--plugins/timer/init.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/timer/init.lua b/plugins/timer/init.lua
index 07b3e20162b..eb61f85bf84 100644
--- a/plugins/timer/init.lua
+++ b/plugins/timer/init.lua
@@ -89,15 +89,21 @@ function timer.startplugin()
return string.format("%03d:%02d:%02d", hrs, min, sec)
end
+ local lastupdate
+
local function menu_populate()
- local time = os.time() - start_time
- return {{ _("Current time"), sectohms(time), "off" },
- { _("Total time"), sectohms(total_time + time), "off" },
- { _("Play Count"), play_count, "off" }}
+ lastupdate = os.time()
+ local time = lastupdate - start_time
+ return
+ {{ _("Current time"), sectohms(time), "off" },
+ { _("Total time"), sectohms(total_time + time), "off" },
+ { _("Play Count"), play_count, "off" }},
+ nil,
+ "idle"
end
local function menu_callback(index, event)
- return false
+ return os.time() > lastupdate
end
emu.register_menu(menu_callback, menu_populate, _("Timer"))