Fix hardcoding of tab

Sasky [03-18-15 - 16:32]
Fix hardcoding of tab
Filename
ui/autoinvitescene.lua
diff --git a/ui/autoinvitescene.lua b/ui/autoinvitescene.lua
index 0e6aa2e..6271543 100644
--- a/ui/autoinvitescene.lua
+++ b/ui/autoinvitescene.lua
@@ -78,29 +78,21 @@ function AutoInviteUI:CreateScene()
     AUTO_INVITE_SCENE:AddFragmentGroup(FRAGMENT_GROUP.MOUSE_DRIVEN_UI_WINDOW)
     AUTO_INVITE_SCENE:AddFragmentGroup(FRAGMENT_GROUP.FRAME_TARGET_STANDARD_RIGHT_PANEL)
     AUTO_INVITE_SCENE:AddFragment(RIGHT_BG_FRAGMENT)
-
-    --AUTO_INVITE_SCENE:AddFragment(GROUP_LIST_FRAGMENT)
-
     AUTO_INVITE_SCENE:AddFragment(DISPLAY_NAME_FRAGMENT)
     AUTO_INVITE_SCENE:AddFragment(TITLE_FRAGMENT)
-
     AUTO_INVITE_SCENE:AddFragment(GROUP_TITLE_FRAGMENT)
     AUTO_INVITE_SCENE:AddFragment(GROUP_MEMBERS_FRAGMENT)
+    AUTO_INVITE_SCENE:AddFragment(GROUP_WINDOW_SOUNDS)
+    AUTO_INVITE_SCENE:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
+    AUTO_INVITE_SCENE:AddFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)

+    --AutoInvite Fragments
     AUTO_INVITE_SCENE:AddFragment(AI_SMALL_GROUP_LIST_FRAGMENT)
-
     AUTO_INVITE_SCENE:AddFragment(AUTO_INVITE_OPTIONS_FRAGMENT)
     AUTO_INVITE_SCENE:AddFragment(AUTO_INVITE_ENABLED_FRAGMENT)
-    --AUTO_INVITE_SCENE:AddFragment(PREFERRED_ROLES_FRAGMENT)
-    --AUTO_INVITE_SCENE:AddFragment(GROUP_CENTER_INFO_FRAGMENT)
-    --AUTO_INVITE_SCENE:AddFragment(SEARCHING_FOR_GROUP_FRAGMENT) --Could add this in
-    AUTO_INVITE_SCENE:AddFragment(GROUP_WINDOW_SOUNDS)
-
-    --AUTO_INVITE_SCENE:AddFragment(FRAME_EMOTE_FRAGMENT_SOCIAL)
-    AUTO_INVITE_SCENE:AddFragment(PLAYER_PROGRESS_BAR_FRAGMENT)
-    AUTO_INVITE_SCENE:AddFragment(PLAYER_PROGRESS_BAR_CURRENT_FRAGMENT)

-    MAIN_MENU.sceneGroupInfo.groupSceneGroup.menuBarIconData[3] = {
+    local indx = #MAIN_MENU.sceneGroupInfo.groupSceneGroup.menuBarIconData + 1
+    MAIN_MENU.sceneGroupInfo.groupSceneGroup.menuBarIconData[indx] = {
         categoryName = SI_AUTO_INVITE,
         descriptor = "autoInvite",
         normal = "EsoUI/Art/Campaign/campaign_tabIcon_summary_up.dds",
@@ -108,10 +100,11 @@ function AutoInviteUI:CreateScene()
         highlight = "EsoUI/Art/Campaign/campaign_tabIcon_summary_over.dds",
     }

-    SCENE_MANAGER:GetSceneGroup("groupSceneGroup").scenes[3] = "autoInvite"
+    SCENE_MANAGER:GetSceneGroup("groupSceneGroup").scenes[indx] = "autoInvite"
     AUTO_INVITE_SCENE:AddFragment(ZO_FadeSceneFragment:New(MAIN_MENU.sceneGroupBar))

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

+    --TODO: Constant for the magic number?
     MAIN_MENU:AddRawScene("autoInvite", 6, MAIN_MENU.categoryInfo[6], "groupSceneGroup")
 end
\ No newline at end of file