cheat: Make string.char and string.format available to cheats (#12183)

This commit is contained in:
eientei95 2024-03-28 09:35:30 +13:00 committed by GitHub
parent 39cd5d6f02
commit 662bc48d9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -453,21 +453,22 @@ function cheat.startplugin()
end
local function parse_cheat(cheat)
cheat.cheat_env = { draw_text = draw_text,
draw_line = draw_line,
draw_box = draw_box,
tobcd = tobcd,
frombcd = frombcd,
pairs = pairs,
ipairs = ipairs,
outputs = manager.machine.output,
time = time,
input_trans = input_trans,
input_run = function(list) input_run(cheat, list) end,
os = { time = os.time, date = os.date, difftime = os.difftime },
table =
{ insert = table.insert,
remove = table.remove } }
cheat.cheat_env = {
draw_text = draw_text,
draw_line = draw_line,
draw_box = draw_box,
tobcd = tobcd,
frombcd = frombcd,
pairs = pairs,
ipairs = ipairs,
outputs = manager.machine.output,
time = time,
input_trans = input_trans,
input_run = function(list) input_run(cheat, list) end,
os = { time = os.time, date = os.date, difftime = os.difftime },
table = { insert = table.insert, remove = table.remove },
string = { format = string.format, char = string.char }
}
cheat.enabled = false
cheat.set_enabled = set_enabled;
cheat.get_enabled = function(cheat) return cheat.enabled end