mirror of
https://github.com/holub/mame
synced 2025-06-07 13:23:50 +03:00
plugins/cheatfind: small cleaups (nw)
This commit is contained in:
parent
f97b68d3ed
commit
37898321e2
@ -248,7 +248,6 @@ function cheatfind.startplugin()
|
|||||||
rightop = 1
|
rightop = 1
|
||||||
matches = {}
|
matches = {}
|
||||||
matchsel = 0
|
matchsel = 0
|
||||||
matchcnt = 0
|
|
||||||
matchpg = 0
|
matchpg = 0
|
||||||
menu_blocks = {}
|
menu_blocks = {}
|
||||||
watches = {}
|
watches = {}
|
||||||
@ -361,7 +360,7 @@ function cheatfind.startplugin()
|
|||||||
return { "Save current -- #" .. #menu_blocks[1] + 1, "", 0 }, f
|
return { "Save current -- #" .. #menu_blocks[1] + 1, "", 0 }, f
|
||||||
end
|
end
|
||||||
menu[#menu + 1] = function()
|
menu[#menu + 1] = function()
|
||||||
function f(event)
|
local function f(event)
|
||||||
if event == "select" then
|
if event == "select" then
|
||||||
local count = 0
|
local count = 0
|
||||||
if #matches == 0 then
|
if #matches == 0 then
|
||||||
@ -392,6 +391,7 @@ function cheatfind.startplugin()
|
|||||||
end
|
end
|
||||||
manager:machine():popmessage(count .. " total matches found")
|
manager:machine():popmessage(count .. " total matches found")
|
||||||
matches[#matches].count = count
|
matches[#matches].count = count
|
||||||
|
matchpg = 0
|
||||||
devsel = devcur
|
devsel = devcur
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
@ -409,7 +409,7 @@ function cheatfind.startplugin()
|
|||||||
menu[#menu + 1] = function()
|
menu[#menu + 1] = function()
|
||||||
local m = { "Operator", optable[opsel], "" }
|
local m = { "Operator", optable[opsel], "" }
|
||||||
menu_lim(opsel, 1, #optable, m)
|
menu_lim(opsel, 1, #optable, m)
|
||||||
function f(event)
|
local function f(event)
|
||||||
local r
|
local r
|
||||||
opsel, r = incdec(event, opsel, 1, #optable)
|
opsel, r = incdec(event, opsel, 1, #optable)
|
||||||
if event == "left" or event == "right" or event == "comment" then
|
if event == "left" or event == "right" or event == "comment" then
|
||||||
@ -480,9 +480,10 @@ function cheatfind.startplugin()
|
|||||||
if #matches == 0 then
|
if #matches == 0 then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
function f(event)
|
local function f(event)
|
||||||
if event == "select" and #matches > 0 then
|
if event == "select" and #matches > 0 then
|
||||||
matches[#matches] = nil
|
matches[#matches] = nil
|
||||||
|
matchpg = 0
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -496,7 +497,7 @@ function cheatfind.startplugin()
|
|||||||
if matchsel == 0 then
|
if matchsel == 0 then
|
||||||
m[2] = "All"
|
m[2] = "All"
|
||||||
end
|
end
|
||||||
function f(event)
|
local function f(event)
|
||||||
local r
|
local r
|
||||||
matchsel, r = incdec(event, matchsel, 0, #matches[#matches])
|
matchsel, r = incdec(event, matchsel, 0, #matches[#matches])
|
||||||
if r then
|
if r then
|
||||||
@ -560,7 +561,7 @@ function cheatfind.startplugin()
|
|||||||
m[2] = "Watch"
|
m[2] = "Watch"
|
||||||
end
|
end
|
||||||
menu_lim(match.mode, 1, 3, m)
|
menu_lim(match.mode, 1, 3, m)
|
||||||
function f(event)
|
local function f(event)
|
||||||
local r
|
local r
|
||||||
match.mode, r = incdec(event, match.mode, 1, 3)
|
match.mode, r = incdec(event, match.mode, 1, 3)
|
||||||
if event == "select" then
|
if event == "select" then
|
||||||
@ -642,7 +643,7 @@ function cheatfind.startplugin()
|
|||||||
max = #matches[#matches][matchsel]
|
max = #matches[#matches][matchsel]
|
||||||
end
|
end
|
||||||
menu_lim(matchpg, 0, max, m)
|
menu_lim(matchpg, 0, max, m)
|
||||||
function f(event)
|
local function f(event)
|
||||||
matchpg, r = incdec(event, matchpg, 0, max)
|
matchpg, r = incdec(event, matchpg, 0, max)
|
||||||
return r
|
return r
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user