Account for group disband, bump API to 100007

Sasky [06-25-14 - 06:08]
Account for group disband, bump API to 100007

Previously if full group disbanded, would not auto-restart.
No relevant changes in 100007, so just version bump
Update UI to reflect non-experimental status
Filename
AutoInvite.lua
AutoInvite.txt
AutoInviteUI.lua
diff --git a/AutoInvite.lua b/AutoInvite.lua
index b2acfbd..fb0d6b0 100644
--- a/AutoInvite.lua
+++ b/AutoInvite.lua
@@ -60,7 +60,6 @@ AutoInvite.guildLookup = function(channel, acctName)
     end
 end

-
 AutoInvite.kickTable = {}
 function AutoInvite.checkOffline()
     local now = GetTimeStamp()
@@ -136,6 +135,12 @@ AutoInvite.offlineEvent = function(_, unitTag, connectStatus)
     end
 end

+function AutoInvite.disbandEvent()
+    if AutoInvite.enabled and AutoInvite.cfg.restart then
+        AutoInvite.startListening()
+    end
+end
+
 -- tick function: called every 15s
 function AutoInvite.kickCheck()
     if not AutoInvite.cfg.autoKick then return end
@@ -159,6 +164,7 @@ AutoInvite.disable = function()
 	AutoInvite.enabled = false
     AutoInvite.stopListening()
     EVENT_MANAGER:UnregisterForUpdate("AutoInviteKickCheck")
+    EVENT_MANAGER:UnregisterForEvent(AutoInvite.AddonId, EVENT_GROUP_DISBANDED)
 end

 AutoInvite.stopListening = function()
@@ -171,6 +177,7 @@ AutoInvite.startListening = function()
         AutoInvite.enabled = true
         AutoInvite.checkOffline()
         EVENT_MANAGER:RegisterForUpdate("AutoInviteKickCheck", 1000, AutoInvite.kickCheck)
+        EVENT_MANAGER:RegisterForEvent(AutoInvite.AddonId, EVENT_GROUP_DISBANDED)
     end

 	if not AutoInvite.listening and GetGroupSize() < AutoInvite.cfg.maxSize then
diff --git a/AutoInvite.txt b/AutoInvite.txt
index c552cbf..46da4b7 100644
--- a/AutoInvite.txt
+++ b/AutoInvite.txt
@@ -1,6 +1,6 @@
-## APIVersion: 100004
+## APIVersion: 100007
 ## Title: AutoInvite
-## Version: 1.3.1
+## Version: 1.3.2
 ## Author: Sasky
 ## SavedVariables: AutoInviteSettings
 ## OptionalDependsOn: LibAddonMenu-2.0
diff --git a/AutoInviteUI.lua b/AutoInviteUI.lua
index 4bc45ef..c8f06cd 100644
--- a/AutoInviteUI.lua
+++ b/AutoInviteUI.lua
@@ -7,13 +7,13 @@ function AutoInviteUI.create()
     local pre = "AAAAutoInviteUI"
     ui.main = wm:CreateTopLevelWindow(pre .. "Panel")
     ui.main:SetAnchor(TOPRIGHT, ZO_SharedRightBackground, TOPLEFT, -50, 50)
-    ui.main:SetDimensions(280,400)
+    ui.main:SetDimensions(280,450)

     ui.scroll = ui.main -- For using LAM controls
     ui.data = {}

     ui.bg = wm:CreateControl(pre .. "bg", ui.main, CT_BACKDROP)
-    ui.bg:SetDimensions(280,400)
+    ui.bg:SetDimensions(280,450)
     ui.bg:SetAnchor(TOPLEFT, ui.main, TOPLEFT, 0, 0)
     ui.bg:SetCenterColor( 0, 0, 0, .7 )
     ui.bg:SetEdgeColor( 1, 1, 1, 0 )
@@ -67,18 +67,18 @@ function AutoInviteUI.create()
     })
     ui.max:SetAnchor(TOPLEFT, ui.text, BOTTOMLEFT, 0, 10)

-    ui.expr = LAMCreateControl.header(ui, {
-        type = "header",
-        name = "Experimental",
-        width = "half"
-    })
-    ui.expr:SetAnchor(TOPLEFT, ui.max, TOPLEFT, 0, 65)
-    ui.expr:SetWidth(270)
-    ui.expr.divider:ClearAnchors()
-    ui.expr.divider:SetAnchor(BOTTOM)
-    ui.expr.header:ClearAnchors()
-    ui.expr.header:SetAnchor(TOPLEFT)
-    ui.expr.header:SetColor(1.0, 0.3, 0.3, 1.0)
+--    ui.expr = LAMCreateControl.header(ui, {
+--        type = "header",
+--        name = "Experimental",
+--        width = "half"
+--    })
+--    ui.expr:SetAnchor(TOPLEFT, ui.max, TOPLEFT, 0, 65)
+--    ui.expr:SetWidth(270)
+--    ui.expr.divider:ClearAnchors()
+--    ui.expr.divider:SetAnchor(BOTTOM)
+--    ui.expr.header:ClearAnchors()
+--    ui.expr.header:SetAnchor(TOPLEFT)
+--    ui.expr.header:SetColor(1.0, 0.3, 0.3, 1.0)

     ui.restart = LAMCreateControl.checkbox(ui, {
         type = "checkbox",
@@ -89,7 +89,7 @@ function AutoInviteUI.create()
         width = "half"
     })
     ui.restart:SetDimensions(250, 26)
-    ui.restart:SetAnchor(TOPLEFT, ui.expr, BOTTOMLEFT, 0, 12)
+    ui.restart:SetAnchor(TOPLEFT, ui.max, BOTTOMLEFT, 0, 12)

     ui.cyr = LAMCreateControl.checkbox(ui, {
         type = "checkbox",
@@ -126,14 +126,14 @@ function AutoInviteUI.create()
     })
     ui.kickTime:SetAnchor(TOPLEFT, ui.kick, BOTTOMLEFT, 0, 5)

---    ui.note = LAMCreateControl.description(ui, {
---        type = "description",
---        title = "Coming Soon",
---        text = "Automatically kick players offline after certain time",
---        width = "half"
---    })
---    ui.note:SetAnchor(TOPLEFT, ui.cyr, BOTTOMLEFT, 0, 25)
---    ui.note.desc:SetColor(.7,.7,.7,1)
+    ui.note = LAMCreateControl.description(ui, {
+        type = "description",
+        title = "Slash Commands",
+        text = "/ai foo - start listening on 'foo'\n/ai - stop listening",
+        width = "half"
+    })
+    ui.note:SetAnchor(TOPLEFT, ui.kickTime, BOTTOMLEFT, 0, 25)
+    ui.note.desc:SetColor(.7,.7,.7,1)
 end

 function AutoInviteUI.menuShow()