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 end
local function parse_cheat(cheat) local function parse_cheat(cheat)
cheat.cheat_env = { draw_text = draw_text, cheat.cheat_env = {
draw_line = draw_line, draw_text = draw_text,
draw_box = draw_box, draw_line = draw_line,
tobcd = tobcd, draw_box = draw_box,
frombcd = frombcd, tobcd = tobcd,
pairs = pairs, frombcd = frombcd,
ipairs = ipairs, pairs = pairs,
outputs = manager.machine.output, ipairs = ipairs,
time = time, outputs = manager.machine.output,
input_trans = input_trans, time = time,
input_run = function(list) input_run(cheat, list) end, input_trans = input_trans,
os = { time = os.time, date = os.date, difftime = os.difftime }, input_run = function(list) input_run(cheat, list) end,
table = os = { time = os.time, date = os.date, difftime = os.difftime },
{ insert = table.insert, table = { insert = table.insert, remove = table.remove },
remove = table.remove } } string = { format = string.format, char = string.char }
}
cheat.enabled = false cheat.enabled = false
cheat.set_enabled = set_enabled; cheat.set_enabled = set_enabled;
cheat.get_enabled = function(cheat) return cheat.enabled end cheat.get_enabled = function(cheat) return cheat.enabled end