diff options
| author | 2020-12-27 01:32:37 +1100 | |
|---|---|---|
| committer | 2020-12-27 01:32:37 +1100 | |
| commit | 9e36b6a6d951ea6f2d72cab874c3c8e72d001001 (patch) | |
| tree | c41bfd0c1b499d790c4091eb266caf6955219fc1 /plugins/data | |
| parent | 509c946736b5f02cac84d19f2cde4e966d637a2c (diff) | |
More Lua interface cleanup - it's simpler with cleaner underlyng APIs.
Made the sound manager mute controls readable, and got rid of system
enable since it just controls system mute anyway. This was causing
confusion: phantom2 was trying to use both independentlyt casuing the
mute bit to be ignored.
THe Lua interface changes are mostly changing methods to properties,
some renames to make things clearer, and some additional properties for
better control over snapshots.
Diffstat (limited to 'plugins/data')
| -rw-r--r-- | plugins/data/data_hiscore.lua | 8 | ||||
| -rw-r--r-- | plugins/data/data_marp.lua | 2 | ||||
| -rw-r--r-- | plugins/data/database.lua | 4 | ||||
| -rw-r--r-- | plugins/data/load_dat.lua | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/plugins/data/data_hiscore.lua b/plugins/data/data_hiscore.lua index 867041a14cc..ac2513d2690 100644 --- a/plugins/data/data_hiscore.lua +++ b/plugins/data/data_hiscore.lua @@ -9,7 +9,7 @@ local curset function env.open(file, size) if file == ".hi" then local path = "hi" - local ini = emu.file(emu.subst_env(manager:options().entries.inipath:value()), 1) + local ini = emu.file(emu.subst_env(manager.options.entries.inipath:value()), 1) local ret = ini:open("hiscore.ini") if not ret then local inifile = ini:read(ini:size()) @@ -23,7 +23,7 @@ function env.open(file, size) end file = path .. "/" .. curset .. ".hi" else - file = emu.subst_env(manager:options().entries.nvram_directory:value()) .. "/" .. curset .. "/" .. file + file = emu.subst_env(manager.options.entries.nvram_directory:value()) .. "/" .. curset .. "/" .. file end local f = io.open(file, "rb") local content = f:read("*all") @@ -789,12 +789,12 @@ function dat.check(set, softlist) output = nil curset = set - local scrfile = emu.file(emu.subst_env(mame_manager:ui():options().entries.historypath:value():gsub("([^;]+)", "%1/hi2txt")), 1) + local scrfile = emu.file(emu.subst_env(mame_manager.ui.options.entries.historypath:value():gsub("([^;]+)", "%1/hi2txt")), 1) local ret = scrfile:open(set .. ".lua") local script if ret then function get_xml_table(fileset) - local file = emu.file(emu.subst_env(mame_manager:ui():options().entries.historypath:value():gsub("([^;]+)", "%1/hi2txt")), 1) + local file = emu.file(emu.subst_env(mame_manager.ui.options.entries.historypath:value():gsub("([^;]+)", "%1/hi2txt")), 1) local ret = file:open(fileset .. ".xml") if ret then return nil diff --git a/plugins/data/data_marp.lua b/plugins/data/data_marp.lua index 5cb0bc3fb19..98e6e8160d4 100644 --- a/plugins/data/data_marp.lua +++ b/plugins/data/data_marp.lua @@ -9,7 +9,7 @@ local function init() local fh local file = "scores3.htm" - for path in mame_manager:ui():options().entries.historypath:value():gmatch("([^;]+)") do + for path in mame_manager.ui.options.entries.historypath:value():gmatch("([^;]+)") do filepath = emu.subst_env(path) .. "/" .. file fh = io.open(filepath, "r") if fh then diff --git a/plugins/data/database.lua b/plugins/data/database.lua index da1a2508cad..b868173ce08 100644 --- a/plugins/data/database.lua +++ b/plugins/data/database.lua @@ -4,12 +4,12 @@ local db local function check_db(msg) if db:errcode() > sql.OK then - emu.print_error("Error: " .. msg .. " (" .. db:errcode() .. " - " .. db:errmsg() .. ")\n") + emu.print_error(string.format("Error: %s (%s - %s)\n", msg, db:errcode(), db:errmsg())) end end do - local dbpath = emu.subst_env(mame_manager:ui():options().entries.historypath:value():match("([^;]+)")) + local dbpath = emu.subst_env(mame_manager.ui.options.entries.historypath:value():match("([^;]+)")) db = sql.open(dbpath .. "/history.db") if not db then lfs.mkdir(dbpath) diff --git a/plugins/data/load_dat.lua b/plugins/data/load_dat.lua index a21ae51aebe..ed13fbefdcc 100644 --- a/plugins/data/load_dat.lua +++ b/plugins/data/load_dat.lua @@ -26,7 +26,7 @@ function datfile.open(file, vertag, fixupcb) local filepath local fh - for path in mame_manager:ui():options().entries.historypath:value():gmatch("([^;]+)") do + for path in mame_manager.ui.options.entries.historypath:value():gmatch("([^;]+)") do filepath = emu.subst_env(path) .. "/" .. file fh = io.open(filepath, "r") if fh then |
