summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2018-05-02 09:37:34 -0500
committer cracyc <cracyc@users.noreply.github.com>2018-05-02 09:37:34 -0500
commitfec83c922befa3f051af10c078b1fb58faf30777 (patch)
treebfba2a01137647767ab1c136d120ace024fa24e6 /plugins
parentf5191c86057fe4c1486a0f7733af0e01ef4b00b5 (diff)
plugins: handle the case where the ui prepends the list name to the list entry name (nw)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cheat/init.lua10
-rw-r--r--plugins/cheatfind/init.lua10
-rw-r--r--plugins/hiscore/init.lua6
-rw-r--r--plugins/portname/init.lua3
4 files changed, 20 insertions, 9 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua
index c6f70a56acc..9495cfc689b 100644
--- a/plugins/cheat/init.lua
+++ b/plugins/cheat/init.lua
@@ -92,9 +92,13 @@ function cheat.startplugin()
local newcheats = {}
local file = emu.file(manager:machine():options().entries.cheatpath:value():gsub("([^;]+)", "%1;%1/cheat") , 1)
if emu.softname() ~= "" then
- for name, image in pairs(manager:machine().images) do
- if image:exists() and image:software_list_name() ~= "" then
- filename = image:software_list_name() .. "/" .. emu.softname()
+ if emu.softname():find(":") then
+ filename = emu.softname():gsub(":", "/")
+ else
+ for name, image in pairs(manager:machine().images) do
+ if image:exists() and image:software_list_name() ~= "" then
+ filename = image:software_list_name() .. "/" .. emu.softname()
+ end
end
end
end
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua
index 57a6b6aad3e..25aac6768b3 100644
--- a/plugins/cheatfind/init.lua
+++ b/plugins/cheatfind/init.lua
@@ -730,9 +730,13 @@ function cheatfind.startplugin()
menu_type = 1
local setname = emu.romname()
if emu.softname() ~= "" then
- for name, image in pairs(manager:machine().images) do
- if image:exists() and image:software_list_name() ~= "" then
- setname = image:software_list_name() .. "/" .. emu.softname()
+ if emu.softname():find(":") then
+ filename = emu.softname():gsub(":", "/")
+ else
+ for name, image in pairs(manager:machine().images) do
+ if image:exists() and image:software_list_name() ~= "" then
+ setname = image:software_list_name() .. "/" .. emu.softname()
+ end
end
end
end
diff --git a/plugins/hiscore/init.lua b/plugins/hiscore/init.lua
index cf1b3edc430..a89acfb33e3 100644
--- a/plugins/hiscore/init.lua
+++ b/plugins/hiscore/init.lua
@@ -94,7 +94,8 @@ function hiscore.startplugin()
file = io.open( hiscore_plugin_path .. "/hiscore.dat", "r" );
end
if emu.softname() ~= "" then
- rm_match = '^' .. emu.romname() .. ',' .. emu.softname() .. ':';
+ local soft = emu.softname():match("([^:]*)$")
+ rm_match = '^' .. emu.romname() .. ',' .. soft .. ':';
else
rm_match = '^' .. emu.romname() .. ':';
end
@@ -148,7 +149,8 @@ function hiscore.startplugin()
local function get_file_name ()
local r;
if emu.softname() ~= "" then
- r = hiscore_path .. '/' .. emu.romname() .. "_" .. emu.softname() .. ".hi";
+ local soft = emu.softname():match("([^:]*)$")
+ r = hiscore_path .. '/' .. emu.romname() .. "_" .. soft .. ".hi";
else
r = hiscore_path .. '/' .. emu.romname() .. ".hi";
end
diff --git a/plugins/portname/init.lua b/plugins/portname/init.lua
index 98601ec8b13..35769acdb76 100644
--- a/plugins/portname/init.lua
+++ b/plugins/portname/init.lua
@@ -31,7 +31,8 @@ function portname.startplugin()
local function get_filename(nosoft)
local filename
if emu.softname() ~= "" and not nosoft then
- filename = emu.romname() .. "_" .. emu.softname() .. ".json"
+ local soft = emu.softname():match("([^:]*)$")
+ filename = emu.romname() .. "_" .. soft .. ".json"
else
filename = emu.romname() .. ".json"
end