changes to logging

git [04-17-18 - 06:36]
changes to logging
Filename
DailyAutoShare/DASUserSettingsAdapter.lua
DailyAutoShare/DasGui.lua
DailyAutoShare/startup.lua
diff --git a/DailyAutoShare/DASUserSettingsAdapter.lua b/DailyAutoShare/DASUserSettingsAdapter.lua
index 2e7992a..fc12034 100644
--- a/DailyAutoShare/DASUserSettingsAdapter.lua
+++ b/DailyAutoShare/DASUserSettingsAdapter.lua
@@ -101,17 +101,17 @@ function DAS.GetAutoAcceptInvite()
 	return DAS.settings.autoAcceptInvite
 end

-local function OnGroupInvite()
-
+local function autoAcceptInvite()
+    AcceptGroupInvite()
 end

 function DAS.SetAutoAcceptInvite(value)
     d("DAS.SetAutoAcceptInvite(" .. tostring(value)..")")
 	DAS.settings.autoAcceptInvite = value
     if value then
-        EVENT_MANAGER:RegisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, AcceptGroupInvite)
+        EVENT_MANAGER:RegisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, autoAcceptInvite)
     else
-        EVENT_MANAGER:UnregisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, AcceptGroupInvite)
+        EVENT_MANAGER:UnregisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, autoAcceptInvite)

     end
 end
@@ -390,8 +390,9 @@ function DAS.GetCompleted(questName)
  end
 function DAS.LogQuest(questName, completed)
 	if nil == questName then return end
-	local settings 	 	=  getSettingsArray()
-	local afterEight 	= (timeStringNumber > 08) -- 08:17:02
+	local settings 	 	=  getSettingsArray()
+	timeStringNumber = timeStringNumber or tonumber(GetTimeString():sub(1,2))
+	local afterEight 	= (timeStringNumber >= 8) -- 08:17:02 - reset is at 8
     for questId, questData in pairs(settings) do
         if questData.afterEight ~= afterEight then
             ZO_ClearTable(settings)
diff --git a/DailyAutoShare/DasGui.lua b/DailyAutoShare/DasGui.lua
index 9197242..addc026 100644
--- a/DailyAutoShare/DasGui.lua
+++ b/DailyAutoShare/DasGui.lua
@@ -162,7 +162,7 @@ function DAS.setLabels(zoneQuests, questList, buttonIndex)
         end
 		label = DAS.labels[buttonIndex] -- despite the name these are actually buttons

-		if nil ~= label then
+		if nil ~= label then
 			local status 	= DAS.GetQuestStatus(questName, questList, zoneId)
 			local hideLabel = hidden or (hideCompleted and status == DAS_STATUS_COMPLETE) or shouldHideLabel(questName, questList, zoneId)
 			-- d(zo_strformat("DAS: <<1>> shoud be hidden <<2>>", questName, tostring(hideLabel)))
@@ -188,7 +188,7 @@ function DAS.setLabels(zoneQuests, questList, buttonIndex)
                 label:SetState(BSTATE_PRESSED)
             elseif status == DAS_STATUS_OPEN then
                 label:SetState(BSTATE_NORMAL)
-            end
+            end

 			buttonIndex = buttonIndex + 1
 		end -- nil check end
diff --git a/DailyAutoShare/startup.lua b/DailyAutoShare/startup.lua
index a3af906..1941869 100644
--- a/DailyAutoShare/startup.lua
+++ b/DailyAutoShare/startup.lua
@@ -384,9 +384,12 @@ local function resetQuests()
     DAS.RefreshControl(true)
 end

+-- has to be a local var, lua error if not
+-- Keep outside of function namespace so we can overwrite it for debugging
+local afterEight = tonumber(GetTimeString():sub(0, 2)) >= 08
 local function handleLog(forceReset)

-    local afterEight = tonumber(GetTimeString():sub(0, 2)) >= 08 -- has to be a local var, lua error if not
+
     DAS.todaysLog = DAS.globalSettings.completionLog[currentDate] or {}
     local lastDate, logSize, counter = _, NonContiguousCount(DAS.todaysLog), 0

@@ -403,6 +406,7 @@ local function handleLog(forceReset)
         end
     end

+    local afterEight = tonumber(GetTimeString():sub(0, 2)) >= 08 -- has to be a local var, lua error if not
     if (not afterEight) and DAS.todaysLog == {} and lastDate ~= dateString then
         DAS.todaysLog = DAS.globalSettings.completionLog[lastDate]
     end
@@ -433,10 +437,6 @@ function DailyAutoShare_Initialize(eventCode, addonName)
     -- local timetoreset = (GetTimeStamp() - 60*60*7)%86400
     -- zo_callLater(resetQuests, timetoreset)

-    -- remove this soon
-    if DAS.GetSettings().questShareString:find("<<3>>") then
-        DAS.GetSettings().questShareString = defaults.questShareString
-    end

     handleLog()
     zo_callLater(OnPlayerActivated, 5000)