Release prep

Sasky [09-18-14 - 05:55]
Release prep
- Remove debug statements
- Cleanup dead code
Filename
AutoInviteUI.lua
lua/kick.lua
lua/queue.lua
ui/autoinvitescene.lua
ui/half_grouplist.lua
diff --git a/AutoInviteUI.lua b/AutoInviteUI.lua
index c6ca912..089428c 100644
--- a/AutoInviteUI.lua
+++ b/AutoInviteUI.lua
@@ -17,73 +17,6 @@

 AutoInviteUI = AutoInviteUI or {}
 local ui = AutoInviteUI
-local wm = WINDOW_MANAGER
-
-function AutoInviteUI.create()
---    local pre = "AutoInviteUI"
---    ui.main = wm:CreateControl(nil, ZO_GroupList, CT_CONTROL)
---    ui.main:SetAnchor(TOPRIGHT, ZO_SharedRightBackground, TOPLEFT, -50, 50)
---    ui.main:SetDimensions(280,450)
---
---    ui.bg = wm:CreateControl(pre .. "bg", ui.main, CT_BACKDROP)
---    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 )
---
---    AutoInviteUI.addControls(ui, pre)
-end
-
-function AutoInviteUI.addControls(ui)
---    ui.main:SetDimensions(280,450)
---    ui.scroll = ui.main -- For using LAM controls
---    ui.data = {}
---
---    ui.title = LAMCreateControl.header(ui, {
---        type = "header",
---        name = "AutoInvite Options",
---        width = "half"
---    })
---    ui.title:SetAnchor(TOPLEFT, ui.main, TOPLEFT, 5, 5)
---    ui.title:SetWidth(270)
---    ui.title.divider:ClearAnchors()
---    ui.title.divider:SetAnchor(BOTTOM)
---    ui.title.header:ClearAnchors()
---    ui.title.header:SetAnchor(TOPLEFT)
-
-
-
-
-
---    ui.hide = wm:CreateControlFromVirtual(nil, ui.main, "ZO_DefaultButton")
---    ui.hide:SetAnchor(TOPRIGHT, ui.main, TOPRIGHT, 7, 2)
---    ui.hide:SetWidth(40)
---    ui.hide:SetText("X")
---    ui.hide:SetScale(0.8)
---    ui.hide:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
---    ui.hide:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
---    ui.hide:SetHandler("OnClicked", AutoInviteUI.menuHide)
---
---    ui.show = wm:CreateControlFromVirtual(nil, ZO_GroupList, "ZO_DefaultButton")
---    ui.show:SetAnchor(TOPLEFT, ZO_GroupList, TOPLEFT, 120, -40)
---    ui.show:SetWidth(160)
---    ui.show:SetText("AutoInvite Settings")
---    ui.show:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter)
---    ui.show:SetHandler("OnMouseExit", ZO_Options_OnMouseExit)
---    ui.show:SetHandler("OnClicked", AutoInviteUI.menuShow)
-end
-
-function AutoInviteUI.menuShow()
---    ui.main:SetHidden(false)
---    ui.show:SetHidden(true)
---    AutoInvite.cfg.showPanel = true
-end
-
-function AutoInviteUI.menuHide()
---    ui.main:SetHidden(true)
---    ui.show:SetHidden(false)
---    AutoInvite.cfg.showPanel = false
-end

 function AutoInviteUI.refresh()
     ui.enabled:UpdateValue()
@@ -100,7 +33,3 @@ function AutoInviteUI.init()
     AutoInviteUI:CreateOptionFragment()
     AutoInviteUI:CreateScene()
 end
-
-SLASH_COMMANDS["/zzg"] = function()
-    d(ZO_GroupList:IsHidden())
-end
diff --git a/lua/kick.lua b/lua/kick.lua
index 39a9ec5..77d6562 100644
--- a/lua/kick.lua
+++ b/lua/kick.lua
@@ -42,7 +42,7 @@ function AutoInvite.kickByName(name)
             return
         end
     end
-    d("No one named " .. name .. " found in group scan. Please manually kick.")
+    echo("No one named " .. name .. " found in group scan. Please manually kick.")
 end

 function AutoInvite.kickCheck()
diff --git a/lua/queue.lua b/lua/queue.lua
index 2287d89..27f8b50 100644
--- a/lua/queue.lua
+++ b/lua/queue.lua
@@ -149,20 +149,6 @@ local responseCodes = {
     [GROUP_INVITE_RESPONSE_SELF_INVITE] = "self",
 }

-local responseCodeInGroup = {
-    [GROUP_INVITE_RESPONSE_ACCEPTED] = true,
-    [GROUP_INVITE_RESPONSE_ALREADY_GROUPED] = false, --Maybe
-    [GROUP_INVITE_RESPONSE_CONSIDERING_OTHER] = false, --Maybe
-    [GROUP_INVITE_RESPONSE_DECLINED] = false,
-    [GROUP_INVITE_RESPONSE_GROUP_FULL] = false,
-    [GROUP_INVITE_RESPONSE_IGNORED] = false,
-    [GROUP_INVITE_RESPONSE_INVITED] = true, --Maybe
-    [GROUP_INVITE_RESPONSE_ONLY_LEADER_CAN_INVITE] = true,
-    [GROUP_INVITE_RESPONSE_OTHER_ALLIANCE] = false,
-    [GROUP_INVITE_RESPONSE_PLAYER_NOT_FOUND] = false,
-    [GROUP_INVITE_RESPONSE_SELF_INVITE] = true,
-}
-
 function AutoInvite.inviteResponse(_, name, responseCode)
     dbg("Invite response: " .. name .. " : (" .. responseCode .. ") " .. nn(responseCodes[responseCode]))
     if AutoInvite.sentInvite[name] ~= nil then
diff --git a/ui/autoinvitescene.lua b/ui/autoinvitescene.lua
index 67bc4b3..0e6aa2e 100644
--- a/ui/autoinvitescene.lua
+++ b/ui/autoinvitescene.lua
@@ -17,61 +17,61 @@

 AutoInviteUI = AutoInviteUI or {}

-local keybindStripDescriptor =
-{
-    alignment = KEYBIND_STRIP_ALIGN_CENTER,
-
-    -- Invite to Group
-    {
-        name = GetString(SI_GROUP_WINDOW_INVITE_PLAYER),
-        keybind = "UI_SHORTCUT_PRIMARY",
-
-        callback = function()
-            ZO_Dialogs_ShowDialog("GROUP_INVITE")
-        end,
-
-        visible = function()
-            --return not self.playerIsGrouped or (self.playerIsLeader and self.groupSize < GROUP_SIZE_MAX)
-            return (GetGroupSize() <= AutoInvite.cfg.maxSize)
-        end
-    },
-
-    -- Start Search
-    {
-        name = GetString(SI_GROUPING_TOOLS_PANEL_START_SEARCH),
-        keybind = "UI_SHORTCUT_SECONDARY",
-
-        callback = function()
-            AutoInvite.startListening()
-        end,
-
-        visible = function()
-            return not AutoInvite.enabled
-        end
-    },
-
-    -- Cancel Search
-    {
-        name = GetString(SI_GROUP_WINDOW_CANCEL_SEARCH),
-        keybind = "UI_SHORTCUT_NEGATIVE",
-
-        callback = function()
-            AutoInvite.disable()
-        end,
-
-        visible = function()
-            return AutoInvite.enabled
-        end
-    },
-}
-
-local function manageKeybinds(_, newState)
-    if(newState == SCENE_SHOWING) then
-        KEYBIND_STRIP:AddKeybindButtonGroup(keybindStripDescriptor)
-    elseif(newState == SCENE_HIDDEN) then
-        KEYBIND_STRIP:RemoveKeybindButtonGroup(keybindStripDescriptor)
-    end
-end
+--local keybindStripDescriptor =
+--{
+--    alignment = KEYBIND_STRIP_ALIGN_CENTER,
+--
+--    -- Invite to Group
+--    {
+--        name = GetString(SI_GROUP_WINDOW_INVITE_PLAYER),
+--        keybind = "UI_SHORTCUT_PRIMARY",
+--
+--        callback = function()
+--            ZO_Dialogs_ShowDialog("GROUP_INVITE")
+--        end,
+--
+--        visible = function()
+--            --return not self.playerIsGrouped or (self.playerIsLeader and self.groupSize < GROUP_SIZE_MAX)
+--            return (GetGroupSize() <= AutoInvite.cfg.maxSize)
+--        end
+--    },
+--
+--    -- Start Search
+--    {
+--        name = GetString(SI_GROUPING_TOOLS_PANEL_START_SEARCH),
+--        keybind = "UI_SHORTCUT_SECONDARY",
+--
+--        callback = function()
+--            AutoInvite.startListening()
+--        end,
+--
+--        visible = function()
+--            return not AutoInvite.enabled
+--        end
+--    },
+--
+--    -- Cancel Search
+--    {
+--        name = GetString(SI_GROUP_WINDOW_CANCEL_SEARCH),
+--        keybind = "UI_SHORTCUT_NEGATIVE",
+--
+--        callback = function()
+--            AutoInvite.disable()
+--        end,
+--
+--        visible = function()
+--            return AutoInvite.enabled
+--        end
+--    },
+--}
+--
+--local function manageKeybinds(_, newState)
+--    if(newState == SCENE_SHOWING) then
+--        KEYBIND_STRIP:AddKeybindButtonGroup(keybindStripDescriptor)
+--    elseif(newState == SCENE_HIDDEN) then
+--        KEYBIND_STRIP:RemoveKeybindButtonGroup(keybindStripDescriptor)
+--    end
+--end

 function AutoInviteUI:CreateScene()
     AUTO_INVITE_SCENE = ZO_Scene:New("autoInvite", SCENE_MANAGER)
@@ -111,7 +111,7 @@ function AutoInviteUI:CreateScene()
     SCENE_MANAGER:GetSceneGroup("groupSceneGroup").scenes[3] = "autoInvite"
     AUTO_INVITE_SCENE:AddFragment(ZO_FadeSceneFragment:New(MAIN_MENU.sceneGroupBar))

-    AUTO_INVITE_SCENE:RegisterCallback("StateChange", manageKeybinds)
+--    AUTO_INVITE_SCENE:RegisterCallback("StateChange", manageKeybinds)

     MAIN_MENU:AddRawScene("autoInvite", 6, MAIN_MENU.categoryInfo[6], "groupSceneGroup")
 end
\ No newline at end of file
diff --git a/ui/half_grouplist.lua b/ui/half_grouplist.lua
index e44e1a4..1be3a11 100644
--- a/ui/half_grouplist.lua
+++ b/ui/half_grouplist.lua
@@ -18,14 +18,14 @@ local function dbg(msg) if AutoInvite.debug then d("|c999999" .. msg) end end
 local function echo(msg) CHAT_SYSTEM.primaryContainer.currentBuffer:AddMessage("|CFFFF00"..msg) end

 local AI_SmallGroupListing = ZO_SortFilterList:Subclass()
-AI_GROUP_LIST_ENTRIES = {}
+local AI_GROUP_LIST_ENTRIES = {}

 local AI_GROUP_DATA = 1

-local ENTRY_SORT_KEYS =
-{
-    ["displayName"] = { },
-}
+--local ENTRY_SORT_KEYS =
+--{
+--    ["displayName"] = { },
+--}

 local STATUS_ORDERING = setmetatable({
     ONLINE = 1,
@@ -58,12 +58,11 @@ function AI_SmallGroupListing:New(control)
 --        manager:updateSingle(name)
 --    end

-    ZO_PreHook(GROUP_LIST, "FilterScrollList", function(...)
+    ZO_PreHook(GROUP_LIST, "FilterScrollList", function()
         dbg("Hooked FilterScrollList")
         if not hookedMasterList then
             manager:RefreshData()
         end
-        --hookedMasterList = false /script AutoInvite:invitePlayer("Dynaxia Artria")
     end)

 --    control:RegisterForEvent(EVENT_GROUP_MEMBER_LEFT, Update)
@@ -78,11 +77,9 @@ function AI_SmallGroupListing:New(control)
 end

 function AI_SmallGroupListing:updateSingle(name)
-    d("Calling AI_SmallGroupListing:updateSingle()")
+    dbg("Calling AI_SmallGroupListing:updateSingle()")
     --Used for sent invite, invite declined, add to queue
     --Updates that one entry then
-    local scrollData = ZO_ScrollList_GetDataList(self.list)
-
     if AI_GROUP_LIST_ENTRIES[name] then
         AI_GROUP_LIST_ENTRIES[name]:Update()
     elseif name then
@@ -198,7 +195,6 @@ function AI_SLG_Entry.NewDefined(name, status, arg)
     local self = setmetatable({}, AI_SLG_Entry)
     self.status = status
     self.displayName = name
-    function self.Update() end --No-op

     if status == STATUS_ORDERING.queue then
         self.position = arg
@@ -248,7 +244,8 @@ function AI_SLG_Entry.New(name, tag)
 end

 --Global XML Handlers
------------------------
+
+
 --function ZO_IgnoreListManager:IgnoreListPanelRow_OnMouseUp(control, button, upInside)
 --    if(button == 2 and upInside) then
 --        ClearMenu()
@@ -277,10 +274,4 @@ end

 function AI_SmallGroupListing_OnInitialized(self)
     MINI_GROUP_LIST = AI_SmallGroupListing:New(self)
-end
-
---[[
-/script MINI_GROUP_LIST:RefreshData()
-/script MINI_GROUP_LIST:BuildMasterList()
-/script AutoInvite:invitePlayer("Streak Muldune")
- ]]
\ No newline at end of file
+end
\ No newline at end of file