I am having a very strange problem. I have a function in a module called menu_onstylusup (which I copied from the Enlight code). Within the function I have a an if statement with a lot of elseifs to check on the mouse location with mousein. I have been building the statement one check at a time, and so I know that it has been working. However, the last one I added isn't working. I can't even get it to show a debug message in the output window. The strange thing is that all of my other mousein checks are still working. What's even stranger is that if I do the same check using menu_onstylusdown, it works just fine. It also works if I separete out the check into its own if statement. I tried moving the problem elseif statement to earlier in the list and it still didn't work, so I don't think that it's a limitation on the number of elseifs.
Here is a snippet showing the problem statement:
Code:
...elseif mousein(49,61,166,76) then
debug("elseif Scoring")
-- show scoring
if HELP_MENU_CLICKED == 1 then
HELP_SCORING_CLICKED = 1
HELP_MENU_CLICKED = 0
end...
And here is the separate if statement that works fine:
Code:
if mousein(49,61,166,76) then
debug("if Scoring")
-- show scoring
if HELP_MENU_CLICKED == 1 then
HELP_SCORING_CLICKED = 1
HELP_MENU_CLICKED = 0
end
end
Any thoughts?