summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheatfind
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-10-15 09:42:35 +1100
committer Vas Crabb <vas@vastheman.com>2021-10-15 10:12:56 +1100
commit22bc3486c3ef8f2230e99daf49785a89ac8a1182 (patch)
tree4f10f7386b7b0a32c9d560395399e8b7632df34c /plugins/cheatfind
parent3e8763bea5a93f3139204fcb8a0c74c2ac364af5 (diff)
More user experience improvements:
frontend: Made it possible to cancel a media audit while it's in progress. Also made the media audit multi-threaded so it's faster. frontend: Made the DIP switches in the DIP switch preview clickable. frontend: Made the system and software selection menus leave focus on the same system when clearing the search rather than jumping to the first item. Also fixed a couple of bugs in the logic for keeping the selected item visible. frontend: Fixed a few places that weren't showing localised system names. frontend: Made UI Cancel clear a search in the file manager the same way it does on the system and sofware selection menus. frontend: Made it possible for plugin menus to handle UI Cancel more naturally, backing up to the previous plugin menu rather than dropping straight back to the list of plugins. Updated the autofire, cheat and cheatfind plugins, and fixed a few other issues in the cheatfind plugin. debugger: Made the mount and unmount commands accept instance names as well as brief instance names. Also updated another page of debugger documentation.
Diffstat (limited to 'plugins/cheatfind')
-rw-r--r--plugins/cheatfind/init.lua23
1 files changed, 14 insertions, 9 deletions
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua
index a1fff20150a..b9ff9ce3403 100644
--- a/plugins/cheatfind/init.lua
+++ b/plugins/cheatfind/init.lua
@@ -371,7 +371,7 @@ function cheatfind.startplugin()
end
local function incdec(event, val, min, max)
- local ret
+ local ret = false
if event == "left" and val ~= min then
val = val - 1
ret = true
@@ -500,8 +500,9 @@ function cheatfind.startplugin()
if (event == "left" or event == "right") and #menu_blocks ~= 0 then
manager.machine:popmessage(_("Changes to this only take effect when \"Start new search\" is selected"))
end
- devsel = incdec(event, devsel, 1, #devtable)
- return true
+ local r
+ devsel, r = incdec(event, devsel, 1, #devtable)
+ return r
end
return m, f
end
@@ -521,9 +522,9 @@ function cheatfind.startplugin()
manager.machine:popmessage(_("Automatically toggle pause with on-screen menus"))
emu.pause()
end
+ return true
end
-
- return true
+ return false
end
return m, f
end
@@ -550,7 +551,7 @@ function cheatfind.startplugin()
return true
end
end
- local opsel = 1
+ local opsel = 1
return { _("Start new search"), "", 0 }, f
end
@@ -577,6 +578,7 @@ function cheatfind.startplugin()
devsel = devcur
return true
end
+ return false
end
return { string.format(_("Save current memory state to Slot %d"), #menu_blocks[1] + 1), "", 0 }, f
end
@@ -615,6 +617,7 @@ function cheatfind.startplugin()
devsel = devcur
return true
end
+ return false
end
local slot_slot_comp = _("Perform Compare : Slot %d %s Slot %d")
@@ -659,7 +662,7 @@ function cheatfind.startplugin()
end
menu[#menu + 1] = function() return { "---", "", "off" }, nil end
menu[#menu + 1] = function()
- local m = { _(leftop), "", 0 }
+ local m = { string.format("%d", leftop), "", 0 }
menu_lim(leftop, 1, #menu_blocks[1], m)
m[1] = string.format(_("Slot %d"), leftop)
return m, function(event) local r leftop, r = incdec(event, leftop, 1, #menu_blocks[1]) return r end
@@ -701,7 +704,7 @@ function cheatfind.startplugin()
if optable[opsel]:sub(3, 3) == "v" then
return nil
end
- local m = { _(rightop), "", 0 }
+ local m = { string.format("%d", rightop), "", 0 }
menu_lim(rightop, 1, #menu_blocks[1], m)
m[1] = string.format(_("Slot %d"), rightop)
return m, function(event) local r rightop, r = incdec(event, rightop, 1, #menu_blocks[1]) return r end
@@ -783,6 +786,7 @@ function cheatfind.startplugin()
matchpg = 0
return true
end
+ return false
end
return { _("Undo last search -- #") .. #matches, "", 0 }, f
end
@@ -1022,6 +1026,7 @@ function cheatfind.startplugin()
end
menu_lim(matchpg, 0, max, m)
local function f(event)
+ local r
matchpg, r = incdec(event, matchpg, 0, max)
return r
end
@@ -1042,7 +1047,7 @@ function cheatfind.startplugin()
if event == "cancel" and pausesel == 1 then
emu.unpause()
menu_is_showing = false
- return {0,0,0}
+ return false -- return false so menu will be popped off the stack
end
return menu_func[index](event)
end