summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/autofire/autofire_menu.lua
diff options
context:
space:
mode:
author Jack Li <jackrjli@berkeley.edu>2019-05-21 15:44:44 -0700
committer ajrhacker <ajrhacker@users.noreply.github.com>2019-05-21 18:44:44 -0400
commit27f66693c5d1263453d625a2d4a17f99b6766443 (patch)
tree9061c48967f7221a009fa44a0886a42b1851c251 /plugins/autofire/autofire_menu.lua
parent20d691db79fd57ac78d15876f7450ae4cdd4ef89 (diff)
Autofire plugin: Save/load fixes (#5093)
* Fixed bugs related to reloading roms Soft resets would reload autofire settings without saving them first, causing the settings to be lost. This commit adds a check to only reload from the settings file if loading a different rom than before. Hard resets would leave bad references lying around, causing MAME to crash under certain circumstances (i.e. resetting while in the edit menu and entering the menu again). This commit makes sure to properly clean up and reinitialize menu and button states when resetting. * Used set_folder to avoid hardcoding plugin name in settings path * Bumped autofire plugin version
Diffstat (limited to 'plugins/autofire/autofire_menu.lua')
-rw-r--r--plugins/autofire/autofire_menu.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/autofire/autofire_menu.lua b/plugins/autofire/autofire_menu.lua
index f5f46a96d1e..1533465105f 100644
--- a/plugins/autofire/autofire_menu.lua
+++ b/plugins/autofire/autofire_menu.lua
@@ -265,6 +265,14 @@ local function handle_button_menu(index, event)
return false
end
+function lib:init_menu(buttons)
+ header_height = 0
+ content_height = 0
+ menu_stack = { MENU_TYPES.MAIN }
+ current_button = {}
+ inputs = {}
+end
+
function lib:populate_menu(buttons)
local current_menu = menu_stack[#menu_stack]
if current_menu == MENU_TYPES.MAIN then