Lua Menu Problem

Started by garry23, July 09, 2016, 09:03:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

I hope someone can help with this Lua menu problem I'm having.

Until now I have only used the select with numbers. I'm now trying it with choices.

What I get with the attached code is the choices toggles between Off and 1Ev, ie it does not move through the choices.

Does anyone see what stupid thing I'm doing?  ;)

name = "Ev bracket delta per image",
help = "Auto exposure bracketing",
choices = {"Off","1Ev","2EV","Auto 1Ev","Auto 2Ev"},
icon_type = ICON_TYPE.BOOL,
select = function(this,delta)
if this.value == "Off" then
factor = 1
this.value = "1Ev"
elseif this.value == "1Ev" then
factor = 2
this.value = "2Ev"
elseif this.value == "2Ev" then
factor = 3
this.value = "Auto 1Ev"
elseif this.value == "1Ev" then
factor = 4
this.value = "Auto 2Ev"
elseif this.value == "2Ev" then
factor = 0
this.value = "Off"
end
end,

dmilligan

I don't think choices was designed to work like that. I would recommend not using select, it doesn't seem necessary for you anyway.

garry23

@David

Yes: I've come to that conclusion myself, after further testing.

I rework my menus accordingly.

Cheers

Garry