selected ulti per char

torsten.philipp [03-30-18 - 22:13]
selected ulti per char
Filename
TaosGroupTools/Defaults.lua
TaosGroupTools/logic/SettingsHandler.lua
TaosGroupTools/ui/groupultimate/CompactSwimlaneList.lua
TaosGroupTools/ui/groupultimate/GroupUltimateSelector.lua
TaosGroupTools/ui/groupultimate/SimpleList.lua
TaosGroupTools/ui/groupultimate/SwimlaneList.lua
diff --git a/TaosGroupTools/Defaults.lua b/TaosGroupTools/Defaults.lua
index 8027349..b53554c 100644
--- a/TaosGroupTools/Defaults.lua
+++ b/TaosGroupTools/Defaults.lua
@@ -26,8 +26,7 @@ TGT_DEFAULTS =
     ["IsSortingActive"]          = false,
     ["StaticUltimateID"]         =
     {
-        { "Default", 29861 },
-        { "Taonnor Annare", 29861 },
+        ["Default"] = 29861,
     },
     ["SwimlaneUltimateGroupIds"] =
     {
diff --git a/TaosGroupTools/logic/SettingsHandler.lua b/TaosGroupTools/logic/SettingsHandler.lua
index 04b9261..da6d8a6 100644
--- a/TaosGroupTools/logic/SettingsHandler.lua
+++ b/TaosGroupTools/logic/SettingsHandler.lua
@@ -75,16 +75,15 @@ function TGT_SettingsHandler.GetStaticUltimateIDSettings()
     if (LOG_ACTIVE) then
         _logger:logTrace("TGT_SettingsHandler.GetStaticUltimateIDSettings")
     end
-
-    -- Find player ID
-    for playerName, ultimateId in ipairs(TGT_SettingsHandler.SavedVariables.StaticUltimateID) do
-        if (playerName == GetUnitName("player")) then
-            return ultimateId
-        end
-    end
-
-    -- If not found, return default
-    return TGT_SettingsHandler.SavedVariables.StaticUltimateID["Default"]
+
+	foundUltimate = TGT_SettingsHandler.SavedVariables.StaticUltimateID[GetUnitName("player")]
+
+	-- If not found, return default
+	if (foundUltimate ~= nil) then
+		return foundUltimate
+	else
+		return TGT_SettingsHandler.SavedVariables.StaticUltimateID["Default"]
+	end
 end

 --[[
diff --git a/TaosGroupTools/ui/groupultimate/CompactSwimlaneList.lua b/TaosGroupTools/ui/groupultimate/CompactSwimlaneList.lua
index 1d59e69..2e2152f 100644
--- a/TaosGroupTools/ui/groupultimate/CompactSwimlaneList.lua
+++ b/TaosGroupTools/ui/groupultimate/CompactSwimlaneList.lua
@@ -493,6 +493,7 @@ function TGT_CompactSwimlaneList.Initialize(logger, isMocked)
     TGT_CompactSwimlaneList.IsMocked = isMocked

     TGT_CompactSwimlaneList.CreateCompactSwimlaneListHeaders()
+    TGT_CompactSwimlaneList.SetControlActive()

     CALLBACK_MANAGER:RegisterCallback(TGT_STYLE_CHANGED, TGT_CompactSwimlaneList.SetControlActive)
     CALLBACK_MANAGER:RegisterCallback(TGT_IS_ZONE_CHANGED, TGT_CompactSwimlaneList.SetControlActive)
diff --git a/TaosGroupTools/ui/groupultimate/GroupUltimateSelector.lua b/TaosGroupTools/ui/groupultimate/GroupUltimateSelector.lua
index d7b7c15..577b1b5 100644
--- a/TaosGroupTools/ui/groupultimate/GroupUltimateSelector.lua
+++ b/TaosGroupTools/ui/groupultimate/GroupUltimateSelector.lua
@@ -181,6 +181,7 @@ function TGT_GroupUltimateSelector.Initialize(logger)
     _control = TGT_UltimateSelectorControl

     TGT_GroupUltimateSelector.SetUltimateIcon(staticUltimateID)
+    TGT_GroupUltimateSelector.SetControlActive()

     CALLBACK_MANAGER:RegisterCallback(TGT_IS_ZONE_CHANGED, TGT_GroupUltimateSelector.SetControlActive)
     CALLBACK_MANAGER:RegisterCallback(TAO_UNIT_GROUPED_CHANGED, TGT_GroupUltimateSelector.SetControlActive)
diff --git a/TaosGroupTools/ui/groupultimate/SimpleList.lua b/TaosGroupTools/ui/groupultimate/SimpleList.lua
index 6cd0b2b..e8d8f81 100644
--- a/TaosGroupTools/ui/groupultimate/SimpleList.lua
+++ b/TaosGroupTools/ui/groupultimate/SimpleList.lua
@@ -314,6 +314,7 @@ function TGT_SimpleList.Initialize(logger, isMocked)
     TGT_SimpleList.IsMocked = isMocked

     TGT_SimpleList.CreateSimpleListRows()
+    TGT_SimpleList.SetControlActive()

     CALLBACK_MANAGER:RegisterCallback(TGT_STYLE_CHANGED, TGT_SimpleList.SetControlActive)
     CALLBACK_MANAGER:RegisterCallback(TGT_IS_ZONE_CHANGED, TGT_SimpleList.SetControlActive)
diff --git a/TaosGroupTools/ui/groupultimate/SwimlaneList.lua b/TaosGroupTools/ui/groupultimate/SwimlaneList.lua
index 70ad8b0..43d6501 100644
--- a/TaosGroupTools/ui/groupultimate/SwimlaneList.lua
+++ b/TaosGroupTools/ui/groupultimate/SwimlaneList.lua
@@ -494,6 +494,7 @@ function TGT_SwimlaneList.Initialize(logger, isMocked)
     TGT_SwimlaneList.IsMocked = isMocked

     TGT_SwimlaneList.CreateSwimLaneListHeaders()
+    TGT_SwimlaneList.SetControlActive()

     CALLBACK_MANAGER:RegisterCallback(TGT_STYLE_CHANGED, TGT_SwimlaneList.SetControlActive)
     CALLBACK_MANAGER:RegisterCallback(TGT_IS_ZONE_CHANGED, TGT_SwimlaneList.SetControlActive)