diff options
| author | 2021-10-11 13:14:31 +1100 | |
|---|---|---|
| committer | 2021-10-11 13:14:31 +1100 | |
| commit | fd6309ee916c8109872e914ac22faedd8b6c8f49 (patch) | |
| tree | bd3605dce3c7cc34804dea0e1ebd3c5aaf87dfb4 /plugins | |
| parent | 00a9f25e72fa206c1e2e3a0233b47899bfcb9a7a (diff) | |
frontend: Keep cleaning up.
Got rid of one of the UI audit inputs. There only needs to be one, and
the options can be presented in the confirmation menu. Two secret
keystrokes is too confusing. Also got rid of the long-obsolete UI
Toggle Debugger input.
Added audit media button to the toolbar so it's a bit less opaque, and
it can be accessed with a mouse/trackball (not just by knowing the key
mapping).
Made default I/O port names localisable.
Made autofire plugin save port fields using the { port, mask, type }
tuple, the same way MAME does. Unfortunately this will break existing
autofire configuration, but it should be more stable going forward.
Added some more UI keys to the default key mappings documentation.
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/autofire/autofire_menu.lua | 6 | ||||
| -rw-r--r-- | plugins/autofire/autofire_save.lua | 14 |
2 files changed, 11 insertions, 9 deletions
diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua index f234ab498ee..d71984a4b57 100644 --- a/plugins/autofire/autofire_menu.lua +++ b/plugins/autofire/autofire_menu.lua @@ -65,7 +65,7 @@ local function populate_main_menu(buttons) local rate = 60 / (button.on_frames + button.off_frames) -- Round to two decimal places rate = math.floor(rate * 100) / 100 - local text = button.button.name .. ' [' .. rate .. ' Hz]' + local text = string.format(_('%s [%d Hz]'), _("input-name", button.button.name), rate) local subtext = input:seq_name(button.key) menu[#menu + 1] = {text, subtext, ''} end @@ -100,7 +100,7 @@ end -- Add/edit menus (mostly identical) local function populate_configure_menu(menu) - local button_name = current_button.button and current_button.button.name or _('NOT SET') + local button_name = current_button.button and _("input-name", current_button.button.name) or _('NOT SET') local key_name = current_button.key and manager.machine.input:seq_name(current_button.key) or _('NOT SET') menu[#menu + 1] = {_('Input'), button_name, ''} menu[#menu + 1] = {_('Hotkey'), key_name, ''} @@ -249,7 +249,7 @@ local function populate_button_menu() for port_key, port in pairs(manager.machine.ioport.ports) do for field_key, field in pairs(port.fields) do if is_supported_input(field) then - menu[#menu + 1] = {field.name, '', ''} + menu[#menu + 1] = { _("input-name", field.name), '', '' } inputs[#inputs + 1] = { port_name = port_key, field_name = field_key, diff --git a/plugins/autofire/autofire_save.lua b/plugins/autofire/autofire_save.lua index 0576a95582d..e75b44c71e3 100644 --- a/plugins/autofire/autofire_save.lua +++ b/plugins/autofire/autofire_save.lua @@ -9,19 +9,20 @@ local function get_settings_filename() end local function initialize_button(settings) - if settings.port and settings.field and settings.key and settings.on_frames and settings.off_frames then + if settings.port and settings.mask and settings.type and settings.key and settings.on_frames and settings.off_frames then local new_button = { port = settings.port, - field = settings.field, key = manager.machine.input:seq_from_tokens(settings.key), on_frames = settings.on_frames, off_frames = settings.off_frames, counter = 0 } - local port = manager.machine.ioport.ports[settings.port] + local ioport = manager.machine.ioport + local port = ioport.ports[settings.port] if port then - local field = port.fields[settings.field] - if field then + local field = port:field(settings.mask) + if field and (field.type == ioport:token_to_input_type(settings.type)) then + new_button.field = field.name new_button.button = field return new_button end @@ -35,7 +36,8 @@ local function serialize_settings(button_list) for index, button in ipairs(button_list) do setting = { port = button.port, - field = button.field, + mask = button.button.mask, + type = manager.machine.ioport:input_type_to_token(button.button.type), key = manager.machine.input:seq_to_tokens(button.key), on_frames = button.on_frames, off_frames = button.off_frames |
