From 9c4d1457dad0e82860d45c76cee04aa8d33a13c4 Mon Sep 17 00:00:00 2001 From: cracyc Date: Sun, 13 Sep 2020 10:00:00 -0500 Subject: [PATCH] plugins: add emu.plugin table to contain plugin exported interfaces --- plugins/boot.lua | 2 +- plugins/cheat/init.lua | 2 +- plugins/cheatfind/init.lua | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/boot.lua b/plugins/boot.lua index 52c56912a0f..09be30ee401 100644 --- a/plugins/boot.lua +++ b/plugins/boot.lua @@ -22,7 +22,7 @@ function lfs.env_replace(str) end _G._ = emu.lang_translate - +_G.emu.plugin = {} -- table to contain plugin interfaces -- substitute environment variables in the plugins path from options local dirs = lfs.env_replace(manager:options().entries.pluginspath:value()) diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua index 4c97c321d6b..3ac15851404 100644 --- a/plugins/cheat/init.lua +++ b/plugins/cheat/init.lua @@ -897,7 +897,7 @@ function cheat.startplugin() return list end - _G.ce = ce + _G.emu.plugin.cheat = ce end diff --git a/plugins/cheatfind/init.lua b/plugins/cheatfind/init.lua index 62b11e8970f..729aed26cb0 100644 --- a/plugins/cheatfind/init.lua +++ b/plugins/cheatfind/init.lua @@ -251,7 +251,7 @@ function cheatfind.startplugin() return cheat.compnext(newdata, olddata, oldmatch, oper, format, val, bcd, step) end - _G.cf = cheat + _G.emu.plugin.cheatfind = cheat local devtable = {} local devsel = 1 local devcur = 1 @@ -937,10 +937,10 @@ function cheatfind.startplugin() cheat.script.run = "cpu:write_" .. wid .. "(" .. match.addr .. "," .. pokevalue .. ")" end if match.mode == 1 then - if not _G.ce then + if not emu.plugin.cheat then manager:machine():popmessage(_("Cheat engine not available")) else - _G.ce.inject(cheat) + emu.plugin.cheat.inject(cheat) end elseif match.mode == 2 then cheat_save = {}