Skip to content

Commit

Permalink
cheat: Make string.char and string.format available to cheats (mamede…
Browse files Browse the repository at this point in the history
  • Loading branch information
einstein95 authored Mar 27, 2024
1 parent 39cd5d6 commit 662bc48
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions plugins/cheat/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 662bc48

Please sign in to comment.