diff options
| author | 2025-06-25 03:56:09 +1000 | |
|---|---|---|
| committer | 2025-06-25 03:56:09 +1000 | |
| commit | af10f3f21cc03a6dcbfde08850f640e26d9cbb9f (patch) | |
| tree | 05895657ff111b3f0ad10640f6ad0cb253cdfadb /plugins/inputmacro/inputmacro_menu.lua | |
| 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/inputmacro/inputmacro_menu.lua')
| -rw-r--r-- | plugins/inputmacro/inputmacro_menu.lua | 24 |
1 files changed, 20 insertions, 4 deletions
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 |
