diff --git a/00_startup.lua b/00_startup.lua index 6184b92..f923eb9 100644 --- a/00_startup.lua +++ b/00_startup.lua @@ -2,7 +2,7 @@ DailyAutoShare = DailyAutoShare or {} DAS = DailyAutoShare DAS.name = "DailyAutoShare" -DAS.version = "3.3.5" +DAS.version = "3.4.0" DAS.author = "manavortex" DAS.settings = {} DAS.globalSettings = {} @@ -41,12 +41,9 @@ local fullBingoString = DAS.fullBingoString UNITTAG_PLAYER = UNITTAG_PLAYER or "player" local defaults = { - - ["singleDailies"] = {}, - ["shareableDailies"] = {}, - ["speakStupid"] = false, - ["debug"] = false, - ["keepInviteUpOnDegroup"] = false, + + debugging = false, + keepInviteUpOnDegroup = false, ["DasControl"] = { ["x"] = 0, @@ -95,28 +92,30 @@ local defaults = { ["active"] = true, }, }, + questShareString = "I can give a DailyAutoShare for <<1>>, type <<2>> for an instant invite", - debugOutput = false, - currentlyWithQuest = false, - currentQuestIndex = nil, - currentQuestName = nil, - autoTrack = false, autoAcceptInvite = false, autoAcceptInviteInterval = 5, + autoAcceptQuest = true, autoAcceptShared = true, + autoDeclineShared = false, + autoHide = false, autoMinimize = false, + + minimised = false, + locked = false, + hidden = false, + autoShare = true, - autoAcceptAllDailies = false, autoInvite = false, autoLeave = false, + useGlobalSettings = true, - minimised = false, - locked = false, - hidden = false, - fontScale = 1, + + fontScale = 0.8, tooltipRight = false, upsideDown = false, hideCompleted = false, @@ -132,88 +131,86 @@ local defaults = { whisperOnly = false, whisperString = "whisper + for an instant invite", tracked = { - [684] = true, - [823] = true, - [849] = true, -- Vvardenfell - [181] = false, - [1011] = false, -- Summerset + [684] = true, + [823] = true, + [849] = true, -- Vvardenfell + [181] = false, + [1011] = true, -- Summerset }, } local function pointerUpSubzones() + local settings = DAS.GetSettings() -- Summerset - defaults[1012] = defaults[1011] - defaults[1013] = defaults[1011] - defaults[1014] = defaults[1011] - defaults[1015] = defaults[1011] - defaults[1016] = defaults[1011] - defaults[1017] = defaults[1011] - defaults[1018] = defaults[1011] - defaults[1019] = defaults[1011] - defaults.tracked[1012] = defaults.tracked[1011] - defaults.tracked[1013] = defaults.tracked[1011] - defaults.tracked[1014] = defaults.tracked[1011] - defaults.tracked[1015] = defaults.tracked[1011] - defaults.tracked[1016] = defaults.tracked[1011] - defaults.tracked[1017] = defaults.tracked[1011] - defaults.tracked[1018] = defaults.tracked[1011] - defaults.tracked[1019] = defaults.tracked[1011] + settings[1012] = settings[1011] + settings[1013] = settings[1011] + settings[1014] = settings[1011] + settings[1015] = settings[1011] + settings[1016] = settings[1011] + settings[1017] = settings[1011] + settings[1018] = settings[1011] + settings[1019] = settings[1011] + settings.tracked[1012] = settings.tracked[1011] + settings.tracked[1013] = settings.tracked[1011] + settings.tracked[1014] = settings.tracked[1011] + settings.tracked[1015] = settings.tracked[1011] + settings.tracked[1016] = settings.tracked[1011] + settings.tracked[1017] = settings.tracked[1011] + settings.tracked[1018] = settings.tracked[1011] + settings.tracked[1019] = settings.tracked[1011] -- Gold Coast - defaults[825] = defaults[823] - defaults[826] = defaults[823] - defaults.tracked[825] = defaults.tracked[823] - defaults.tracked[826] = defaults.tracked[823] + settings[825] = settings[823] + settings[826] = settings[823] + settings.tracked[825] = settings.tracked[823] + settings.tracked[826] = settings.tracked[823] -- Capitals - defaults[19] = defaults[57] - defaults[383] = defaults[57] - defaults.tracked[19] = defaults.tracked[57] - defaults.tracked[383] = defaults.tracked[57] + settings[19] = settings[57] + settings[383] = settings[57] + settings.tracked[19] = settings.tracked[57] + settings.tracked[383] = settings.tracked[57] -- Clockwork City - defaults[981] = defaults[980] - defaults[981] = defaults[980] - defaults[982] = defaults[980] - defaults.tracked[982] = defaults.tracked[980] - defaults.tracked[983] = defaults.tracked[980] - defaults.tracked[983] = defaults.tracked[980] + settings[981] = settings[980] + settings[981] = settings[980] + settings[982] = settings[980] + settings.tracked[982] = settings.tracked[980] + settings.tracked[983] = settings.tracked[980] + settings.tracked[983] = settings.tracked[980] -- Morrowind - defaults[921] = defaults[849] - defaults[922] = defaults[849] - defaults[923] = defaults[849] - defaults[924] = defaults[849] - defaults[925] = defaults[849] - defaults[961] = defaults[849] - defaults.tracked[921] = defaults.tracked[849] - defaults.tracked[922] = defaults.tracked[849] - defaults.tracked[923] = defaults.tracked[849] - defaults.tracked[924] = defaults.tracked[849] - defaults.tracked[925] = defaults.tracked[849] - defaults.tracked[961] = defaults.tracked[849] + settings[921] = settings[849] + settings[922] = settings[849] + settings[923] = settings[849] + settings[924] = settings[849] + settings[925] = settings[849] + settings[961] = settings[849] + settings.tracked[921] = settings.tracked[849] + settings.tracked[922] = settings.tracked[849] + settings.tracked[923] = settings.tracked[849] + settings.tracked[924] = settings.tracked[849] + settings.tracked[925] = settings.tracked[849] + settings.tracked[961] = settings.tracked[849] -- Wrothgar - defaults[689] = defaults[684] - defaults[690] = defaults[684] - defaults[691] = defaults[684] - defaults[692] = defaults[684] - defaults[693] = defaults[684] - defaults[694] = defaults[684] - defaults.tracked[689] = defaults.tracked[684] - defaults.tracked[690] = defaults.tracked[684] - defaults.tracked[691] = defaults.tracked[684] - defaults.tracked[692] = defaults.tracked[684] - defaults.tracked[693] = defaults.tracked[684] - defaults.tracked[694] = defaults.tracked[684] + settings[689] = settings[684] + settings[690] = settings[684] + settings[691] = settings[684] + settings[692] = settings[684] + settings[693] = settings[684] + settings[694] = settings[684] + settings.tracked[689] = settings.tracked[684] + settings.tracked[690] = settings.tracked[684] + settings.tracked[691] = settings.tracked[684] + settings.tracked[692] = settings.tracked[684] + settings.tracked[693] = settings.tracked[684] + settings.tracked[694] = settings.tracked[684] end -pointerUpSubzones() local characterName = zo_strformat(GetUnitName(UNITTAG_PLAYER)) -local allDailyQuestIds = DAS_QUEST_IDS - local em = EVENT_MANAGER local function debugOut(p1, p2, p3, p4, p5, p6, p7, p8) @@ -282,14 +279,9 @@ local function OnQuestShared(eventCode, questId) local zoneQuestIds = DAS.questIds[DAS.GetZoneId()] or {} if not (zoneQuestIds[questName] or DAS_QUEST_IDS[questId]) and DAS.GetActiveIn(zoneId) then return end - if zoneQuestIds[questId] then - if DAS.GetAutoDeclineShared() then - DAS.Report("DailyAutoShare declined a quest for you. Type /DailyAutoShare disabledecline to stop it from doing so.") - DeclineSharedQuest(questId) - else + if zoneQuestIds[questId] then AcceptSharedQuest(questId) zo_callLater(forceRefreshControl, 500) - end end end @@ -298,12 +290,12 @@ local function OnChatMessage(eventCode, channelType, fromName, messageText, _, f end local function OnPlayerActivated(eventCode) - local active = DAS.GetActiveIn() + local active = DAS.GetActiveIn() DAS.SetHidden(not active) DAS.SetAutoInvite(DAS.GetAutoInvite()) -- disables if we aren't group lead DAS.SetChatListenerStatus(DAS.autoInviting) DAS.guildInviteText = DAS.GetGuildInviteText() - DAS.cacheChatterData() + DAS.cacheChatterData() end local function OnUnitCreated(eventCode, unitTag) @@ -332,10 +324,14 @@ local function OnQuestRemoved(eventCode, isCompleted, journalIndex, questName, z local bingoIndex = DAS.GetBingoIndexFromQuestName(questName) or 0 DAS.activeBingoIndices[bingoIndex] = false + if DAS.trackedIndex == journalIndex then + DAS.trackedIndex = 99 + end zo_callLater(function() - DAS.SetAutoInvite(autoInvite) + DAS.SetAutoInvite(autoInvite) forceRefreshControl() + DAS.RefreshLabelsWithDelay() end, 5000) end @@ -360,7 +356,7 @@ local function queueQuestRefresh() zo_callLater(questRefresh, 600) end -local function hookQuestTracker() +local function hookQuestTracker() if FOCUSED_QUEST_TRACKER and FOCUSED_QUEST_TRACKER.ForceAssist then ZO_PreHook(FOCUSED_QUEST_TRACKER, "ForceAssist", queueQuestRefresh) end @@ -405,37 +401,43 @@ local function resetQuests() DAS.globalSettings.completionLog[currentDate] = DAS.todaysLog forceRefreshControl() end + local typeTable = "table" local function isEmpty(tbl) if not tbl then return true end local ret = true for key, value in pairs(tbl) do - if type(value) == typeTable then - ret = ret and isEmpty(value) + if type(value) == typeTable then + ret = ret and ({} == value or isEmpty(value)) else ret = false - end + end end return ret 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) - DAS.globalSettings.completionLog = DAS.globalSettings.completionLog or {} + +local function handleLog(forceNoAfterEight) + + local todaysLog = DAS.GetSettingsArray() + if {} ~= todaysLog then + todaysLog = ZO_DeepTableCopy(todaysLog, {}) + end + local allLogs = DAS.globalSettings.completionLog local currentDate = tonumber(GetDate()) allLogs[currentDate] = allLogs[currentDate] or {} local logSize, lastDate = NonContiguousCount(DAS.globalSettings.completionLog) - if forceReset then - return resetQuests() - end local counter = 0 for dateNumber, dateLog in pairs(DAS.globalSettings.completionLog) do counter = counter + 1 - if dateNumber < currentDate then + if nil ~= dateNumber and dateNumber < currentDate then lastDate = dateNumber end if counter < logSize-2 then @@ -443,19 +445,23 @@ 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 isEmpty(DAS.todaysLog) and lastDate ~= currentDate then - DAS.globalSettings.completionLog[currentDate] = ZO_DeepTableCopy(DAS.globalSettings.completionLog[lastDate], {}) + local afterEight = not forceNoAfterEight and tonumber(GetTimeString():sub(0, 2)) >= 08 -- has to be a local var, lua error if not + + if (not afterEight) and isEmpty(DAS.todaysLog) and lastDate ~= currentDate then + local lastLog = DAS.globalSettings.completionLog[lastDate] + DAS.globalSettings.completionLog[currentDate] = ZO_DeepTableCopy(lastLog, {}) + d(DAS.globalSettings.completionLog[currentDate]) for charName, charLog in pairs(DAS.globalSettings.completionLog[currentDate]) do for questName, questData in pairs(charLog) do questData.afterEight = false end end + characterName = characterName or GetUnitName(UNITTAG_PLAYER) + DAS.todaysLog = DAS.globalSettings.completionLog[currentDate] + DAS.todaysCharacterLog = DAS.todaysLog[characterName] end - - DAS.todaysLog = DAS.globalSettings.completionLog[currentDate] end -DAS.handleLog = handleLog +DAS.handleLog = handleLog -- expose this for debugging purpose local function minimiseOnStartup() DAS.SetMinimized(DAS.GetSettings().startupMinimized) @@ -468,10 +474,11 @@ function DailyAutoShare_Initialize(eventCode, addonName) if addonName ~= DAS.name then return end - DAS.settings = ZO_SavedVars:New("DAS_Settings", 1, "DAS_Settings", defaults) - DAS.globalSettings = ZO_SavedVars:NewAccountWide("DAS_Globals", 1, "DAS_Global", defaults) + DAS.settings = ZO_SavedVars:New( "DAS_Settings", 2, "DAS_Settings", defaults) + DAS.globalSettings = ZO_SavedVars:NewAccountWide( "DAS_Globals", 2, "DAS_Globals", defaults) DAS.pdn = GetUnitDisplayName(UNITTAG_PLAYER) + pointerUpSubzones() RegisterEventHooks() DAS.CreateMenu(DAS.settings, defaults) diff --git a/DASContextMenu.lua b/DASContextMenu.lua index 4f87dd0..5441661 100644 --- a/DASContextMenu.lua +++ b/DASContextMenu.lua @@ -2,7 +2,7 @@ local guiHeight = GuiRoot:GetHeight() local guiWidth = GuiRoot:GetWidth() local questName, journalIndex, bingoString, currentControl -local QUEST_TRACKER = QUEST_TRACKER or FOCUSED_QUEST_TRACKER + local function getAnchorPos(control) local menuWidth = ZO_Menu:GetWidth() @@ -41,9 +41,8 @@ end local function forceAssist() - if nil ~= QUEST_TRACKER then - QUEST_TRACKER:ForceAssist(journalIndex) - end + if nil == FOCUSED_QUEST_TRACKER then return end + FOCUSED_QUEST_TRACKER:ForceAssist(journalIndex) end local function shareQuest() ShareQuest(journalIndex) diff --git a/DASData.lua b/DASData.lua index 73838b4..12cf11e 100644 --- a/DASData.lua +++ b/DASData.lua @@ -1,31 +1,6 @@ local DAS = DailyAutoShare - local p = DAS.debug -DAS.subzones = { - -- Morrowind - [921] = 849, -- Khartag Point - [922] = 849, -- Zainsipilu - [923] = 849, -- Zainsipilu - [924] = 849, -- Zainsipilu - - -- CC - [985] = 980, -- Halls of Regulation - [986] = 980, -- Shadow Cleft - [993] = 980, -- Planisphere - - -- Gold Coast - [824] = 823, -- Hrota Cave - - -- Wrothgar - [689] = 684, -- Nikolovara's Kennel - [690] = 684, -- - [691] = 684, -- - [692] = 684, -- - [693] = 684, -- Argent Mine - [694] = 684, -- Argent Mine -} - DAS.festivals = { [19 ] = "newLife", [41 ] = "newLife", diff --git a/DASHelper.lua b/DASHelper.lua index e32a516..962da96 100644 --- a/DASHelper.lua +++ b/DASHelper.lua @@ -94,8 +94,6 @@ local function shareQuestQueue() zo_callLater(shareQuestQueue, DAS.GetQuestShareDelay()) end -local allDailyQuestIds = DAS_QUEST_IDS - function DAS.TryShareActiveDaily() if not DAS.GetAutoShare() then return end for _, journalIndex in pairs(DAS.activeZoneQuests) do diff --git a/DASMenu.lua b/DASMenu.lua index d5c5704..e78f25d 100644 --- a/DASMenu.lua +++ b/DASMenu.lua @@ -3,6 +3,8 @@ local DAS = DailyAutoShare local optionsData local questShareDefault +local GetSettings = DAS.GetSettings + function DAS.CreateMenu(savedVars, defaults) questShareDefault = defaults.questShareString @@ -356,7 +358,7 @@ function DAS.CreateMenu(savedVars, defaults) name = "Use whisper only", tooltip = "This will ignore bingo spam in zone chat!", getFunc = function() return DAS.GetWhisperOnly() end, - setFunc = function(value) DAS.SetWhisperOnly(value) end + setFunc = function(value) GetSettings().whisperOnly = value end }, { -- header: Use global variables? @@ -503,13 +505,6 @@ function DAS.CreateMenu(savedVars, defaults) type = "header", name = "automatically..." }, - { -- auto-track - type = "checkbox", - tooltip = "Auto-track active daily quest?", - name = "track active daily", - getFunc = function() return DAS.GetAutoTrack() end, - setFunc = function(value) DAS.SetAutoTrack(value) end - }, { -- auto-accept type = "checkbox", tooltip = "Accept repeatable quest if they are shared?", diff --git a/DASUserSettingsAdapter.lua b/DASUserSettingsAdapter.lua index e109932..5c1d948 100644 --- a/DASUserSettingsAdapter.lua +++ b/DASUserSettingsAdapter.lua @@ -30,14 +30,6 @@ local function CanInvite(unitTag, unitName) return true end - -function DAS.GetSpeakStupid() - return GetSettings().speakStupid -end -function DAS.SetSpeakStupid(value) - GetSettings().speakStupid = value -end - function DAS.GetDebugMode() return GetSettings().debugging end @@ -76,7 +68,6 @@ function DAS.SetHidden(hidden) end if not hidden then DAS.RefreshControl(true) end end - function DAS.GetQuestShareDelay() return GetSettings().questShareDelay end @@ -89,46 +80,22 @@ end function DAS.SetGroupInviteDelay(value) GetSettings().groupInviteDelay = value end - --- called from settings -function DAS.GetAutoTrack() - return GetSettings().autoTrack -end -function DAS.SetAutoTrack(value) - GetSettings().autoTrack = value -end - function DAS.GetAutoAcceptInvite() return DAS.settings.autoAcceptInvite end -local function autoAcceptInvite() - AcceptGroupInvite() -end - function DAS.SetAutoAcceptInvite(value) DAS.settings.autoAcceptInvite = value if value then - EVENT_MANAGER:RegisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, autoAcceptInvite) + EVENT_MANAGER:RegisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, AcceptGroupInvite) else - EVENT_MANAGER:UnregisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, autoAcceptInvite) + EVENT_MANAGER:UnregisterForEvent("DailyAutoshare", EVENT_GROUP_INVITE_RECEIVED, AcceptGroupInvite) end end function DAS.GetWhisperOnly() return GetSettings().whisperOnly end -function DAS.SetWhisperOnly(value) - GetSettings().whisperOnly = value -end - - -function DAS.GetGroupLeaveOnNewSearch() - -end -function DAS.SetGroupLeaveOnNewSearch(value) - -end function DAS.GetMinimized() return DAS.settings.minimised @@ -137,13 +104,6 @@ function DAS.SetMinimized(value) DAS.settings.minimised = value end -function DAS.GetAutoDeclineShared() - return GetSettings().autoDeclineShared -end -function DAS.SetAutoDeclineShared(value) - GetSettings().autoDeclineShared = value -end - function DAS.GetAutoAcceptShared() return GetSettings().autoAcceptShared end @@ -276,9 +236,11 @@ end function DAS.SetFontSize(value) GetSettings().fontScale = value - DAS.RefreshControl() + DAS.SetLabelFontSize() + DAS.RefreshLabelsWithDelay() end --- called from gui + +-- called from GUI function DAS.GetX(controlname) controlname = controlname or "DasControl" return GetSettings()[controlname].x @@ -359,73 +321,60 @@ function DAS.SetUserMinimised(value) GetSettings().userMinimised = value end +local characterName = GetUnitName(UNITTAG_PLAYER) +local dateNumber = tonumber(GetDate()) +local timeStringNumber = tonumber(GetTimeString():sub(1,2)) -local function assertSettingArray(settings, dateNumber, characterName) +DAS.todaysCharacterLog = nil - local dateNumber = tonumber(GetDate()) -- 20160411 - local afterEight = (tonumber(GetTimeString():sub(0, 2)) >= 08) --08:17:02 - local characterName = GetUnitName(UNITTAG_PLAYER) - if nil == settings[dateNumber] then settings[dateNumber] = {} end - if nil == settings[dateNumber][characterName] then settings[dateNumber][characterName] = {} end +local function getSettingsArray(forceRefresh) - return settings[dateNumber][characterName] - -end - -function DAS.GetSetting(settingsArray, arrayKey) - if not GetSettings()[settingsArray] then return false end - return GetSettings()[settingsArray][arrayKey] -end -function DAS.SetSetting(settingsArray, arrayKey, arrayValue) - GetSettings()[settingsArray] = DAS.settings[settingsArray] or {} - GetSettings()[settingsArray][arrayKey] = arrayValue + if not forceRefresh and DAS.todaysCharacterLog then return DAS.todaysCharacterLog end + characterName = characterName or GetUnitName(UNITTAG_PLAYER) + + DAS.globalSettings.completionLog = DAS.globalSettings.completionLog or {} + local completionLog = DAS.globalSettings.completionLog + + completionLog[dateNumber] = completionLog[dateNumber] or {} + + DAS.todaysLog = DAS.todaysLog or completionLog[dateNumber] + DAS.todaysLog[characterName] = DAS.todaysLog[characterName] or {} + DAS.todaysCharacterLog = DAS.todaysLog[characterName] + + return DAS.todaysCharacterLog end - -local characterName -local dateNumber -local timeStringNumber -local settings = DAS.todaysLog -local function getSettingsArray() - dateNumber = dateNumber or tonumber(GetDate()) - characterName = characterName or GetUnitName(UNITTAG_PLAYER) - timeStringNumber = timeStringNumber or tonumber(GetTimeString():sub(1,2)) - if nil == settings then - DAS.globalSettings.completionLog = DAS.globalSettings.completionLog or {} - DAS.globalSettings.completionLog[dateNumber] = DAS.globalSettings.completionLog[dateNumber] or {} - DAS.globalSettings.completionLog[dateNumber][characterName] = DAS.globalSettings.completionLog[dateNumber][characterName] or {} - settings = DAS.globalSettings.completionLog[dateNumber][characterName] - end - return settings -end DAS.GetSettingsArray = getSettingsArray -DAS.lbe = LBE +local typeString = "string" function DAS.GetCompleted(questName) - if nil == questName or "" == questName or "string" ~= type(questName) then return false end - questName = zo_strformat(questName) + if nil == questName or "" == questName or typeString ~= type(questName) then return false end local settings = getSettingsArray() - local logEntry = settings[questName] + local logEntry = settings[zo_strformat(questName)] return nil ~= logEntry and logEntry.completed - end +end + function DAS.LogQuest(questName, completed) if nil == questName then return end - getSettingsArray() - local settings = DAS.globalSettings.completionLog[dateNumber][characterName] + timeStringNumber = timeStringNumber or tonumber(GetTimeString():sub(1,2)) - local afterEight = (timeStringNumber >= 8) -- 08:17:02 - reset is at 8 + local settings = getSettingsArray() + + 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) end end + settings[questName] = {} settings[questName].completed = completed settings[questName].afterEight = afterEight end + function DAS.GetQuestStatus(questName) if nil == questName then return end diff --git a/DailyAutoShare.txt b/DailyAutoShare.txt index 00bf919..d8d28c3 100644 --- a/DailyAutoShare.txt +++ b/DailyAutoShare.txt @@ -1,6 +1,6 @@ ## Title: DailyAutoShare ## Author: manavortex -## Version: 3.3.5 +## Version: 3.4.0 ## APIVersion: 100023 ## SavedVariables: DAS_Settings DAS_Globals ## OptionalDependsOn: LibStub LibCustomMenu LibAddonMenu-2.0 LibMediaProvider-1.0 pchat @@ -30,11 +30,13 @@ xml/VirtualButtons.xml DAS_xml.xml questData/00_ids.lua +questData/01_subzones.lua locale/en.lua locale/$(language).lua 00_startup.lua +xml/Bindings.xml DASHelper.lua questData/BingoClean.lua diff --git a/DasGui.lua b/DasGui.lua index f9e56cf..54a1e94 100644 --- a/DasGui.lua +++ b/DasGui.lua @@ -9,7 +9,6 @@ DAS.labels = {} local labelTexts = {} local p = DAS.DebugOut -local QUEST_TRACKER = QUEST_TRACKER or FOCUSED_QUEST_TRACKER local function isHidden() return (not DAS.GetActiveIn()) or DAS.GetHidden() or (DAS.GetAutoHide() and (not DAS.OpenDailyPresent())) @@ -20,12 +19,12 @@ local function isMinimised() end local function cacheVisibilityStatus(forceOverride) - stateIsHidden = isHidden() stateIsMinimised = isMinimised() end function DAS.RefreshControl(refreshQuestCache) + -- p("DAS.RefreshControl(" .. tostring(refreshQuestCache).. ")") if not DAS.HasActiveDaily() then DAS.SetAutoInvite(false) @@ -34,9 +33,7 @@ function DAS.RefreshControl(refreshQuestCache) cacheVisibilityStatus() DasHandle:SetHidden( stateIsHidden) DasControl:SetHidden( stateIsHidden) - DasList:SetHidden( stateIsMinimised or stateIsHidden) - if stateIsMinimised or stateIsHidden then return end - + DasList:SetHidden( stateIsMinimised or stateIsHidden) DAS.RefreshLabelsWithDelay() end @@ -105,13 +102,16 @@ function DAS.QuestLabelClicked(control, mouseButton) if mouseButton == MOUSE_BUTTON_INDEX_RIGHT then -- and isValidJournalIndex then return DAS.OnRightClick(control) - end + end - local journalIndex = control["dataJournalIndex"] - local isValidJournalIndex = IsValidQuestIndex(journalIndex) + local journalIndex = control.dataJournalIndex + local isValidJournalIndex = IsValidQuestIndex(journalIndex) - if isValidJournalIndex then - ShareQuest(journalIndex) + if isValidJournalIndex then + ShareQuest(journalIndex) + if journalIndex ~= DAS.trackedIndex then + FOCUSED_QUEST_TRACKER:ForceAssist(journalIndex) + end end end @@ -299,6 +299,7 @@ function DAS.setLabels(zoneQuests) buttonIndex = buttonIndex + 1 + end -- nil check end end end -- for loop end @@ -316,10 +317,7 @@ function DAS.RefreshLabels(forceQuestRefresh, forceSkipQuestRefresh) cacheVisibilityStatus() setButtonStates() - DAS.trackedIndex = 99 - if QUEST_TRACKER and QUEST_TRACKER.assistedData then - DAS.trackedIndex = QUEST_TRACKER.assistedData.arg1 - end + local buttonIndex = 1 @@ -327,7 +325,10 @@ function DAS.RefreshLabels(forceQuestRefresh, forceSkipQuestRefresh) local hidden = DasList:IsHidden() local label, questIndex, tracked if not forceSkipQuestRefresh then - DAS.RefreshQuestLogs(forceQuestRefresh) + DAS.RefreshQuestLogs(forceQuestRefresh) + if FOCUSED_QUEST_TRACKER and FOCUSED_QUEST_TRACKER.assistedData then + DAS.trackedIndex = FOCUSED_QUEST_TRACKER.assistedData.arg1 + end end local questList = DAS.QuestLists[DAS.GetZoneId()] @@ -377,15 +378,18 @@ function DAS.AnchorList() 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) @@ -393,14 +397,15 @@ local function setFontSize(labelList) control:SetHeight(labelHeight) control:SetScale(fontScale) end - end + end + parent:SetWidth(maxWidth) end DAS.setFontSize = setFontSize function DAS.SetLabelFontSize() - - setFontSize(DAS.labels) - DasControl:SetHeight(DasList:GetHeight() + DasHandle:GetHeight()) + + setFontSize(DAS.labels) + DasControl:SetHeight(DasList:GetHeight() + DasHandle:GetHeight()) setFontSize(DAS.sublabels) end diff --git a/DasGuiStringBuilder.lua b/DasGuiStringBuilder.lua index bb980ac..9b1d047 100644 --- a/DasGuiStringBuilder.lua +++ b/DasGuiStringBuilder.lua @@ -9,23 +9,25 @@ function DAS.GetLogIndex(questName) return DAS.QuestNameTable[questName] or 0 end - -local function getEnglishQuestNames(activeQuestNames) +local en = "en" +local function getEnglishQuestNames(activeQuestNames) activeQuestNames = activeQuestNames or DAS.GetZoneQuests() - if DAS.locale == "en" then return activeQuestNames end - local ret = {} - for index, questName in pairs(activeQuestNames) do - if nil ~= DAS_STRINGS_LOCALE and nil ~= DAS.locale and nil ~= DAS_STRINGS_LOCALE.en then - for key, value in pairs(DAS_STRINGS_LOCALE[DAS.locale]) do - if DAS.IsMatch(questName, value) then - table.insert(ret, DAS_STRINGS_LOCALE.en[key]) - end - end - end + if DAS.locale == en or not DAS_STRINGS_LOCALE or not DAS.locale then + 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 + if ret == {} then return activeQuestNames end return ret end +DAS.getEnglishQuestNames = getEnglishQuestNames local function askForQuest(questNames) local ret = "" @@ -81,7 +83,7 @@ end local function GenerateBingoString(activeQuestNames, verbose) - activeQuestNames = getEnglishQuestNames(activeQuestNames) + activeQuestNames = DAS.getEnglishQuestNames(activeQuestNames) local qsString = DAS.GetSettings().questShareString local bingoCodes = {} local bingo, questNames = empty, empty diff --git a/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua b/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua index 3c4ab31..7a88896 100644 --- a/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua +++ b/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua @@ -4,7 +4,7 @@ --Register LAM with LibStub -local MAJOR, MINOR = "LibAddonMenu-2.0", 25 +local MAJOR, MINOR = "LibAddonMenu-2.0", 26 local lam, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not lam then return end --the same or newer version of this lib is already loaded into memory @@ -409,9 +409,31 @@ local localization = { RELOAD_DIALOG_RELOAD_BUTTON = "Przeładuj", RELOAD_DIALOG_DISCARD_BUTTON = "Porzuć", }, + kr = { -- provided by p.walker + PANEL_NAME = "蝠盜蠨", + VERSION = "纄訄: <<X:1>>", + WEBSITE = "裹芬襴钸 縩紸", + PANEL_INFO_FONT = "EsoKR/fonts/Univers57.otf|14|soft-shadow-thin", + RELOAD_UI_WARNING = "襴 茤訕襄 绀溽靘籴 風滼筼 訁袩靘瀰褄靴 UI 苈穜滠遨襴 靄袔革瓈瓤.", + RELOAD_DIALOG_TITLE = "UI 苈穜滠遨 靄袔", + RELOAD_DIALOG_TEXT = "绀溽瘜 茤訕 謑 UI 苈穜滠遨襄 靄袔穜靘璔 芬靭襴 覈蒵瓈瓤. 诀瀈 苈穜滠遨靘蓜溠蒵瓈灌? 蝄瓈籴 绀溽襄 迨莌靘蓜溠蒵瓈灌?", + RELOAD_DIALOG_RELOAD_BUTTON = "苈穜滠遨", + RELOAD_DIALOG_DISCARD_BUTTON = "绀溽迨莌", + }, + br = { -- provided by mlsevero + PANEL_NAME = "Addons", + AUTHOR = string.format("%s: <<X:1>>", GetString(SI_ADDON_MANAGER_AUTHOR)), -- "Autor: <<X:1>>" + VERSION = "Versão: <<X:1>>", + WEBSITE = "Visite o Website", + RELOAD_UI_WARNING = "Mudanças nessa configuração requer a releitura da UI para ter efeito.", + RELOAD_DIALOG_TITLE = "Releitura da UI requerida", + RELOAD_DIALOG_TEXT = "Algumas mudanças requerem a releitura da UI para ter efeito. Você deseja reler agora ou descartar as mudanças?", + RELOAD_DIALOG_RELOAD_BUTTON = "Relê", + RELOAD_DIALOG_DISCARD_BUTTON = "Descarta", + }, } -util.L = ZO_ShallowTableCopy(localization[GetCVar("Language.2")], localization["en"]) +util.L = ZO_ShallowTableCopy(localization[GetCVar("Language.2")] or {}, localization["en"]) util.GetTooltipText = GetStringFromValue -- deprecated, use util.GetStringFromValue instead util.GetStringFromValue = GetStringFromValue util.GetDefaultValue = GetDefaultValue diff --git a/locale/de.lua b/locale/de.lua index d02c48e..37575c1 100644 --- a/locale/de.lua +++ b/locale/de.lua @@ -25,37 +25,31 @@ local strings = { DAS_SI_SPAM_SINGLE = "Spammen", DAS_SI_REFRESH ="Aktualisieren", - + DAS_SI_SETOPEN_TRUE = "Toggle open", DAS_SI_SETOPEN_FALSE = "Toggle complete", - DAS_ELF_RELIC = "Relic Runaround", - DAS_ELF_PILGR = "Pilgrimage's End", - DAS_ELF_LIGHT = "Snuffing Out the Light", - DAS_ELF_SERPE = "Culling Serpents", - DAS_ELF_MEMO = "Struck from Memory", - DAS_ELF_ROSE = "A Rose's Beauty", + DAS_ELF_RELIC = "Die Reliktrettung", + DAS_ELF_PILGR = "Das Ende der Pilgerfahrt", + DAS_ELF_LIGHT = "Das verlöschen des Lichts", + DAS_ELF_SERPE = "Schlangentöter", + DAS_ELF_MEMO = "Aus der Erinnerung getilgt", + DAS_ELF_ROSE = "Die Schönheit einer Rose", - DAS_ELF_ALCHE = "The Abyssal Alchemist", - DAS_ELF_GRAVE = "Never Forgotten", - DAS_ELF_QUEEN = "The Sickening Sea", - DAS_ELF_GRIFFIN = "Birds of a Feather", - DAS_ELF_SNAKE = "Run Aground", - DAS_ELF_WILD = "Taming the Wild", + DAS_ELF_ALCHE = "Der Kluftalchemist", + DAS_ELF_GRAVE = "Nie vergessen", + DAS_ELF_QUEEN = "Die Seuchensee", + DAS_ELF_GRIFFIN = "Fremde Federn", + DAS_ELF_SNAKE = "Auf Grund gelaufen", + DAS_ELF_WILD = "Die Zähmung der Wildnis", - DAS_ELF_GEYSER = "Sinking Summerset", + DAS_ELF_GEYSER = "Die Versenkung Sommersends", -- Clockwork City - DAS_CLOCK_IMP = "Das Reizen des Unvollendeten", - DAS_CLOCK_FOE = "Ein feingefiederter Feind", - - -- Clockwork City - DAS_CLOCK_BOSS_START = "I'll take on a contract.", - DAS_CLOCK_CRAFT_START = "Got any work?", - DAS_CLOCK_CAVE_START = "What's the job?", - DAS_CLOCK_CROW_START = "How can I help?", - + DAS_CLOCK_IMP = "Das Reizen des Unvollendeten", + DAS_CLOCK_FOE = "Ein feingefiederter Feind", + DAS_CLOCK_CRAFT_CLOTH = "Lose Fasern", DAS_CLOCK_CRAFT_WATER = "Eine klebrige Lösung", DAS_CLOCK_CRAFT_RUNE = "Verzauberte Ansammlung", @@ -182,8 +176,11 @@ local strings = { DAS_QUEST_DB_ARVINA = "Cleric Arvina", - DAS_QUEST_DB_BOUNTY = "Bounty Board", + DAS_QUEST_DB_BOUNTY = "Bounty Board", + DAS_QUEST_SS_TANO = "Justiziar Tanorian", + DAS_QUEST_SS_FARO = "Justiziarin Farowel", + DAS_QUEST_SS_TANE = "Battlereeve Tanerline", } diff --git a/questData/00_ids.lua b/questData/00_ids.lua index f3c6544..8852343 100644 --- a/questData/00_ids.lua +++ b/questData/00_ids.lua @@ -1,3 +1,27 @@ +DailyAutoShare = DailyAutoShare or {} +DAS = DailyAutoShare + +DAS.subzones = { + + -- CC + [985] = 980, -- Halls of Regulation + [986] = 980, -- Shadow Cleft + [993] = 980, -- Planisphere + + -- Gold Coast + [824] = 823, -- Hrota Cave + + -- Wrothgar + [689] = 684, -- Nikolovara's Kennel + [690] = 684, -- + [691] = 684, -- + [692] = 684, -- + [693] = 684, -- Argent Mine + [694] = 684, -- Argent Mine +} + + + DAS_QUEST_IDS = { -- Summerset diff --git a/questData/Morrowind.lua b/questData/Morrowind.lua index b3f88ec..39a1fe3 100644 --- a/questData/Morrowind.lua +++ b/questData/Morrowind.lua @@ -111,12 +111,11 @@ table.insert(tbl2, "yasam") DAS.shareables[zoneId] = tbl - - -- Khartag point DAS.shareables[921] = { [1] = DAS.shareables[zoneId][20], -}-- Zainsipilu +} +-- Zainsipilu DAS.shareables[922] = { [1] = DAS.shareables[zoneId][17], } @@ -137,6 +136,12 @@ DAS.shareables[961] = { [1] = DAS.shareables[zoneId][9], } +DAS.subzones[921] = zoneId +DAS.subzones[922] = zoneId +DAS.subzones[923] = zoneId +DAS.subzones[924] = zoneId +DAS.subzones[961] = zoneId + DAS.makeBingoTable(zoneId, tbl2) diff --git a/questData/Summerset.lua b/questData/Summerset.lua index b7d3267..ee3374f 100644 --- a/questData/Summerset.lua +++ b/questData/Summerset.lua @@ -5,12 +5,10 @@ local tbl = {} local tbl2 = {} - - table.insert(tbl, GetString(DAS_ELF_ALCHE)) table.insert(tbl2, {[1] = "korgen", [2] = "b'korgen", [3] = "korg", [4] = "corgi"}) table.insert(tbl, GetString(DAS_ELF_GRAVE)) -table.insert(tbl2, {[1] = "graveld", [2] = "grave"}) +table.insert(tbl2, {[1] = "graveld", [2] = "grave", [3] = "grav"}) table.insert(tbl, GetString(DAS_ELF_QUEEN)) table.insert(tbl2, {[1] = "queen"}) table.insert(tbl, GetString(DAS_ELF_GRIFFIN)) @@ -18,7 +16,7 @@ table.insert(tbl2, {[1] = "griffon", [2] = "griffin", [3] = "gryphon", [4] = "gr table.insert(tbl, GetString(DAS_ELF_SNAKE)) table.insert(tbl2, {[1] = "keel", [2] = "snake"}) table.insert(tbl, GetString(DAS_ELF_WILD)) -table.insert(tbl2, {[1] = "wild", [2] = "ward"}) +table.insert(tbl2, {[1] = "caan", [2] = "indrik", [3] = "wild", [4] = "ward"}) table.insert(tbl, GetString(DAS_ELF_RELIC)) @@ -35,22 +33,20 @@ table.insert(tbl, GetString(DAS_ELF_ROSE )) table.insert(tbl2, {[1] = "rose"}) table.insert(tbl, GetString(DAS_ELF_GEYSER )) -table.insert(tbl2, {[1] = "+geyser"}) +table.insert(tbl2, {[1] = "geyser"}) DAS.shareables[zoneId] = tbl DAS.shareables[zoneId2] = DAS.shareables[zoneId] - - - DAS.makeBingoTable(zoneId, tbl2) DAS.bingo[zoneId2] = DAS.bingo[zoneId] for i=1012, 1019 do DAS.shareables[i] = DAS.shareables[zoneId] DAS.bingo[i] = DAS.bingo[zoneId] + DAS.subzones[i] = zoneId end DAS.questStarter[zoneId] = { diff --git a/xml/100023.lua b/xml/100023.lua deleted file mode 100644 index e69de29..0000000