hopefully fixed quest label states

git [11-18-18 - 13:18]
hopefully fixed quest label states
Filename
00_startup.lua
DASMenu.lua
DASUserSettingsAdapter.lua
DailyAutoShare.txt
DasGui.lua
DasGuiStringBuilder.lua
diff --git a/00_startup.lua b/00_startup.lua
index 6cf2b47..b584354 100644
--- a/00_startup.lua
+++ b/00_startup.lua
@@ -58,6 +58,7 @@ local defaults = {
 	inactiveZones			= {
     hide				= true,
   },
+  -- Morrowind
 	[849] = {
 		relic = {
 			invisible = false,
@@ -76,6 +77,7 @@ local defaults = {
 			active = true,
     },
   },
+  -- Clockwork
 	[980] = {
 		crow = {
 			invisible = false,
@@ -94,6 +96,7 @@ local defaults = {
 			active = true,
     },
   },
+  -- Murkmire
   [726] = {
 		root = {
 			invisible = false,
@@ -149,12 +152,14 @@ local defaults = {
   mapMarkersVisible           = true,

   tracked = {
-		[684]  = true,
-		[823]  = true,
-		[849]  = true,	    -- Vvardenfell
-		[181]  = false,
-		[1011] = true,     -- Summerset
-		[726] = true,      -- Murkmire
+		[684]   = true,
+		[823]   = true,
+		[181]   = true,     -- Cyrodiil
+
+		[849]   = true,	    -- Vvardenfell
+		[980]   = true,	    -- Clockwork
+		[1011]  = true,     -- Summerset
+		[726]   = true,     -- Murkmire
   },
 }

diff --git a/DASMenu.lua b/DASMenu.lua
index 84b392d..faab815 100644
--- a/DASMenu.lua
+++ b/DASMenu.lua
@@ -86,14 +86,8 @@ function DAS.CreateMenu(savedVars, defaults)
 			controls = {


-				{ -- checkbox: Murkmire
-					type    = "checkbox",
-					tooltip = "Murkmire?",
-					name    = "Activate in Murkmire?",
-					getFunc = function() return DAS.GetActiveIn(726) end,
-					setFunc = function(value) DAS.SetActiveIn(726, value) end
-				},
-				{
+
+				{ -- submenu: Murkmire
 					type        = "submenu",
 					name        = "Murkmire",
 					controls    = {
@@ -153,7 +147,18 @@ function DAS.CreateMenu(savedVars, defaults)
 						},
 					},
 				},
+        { -- checkbox: Murkmire
+					type    = "checkbox",
+					tooltip = "Murkmire?",
+					name    = "Activate in Murkmire?",
+					getFunc = function() return DAS.GetActiveIn(726) end,
+					setFunc = function(value) DAS.SetActiveIn(726, value) end
+				},

+         {
+            type    = "header",
+            title   = "Summerset",
+        },
         { -- checkbox: Summerset
 					type    = "checkbox",
 					tooltip = "Summerset?",
@@ -161,21 +166,11 @@ function DAS.CreateMenu(savedVars, defaults)
 					getFunc = function() return DAS.GetActiveIn(1011) end,
 					setFunc = function(value) DAS.SetActiveIn(1011, value) end
 				},
-        {
+
+        { -- submenu: Clockwork City
 					type    = "submenu",
 					name    = "Clockwork City",
 					controls = {
-                        { -- checkbox: Clockwork City?
-                            type    = "checkbox",
-                            tooltip = "activate",
-                            name    = "Activate in Clockwork City?",
-                            getFunc = function() return DAS.GetActiveIn(980) end,
-                            setFunc = function(value)
-                                DAS.SetActiveIn(980, value)
-                                DAS.SetActiveIn(981, value)
-                                DAS.SetActiveIn(983, value)
-                            end
-                        },
 						{ -- header: CC Worldbosses
 							type    = "header",
 							name    = "Worldbosses"
@@ -251,15 +246,20 @@ function DAS.CreateMenu(savedVars, defaults)
 						},
 					},
 				},
-
-				{ -- checkbox: Morrowind
-					type    = "checkbox",
-					tooltip = "Vvardenfell?",
-					name    = "Activate in Vvardenfell?",
-					getFunc = function() return DAS.GetActiveIn(849) end,
-					setFunc = function(value) DAS.SetActiveIn(849, value) end
-				},
-				{
+        { -- checkbox: Clockwork City?
+            type    = "checkbox",
+            tooltip = "activate",
+            name    = "Activate in Clockwork City?",
+            getFunc = function() return DAS.GetActiveIn(980) end,
+            setFunc = function(value)
+                DAS.SetActiveIn(980, value)
+                DAS.SetActiveIn(981, value)
+                DAS.SetActiveIn(983, value)
+            end
+        },
+
+
+				{ -- submenu: Morrowind
 					type        = "submenu",
 					name        = "Vvardenfell",
 					controls    = {
@@ -337,7 +337,15 @@ function DAS.CreateMenu(savedVars, defaults)
 						},
 					},
 				},
-				{ -- checkbox: Wrothgar
+				{ -- checkbox: Morrowind
+					type    = "checkbox",
+					tooltip = "Vvardenfell?",
+					name    = "Activate in Vvardenfell?",
+					getFunc = function() return DAS.GetActiveIn(849) end,
+					setFunc = function(value) DAS.SetActiveIn(849, value) end
+				},
+
+        { -- checkbox: Wrothgar
 					type    = "checkbox",
 					tooltip = "Wrothgar?",
 					name    = "Activate in Wrothgar?",
diff --git a/DASUserSettingsAdapter.lua b/DASUserSettingsAdapter.lua
index 31972f5..1a8e4eb 100644
--- a/DASUserSettingsAdapter.lua
+++ b/DASUserSettingsAdapter.lua
@@ -149,7 +149,7 @@ function DAS.SetActiveIn(zoneIndex, value)
   zoneIndex = zoneIndex or DAS.GetZoneId()
   if not zoneIndex then return end
 	GetSettings()["tracked"][zoneIndex] = value
-	zo_callLater(function() DailyAutoShare.RefreshGui(not DAS.GetActiveIn()) end, 500)
+	zo_callLater(function() DailyAutoShare.RefreshGui(not DAS.GetActiveIn()) end, 200)
 end

 local nestedLists = {
diff --git a/DailyAutoShare.txt b/DailyAutoShare.txt
index 0545288..478dc1a 100644
--- a/DailyAutoShare.txt
+++ b/DailyAutoShare.txt
@@ -1,6 +1,6 @@
 ## Title: DailyAutoShare
 ## Author: manavortex
-## Version: 3.51
+## Version: 3.6
 ## APIVersion: 100025
 ## SavedVariables: DAS_Settings DAS_Globals
 ## DependsOn: LibStub LibCustomMenu LibAddonMenu-2.0
diff --git a/DasGui.lua b/DasGui.lua
index de38895..bd181ba 100644
--- a/DasGui.lua
+++ b/DasGui.lua
@@ -152,7 +152,7 @@ local function shouldHideLabel(questName, zoneId)
       -- d("hidden: " .. tostring(DAS.GetQuestListItem(zoneId, questListName, "invisible")))
 			return  (
 				(not DAS.GetQuestListItem(zoneId, questListName, "active")) or
-         DAS.GetQuestListItem(zoneId, questListName, "invisible"))
+      DAS.GetQuestListItem(zoneId, questListName, "invisible"))
     end
   end
 	return false
@@ -276,7 +276,7 @@ function DAS.setLabels(zoneQuests)
           label.dataQuestState            = status or DAS_STATUS_OPEN
           label.dataTitle                 = makeSubLabelTitle(label.dataQuestList[1], label.dataQuestList[2]) or questName

-        else
+          else
           label.dataQuestList 	  = nil
           label.dataTitle         = questNameOrTable
           label.dataQuestName     = questNameOrTable
@@ -365,110 +365,106 @@ function DAS.RefreshGui(hidden)
 end

 function DAS.AnchorList()
-DasList:ClearAnchors()
-if DAS.GetUpsideDown() then
-DasList:SetAnchor(BOTTOM, DasHandle, TOP)
-else
-DasList:SetAnchor(TOP, DasHandle, BOTTOM)
-end
-DasSubList:ClearAnchors()
-if DAS.GetSettings().tooltipRight then
-DasSubList:SetAnchor(LEFT, DasList, RIGHT)
-else
-DasSubList:SetAnchor(RIGHT, DasList, LEFT)
-end
+  DasList:ClearAnchors()
+  if DAS.GetUpsideDown() then
+    DasList:SetAnchor(BOTTOM, DasHandle, TOP)
+    else
+    DasList:SetAnchor(TOP, DasHandle, BOTTOM)
+  end
+  DasSubList:ClearAnchors()
+  if DAS.GetSettings().tooltipRight then
+    DasSubList:SetAnchor(LEFT, DasList, RIGHT)
+    else
+    DasSubList:SetAnchor(RIGHT, DasList, LEFT)
+  end
 end

 local function setFontSize(labelList)
-local labelHeight 	= 30
-local fontScale 	= DAS.GetFontSize()
-
-local totalHeight 	= 0
-local hidden		= false
-local parent        = nil
-local maxWidth      = DasHandle:GetWidth()
-
-for index, control in pairs(labelList) do
-parent = parent or control:GetParent()
-maxWidth = math.max(maxWidth, control:GetWidth())
-control:SetScale(fontScale)
-if control:IsHidden() then
-control:SetHeight(0)
-else
-control:SetHeight(labelHeight)
-control:SetScale(fontScale)
-end
-end
-parent:SetWidth(maxWidth)
+  local labelHeight 	= 30
+  local fontScale 	= DAS.GetFontSize()
+
+  local totalHeight 	= 0
+  local hidden		= false
+  local parent        = nil
+  local maxWidth      = DasHandle:GetWidth()
+
+  for index, control in pairs(labelList) do
+    parent = parent or control:GetParent()
+    maxWidth = math.max(maxWidth, control:GetWidth())
+    control:SetScale(fontScale)
+    if control:IsHidden() then
+      control:SetHeight(0)
+      else
+      control:SetHeight(labelHeight)
+      control:SetScale(fontScale)
+    end
+  end
+  parent:SetWidth(maxWidth)
 end
 DAS.setFontSize = setFontSize

 local function setGuiHeight()
-local buttonIndex = numLabels or 0
-local listHeight = DasHeader:GetHeight() + buttonIndex*(DAS.labels[1]:GetHeight() + 2)
-DasList:SetHeight(listHeight)
-DasControl:SetHeight(listHeight + DasHandle:GetHeight())
+  local buttonIndex = numLabels or 0
+  local listHeight = DasHeader:GetHeight() + buttonIndex*(DAS.labels[1]:GetHeight() + 2)
+  DasList:SetHeight(listHeight)
+  DasControl:SetHeight(listHeight + DasHandle:GetHeight())
 end
 DAS.SetGuiHeight = setGuiHeight

 function DAS.SetLabelFontSize()
-
-setFontSize(DAS.labels)
-setFontSize(DAS.sublabels)
-DAS.SetGuiHeight()
+
+  setFontSize(DAS.labels)
+  setFontSize(DAS.sublabels)
+  DAS.SetGuiHeight()
 end


 function DAS.CreateGui()
-
-local function setupGuiLabels()
-
-local predecessor 	    = DasHeader
-local offsetX, offsetY  = 10, 10
-
-for i=1, 28 do
-local button 	= WINDOW_MANAGER:CreateControlFromVirtual("Das_Label_"..tostring(i), DasList, "Das_Label")
-button:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, offsetY)
-predecessor 	= button
-offsetY 		= 0
-table.insert(DAS.labels, button)
-end
-
-local spacer = WINDOW_MANAGER:CreateControlFromVirtual("Das_Spacer_1", DasList, "DasInvisibleFooterSpacer")
-spacer:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, offsetY)
-
-predecessor 	    = DasSubList
-offsetY 		    = 10
-
-local anchor        = TOPLEFT
-for i=1, 15 do
-local button 	= WINDOW_MANAGER:CreateControlFromVirtual("Das_Sublabel_"..tostring(i), DasSubList, "Das_Label")
-button:SetAnchor(TOPLEFT, predecessor, anchor, offsetX, offsetY)
-predecessor 	= button
-offsetY 		= 0
-offsetX 		= 0
-anchor 		    = BOTTOMLEFT
-
-table.insert(DAS.sublabels, button)
-end
-local spacer = WINDOW_MANAGER:CreateControlFromVirtual("Das_Spacer_2", DasSubList, "DasInvisibleFooterSpacer")
-spacer:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, offsetY)
-
-DAS.SetLabelFontSize()
-end
-
-
-local eprint = function(s) return(table.concat({string.byte(s, 0, -1)}, '')) end
-
-DAS.GetSettings().lastLookingFor = eprint(DAS.pdn)
-setupGuiLabels()
-DAS.LoadControlLocation(DasControl)
--- DAS.LoadControlLocation(DasButton)
-
-DAS.AnchorList()
-SetMinimizedButton(DAS.GetMinimized())
-
-DAS.RefreshGui()
-zo_callLater(function() DAS.SetLabelFontSize() end, 2000)
+
+  local function setupGuiLabels()
+
+    local predecessor 	    = DasHeader
+    local offsetX, offsetY  = 10, 10
+
+    for i=1, 28 do
+      local button 	= WINDOW_MANAGER:CreateControlFromVirtual("Das_Label_"..tostring(i), DasList, "Das_Label")
+      button:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, offsetY)
+      predecessor 	= button
+      offsetY 		= 0
+      table.insert(DAS.labels, button)
+    end
+
+    local spacer = WINDOW_MANAGER:CreateControlFromVirtual("Das_Spacer_1", DasList, "DasInvisibleFooterSpacer")
+    spacer:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, offsetY)
+
+    predecessor 	    = DasSubList
+    offsetY 		    = 10
+
+    local anchor        = TOPLEFT
+    for i=1, 15 do
+      local button 	= WINDOW_MANAGER:CreateControlFromVirtual("Das_Sublabel_"..tostring(i), DasSubList, "Das_Label")
+      button:SetAnchor(TOPLEFT, predecessor, anchor, offsetX, offsetY)
+      predecessor 	= button
+      offsetY 		= 0
+      offsetX 		= 0
+      anchor 		    = BOTTOMLEFT
+
+      table.insert(DAS.sublabels, button)
+    end
+    local spacer = WINDOW_MANAGER:CreateControlFromVirtual("Das_Spacer_2", DasSubList, "DasInvisibleFooterSpacer")
+    spacer:SetAnchor(TOPLEFT, predecessor, BOTTOMLEFT, 0, offsetY)
+
+    DAS.SetLabelFontSize()
+  end
+
+  setupGuiLabels()
+  DAS.LoadControlLocation(DasControl)
+  -- DAS.LoadControlLocation(DasButton)
+
+  DAS.AnchorList()
+  SetMinimizedButton(DAS.GetMinimized())
+
+  DAS.RefreshGui()
+  zo_callLater(function() DAS.SetLabelFontSize() end, 2000)
 end

diff --git a/DasGuiStringBuilder.lua b/DasGuiStringBuilder.lua
index 81c2012..9aa7be2 100644
--- a/DasGuiStringBuilder.lua
+++ b/DasGuiStringBuilder.lua
@@ -9,41 +9,41 @@ local en = "en"
 local function getEnglishQuestNames(activeQuestNames)
 	activeQuestNames = activeQuestNames or DAS.GetZoneQuests()
 	if DAS.locale == en or not DAS_STRINGS_LOCALE or not DAS.locale then
-        return activeQuestNames
-    end
-    local ret = {}
+    return activeQuestNames
+  end
+  local ret = {}
 	for _, questName in ipairs(activeQuestNames) do
-        for key, value in pairs(DAS_STRINGS_LOCALE[DAS.locale]) do
-            if value == questName then
-                table.insert(ret, DAS_STRINGS_LOCALE.en[key])
-            end
-        end
-	end
-
+    for key, value in pairs(DAS_STRINGS_LOCALE[DAS.locale]) do
+      if value == questName then
+        table.insert(ret, DAS_STRINGS_LOCALE.en[key])
+      end
+    end
+  end
+
 	if ret == {} then return activeQuestNames end
 	return ret
 end
 DAS.getEnglishQuestNames = getEnglishQuestNames

 local function askForQuest(questNames)
-    local ret = ""
-    for _, questName in ipairs(questNames) do
-      if "" ~= questName then
-        ret = ret .. questName .. ", "
-      end
-		end
-    if ret == "" then return ret end
-    return ret:sub(1, -3)
+  local ret = ""
+  for _, questName in ipairs(questNames) do
+    if "" ~= questName then
+      ret = ret .. questName .. ", "
+    end
+  end
+  if ret == "" then return ret end
+  return ret:sub(1, -3)
 end
 local function generateQuestSpam(questNames)
-    local ret = ""
-    for _, questName in ipairs(questNames) do
-        bingoString = DAS.GetBingoStringFromQuestName(questName)
-        if not ret:find(bingoString) then
-            ret = ret .. ((("" == bingoString) and "") or bingoString .. " ")
-        end
+  local ret = ""
+  for _, questName in ipairs(questNames) do
+    bingoString = DAS.GetBingoStringFromQuestName(questName)
+    if not ret:find(bingoString) then
+      ret = ret .. ((("" == bingoString) and "") or bingoString .. " ")
     end
-    return ret
+  end
+  return ret
 end


@@ -54,78 +54,77 @@ local any = "+any"
 local eitherof = "either of "

 local function getQuestNames(activeQuestNames)
-
-    local questNames = empty
-    for _, questName in ipairs(activeQuestNames) do
-        if DAS.IsQuestActive(questName) then
-            questNames = questNames .. questName .. comma
-        end
-    end
-
-    return questNames
-
+  activeQuestNames = activeQuestNames or (questName and {[1] = questName,}) or DAS.GetActiveQuestNames()
+  local questNames = empty
+  for _, questName in pairs(activeQuestNames) do
+    questNames = questNames .. questName .. comma
+  end
+
+  return questNames
+
 end

 local varargOne, varargTwo, varargAny = "<<1>>", "<<2>>", "%+any"
 local function whisperify(qsString)
-    local beginIndex, endIndex = string.find(qsString, varargOne)
-    if endIndex then
-        qsString = qsString:sub(0, endIndex+2)
-    end
-    return qsString .. space .. varargTwo
-
+  local beginIndex, endIndex = string.find(qsString, varargOne)
+  if endIndex then
+    qsString = qsString:sub(0, endIndex+2)
+  end
+  return qsString .. space .. varargTwo
 end


 local function GenerateBingoString(activeQuestNames)
-
+
+  activeQuestNames = activeQuestNames or (questName and {[1] = questName,}) or DAS.GetActiveQuestNames()
 	activeQuestNames = DAS.getEnglishQuestNames(activeQuestNames)
+
 	local qsString = DAS.GetSettings().questShareString
 	local bingoCodes = {}
-    local bingo, questNames = empty, empty
-    local bingoString = (DAS.fullBingoString or empty):gsub(varargAny, empty)
+  local bingo, questNames = empty, empty
+  local bingoString = (DAS.fullBingoString or empty):gsub(varargAny, empty)
 	if DAS.GetAutoInvite() then
-        local questNames = getQuestNames(activeQuestNames)
+    local questNames = getQuestNames(activeQuestNames)

-        -- if we're listening for whisper only, adjust spam accordingly
-        if DAS.GetWhisperOnly() then
-            qsString = whisperify(qsString)
-            bingoString = DAS.GetSettings().whisperString
-        else
-
-        -- if we have more than one, insert either of
-            if #bingoString > 0 then
-                bingo = ((#activeQuestNames > 1 and eitherof) or empty) .. bingoString
-            end
-        end
-        return zo_strformat(qsString, questNames, bingoString)
-    end
+    -- if we're listening for whisper only, adjust spam accordingly
+    if DAS.GetWhisperOnly() then
+      qsString = whisperify(qsString)
+      bingoString = DAS.GetSettings().whisperString
+      else
+
+      -- if we have more than one, insert either of
+      if #bingoString > 0 then
+        bingo = ((#activeQuestNames > 1 and eitherof) or empty) .. bingoString
+      end
+    end
+    return zo_strformat(qsString, questNames, bingoString)
+  end
 	if #bingoString > 0 then return bingoString end
-
-    if NonContiguousCount(DAS.GetShareableLog()) == 0 and #activeQuestNames == 0 then
-        return any
-    end
-    activeQuestNames = DAS.GetOpenQuestNames()
-    return generateQuestSpam(activeQuestNames)
-
+
+  if NonContiguousCount(DAS.GetShareableLog()) == 0 and #activeQuestNames == 0 then
+    return any
+  end
+  activeQuestNames = DAS.GetOpenQuestNames()
+  return generateQuestSpam(activeQuestNames)
+
 end
 DAS.GenerateBingoString = GenerateBingoString

 local function SpamChat(questName)
 	if CHAT_SYSTEM.textEntry.editControl:HasFocus() then
 		CHAT_SYSTEM.textEntry.editControl:Clear()
-	end
+  end
 	local activeQuestNames = (questName and {[1] = questName,}) or DAS.GetActiveQuestNames()
 	if nil == questName then
 		activeQuestNames = DAS.GetActiveQuestNames()
-	else
+    else
 		table.insert(activeQuestNames, questName)
-	end
+  end
 	if #activeQuestNames == 0 then
 		DAS.SetAutoInvite(false)
-	end
+  end
 	StartChatInput(DAS.GenerateBingoString(activeQuestNames), CHAT_CHANNEL_ZONE)
-
+
 end
 DAS.SpamChat = SpamChat

@@ -140,17 +139,17 @@ end

 -- called from XML
 function DAS.SettingsButton(control, mouseButton)
-
+
 	local name = control:GetName():gsub("DasButton", "")
 	if name == "Spam" 		then return SpamChat() end
 	if 	name == "Invite" 	then return DAS.SetAutoInvite(not DAS.GetAutoInvite()) end
 	if  name == "Accept"	then return DAS.SetAutoAcceptShared(not DAS.GetAutoAcceptShared()) end
 	if 	name == "Share" 	then
 		if mouseButton == 2 then return DAS.TryShareActiveDaily() end
-        DAS.SetAutoShare(not DAS.GetAutoShare())
-	end
+    DAS.SetAutoShare(not DAS.GetAutoShare())
+  end

- end
+end

 function DAS.ToggleQuest(control)
 	local questName = control["dataQuestName"] or control:GetText()
@@ -159,6 +158,7 @@ function DAS.ToggleQuest(control)
 	local newQuestState = (completed and DAS_STATUS_OPEN) or DAS_STATUS_COMPLETE
 	if not completed then
 		control.dataIsTracked = false
-	end
+  end
+  control.dataQuestState = newQuestState
 	DAS.LogQuest(questName, newQuestState)
 end