diff options
author | 2020-12-16 02:18:52 +1100 | |
---|---|---|
committer | 2020-12-16 02:18:52 +1100 | |
commit | 503332a9867f9aa27fc77cd9e762626d22d213ef (patch) | |
tree | e60fba6664a3d980d5f62846982bde381a25c3f7 /plugins/autofire/autofire_menu.lua | |
parent | b5f78fe38358b68fc54416328f764cf4e2bf3333 (diff) |
-Lua cleanup and documentation migration checkpoint.
* Cleaned up some more of the Lua inteface. Mostly replacing methods
with properties, some consistency fixes, a few renames, some more
exposed functionality, and a couple of properties that have no
business being set from scripts made read-only.
* Moved a lot more Lua documentation out of source comments into the
documentation, and expanded on it in the process.
* Got more UI code out of the input manager.
* Changed input sequence poller to a polymorphic class where you
specify your intention upfront.
* Changed the cheat plugin to use UI Clear to clear hotkey assignments
and leave them unchanged if the user starts assignment but doesn't
press any switches.
* Ported AJR's fix for over-eager double-click recognition from SDL to
Windows OSD.
-goldnpkr.cpp: Cleaned up inputs, using standard keyout and payout types
and key assignments.
Diffstat (limited to 'plugins/autofire/autofire_menu.lua')
-rw-r--r-- | plugins/autofire/autofire_menu.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua index 4744de1b2ac..b9fb89d5042 100644 --- a/plugins/autofire/autofire_menu.lua +++ b/plugins/autofire/autofire_menu.lua @@ -76,6 +76,7 @@ end local function handle_main_menu(index, event, buttons) local section, adjusted_index = menu_section(index) if section == MENU_SECTIONS.CONTENT then + manager:machine():popmessage(_('Press UI Clear to delete')) if event == 'select' then current_button = buttons[adjusted_index] table.insert(menu_stack, MENU_TYPES.EDIT) @@ -108,10 +109,10 @@ end -- Borrowed from the cheat plugin local function poll_for_hotkey() local input = manager:machine():input() - local poller = input:sequence_poller() + local poller = input:switch_sequence_poller() manager:machine():popmessage(_('Press button for hotkey or wait to leave unchanged')) manager:machine():video():frame_update(true) - poller:start('switch') + poller:start() local time = os.clock() local clearmsg = true while (not poller:poll()) and (poller.modified or (os.clock() < time + 1)) do @@ -132,16 +133,16 @@ local function poll_for_hotkey() end local function handle_configure_menu(index, event) - -- Input if index == 1 then + -- Input if event == 'select' then table.insert(menu_stack, MENU_TYPES.BUTTON) return true else return false end - -- Hotkey elseif index == 2 then + -- Hotkey if event == 'select' then local keycode = poll_for_hotkey() if keycode then @@ -153,16 +154,16 @@ local function handle_configure_menu(index, event) else return false end - -- On frames elseif index == 3 then + -- On frames manager:machine():popmessage(_('Number of frames button will be pressed')) if event == 'left' then current_button.on_frames = current_button.on_frames - 1 elseif event == 'right' then current_button.on_frames = current_button.on_frames + 1 end - -- Off frames elseif index == 4 then + -- Off frames manager:machine():popmessage(_('Number of frames button will be released')) if event == 'left' then current_button.off_frames = current_button.off_frames - 1 |