diff options
| author | 2025-06-25 03:56:09 +1000 | |
|---|---|---|
| committer | 2025-06-25 03:56:09 +1000 | |
| commit | af10f3f21cc03a6dcbfde08850f640e26d9cbb9f (patch) | |
| tree | 05895657ff111b3f0ad10640f6ad0cb253cdfadb /plugins | |
| parent | 72251989ad8df6f6a1f401c56a1b02ec60938e25 (diff) | |
Various fixes:
ui: The new menus were unusable with a touchscreen, and not conducive to
localisation. It's still not possible to add sound routes with a
touchscreen, but at least it's possible to configure routes that exist.
emu/sound.cpp: Fixed localisation issues, less temporary objects.
emu/audio_effects: Fixed some localisation issues.
plugins/autofire, plugins/inputmacro: Allow deleting autofire buttons or
input macros without needing to use the UI Clear input.
ui/selmenu.cpp, ui/imgcntrl.cpp: Use terse messages for bad media.
Making these messages longer hasn't reduced support burden. Adding the
version will just perpetuate the myth that you need to redownload all
your ROMs for every release.
ui/ui.cpp: Allow info screens to be dismissed by mouse clicks or
touches.
ui/sliders.cpp: Hiding the menu should preserve state. This is a design
choice.
sound: Avoid anything that could possibly depend on static
initialisation order across transaltion units. Allow speaker position
names to be localised.
sound/none.cpp: Don't pretend it can create output streams.
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/autofire/autofire_menu.lua | 25 | ||||
| -rw-r--r-- | plugins/inputmacro/inputmacro_menu.lua | 24 |
2 files changed, 42 insertions, 7 deletions
diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua index c53dd711f53..64ab58a5885 100644 --- a/plugins/autofire/autofire_menu.lua +++ b/plugins/autofire/autofire_menu.lua @@ -117,6 +117,7 @@ local function handle_main_menu(index, event, buttons) local section, adjusted_index = menu_section(index) if section == MENU_SECTIONS.CONTENT then if event == 'select' then + initial_button = adjusted_index main_selection_save = index current_button = buttons[adjusted_index] table.insert(menu_stack, MENU_TYPES.EDIT) @@ -235,6 +236,9 @@ local function populate_edit_menu() content_height = #menu table.insert(menu, {'---', '', ''}) + table.insert(menu, {_p('plugin-autofire', 'Delete'), '', ''}) + + table.insert(menu, {'---', '', ''}) table.insert(menu, {_p('plugin-autofire', 'Done'), '', ''}) local selection = configure_selection_save @@ -248,10 +252,20 @@ end local function handle_edit_menu(index, event, buttons) local section, adjusted_index = menu_section(index) - if ((section == MENU_SECTIONS.FOOTER) and (event == 'select')) or (event == 'back') then + if (section == MENU_SECTIONS.FOOTER) and (adjusted_index == 2) and (event == 'select') then + table.remove(buttons, initial_button) + if initial_button > #buttons then + main_selection_save = main_selection_save - 1 + end + initial_button = nil configure_menu_active = false table.remove(menu_stack) return true + elseif ((section == MENU_SECTIONS.FOOTER) and (event == 'select')) or (event == 'back') then + configure_menu_active = false + initial_button = nil + table.remove(menu_stack) + return true elseif section == MENU_SECTIONS.CONTENT then return handle_configure_menu(adjusted_index, event) end @@ -303,8 +317,13 @@ end local function populate_button_menu() local function is_supported_input(ioport_field) - -- IPT_BUTTON1 through IPT_BUTTON16 in ioport_type enum (ioport.h) - return ioport_field.type >= 64 and ioport_field.type <= 79 + if ioport_field.is_analog or ioport_field.is_toggle then + return false + elseif (ioport_field.type_class == 'config') or (ioport_field.type_class == 'dipswitch') then + return false + else + return true + end end local function action(field) diff --git a/plugins/inputmacro/inputmacro_menu.lua b/plugins/inputmacro/inputmacro_menu.lua index 48fef405d0f..1680a7c8516 100644 --- a/plugins/inputmacro/inputmacro_menu.lua +++ b/plugins/inputmacro/inputmacro_menu.lua @@ -13,7 +13,9 @@ local commonui local macros local menu_stack -local macros_start_macro -- really for the macros menu, but has to be declared local before edit menu functions +local macros_start_macro -- really for the macros menu, but have to be declared local before edit menu functions +local macros_item_first_macro +local macros_selection_save -- Helpers @@ -104,6 +106,7 @@ local edit_menu_active local edit_insert_position local edit_name_buffer local edit_items +local edit_item_delete local edit_item_exit local edit_switch_poller @@ -460,6 +463,17 @@ local function handle_edit(index, event) local handled, selection = handle_edit_items(index, event) if handled then return true, selection + elseif (index == edit_item_delete) and (event == 'select') then + local macro = macros_selection_save - macros_item_first_macro + 1 + table.remove(macros, macro) + if macro > #macros then + macros_selection_save = macros_selection_save - 1 + end + edit_current_macro = nil + edit_menu_active = false + edit_items = nil + table.remove(menu_stack) + return true, selection elseif (event == 'back') or ((index == edit_item_exit) and (event == 'select')) then edit_current_macro = nil edit_menu_active = false @@ -504,6 +518,10 @@ local function populate_edit() add_edit_items(items) table.insert(items, { '---', '', '' }) + table.insert(items, { _p('plugin-inputmacro', 'Delete macro'), '', '' }) + edit_item_delete = #items + + table.insert(items, { '---', '', '' }) table.insert(items, { _p('plugin-inputmacro', 'Done'), '', '' }) edit_item_exit = #items @@ -519,8 +537,6 @@ end -- Macros menu -local macros_item_first_macro -local macros_selection_save local macros_item_add function handle_macros(index, event) @@ -533,7 +549,7 @@ function handle_macros(index, event) return true end elseif index >= macros_item_first_macro then - macro = index - macros_item_first_macro + 1 + local macro = index - macros_item_first_macro + 1 if event == 'select' then edit_current_macro = macros[macro] edit_insert_position = #edit_current_macro.steps + 1 |
