Ok I got this strange problem, for some reason the last part of my elseif check is not working (colored red). However if I move the code above the other elseif checks it will start working but then the one at the end (that I replaced with) will stop working .. ? Is there some kinda limit on how many elseif you can use or am I missing something?
local function EventHandler(self, event, ...)
elseif (event == "ADDON_LOADED" and arg1 == "MKN") then
StopFrame:SetPoint("CENTER", UIParent, "CENTER", MKNDB.x, MKNDB.y)
if (MKNDB.IsLocked == nil) then -- Fist time loaded
MKNDB.IsLocked = false
elseif (MKNDB.IsLocked == true) then -- frame is locked
elseif (MKNDB.IsLocked == false) then -- frame is not locked
[COLOR=Red] elseif (MKNDB.enabled == false) then -- addon is disabled
-- StopFrame:SetScript("OnEvent", nil)[/COLOR]
No, there is no such limit. But consider what the rest of the if-else chain is testing. Either the boolean hasn't been set yet (nil), or it's true, or it's false. All the possibilities are exhausted before the red code executes.