Magic Lantern Forum

Developing Magic Lantern => Scripting Corner => Scripting API suggestions => Topic started by: garry23 on October 31, 2017, 05:07:46 PM

Title: [DONE - lv.overlays] Lua graphics question/help
Post by: garry23 on October 31, 2017, 05:07:46 PM
I have a script that draws to the screen and all is well, until I switch to Canon menus, eg INFO or MENU.

I'm detecting these screens via a property change, ie:

Code: [Select]
function property.GUI_STATE:handler(value)
    if value == 1 then
        fb_dirty = true
    else
        fb_dirty = false
    end
end

Both MENU and INFO return the value 1.

The issue I have is how to decouple me not (sic) drawing and the Canon side drawing MENU or INFO screens.

Has anyone worked out how to manage the Lua and Canon side graphics? That is cleanly doing one or the other.
Title: Re: Lua graphics question/help
Post by: a1ex on November 05, 2017, 07:56:28 PM
If I understood well, testing lv.overlays (https://builds.magiclantern.fm/lua_api/modules/lv.html#overlays) should do the trick.
Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: garry23 on November 06, 2017, 01:03:38 PM
@a1ex

Have now used lv.overlays and also exploited event.keypress to delay the Canon MENU or INFO key presses until I can clean up my Lua drawing stuff. This fully deconflicts Lua drawing from Canon drawing :-)

However, one thing I noticed was that lv.overlays returns false when the full MENU or INFO screens are showing.

When INFO is toggled through its options, then lv.overlays returns 1.

As expected lv.overlays returns 2 if ML overlays active.

Is the above what is expected, ie false for MENU and INFO full displays?

Cheers

Garry

Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: a1ex on November 06, 2017, 03:01:24 PM
You mean, outside LiveView (lv.enabled == false) ?

What should be the return value in this case?
Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: garry23 on November 06, 2017, 03:09:02 PM
On an EOSM, with Canon MENU or INFO showing, lv.overlays returns false.

As you toggle through the INFO screens lv.overlays returns 1.

Do I infer that on the EOSM, which I thought was always in LV, disables LV when showing the Canon MENU or INFO screens?
Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: a1ex on November 06, 2017, 03:11:05 PM
I don't know, you tell me the return value of lv.enabled in these modes.

Canon menu disables LiveView on all models; the INFO screen is usually outside LiveView, but I don't know what happens on M.
Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: garry23 on November 06, 2017, 03:36:42 PM
Just tested and lv.enabled = false when showing the full MENU and INFO screens.

All is well with the world and ML  ;)

Cheers

Garry
Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: a1ex on November 06, 2017, 03:50:12 PM
Alright, good to know.

Just out of curiosity - does pressing half-shutter go back to LiveView from the INFO screen?
Title: Re: [DONE - lv.overlays] Lua graphics question/help
Post by: garry23 on November 06, 2017, 03:59:57 PM
Yes, but only from the full INFO screen.

If you have started toggling through the various INFO screens, and returned to LV, the half-shutter does nothing.