summaryrefslogtreecommitdiffstats
path: root/plugins/autofire/autofire_menu.lua
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-12-09 01:01:22 +1100
committer Vas Crabb <vas@vastheman.com>2020-12-09 01:10:26 +1100
commite008c7b1b1042d644be2a1e177ffa15d53e942c5 (patch)
treed248f9fcbe15563c46c1ae9605d35a19ed4ada5e /plugins/autofire/autofire_menu.lua
parent06568860e7a30424bab61498cd2a8a44889e4412 (diff)
-Lua engine cleanup, input edition:
* Modernised and cleaned up Lua bindings for input classes. * Exposed the input_sequence_poller class to Lua and updated the autofire and cheat plugins to use it, rather than continuing to pretend it's part of the input manager. * Exposed more of the natural keyboard manager, including the ability to enable/disable individual keyboard and keypad devices like you can from the keyboard mode menu. * Exposed a few more things on ioport_port and input_device. -plugins/cheat: Fixed menu item not updating visually when disabling a cheat with UI Left. -plugins/cheatfind: Fixed not finding the first screen after screen enumerator was exposed as an object rather than using a table. -bwidow.cpp, pacman.cpp: Minor cleanup to recent changes.
Diffstat (limited to 'plugins/autofire/autofire_menu.lua')
-rw-r--r--plugins/autofire/autofire_menu.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua
index a880d1c5008..4744de1b2ac 100644
--- a/plugins/autofire/autofire_menu.lua
+++ b/plugins/autofire/autofire_menu.lua
@@ -108,26 +108,27 @@ end
-- Borrowed from the cheat plugin
local function poll_for_hotkey()
local input = manager:machine():input()
+ local poller = input:sequence_poller()
manager:machine():popmessage(_('Press button for hotkey or wait to leave unchanged'))
manager:machine():video():frame_update(true)
- input:seq_poll_start('switch')
+ poller:start('switch')
local time = os.clock()
local clearmsg = true
- while (not input:seq_poll()) and (input:seq_poll_modified() or (os.clock() < time + 1)) do
- if input:seq_poll_modified() then
- if not input:seq_poll_valid() then
+ while (not poller:poll()) and (poller.modified or (os.clock() < time + 1)) do
+ if poller.modified then
+ if not poller.valid then
manager:machine():popmessage(_("Invalid sequence entered"))
clearmsg = false
break
end
- manager:machine():popmessage(input:seq_name(input:seq_poll_sequence()))
+ manager:machine():popmessage(input:seq_name(poller.sequence))
manager:machine():video():frame_update(true)
end
end
if clearmsg then
manager:machine():popmessage()
end
- return input:seq_poll_valid() and input:seq_poll_final() or nil
+ return poller.valid and poller.sequence or nil
end
local function handle_configure_menu(index, event)