summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/inputmacro/inputmacro_persist.lua
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-11-06 05:20:59 +1100
committer Vas Crabb <vas@vastheman.com>2021-11-06 05:20:59 +1100
commit07e55935cf49c94a94dcc75d8240d0733d1ed5d7 (patch)
treefa60ebf78fee04fd57d9c8b8665f02729ef48a43 /plugins/inputmacro/inputmacro_persist.lua
parent3bb8e3adc7dbd6a9e57771047011efc3c54378ac (diff)
plugins: Rewrote timer plugin fixing multiple issues.
Added emulated time recording as well as wall clock time. Fixed recording time for multiple software items per system. An incorrect constraint on the database table meant that time was only being recorded for a single software item per system. Detect the "empty" driver so the time spent at the selection menu isn't recorded (you'd get multiple entries for this due to the way options leak when returning to the system selection menu). Included schema migration code to update existing timer plugin databases. Also replaced some unnecessary floating point code with integer maths, added log messages, and made the plugin unload unload its database access code during emulation. Changed other plugins' use of paths with trailing slashes as this causes stat to fail on Windows.
Diffstat (limited to 'plugins/inputmacro/inputmacro_persist.lua')
-rw-r--r--plugins/inputmacro/inputmacro_persist.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/inputmacro/inputmacro_persist.lua b/plugins/inputmacro/inputmacro_persist.lua
index 4e043852c51..6c2aa6fd188 100644
--- a/plugins/inputmacro/inputmacro_persist.lua
+++ b/plugins/inputmacro/inputmacro_persist.lua
@@ -5,7 +5,7 @@
-- Helpers
local function settings_path()
- return emu.subst_env(manager.machine.options.entries.homepath:value():match('([^;]+)')) .. '/inputmacro/'
+ return emu.subst_env(manager.machine.options.entries.homepath:value():match('([^;]+)')) .. '/inputmacro'
end
local function settings_filename()
@@ -101,7 +101,7 @@ end
local lib = { }
function lib:load_settings()
- filename = settings_path() .. settings_filename()
+ filename = settings_path() .. '/' .. settings_filename()
local file = io.open(filename, 'r')
if not file then
return { }
@@ -133,7 +133,7 @@ function lib:save_settings(macros)
emu.print_error(string.format('Error saving input macros: "%s" is not a directory', path))
return
end
- filename = path .. settings_filename()
+ filename = path .. '/' .. settings_filename()
if #macros == 0 then
os.remove(filename)