summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/autofire/autofire_menu.lua
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/autofire/autofire_menu.lua
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/autofire/autofire_menu.lua')
-rw-r--r--plugins/autofire/autofire_menu.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua
index 14ad0ea0634..f234ab498ee 100644
--- a/plugins/autofire/autofire_menu.lua
+++ b/plugins/autofire/autofire_menu.lua
@@ -52,8 +52,11 @@ end
-- Main menu
local function populate_main_menu(buttons)
+ local ioport = manager.machine.ioport
+ local input = manager.machine.input
local menu = {}
menu[#menu + 1] = {_('Autofire buttons'), '', 'off'}
+ menu[#menu + 1] = {string.format(_('Press %s to delete'), input:seq_name(ioport:type_seq(ioport:token_to_input_type("UI_CLEAR")))), '', 'off'}
menu[#menu + 1] = {'---', '', ''}
header_height = #menu
@@ -63,7 +66,7 @@ local function populate_main_menu(buttons)
-- Round to two decimal places
rate = math.floor(rate * 100) / 100
local text = button.button.name .. ' [' .. rate .. ' Hz]'
- local subtext = manager.machine.input:seq_name(button.key)
+ local subtext = input:seq_name(button.key)
menu[#menu + 1] = {text, subtext, ''}
end
content_height = #menu
@@ -76,7 +79,6 @@ 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)