summaryrefslogtreecommitdiffstatshomepage
path: root/plugins
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2016-05-03 09:27:31 -0500
committer cracyc <cracyc@users.noreply.github.com>2016-05-03 09:27:31 -0500
commit37898321e24721d55c908cd8f04a087c20a14524 (patch)
treec83dab2d96456e10fa4c26feb6d4633d16fdd48b /plugins
parentf97b68d3ed8312f0800fc0e501ad0174a968d3e9 (diff)
plugins/cheatfind: small cleaups (nw)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/cheatfind/init.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua
index 056153a236e..378b023ed4f 100644
--- a/plugins/cheatfind/init.lua
+++ b/plugins/cheatfind/init.lua
@@ -248,7 +248,6 @@ function cheatfind.startplugin()
rightop = 1
matches = {}
matchsel = 0
- matchcnt = 0
matchpg = 0
menu_blocks = {}
watches = {}
@@ -361,7 +360,7 @@ function cheatfind.startplugin()
return { "Save current -- #" .. #menu_blocks[1] + 1, "", 0 }, f
end
menu[#menu + 1] = function()
- function f(event)
+ local function f(event)
if event == "select" then
local count = 0
if #matches == 0 then
@@ -392,6 +391,7 @@ function cheatfind.startplugin()
end
manager:machine():popmessage(count .. " total matches found")
matches[#matches].count = count
+ matchpg = 0
devsel = devcur
return true
end
@@ -409,7 +409,7 @@ function cheatfind.startplugin()
menu[#menu + 1] = function()
local m = { "Operator", optable[opsel], "" }
menu_lim(opsel, 1, #optable, m)
- function f(event)
+ local function f(event)
local r
opsel, r = incdec(event, opsel, 1, #optable)
if event == "left" or event == "right" or event == "comment" then
@@ -480,9 +480,10 @@ function cheatfind.startplugin()
if #matches == 0 then
return nil
end
- function f(event)
+ local function f(event)
if event == "select" and #matches > 0 then
matches[#matches] = nil
+ matchpg = 0
return true
end
end
@@ -496,7 +497,7 @@ function cheatfind.startplugin()
if matchsel == 0 then
m[2] = "All"
end
- function f(event)
+ local function f(event)
local r
matchsel, r = incdec(event, matchsel, 0, #matches[#matches])
if r then
@@ -560,7 +561,7 @@ function cheatfind.startplugin()
m[2] = "Watch"
end
menu_lim(match.mode, 1, 3, m)
- function f(event)
+ local function f(event)
local r
match.mode, r = incdec(event, match.mode, 1, 3)
if event == "select" then
@@ -642,7 +643,7 @@ function cheatfind.startplugin()
max = #matches[#matches][matchsel]
end
menu_lim(matchpg, 0, max, m)
- function f(event)
+ local function f(event)
matchpg, r = incdec(event, matchpg, 0, max)
return r
end