summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/cheat
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-12-27 04:27:42 +1100
committer Vas Crabb <vas@vastheman.com>2020-12-27 04:27:42 +1100
commita5e6f4ea8d468f8f8e50ad5199a9f8aa9a81e9f1 (patch)
tree13e47f6a7501b3a5f96d19018e26b0850d1d69ae /plugins/cheat
parentc2f698a95f80512d8fd461bdabf3868cb8edc0c4 (diff)
Expose a couple more things to Lua so the plugins can show the actual key mapped to UI clear.
Diffstat (limited to 'plugins/cheat')
-rw-r--r--plugins/cheat/init.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/cheat/init.lua b/plugins/cheat/init.lua
index 46a086f8ac2..4b409d1e029 100644
--- a/plugins/cheat/init.lua
+++ b/plugins/cheat/init.lua
@@ -604,8 +604,10 @@ function cheat.startplugin()
local function menu_populate()
local menu = {}
if hotkeymenu then
+ local ioport = manager.machine.ioport
+ local input = manager.machine.input
menu[1] = {_("Select cheat to set hotkey"), "", "off"}
- menu[2] = {_("Press UI Clear to clear hotkey"), "", "off"}
+ menu[2] = {string.format(_("Press %s to clear hotkey"), input:seq_name(ioport:type_seq(ioport:token_to_input_type("UI_CLEAR")))), "", "off"}
menu[3] = {"---", "", "off"}
hotkeylist = {}
@@ -615,7 +617,6 @@ function cheat.startplugin()
return
end
- local input = manager.machine.input
local poller = input:switch_sequence_poller()
manager.machine:popmessage(_("Press button for hotkey or wait to leave unchanged"))
manager.machine.video:frame_update()
@@ -644,7 +645,7 @@ function cheat.startplugin()
for num, cheat in ipairs(cheats) do
if cheat.script then
- menu[#menu + 1] = {cheat.desc, cheat.hotkeys and manager.machine.input:seq_name(cheat.hotkeys.keys) or _("None"), ""}
+ menu[#menu + 1] = {cheat.desc, cheat.hotkeys and input:seq_name(cheat.hotkeys.keys) or _("None"), ""}
hotkeylist[#hotkeylist + 1] = function(event) return hkcbfunc(cheat, event) end
end
end