Skip to content

Commit

Permalink
Update plugins for changes in MAME.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuavas committed Mar 23, 2023
1 parent 99c60b0 commit 4f2e4c4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugins/viewswitch/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ local viewswitch = exports
function viewswitch.startplugin()
local switch_hotkeys = { }

local machine = { ui_active = true }
local input_manager
local ui_manager = { menu_active = true }
local ui_manager = { menu_active = true, ui_active = true }
local render_targets
local menu_handler

local function frame_done()
if machine.ui_active and (not ui_manager.menu_active) then
if ui_manager.ui_active and (not ui_manager.menu_active) then
for k, hotkey in pairs(switch_hotkeys) do
if input_manager:seq_pressed(hotkey.sequence) then
render_targets[hotkey.target].view_index = hotkey.view
Expand All @@ -32,7 +31,7 @@ function viewswitch.startplugin()
local persister = require('viewswitch/viewswitch_persist')
switch_hotkeys = persister:load_settings()

machine = manager.machine
local machine = manager.machine
input_manager = machine.input
ui_manager = manager.ui
render_targets = machine.render.targets
Expand All @@ -44,9 +43,8 @@ function viewswitch.startplugin()

menu_handler = nil
render_targets = nil
ui_manager = { menu_active = true }
ui_manager = { menu_active = true, ui_active = true }
input_manager = nil
machine = { ui_active = true }
switch_hotkeys = { }
end

Expand Down

0 comments on commit 4f2e4c4

Please sign in to comment.