diff --git a/ElvUI_SLE/modules/quests/load_quests.xml b/ElvUI_SLE/modules/quests/load_quests.xml index bb90d90..0e3b011 100644 --- a/ElvUI_SLE/modules/quests/load_quests.xml +++ b/ElvUI_SLE/modules/quests/load_quests.xml @@ -1,4 +1,3 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Script file='quests.lua'/> - <Include file='questking\load_questking.xml'/> </Ui> diff --git a/ElvUI_SLE/modules/quests/questking/buttons/achievement.lua b/ElvUI_SLE/modules/quests/questking/buttons/achievement.lua deleted file mode 100644 index b874c84..0000000 --- a/ElvUI_SLE/modules/quests/questking/buttons/achievement.lua +++ /dev/null @@ -1,288 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end -local ACHIEVEMENTS = ACHIEVEMENTS -local achievementTimers = {} -local achievementTimersMeta = {} - -local mouseHandlerAchievement = {} - -local function Replace() -local QuestKing = _G["QuestKing"] -local WatchButton = QuestKing.WatchButton -local opt = QuestKing.options -local opt_colors = opt.colors - - local function QuestKingClickTemplate(button, mouse) - if IsAltKeyDown() then - if mouse == "RightButton" then - RemoveTrackedAchievement(button.id) - QuestKing:UpdateTracker() - return - else - if _G["QuestKingDBPerChar"].collapsedAchievements[button.id] then - _G["QuestKingDBPerChar"].collapsedAchievements[button.id] = nil - else - _G["QuestKingDBPerChar"].collapsedAchievements[button.id] = true - end - QuestKing:UpdateTracker() - return - end - end - - if (not AchievementFrame) then AchievementFrame_LoadUI() end - - if (not AchievementFrame:IsShown()) then - AchievementFrame_ToggleAchievementFrame() - AchievementFrame_SelectAchievement(button.id) - else - if (AchievementFrameAchievements.selection ~= button.id) then - AchievementFrame_SelectAchievement(button.id) - else - AchievementFrame_ToggleAchievementFrame() - end - end - end - - local function BlizzlikeClickTemplate(button, mouse) - if IsShiftKeyDown() then - if mouse == "RightButton" then - if (GetSuperTrackedQuestID() == button.id) then - QuestKing:SetSuperTrackedQuestID(0) - QuestKing:UpdateTracker() - else - QuestKing:SetSuperTrackedQuestID(button.id) - QuestKing:UpdateTracker() - end - return - else - RemoveTrackedAchievement(button.id) - QuestKing:UpdateTracker() - return - end - end - if IsControlKeyDown() then - if _G["QuestKingDBPerChar"].collapsedAchievements[button.id] then - _G["QuestKingDBPerChar"].collapsedAchievements[button.id] = nil - else - _G["QuestKingDBPerChar"].collapsedAchievements[button.id] = true - end - QuestKing:UpdateTracker() - return - end - if (not AchievementFrame) then AchievementFrame_LoadUI() end - if mouse == "RightButton" then - ObjectiveTracker_ToggleDropDown(button, AchievementObjectiveTracker_OnOpenDropDown) - else - if (not AchievementFrame:IsShown()) then - AchievementFrame_ToggleAchievementFrame() - AchievementFrame_SelectAchievement(button.id) - else - if (AchievementFrameAchievements.selection ~= button.id) then - AchievementFrame_SelectAchievement(button.id) - else - AchievementFrame_ToggleAchievementFrame() - end - end - end - end - - function QuestKing:UpdateTrackerAchievements() - local trackedAchievements = { GetTrackedAchievements() } - local numTrackedAchievements = #trackedAchievements - - -- header - local showAchievements = true - local SLE_HeaderColor = E.db.sle.skins.objectiveTracker.colorHeader - if (QuestKingDBPerChar.displayMode == "combined") then - local headerName = "|T"..QK.Icons["Achievement_small"]..":14|t "..ACHIEVEMENTS.." |T"..QK.Icons["Achievement_small"]..":14|t" - if numTrackedAchievements > 0 then - local button = WatchButton:GetKeyed("collapser", "Achievements") - button._headerName = headerName - - if QuestKingDBPerChar.collapsedHeaders[headerName] then - button.title:SetTextIcon("|TInterface\\AddOns\\QuestKing\\textures\\UI-SortArrow_sm_right:8:8:0:-1:0:0:0:0:0:0:1:1:1|t "..headerName) - else - button.title:SetTextIcon("|TInterface\\AddOns\\QuestKing\\textures\\UI-SortArrow_sm_down:8:8:0:-1:0:0:0:0:0:0:1:1:1|t "..headerName) - end - button.title:SetTextColor(SLE_HeaderColor.r, SLE_HeaderColor.g, SLE_HeaderColor.b) - end - - if QuestKingDBPerChar.collapsedHeaders[headerName] then - showAchievements = false - end - elseif (inScenario) and (QuestKingDBPerChar.displayMode == "achievements") then - local achheader = WatchButton:GetKeyed("header", "Achievements") - achheader.title:SetText(headerName) - achheader.title:SetTextColor(SLE_HeaderColor.r, SLE_HeaderColor.g, SLE_HeaderColor.b) - end - - -- achievements - if showAchievements then - for i = 1, numTrackedAchievements do - local achievementID = trackedAchievements[i] - - local button = WatchButton:GetKeyed("achievement", achievementID) - setButtonToAchievement(button, achievementID) - end - end - end - - function setButtonToAchievement (button, achievementID) - button.mouseHandler = mouseHandlerAchievement - - local id, achievementName, points, achievemntCompleted, _, _, _, achievementDesc, flags, image, rewardText, isGuildAch = GetAchievementInfo(achievementID) - button.id = achievementID - - local collapseCriteria = QuestKingDBPerChar.collapsedAchievements[achievementID] - - -- set title - button.title:SetText(achievementName) - if completed then - button.title:SetTextColor(opt_colors.AchievementTitleComplete[1], opt_colors.AchievementTitleComplete[2], opt_colors.AchievementTitleComplete[3]) - else - if isGuildAch then - button.title:SetTextColor(opt_colors.AchievementTitleGuild[1], opt_colors.AchievementTitleGuild[2], opt_colors.AchievementTitleGuild[3]) - else - button.title:SetTextColor(opt_colors.AchievementTitle[1], opt_colors.AchievementTitle[2], opt_colors.AchievementTitle[3]) - end - end - - if collapseCriteria then - button.title:SetAlpha(0.6) - end - - -- criteria setup - local numCriteria = GetAchievementNumCriteria(achievementID) - local foundTimer = false - local timeNow -- avoid multiple calls to GetTime() - - -- no criteria - if (numCriteria == 0) then - if (not collapseCriteria) then - button:AddLine(" "..achievementDesc, nil, opt_colors.AchievementDescription[1], opt_colors.AchievementDescription[2], opt_colors.AchievementDescription[3]) -- no criteria exist, show desc line - end - end - - -- criteria loop - for i = 1, numCriteria do - local _ - local criteriaString, criteriaType, criteriaCompleted, quantity, totalQuantity, name, flags, assetID, quantityString, criteriaID, eligible, duration, elapsed = GetAchievementCriteriaInfo(achievementID, i) - - -- set string - if (bit.band(flags, EVALUATION_TREE_FLAG_PROGRESS_BAR) == EVALUATION_TREE_FLAG_PROGRESS_BAR) then - criteriaString = quantityString - else - if (criteriaType == CRITERIA_TYPE_ACHIEVEMENT and assetID) then -- meta achievement - _, criteriaString = GetAchievementInfo(assetID) - end - end - - -- display criteria depending on timer state - -- kinda wanna seperate this out, but display is dependent on timer logic (e.g. timeLeft > 0 forces display) - - --[[ - local timerTable = achievementTimers[criteriaID] - if (timerTable) then - duration = timerTable.duration - elapsed = GetTime() - timerTable.startTime - end - if ((timerTable) and (duration) and (elapsed) and (elapsed < duration)) then - --]] - if ((duration) and (elapsed) and (elapsed < duration)) then - foundTimer = true - - -- timer is running, force showing criteria - if criteriaCompleted then - button:AddLine(" "..criteriaString, nil, opt_colors.AchievementCriteriaComplete[1], opt_colors.AchievementCriteriaComplete[2], opt_colors.AchievementCriteriaComplete[3]) -- timer running, force showing completed objective - else - button:AddLine(" "..criteriaString, nil, opt_colors.AchievementCriteria[1], opt_colors.AchievementCriteria[2], opt_colors.AchievementCriteria[3]) -- timer running, force showing normal objective - end - - -- adding timer line - local timerBar = button:AddTimerBar(duration, GetTime() - elapsed) - timerBar:SetStatusBarColor(opt_colors.AchievementTimer[1], opt_colors.AchievementTimer[2], opt_colors.AchievementTimer[3]) - - else - -- no timer exists / timer expired - - local timerTable = achievementTimers[criteriaID] - if (timerTable) then - achievementTimers[criteriaID] = nil - achievementTimersMeta[achievementID] = nil - end - - if (not criteriaCompleted) and (not collapseCriteria) then - button:AddLine(" "..criteriaString, nil, opt_colors.AchievementCriteria[1], opt_colors.AchievementCriteria[2], opt_colors.AchievementCriteria[3]) -- no timer, show normally unless completed/collapsed - end - end - - end - - -- show "meta" timer if there is a timer on this achievement, but no associated criteria are found in GetAchievementNumCriteria (Salt and Pepper?) - -- multiple timers would be a problem (it sets/unsets with whichever criteria timer fires last), but it's better than nothing - if ((foundTimer == false) and (achievementTimersMeta[achievementID])) then - local timerTable = achievementTimersMeta[achievementID] - local duration = timerTable.duration - local elapsed = GetTime() - timerTable.startTime - - if ((duration) and (elapsed) and (elapsed < duration)) then - foundTimer = true - - local timerBar = button:AddTimerBar(timerTable.duration, timerTable.startTime) - timerBar:SetStatusBarColor(opt_colors.AchievementTimerMeta[1], opt_colors.AchievementTimerMeta[2], opt_colors.AchievementTimerMeta[3]) - end - end - - -- D(achievementName, foundTimer) - - if (foundTimer == false) then - button:SetBackdropColor(0, 0, 0, 0) - button:SetScript("OnUpdate", nil) - else - button.title:SetTextColor(opt_colors.AchievementTimedTitle[1], opt_colors.AchievementTimedTitle[2], opt_colors.AchievementTimedTitle[3]) - button:SetBackdropColor(opt_colors.AchievementTimedBackground[1], opt_colors.AchievementTimedBackground[2], opt_colors.AchievementTimedBackground[3], opt_colors.AchievementTimedBackground[4]) - end - - end - - function mouseHandlerAchievement:TitleButtonOnEnter (motion) - local button = self.parent - - local link = GetAchievementLink(button.id) - if link then - _G["GameTooltip"]:SetOwner(self, E.private.sle.skins.QuestKing.tooltipAnchor) - - if opt.tooltipScale then - if not GameTooltip.__QuestKingPreviousScale then - GameTooltip.__QuestKingPreviousScale = GameTooltip:GetScale() - end - GameTooltip:SetScale(opt.tooltipScale) - end - - GameTooltip:SetHyperlink(link) - GameTooltip:Show() - end - end - - function mouseHandlerAchievement:TitleButtonOnClick (mouse, down) - local button = self.parent - - if (IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then - local achievementLink = GetAchievementLink(button.id) - if (achievementLink) then - ChatEdit_InsertLink(achievementLink) - return - end - end - if E.private.sle.skins.QuestKing.clickTemplate == "QuestKing" then - QuestKingClickTemplate(button, mouse) - elseif E.private.sle.skins.QuestKing.clickTemplate == "Blizzlike" then - BlizzlikeClickTemplate(button, mouse) - end - end -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/buttons/bonusobjective.lua b/ElvUI_SLE/modules/quests/questking/buttons/bonusobjective.lua deleted file mode 100644 index 73871ca..0000000 --- a/ElvUI_SLE/modules/quests/questking/buttons/bonusobjective.lua +++ /dev/null @@ -1,283 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end -local addHeader -local setButtonToBonusTask -local mouseHandlerBonusTask = {} - -local function Replace() - local QuestKing = _G["QuestKing"] - local WatchButton = QuestKing.WatchButton - local getQuestTaggedTitle = QuestKing.GetQuestTaggedTitle - local getObjectiveColor = QuestKing.GetObjectiveColor - local opt = QuestKing.options - local opt_colors = opt.colors - - function setButtonToBonusTask (button, questID) - button.mouseHandler = mouseHandlerBonusTask - - local questIndex = GetQuestLogIndexByID(questID) - button.questID = questID - button.questIndex = questIndex - - local taggedTitle, level = getQuestTaggedTitle(questIndex, true) - local color = GetQuestDifficultyColor(level) - - if (GetSuperTrackedQuestID() == questID) then - taggedTitle = taggedTitle .. " |TInterface\\Scenarios\\ScenarioIcon-Combat:10:10:-1:0|t" - end - - button.title:SetTextIcon(taggedTitle) - button.title:SetTextColor(color.r, color.g, color.b) - - local isInArea, isOnMap, numObjectives = GetTaskInfo(questID) - local useNonBonusHeader = false - - for i = 1, numObjectives do - local desc, objectiveType, isDone, displayAsObjective = GetQuestObjectiveInfo(questID, i, false) - useNonBonusHeader = useNonBonusHeader or displayAsObjective - - if (desc == nil) then desc = "Unknown" end - - local quantCur, quantMax, quantName = QuestKing.MatchObjective(desc) - - if (objectiveType == "progressbar") then - local percent = GetQuestProgressBarPercent(questID) - - local objectiveFraction = isDone and 1 or (percent / 100) - if (objectiveFraction >= 1) and (not isDone) then - objectiveFraction = 0.999 - end - - local r, g, b = getObjectiveColor(objectiveFraction) - button:AddLine(format(" %s", desc), nil, r, g, b) - - local progressBar = button:AddProgressBar() - progressBar:SetPercent(percent) - elseif (quantName) then - local r, g, b = getObjectiveColor(quantCur / quantMax) - local line = button:AddLine(format(" %s", quantName), format(": %s/%s", quantCur, quantMax), r, g, b) - - local lastQuant = line._lastQuant - if ((lastQuant) and (quantCur > lastQuant)) then - line:Flash() - end - line._lastQuant = quantCur - else - local r, g, b = getObjectiveColor(isDone and 1 or 0) - button:AddLine(format(" %s", desc), nil, r, g, b) - end - - end - - if (useNonBonusHeader) and (button._previousHeader) then - button._previousHeader.title:SetText(TRACKER_HEADER_OBJECTIVE) - end - - if (button.fresh) then - local lines = button.lines - for i = 1, #lines do - local line = lines[i] - line:Glow(opt_colors.ObjectiveAlertGlow[1], opt_colors.ObjectiveAlertGlow[2], opt_colors.ObjectiveAlertGlow[3]) - end - end - -- button.titleButton:EnableMouse(false) - -- button:EnableMouse(true) - end - - function addHeader () - local header = WatchButton:GetKeyed("header", "Bonus Objectives") - header.title:SetText(TRACKER_HEADER_BONUS_OBJECTIVES) - local SLE_HeaderColor = E.db.sle.skins.objectiveTracker.colorHeader - if E.private.sle.skins.QuestKing.enable then - header.title:SetTextColor(SLE_HeaderColor.r, SLE_HeaderColor.g, SLE_HeaderColor.b) - else - header.title:SetTextColor(opt_colors.SectionHeader[1], opt_colors.SectionHeader[2], opt_colors.SectionHeader[3]) - end - return header - end - - function QuestKing:UpdateTrackerBonusObjectives () - local tasksTable = GetTasksTable() - local header - - if (dummyTaskID) then - header = addHeader() - - local button = WatchButton:GetKeyed("bonus_task_dummy", questID) - button._previousHeader = header - setButtonToDummyTask(button, questID) - end - - for i = 1, #tasksTable do - local questID = tasksTable[i] - local isInArea, isOnMap, numObjectives = GetTaskInfo(questID) - - if (isInArea) and (questID ~= dummyTaskID) then - if (not header) then - header = addHeader() - end - - local button = WatchButton:GetKeyed("bonus_task", questID) - button._previousHeader = header - setButtonToBonusTask(button, questID) - end - end - - local inScenario = C_Scenario.IsInScenario() - if (not inScenario) then return end - - local tblBonusSteps = C_Scenario.GetBonusSteps() - - -- do superseding stuff - supersededObjectives = C_Scenario.GetSupersededObjectives() - if (supersededObjectives) and (opt.hideSupersedingObjectives) then - local hiddenSteps = {} - - for i = 1, #tblBonusSteps do - local bonusStepIndex = tblBonusSteps[i] - local supersededIndex = getSupersedingStep(bonusStepIndex) - if (supersededIndex) then - local _, _, numCriteria, stepFailed = C_Scenario.GetStepInfo(bonusStepIndex) - local completed = true - if stepFailed then - completed = false - else - for criteriaIndex = 1, numCriteria do - local criteriaString, _, criteriaCompleted = C_Scenario.GetCriteriaInfoByStep(bonusStepIndex, criteriaIndex) - if (criteriaString) and (not criteriaCompleted) then - completed = false - break - end - end - end - - if (not completed) then - hiddenSteps[#hiddenSteps+1] = supersededIndex - end - end - end - - if (hiddenSteps) then - -- dumptable(hiddenSteps) - for i = 1, #hiddenSteps do - tDeleteItem(tblBonusSteps, hiddenSteps[i]) - end - end - end - - for i = 1, #tblBonusSteps do - -- each bonus step - local bonusStepIndex = tblBonusSteps[i] - - if (not header) then - header = addHeader() - end - - local button = WatchButton:GetKeyed("bonus_step", bonusStepIndex) - button._previousHeader = header - QuestKing.SetButtonToScenario(button, bonusStepIndex) - end - end - - function mouseHandlerBonusTask:TitleButtonOnClick (mouse, down) - local button = self.parent - - if (IsModifiedClick("CHATLINK")) and (ChatEdit_GetActiveWindow()) then - local questLink = GetQuestLink(button.questIndex) - if (questLink) then - ChatEdit_InsertLink(questLink) - return - end - end - - if (IsShiftKeyDown()) and (ClassicQuestLog) then - SelectQuestLogEntry(button.questIndex) - if ClassicQuestLog:IsVisible() then - ClassicQuestLog:OnShow() - else - ClassicQuestLog:SetShown(true) - end - return - end - - if (mouse == "RightButton") then - if (GetSuperTrackedQuestID() == button.questID) then - QuestKing:SetSuperTrackedQuestID(0) - QuestKing:UpdateTracker() - else - QuestKing:SetSuperTrackedQuestID(button.questID) - QuestKing:UpdateTracker() - end - else - QuestObjectiveTracker_OpenQuestMap(nil, button.questIndex) - end - end - - function mouseHandlerBonusTask:TitleButtonOnEnter (motion) - local button = self.parent - - local questID = button.questID - - if ((HaveQuestData(questID)) and (GetQuestLogRewardXP(questID) == 0) and (GetNumQuestLogRewardCurrencies(questID) == 0) - and (GetNumQuestLogRewards(questID) == 0) and (GetQuestLogRewardMoney(questID) == 0)) then - GameTooltip:Hide() - return - end - - GameTooltip:ClearAllPoints() - -- GameTooltip:SetPoint("TOPRIGHT", block, "TOPLEFT", 0, 0); - -- GameTooltip:SetOwner(block, "ANCHOR_PRESERVE"); - _G["GameTooltip"]:SetOwner(self, E.private.sle.skins.QuestKing.tooltipAnchor) - GameTooltip:SetText(REWARDS, 1, 0.831, 0.380) - - if (not HaveQuestData(questID)) then - GameTooltip:AddLine(RETRIEVING_DATA, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b) - else - GameTooltip:AddLine(BONUS_OBJECTIVE_TOOLTIP_DESCRIPTION, 1, 1, 1, 1) - GameTooltip:AddLine(" ") - - -- xp - local xp = GetQuestLogRewardXP(questID) - if (xp > 0) then - GameTooltip:AddLine(string.format(BONUS_OBJECTIVE_EXPERIENCE_FORMAT, xp), 1, 1, 1) - end - - -- currency - local numQuestCurrencies = GetNumQuestLogRewardCurrencies(questID) - for i = 1, numQuestCurrencies do - local name, texture, numItems = GetQuestLogRewardCurrencyInfo(i, questID) - local text = string.format(BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT, texture, numItems, name) - GameTooltip:AddLine(text, 1, 1, 1) - end - - -- items - local numQuestRewards = GetNumQuestLogRewards(questID) - for i = 1, numQuestRewards do - local name, texture, numItems, quality, isUsable = GetQuestLogRewardInfo(i, questID) - local text - if (numItems > 1) then - text = string.format(BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT, texture, numItems, name) - elseif (texture and name) then - text = string.format(BONUS_OBJECTIVE_REWARD_FORMAT, texture, name) - end - if (text) then - local color = ITEM_QUALITY_COLORS[quality] - GameTooltip:AddLine(text, color.r, color.g, color.b) - end - end - - -- money - local money = GetQuestLogRewardMoney(questID) - if (money > 0) then - SetTooltipMoney(GameTooltip, money, nil) - end - end - - GameTooltip:Show() - end -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/buttons/challengetimer.lua b/ElvUI_SLE/modules/quests/questking/buttons/challengetimer.lua deleted file mode 100644 index 49c4ab8..0000000 --- a/ElvUI_SLE/modules/quests/questking/buttons/challengetimer.lua +++ /dev/null @@ -1,150 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local function Replace() - local QuestKing = _G["QuestKing"] - local WatchButton = QuestKing.WatchButton - local opt = QuestKing.options - local opt_buttonWidth = opt.buttonWidth - local opt_font = opt.font - local opt_fontChallengeTimer = opt.fontChallengeTimer - local opt_fontSize = opt.fontSize - local opt_fontStyle = opt.fontStyle - - local function SetProgressBarsColor(challengeBar) - local COLOR - if E.private.sle.skins.objectiveTracker.class then - COLOR = classColor - else - COLOR = E.private.sle.skins.objectiveTracker.color - end - challengeBar:SetStatusBarColor(COLOR.r, COLOR.g, COLOR.b) - end - - local cachedChallengeBar = nil - function WatchButton:AddChallengeBar() - local button = self - - if (button.challengeBar) then - return button.challengeBar - end - - local challengeBar - if (not cachedChallengeBar) then - challengeBar = CreateFrame("StatusBar", "QuestKing_ChallengeBar", QuestKing.Tracker) - challengeBar:SetStatusBarTexture(E.LSM:Fetch('statusbar', E.private.sle.skins.objectiveTracker.texture)) - challengeBar:GetStatusBarTexture():SetHorizTile(false) - SetProgressBarsColor(challengeBar) - challengeBar:SetMinMaxValues(0, 1) - challengeBar:SetValue(1) - challengeBar:SetWidth(opt_buttonWidth - 36) - challengeBar:SetHeight(17) - challengeBar:CreateBackdrop("Transparent") - - local barPulser = button:CreateTexture() - barPulser:SetAllPoints(challengeBar) - barPulser:SetTexture("Interface\\TargetingFrame\\UI-StatusBar") - barPulser:SetVertexColor(1, 0.9, 0.7, 0) - barPulser:SetBlendMode("ADD") - challengeBar.barPulser = barPulser - - local animGroup = barPulser:CreateAnimationGroup() - local a1 = animGroup:CreateAnimation("Alpha") - a1:SetDuration(0.25); a1:SetChange(1); a1:SetOrder(1); - local a2 = animGroup:CreateAnimation("Alpha") - a2:SetDuration(0.3); a2:SetChange(-1); a2:SetOrder(2); a2:SetEndDelay(0.45); - animGroup.cycles = 0 - animGroup:SetScript("OnFinished", function (self) - if (self.cycles > 0) then - self:Play() - self.cycles = self.cycles - 1 - else - self.cycles = 0 - end - end) - challengeBar.barPulserAnim = animGroup - - -- <Alpha childKey="BorderAnim" change="1" duration="0.25" order="1"/> - -- <Alpha childKey="BorderAnim" endDelay="0.45" change="-1" duration="0.3" order="2"/> - - local icon = challengeBar:CreateTexture(nil, "OVERLAY") - icon:SetTexture([[Interface\Challenges\challenges-plat-sm]]) - icon:SetSize(22, 22) - icon:SetPoint("RIGHT", challengeBar, "LEFT", -6, 0) - icon:SetTexCoord(0.25, 0.7, 0.25, 0.7) - challengeBar.icon = icon - - local text = challengeBar:CreateFontString(nil, "OVERLAY") - text:SetFont(opt_font, opt_fontSize, opt_fontStyle) - text:SetJustifyH("CENTER") - text:SetJustifyV("CENTER") - text:SetAllPoints(true) - text:SetTextColor(1, 1, 1) - text:SetShadowOffset(1, -1) - text:SetShadowColor(0, 0, 0, 1) - text:SetText(CHALLENGES_TIMER_NO_MEDAL) - challengeBar.text = text - - local extraText = challengeBar:CreateFontString(nil, "OVERLAY") - extraText:SetFont(opt_font, opt_fontSize, opt_fontStyle) - extraText:SetPoint("BOTTOMLEFT", challengeBar, "TOPLEFT", 2, 4) - extraText:SetTextColor(1, 1, 1) - extraText:SetShadowOffset(1, -1) - extraText:SetShadowColor(0, 0, 0, 1) - extraText:SetText(PROVING_GROUNDS_WAVE.." 1/5") - extraText:Hide() - challengeBar.extraText = extraText - - local score = challengeBar:CreateFontString(nil, "OVERLAY") - score:SetFont(opt_font, opt_fontSize, opt_fontStyle) - score:SetJustifyH("RIGHT") - score:SetPoint("BOTTOMRIGHT", challengeBar, "TOPRIGHT", -2, 4) - score:SetTextColor(1, 1, 1) - score:SetShadowOffset(1, -1) - score:SetShadowColor(0, 0, 0, 1) - score:SetText("0") - score:Hide() - challengeBar.score = score - - challengeBar.bonusHeight = 18 - - challengeBar:SetScript("OnUpdate", nil) - - cachedChallengeBar = challengeBar - else - challengeBar = cachedChallengeBar - challengeBar:ClearAllPoints() - - challengeBar.extraText:Hide() - challengeBar.score:SetText("0") - challengeBar.score:Hide() - challengeBar.bonusHeight = 18 - - challengeBar.barPulserAnim:Stop() - challengeBar.barPulserAnim.cycles = 0 - - challengeBar:SetScript("OnUpdate", nil) - - SetProgressBarsColor(challengeBar) - challengeBar.text:SetText(CHALLENGES_TIMER_NO_MEDAL) - - challengeBar._medalTimes = nil - challengeBar._currentMedalTime = nil - challengeBar._startTime = nil - end - - challengeBar:SetPoint("BOTTOMLEFT", button, "BOTTOMLEFT", 26, 5) - challengeBar:Show() - - button.challengeBar = challengeBar - button.challengeBarIcon = challengeBar.icon - button.challengeBarText = challengeBar.text - - return challengeBar - end -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/buttons/quest.lua b/ElvUI_SLE/modules/quests/questking/buttons/quest.lua deleted file mode 100644 index 420f1e5..0000000 --- a/ElvUI_SLE/modules/quests/questking/buttons/quest.lua +++ /dev/null @@ -1,519 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local IsShiftKeyDown = IsShiftKeyDown -local IsAltKeyDown = IsAltKeyDown -local RemoveQuestWatch = RemoveQuestWatch -local GetNumQuestLogEntries = GetNumQuestLogEntries -local GetQuestWatchInfo = GetQuestWatchInfo -local GetQuestWatchIndex = GetQuestWatchIndex -local IsQuestSequenced = IsQuestSequenced -local GetQuestLogRequiredMoney = GetQuestLogRequiredMoney -local GetMoneyString = GetMoneyString -local GetNumQuestWatches = GetNumQuestWatches - -local prev_GetNumQuestLogEntries = 0 -local prev_GetNumQuestWatches = 0 - -local buildQuestSortTable -local setButtonToQuest -local headerList = {} -local questSortTable = {} -local mouseHandlerQuest = {} - -local function Replace() - local QuestKing = _G["QuestKing"] - local WatchButton = QuestKing.WatchButton - local getObjectiveColor = QuestKing.GetObjectiveColor - local getQuestTaggedTitle = QuestKing.GetQuestTaggedTitle - local matchObjective = QuestKing.MatchObjective - local matchObjectiveRep = QuestKing.MatchObjectiveRep - -- options - local opt = QuestKing.options - local opt_colors = opt.colors - local opt_itemAnchorSide = opt.itemAnchorSide - local opt_showCompletedObjectives = opt.showCompletedObjectives - - local function QuestKingClickTemplate(button, mouse) - if (IsShiftKeyDown()) and (_G["ClassicQuestLog"]) then - SelectQuestLogEntry(button.questLogIndex) - if _G["ClassicQuestLog"]:IsVisible() then - _G["ClassicQuestLog"]:OnShow() - else - _G["ClassicQuestLog"]:SetShown(true) - end - return - end - - if IsAltKeyDown() then - if mouse == "RightButton" then - RemoveQuestWatch(button.questLogIndex) - QuestKing:UpdateTracker() - return - else - if _G["QuestKingDBPerChar"].collapsedQuests[button.questID] then - _G["QuestKingDBPerChar"].collapsedQuests[button.questID] = nil - else - _G["QuestKingDBPerChar"].collapsedQuests[button.questID] = true - end - QuestKing:UpdateTracker() - return - end - end - - if mouse == "RightButton" then - -- WORLDMAP_SETTINGS.selectedQuestId = button.questID - if (GetSuperTrackedQuestID() == button.questID) then - QuestKing:SetSuperTrackedQuestID(0) - QuestKing:UpdateTracker() - else - QuestKing:SetSuperTrackedQuestID(button.questID) - QuestKing:UpdateTracker() - end - -- QuestPOIUpdateIcons() - -- if WorldMapFrame:IsShown() then - -- HideUIPanel(WorldMapFrame) - -- ShowUIPanel(WorldMapFrame) - -- end - else - -- if (QuestLogFrame:IsShown()) and (QuestLogFrame.selectedIndex == button.questLogIndex) then - -- HideUIPanel(QuestLogFrame) - -- else - -- QuestLog_OpenToQuest(button.questLogIndex) - -- ShowUIPanel(QuestLogFrame) - -- end - QuestObjectiveTracker_OpenQuestMap(nil, button.questLogIndex) - end - end - - local function BlizzlikeClickTemplate(button, mouse) - if (not IsShiftKeyDown()) and (_G["ClassicQuestLog"]) then - SelectQuestLogEntry(button.questLogIndex) - if _G["ClassicQuestLog"]:IsVisible() then - _G["ClassicQuestLog"]:OnShow() - else - _G["ClassicQuestLog"]:SetShown(true) - end - return - end - if IsShiftKeyDown() then - if mouse == "RightButton" then - if (GetSuperTrackedQuestID() == button.questID) then - QuestKing:SetSuperTrackedQuestID(0) - QuestKing:UpdateTracker() - else - QuestKing:SetSuperTrackedQuestID(button.questID) - QuestKing:UpdateTracker() - end - return - else - RemoveQuestWatch(button.questLogIndex) - QuestKing:UpdateTracker() - return - end - end - if IsControlKeyDown() then - if _G["QuestKingDBPerChar"].collapsedQuests[button.questID] then - _G["QuestKingDBPerChar"].collapsedQuests[button.questID] = nil - else - _G["QuestKingDBPerChar"].collapsedQuests[button.questID] = true - end - QuestKing:UpdateTracker() - return - end - if mouse == "RightButton" then - ObjectiveTracker_ToggleDropDown(button, QuestObjectiveTracker_OnOpenDropDown) - else - CloseDropDownMenus(); - if _G["ClassicQuestLog"] then - SelectQuestLogEntry(button.questLogIndex) - if _G["ClassicQuestLog"]:IsVisible() then - _G["ClassicQuestLog"]:OnShow() - else - _G["ClassicQuestLog"]:SetShown(true) - end - return - else - QuestObjectiveTracker_OpenQuestMap(nil, button.questLogIndex) - return - end - end - end - - function buildQuestSortTable () - for k,v in T.pairs(questSortTable) do - T.twipe(questSortTable[k]) - end - T.twipe(headerList) - - local numEntries = GetNumQuestLogEntries() - local currentHeader = "(Unknown 0)" - - local numQuests = 0 - for i = 1, numEntries do - local title, _, _, isHeader, isCollapsed, _, _, questID = GetQuestLogTitle(i) - if (not title) or (title == "") then - title = T.format("(Unknown %d)", i) - end - - if (isHeader) then - - if not questSortTable[title] then - questSortTable[title] = {} - end - - if (title ~= currentHeader) then - -- new header found - -- note: quest "Safe Passage" in Frostfire Ridge is under a duplicate zone header - currentHeader = title - T.tinsert(headerList, title) - end - - elseif (not isHeader) and (IsQuestWatched(i)) then - if (not questSortTable[currentHeader]) then - questSortTable[currentHeader] = {} - end - - T.tinsert(questSortTable[currentHeader], i) - end - - if (not isHeader) then - numQuests = numQuests + 1 - end - end - - -- totalQuestCount = numQuests - end - - function setButtonToQuest(button, questLogIndex) - button.mouseHandler = mouseHandlerQuest - - local questTitle, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle(questLogIndex) - - button.questLogIndex = questLogIndex - button.questID = questID - - local collapseObjectives = QuestKingDBPerChar.collapsedQuests[questID] - - -- set title - local taggedTitle = getQuestTaggedTitle(questLogIndex) - - if (GetSuperTrackedQuestID() == questID) then - local icon = E.private.sle.skins.QuestKing.trackerIcon == "DEFAULT" and [[Interface\Scenarios\ScenarioIcon-Combat]] or E.private.sle.skins.QuestKing.trackerIcon == "CUSTOM" and E.private.sle.skins.QuestKing.trackerIconCustom or QK.Icons[E.private.sle.skins.QuestKing.trackerIcon] - local size = E.private.sle.skins.QuestKing.trackerSize - taggedTitle = taggedTitle .. " |T"..icon..":"..size..":"..size..":-1:0|t" - end - - if (isComplete == -1) then - button.title:SetFormattedTextIcon("|TInterface\\RAIDFRAME\\ReadyCheck-NotReady:0:0:1:0|t %s", taggedTitle) - else - button.title:SetTextIcon(taggedTitle) - end - - -- add objectives - local numObj = GetNumQuestLeaderBoards(questLogIndex) or 0 - local completedObj = 0 - local displayedObj = 0 - - for i = 1, numObj do - local objectiveDesc, objectiveType, objectiveIsDone = GetQuestLogLeaderBoard(i, questLogIndex) - - if (objectiveIsDone) then - completedObj = completedObj + 1 - end - - local displayObjective = true - if (collapseObjectives) then - -- hide for collapsed quest - displayObjective = false - elseif (isComplete == 1) and (opt_showCompletedObjectives ~= "always") then - -- hide for complete quest (unless show type is "always") - displayObjective = false - elseif (objectiveIsDone) and (opt_showCompletedObjectives == false) then - -- hide for completed objectives if showCompletedObjectives is false - displayObjective = false - elseif (objectiveDesc == nil) then - -- hide invalid objectives - displayObjective = false - end - - -- types: - -- event, reputation, item, log(Direbrew's Dire Brew), monster, object?, spell(Frost Nova) - if (displayObjective) then - local quantCur, quantMax, quantName = matchObjective(objectiveDesc) - - if (objectiveType == "reputation") then - quantCur, quantMax, quantName = matchObjectiveRep(objectiveDesc) - - local r, g, b = getObjectiveColor(objectiveIsDone and 1 or 0) - local line - if (not quantName) then - line = button:AddLine(T.format(" %s", objectiveDesc), nil, r, g, b) - else - line = button:AddLine(T.format(" %s", quantName), T.format(": %s / %s", quantCur, quantMax), r, g, b) - end - - objectiveIsDone = not not objectiveIsDone - if ((line._lastQuant == false) and (objectiveIsDone == true)) then - line:Flash() - end - line._lastQuant = objectiveIsDone - - displayedObj = displayedObj + 1 - - elseif (not quantName) or (objectiveType == "spell") then - if ((displayObjective) or (not objectiveIsDone)) then - local r, g, b = getObjectiveColor(objectiveIsDone and 1 or 0) - local line = button:AddLine(T.format(" %s", objectiveDesc), nil, r, g, b) - - ---- FIXME: test this! - objectiveIsDone = not not objectiveIsDone - if ((line._lastQuant == false) and (objectiveIsDone == true)) then - line:Flash() - end - line._lastQuant = objectiveIsDone - - displayedObj = displayedObj + 1 - end - - else - if ((displayObjective) or (not objectiveIsDone)) then - local r, g, b = getObjectiveColor(quantCur / quantMax) - local line = button:AddLine(T.format(" %s", quantName), T.format(": %s/%s", quantCur, quantMax), r, g, b) - - local lastQuant = line._lastQuant - if ((lastQuant) and (quantCur > lastQuant)) then - line:Flash() - end - line._lastQuant = quantCur - - displayedObj = displayedObj + 1 - end - end - end - - end - - -- money - local requiredMoney = GetQuestLogRequiredMoney(questLogIndex) - if (requiredMoney > 0) then - QuestKing.watchMoney = true - local playerMoney = GetMoney() - - -- not sure about this, but the default watch frame does it - -- (fake completion for gold-requiring connectors when gold req is met and no event begins) - if (numObj == 0 and playerMoney >= requiredMoney and not startEvent) then - isComplete = 1 - end - - numObj = numObj + 1 -- (questking only) ensure all gold-requiring quests aren't marked as connectors - - if (not collapseObjectives) then -- hide entirely if objectives are collapsed - if playerMoney >= requiredMoney then - -- show met gold amounts only for incomplete quests - if (isComplete ~= 1) and (opt_showCompletedObjectives) then - local r, g, b = getObjectiveColor(1) - button:AddLine(L["SLE_QUESTKING_Required"]..GetMoneyString(requiredMoney), nil, r, g, b) - end - else - -- always show unmet gold amount - local r, g, b = getObjectiveColor(0) - button:AddLine(L["SLE_QUESTKING_Required"]..GetMoneyString(requiredMoney), nil, r, g, b) - end - end - end - - local _, _, _, _, _, _, _, _, failureTime, timeElapsed = GetQuestWatchInfo(GetQuestWatchIndex(questLogIndex)) - - -- timer - if (failureTime) then - if (timeElapsed) then - local timerBar = button:AddTimerBar(failureTime, T.GetTime() - timeElapsed) - timerBar:SetStatusBarColor(opt_colors.QuestTimer[1], opt_colors.QuestTimer[2], opt_colors.QuestTimer[3]) - end - end - - -- set title colour - if (isComplete == -1) then - -- failed - button.title:SetTextColor(opt_colors.ObjectiveFailed[1], opt_colors.ObjectiveFailed[2], opt_colors.ObjectiveFailed[3]) - elseif (isComplete == 1) then - if GetQuestLogIsAutoComplete(questLogIndex) then - -- autocomplete - button.title:SetTextColor(opt_colors.QuestCompleteAuto[1], opt_colors.QuestCompleteAuto[2], opt_colors.QuestCompleteAuto[3]) - elseif (numObj == 0) then - -- connector quest [type c] (complete, 0/0 objectives) - button.title:SetTextColor(opt_colors.QuestConnector[1], opt_colors.QuestConnector[2], opt_colors.QuestConnector[3]) - else - -- completed quest (complete, n/n objectives) - button.title:SetTextColor(opt_colors.ObjectiveComplete[1], opt_colors.ObjectiveComplete[2], opt_colors.ObjectiveComplete[3]) - end - else - if numObj == 0 then - -- connector quest [type i] (incomplete, 0/0 objectives) - button.title:SetTextColor(opt_colors.QuestConnector[1], opt_colors.QuestConnector[2], opt_colors.QuestConnector[3]) - elseif numObj == completedObj then - -- unknown state (incomplete, n/n objectives where n>0) - button.title:SetTextColor(1, 0, 1) - else - -- incomplete quest (incomplete, n/m objectives where m>n) - local color = GetQuestDifficultyColor(level) - button.title:SetTextColor(color.r, color.g, color.b) - end - end - - if collapseObjectives then - button.title:SetAlpha(0.6) - end - - -- add item button - local link, item, charges, showItemWhenComplete = GetQuestLogSpecialItemInfo(questLogIndex) - local itemButton - if opt_itemAnchorSide and item and ((isComplete ~= 1) or (showItemWhenComplete)) then - if T.InCombatLockdown() then - QuestKing:StartCombatTimer() - else - itemButton = button:SetItemButton(questLogIndex, link, item, charges, displayedObj) - end - - else - if (button.itemButton) then - if T.InCombatLockdown() then - QuestKing:StartCombatTimer() - else - button:RemoveItemButton() - end - end - end - - if (button.fresh) then - if (QuestKing.newlyAddedQuests[questID]) then - button:Pulse(0.9, 0.6, 0.2) - QuestKing.newlyAddedQuests[questID] = nil - end - end - - -- quests enter a state of unknown completion (isComplete == nil) when zoning between instances. - -- since they also has no objectives in this state, we completely ignore completion changes for quests with no objectives - if (numObj > 0) then - if (isComplete == 1) and (button._questCompleted == false) then - button:Pulse(0.2, 0.6, 0.9) - QuestKing:OnQuestObjectivesCompleted(questID) - end - button._questCompleted = not not (isComplete == 1) - end - - -- animate sequenced quests - if ((not button.fresh) and IsQuestSequenced(questID)) then - local lastNumObj = button._lastNumObj - - if ((lastNumObj) and (lastNumObj > 0) and (numObj > lastNumObj)) then - -- do animations [FIXME: test this] - PlaySound("UI_QuestRollingForward_01") - local lines = button.lines - for i = 1, #lines do - if (i > lastNumObj) then - local line = lines[i] - line:Glow(opt_colors.ObjectiveChangedGlow[1], opt_colors.ObjectiveChangedGlow[2], opt_colors.ObjectiveChangedGlow[3]) - end - end - end - button._lastNumObj = numObj - end - - end - - function QuestKing:UpdateTrackerQuests() - local headerName, questLogIndex - for i = 1, #headerList do - headerName = headerList[i] - -- header - if #questSortTable[headerName] > 0 then - local button = QuestKing.WatchButton:GetKeyed("collapser", headerName) - button._headerName = headerName - - --|TTexturePath:size1:size2:xoffset:yoffset:dimx:dimy:coordx1:coordx2:coordy1:coordy2:red:green:blue|t - --[[Altered part to allow for using S&L's objective tracker skin options for colors]] - local SLE_HeaderColor = E.db.sle.skins.objectiveTracker.colorHeader - if QuestKingDBPerChar.collapsedHeaders[headerName] then - button.title:SetTextIcon("|TInterface\\AddOns\\QuestKing\\textures\\UI-SortArrow_sm_right:8:8:0:-1:0:0:0:0:0:0:1:1:1|t "..headerName) - else - button.title:SetTextIcon("|TInterface\\AddOns\\QuestKing\\textures\\UI-SortArrow_sm_down:8:8:0:-1:0:0:0:0:0:0:1:1:1|t "..headerName) - end - button.title:SetTextColor(SLE_HeaderColor.r, SLE_HeaderColor.g, SLE_HeaderColor.b) - end - - -- quests - - if not QuestKingDBPerChar.collapsedHeaders[headerName] then - for j = 1, #questSortTable[headerName] do - questLogIndex = questSortTable[headerName][j] - local _,_,_,_,_,_,_, questID = GetQuestLogTitle(questLogIndex) - local button = QuestKing.WatchButton:GetKeyed("quest", questID) - setButtonToQuest(button, questLogIndex) - end - end - end - - end - - function QuestKing:CheckQuestSortTable (forceBuild) - if (forceBuild) then - buildQuestSortTable() - prev_GetNumQuestLogEntries = GetNumQuestLogEntries() - prev_GetNumQuestWatches = GetNumQuestWatches() - else - local numEntries = GetNumQuestLogEntries() - local numWatches = GetNumQuestWatches() - - if (numEntries ~= prev_GetNumQuestLogEntries) or (numWatches ~= prev_GetNumQuestWatches) then - buildQuestSortTable() - prev_GetNumQuestLogEntries = numEntries - prev_GetNumQuestWatches = numWatches - end - end - end - - function mouseHandlerQuest:TitleButtonOnEnter (motion) - local button = self.parent - - local link = GetQuestLink(button.questLogIndex) - if link then - _G["GameTooltip"]:SetOwner(self, E.private.sle.skins.QuestKing.tooltipAnchor) - - if opt.tooltipScale then - if not _G["GameTooltip"].__QuestKingPreviousScale then - _G["GameTooltip"].__QuestKingPreviousScale = GameTooltip:GetScale() - end - _G["GameTooltip"]:SetScale(E.private.sle.skins.QuestKing.enable and E.private.sle.skins.QuestKing.tooltipScale or opt.tooltipScale) - end - - _G["GameTooltip"]:SetHyperlink(link) - _G["GameTooltip"]:Show() - end - end - - function mouseHandlerQuest:TitleButtonOnClick (mouse, down) - local button = self.parent - - if (IsModifiedClick("CHATLINK") and ChatEdit_GetActiveWindow()) then - local questLink = GetQuestLink(button.questLogIndex) - if (questLink) then - ChatEdit_InsertLink(questLink) - return - end - end - - if E.private.sle.skins.QuestKing.clickTemplate == "QuestKing" then - QuestKingClickTemplate(button, mouse) - elseif E.private.sle.skins.QuestKing.clickTemplate == "Blizzlike" then - BlizzlikeClickTemplate(button, mouse) - end - end - -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/buttons/scenario.lua b/ElvUI_SLE/modules/quests/questking/buttons/scenario.lua deleted file mode 100644 index bc2fe4a..0000000 --- a/ElvUI_SLE/modules/quests/questking/buttons/scenario.lua +++ /dev/null @@ -1,290 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local mouseHandlerScenario = {} - -local function Replace() - local QuestKing = _G["QuestKing"] - local WatchButton = QuestKing.WatchButton - local getObjectiveColor = QuestKing.GetObjectiveColor - local opt = QuestKing.options - local opt_colors = opt.colors - - function QuestKing:UpdateTrackerScenarios () - local scenarioName, currentStage, numStages, flags, hasBonusStep, isBonusStepComplete, completed, xp, money = C_Scenario.GetInfo() - local inChallengeMode = bit.band(flags, SCENARIO_FLAG_CHALLENGE_MODE) == SCENARIO_FLAG_CHALLENGE_MODE; - local inProvingGrounds = bit.band(flags, SCENARIO_FLAG_PROVING_GROUNDS) == SCENARIO_FLAG_PROVING_GROUNDS; - local dungeonDisplay = bit.band(flags, SCENARIO_FLAG_USE_DUNGEON_DISPLAY) == SCENARIO_FLAG_USE_DUNGEON_DISPLAY; - -- D("updateTrackerScenarios:", dungeonDisplay) - - local _, _, _, _, _, _, _, mapID = GetInstanceInfo() - if (mapID == 1148) then - inProvingGrounds = true - end - - if (inProvingGrounds) then - local diffID, currWave, maxWave, duration = C_Scenario.GetProvingGroundsInfo() - if (duration ~= 0) then - return - end - end - - local stageName, stageDescription, numCriteria = C_Scenario.GetStepInfo() - local inChallengeMode = C_Scenario.IsChallengeMode() - local SLE_HeaderColor = E.db.sle.skins.objectiveTracker.colorHeader - if (currentStage > 0) then - if (currentStage <= numStages) then - -- scenario type header - local header = WatchButton:GetKeyed("header", scenarioName) - - if (inProvingGrounds) then - header.title:SetText(TRACKER_HEADER_PROVINGGROUNDS) - else - local displayText = TRACKER_HEADER_SCENARIO - - if (dungeonDisplay) then - displayText = TRACKER_HEADER_DUNGEON - elseif (inChallengeMode) then - displayText = CHALLENGE_MODE - end - - if (numStages > 1) then - if (currentStage == numStages) then - header.title:SetFormattedText("%s: "..SCENARIO_STAGE_FINAL, displayText) - else - header.title:SetFormattedText("%s: "..SCENARIO_STAGE_STATUS, displayText, currentStage, numStages) - end - else - header.title:SetText(displayText) - end - end - header.title:SetTextColor(SLE_HeaderColor.r, SLE_HeaderColor.g, SLE_HeaderColor.b) - - -- scenario stage - local button = WatchButton:GetKeyed("scenario", scenarioName) - QuestKing.SetButtonToScenario(button) - - elseif (currentStage > numStages) then - -- scenario complete header - local header = WatchButton:GetKeyed("header", scenarioName) - if (not inChallengeMode) then - if (dungeonDisplay) then - header.title:SetText(DUNGEON_COMPLETED) - else - header.title:SetText(SCENARIO_COMPLETED) - end - else - header.title:SetText(CHALLENGE_MODE_COMPLETED) - end - header.title:SetTextColor(SLE_HeaderColor.r, SLE_HeaderColor.g, SLE_HeaderColor.b) - end - end - end - - function QuestKing.SetButtonToScenario(button, stepIndex) - button.mouseHandler = mouseHandlerScenario - - local scenarioName, currentStage, numStages, flags, hasBonusStep, isBonusStepComplete, completed, xp, money = C_Scenario.GetInfo() - - if (not stepIndex) then - stepIndex = currentStage - end - button.stepIndex = stepIndex - - local lastStepIndex = button._lastStepIndex - local isNewStep = false - if (lastStepIndex) and (stepIndex > lastStepIndex) and (not button.fresh) then - isNewStep = true - -- D("isNewStep") - end - button._lastStepIndex = stepIndex - - local stageName, stageDescription, numCriteria, stepFailed, isBonusStep, isForCurrentStepOnly = C_Scenario.GetStepInfo(stepIndex) - - -- pre-parse - local stepFinished = (numCriteria > 0) and true or false - for i = 1, numCriteria do - local criteriaString, criteriaType, criteriaCompleted, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed, criteriaFailed = C_Scenario.GetCriteriaInfoByStep(stepIndex, i) - if (not criteriaCompleted) then - stepFinished = false - end - end - - if (stepFailed) then - button.title:SetFormattedTextIcon("|TInterface\\RAIDFRAME\\ReadyCheck-NotReady:0:0:1:0|t %s", stageName) - button.title:SetTextColor(opt_colors.ObjectiveFailed[1], opt_colors.ObjectiveFailed[2], opt_colors.ObjectiveFailed[3]) - stepFinished = true - elseif (stepFinished) then - button.title:SetFormattedTextIcon("|TInterface\\RAIDFRAME\\ReadyCheck-Ready:0:0:1:1|t %s", stageName) - button.title:SetTextColor(opt_colors.ObjectiveComplete[1], opt_colors.ObjectiveComplete[2], opt_colors.ObjectiveComplete[3]) - else - button.title:SetText(stageName) - button.title:SetTextColor(opt_colors.ScenarioStageTitle[1], opt_colors.ScenarioStageTitle[2], opt_colors.ScenarioStageTitle[3]) - end - - if (not stepFinished) then - for i = 1, numCriteria do - local criteriaString, criteriaType, criteriaCompleted, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed, criteriaFailed = C_Scenario.GetCriteriaInfoByStep(stepIndex, i) - local line - - if (criteriaCompleted) then - if (opt_showCompletedObjectives) then - line = button:AddLine( - format(" %s", criteriaString), - format(": %s/%s", quantity, totalQuantity), - opt_colors.ObjectiveGradientComplete[1], opt_colors.ObjectiveGradientComplete[2], opt_colors.ObjectiveGradientComplete[3]) - end - elseif (criteriaFailed) then - line = button:AddLineIcon( - format(" |TInterface\\RAIDFRAME\\ReadyCheck-NotReady:0|t %s", criteriaString), - format(": %s/%s", quantity, totalQuantity), - opt_colors.ObjectiveFailed[1], opt_colors.ObjectiveFailed[2], opt_colors.ObjectiveFailed[3]) - else - local r, g, b = getObjectiveColor(quantity / totalQuantity) - line = button:AddLine( - format(" %s", criteriaString), - format(": %s/%s", quantity, totalQuantity), - r, g, b) - end - if not line then return end - local lastQuant = line._lastQuant - if ((lastQuant) and (quantity > lastQuant) and (not isNewStep)) then - -- line:Glow(opt_colors.ObjectiveProgressFlash[1], opt_colors.ObjectiveProgressFlash[2], opt_colors.ObjectiveProgressFlash[3]) - line:Flash() - end - line._lastQuant = quantity - - if ((duration) and (elapsed) and (elapsed < duration)) then - local timerBar = button:AddTimerBar(duration, GetTime() - elapsed) - local COLOR - if E.private.sle.skins.objectiveTracker.class then - COLOR = classColor - else - COLOR = E.private.sle.skins.objectiveTracker.color - end - timerBar:SetStatusBarColor(COLOR.r, COLOR.g, COLOR.b) - end - end - - if (isNewStep) or (button.fresh) then - local lines = button.lines - for i = 1, #lines do - local line = lines[i] - line:Glow(0.1, 0.7, 0.4) - end - -- D("glowed lines") - end - end - end - - function mouseHandlerScenario:TitleButtonOnEnter (motion) - local button = self.parent - local stepIndex = button.stepIndex - - local scenarioName, currentStage, numStages, flags, hasBonusStep, isBonusStepComplete, completed, xp, money = C_Scenario.GetInfo() - local stageName, stageDescription, numCriteria, stepFailed, isBonusStep, isForCurrentStepOnly = C_Scenario.GetStepInfo(stepIndex) - - _G["GameTooltip"]:SetOwner(self, E.private.sle.skins.QuestKing.tooltipAnchor) - - if opt.tooltipScale then - if not GameTooltip.__QuestKingPreviousScale then - GameTooltip.__QuestKingPreviousScale = GameTooltip:GetScale() - end - GameTooltip:SetScale(opt.tooltipScale) - end - - GameTooltip:AddLine(scenarioName, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1) - GameTooltip:AddLine(stageName, opt_colors.ScenarioStageTitle[1], opt_colors.ScenarioStageTitle[2], opt_colors.ScenarioStageTitle[3], 1) - - if (isBonusStep) then - GameTooltip:AddLine("Bonus Objective", 1, 0.914, 0.682, 1) - else - GameTooltip:AddLine(string.format(SCENARIO_STAGE_STATUS, currentStage, numStages), 1, 0.914, 0.682, 1) - end - GameTooltip:AddLine(" ") - - GameTooltip:AddLine(stageDescription, 1, 1, 1, 1) - GameTooltip:AddLine(" ") - - GameTooltip:AddLine(QUEST_TOOLTIP_REQUIREMENTS, NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1) - for i = 1, numCriteria do - local criteriaString, criteriaType, criteriaCompleted, quantity, totalQuantity, flags, assetID, quantityString, criteriaID, duration, elapsed, criteriaFailed = C_Scenario.GetCriteriaInfoByStep(stepIndex, i) - if criteriaCompleted then - GameTooltip:AddLine(format("- %s: %s/%s |cff808080(%s)|r", criteriaString, quantity, totalQuantity, COMPLETE), 0.2, 0.9, 0.2) - elseif criteriaFailed then - GameTooltip:AddLine(format("- %s: %s/%s |cff808080(%s)|r", criteriaString, quantity, totalQuantity, FAILED), 1, 0.2, 0.2) - else - GameTooltip:AddLine(format("- %s: %s/%s", criteriaString, quantity, totalQuantity), 1, 1, 1) - end - - end - - local blankLine = false - - if (isBonusStep) then - local questID = C_Scenario.GetBonusStepRewardQuestID(stepIndex) - if (not HaveQuestData(questID)) then - -- GameTooltip:AddLine(RETRIEVING_DATA, RED_FONT_COLOR.r, RED_FONT_COLOR.g, RED_FONT_COLOR.b); - else - -- xp - local xp = GetQuestLogRewardXP(questID) - if ( xp > 0 ) then - if (not blankLine) then GameTooltip:AddLine(" "); blankLine = true end - GameTooltip:AddLine(string.format(BONUS_OBJECTIVE_EXPERIENCE_FORMAT, xp), 1, 1, 1) - end - - -- currency - local numQuestCurrencies = GetNumQuestLogRewardCurrencies(questID) - for i = 1, numQuestCurrencies do - local name, texture, numItems = GetQuestLogRewardCurrencyInfo(i, questID) - local text = string.format(BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT, texture, numItems, name) - if (not blankLine) then GameTooltip:AddLine(" "); blankLine = true end - GameTooltip:AddLine(text, 1, 1, 1) - end - - -- items - local numQuestRewards = GetNumQuestLogRewards(questID) - for i = 1, numQuestRewards do - local name, texture, numItems, quality, isUsable = GetQuestLogRewardInfo(i, questID) - local text - - if (numItems > 1) then - text = string.format(BONUS_OBJECTIVE_REWARD_WITH_COUNT_FORMAT, texture, numItems, name) - elseif (texture) and (name) then - text = string.format(BONUS_OBJECTIVE_REWARD_FORMAT, texture, name) - end - - if (text) then - local color = ITEM_QUALITY_COLORS[quality] - if (not blankLine) then GameTooltip:AddLine(" "); blankLine = true end - GameTooltip:AddLine(text, color.r, color.g, color.b) - end - end - - -- money - local money = GetQuestLogRewardMoney(questID) - if (money > 0) then - if (not blankLine) then GameTooltip:AddLine(" "); blankLine = true end - SetTooltipMoney(GameTooltip, money, nil) - end - end - else - if (xp > 0) then - if (not blankLine) then GameTooltip:AddLine(" "); blankLine = true end - GameTooltip:AddLine(string.format(BONUS_OBJECTIVE_EXPERIENCE_FORMAT, xp), 1, 1, 1) - end - if (money > 0) then - if (not blankLine) then GameTooltip:AddLine(" "); blankLine = true end - SetTooltipMoney(GameTooltip, money, nil) - end - end - - GameTooltip:Show() - end - -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/core/core.lua b/ElvUI_SLE/modules/quests/questking/core/core.lua deleted file mode 100644 index 619f7ed..0000000 --- a/ElvUI_SLE/modules/quests/questking/core/core.lua +++ /dev/null @@ -1,150 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local function Replace() - local QuestKing = _G["QuestKing"] - local WatchButton = QuestKing.WatchButton - local Tracker = QuestKing.Tracker - local opt = QuestKing.options - local opt_colors = opt.colors - - function QuestKing:UpdateTracker(forceBuild, postCombat) - --D("!QuestKing:UpdateTracker") - - QuestKing:CheckQuestSortTable(forceBuild) - QuestKing.watchMoney = false - - QuestKing:PreCheckQuestTracking() - - WatchButton:StartOrder() - - -- titlebar - local trackerCollapsed = QuestKingDBPerChar.trackerCollapsed - if (trackerCollapsed == 2) then - QuestKing_TrackerMinimizeButton.label:SetText("x") - elseif (trackerCollapsed == 1) then - QuestKing_TrackerMinimizeButton.label:SetText("+") - else - QuestKing_TrackerMinimizeButton.label:SetText("-") - end - - if (QuestKingDBPerChar.trackerCollapsed <= 1) then - QuestKing:UpdateTrackerPopups() - - -- challenge timers - QuestKing:UpdateTrackerChallengeTimers() - - -- scenarios - local inScenario = C_Scenario.IsInScenario() - if inScenario then - QuestKing:UpdateTrackerScenarios() - end - - -- bonus objectives - QuestKing:UpdateTrackerBonusObjectives() - end - - local displayMode = QuestKingDBPerChar.displayMode - - if (trackerCollapsed == 0) then - if (displayMode == "combined") or (displayMode == "achievements") then - QuestKing:UpdateTrackerAchievements() - end - - if (displayMode == "combined") or (displayMode == "quests") then - QuestKing:UpdateTrackerQuests() - end - end - - local numAch = GetNumTrackedAchievements() - local numWatches = GetNumQuestWatches() - local totalLogLines, totalQuestCount = GetNumQuestLogEntries() - - if displayMode == "combined" then - QuestKing_TrackerModeButton.label:SetText("C") - if numAch > 0 then - Tracker.titlebarText:SetText(format("%d/%d | %d", totalQuestCount, MAX_QUESTS, numAch)) - else - Tracker.titlebarText:SetText(format("%d/%d", totalQuestCount, MAX_QUESTS)) - end - if (numWatches == 0) and (numAch == 0) then - Tracker.titlebarText:SetTextColor(opt_colors.TrackerTitlebarTextDimmed[1], opt_colors.TrackerTitlebarTextDimmed[2], opt_colors.TrackerTitlebarTextDimmed[3]) - else - Tracker.titlebarText:SetTextColor(opt_colors.TrackerTitlebarText[1], opt_colors.TrackerTitlebarText[2], opt_colors.TrackerTitlebarText[3]) - end - - elseif displayMode == "achievements" then - QuestKing_TrackerModeButton.label:SetText("A") - Tracker.titlebarText:SetText(numAch) - if (numAch == 0) then - Tracker.titlebarText:SetTextColor(opt_colors.TrackerTitlebarTextDimmed[1], opt_colors.TrackerTitlebarTextDimmed[2], opt_colors.TrackerTitlebarTextDimmed[3]) - else - Tracker.titlebarText:SetTextColor(opt_colors.TrackerTitlebarText[1], opt_colors.TrackerTitlebarText[2], opt_colors.TrackerTitlebarText[3]) - end - - else - QuestKing_TrackerModeButton.label:SetText("Q") - Tracker.titlebarText:SetText(format("%d/%d", totalQuestCount, MAX_QUESTS)) - if (numWatches == 0) then - Tracker.titlebarText:SetTextColor(opt_colors.TrackerTitlebarTextDimmed[1], opt_colors.TrackerTitlebarTextDimmed[2], opt_colors.TrackerTitlebarTextDimmed[3]) - else - Tracker.titlebarText:SetTextColor(opt_colors.TrackerTitlebarText[1], opt_colors.TrackerTitlebarText[2], opt_colors.TrackerTitlebarText[3]) - end - end - - - -- LAYOUT - local requestOrder = WatchButton.requestOrder - local requestCount = WatchButton.requestCount - local lastShown = nil - for i = 1, requestCount do - -- loop over watch buttons - local button = requestOrder[i] - button:ClearAllPoints() - - -- layout shown buttons - if (lastShown == nil) then - button:SetPoint("TOPLEFT", Tracker.titlebar, "BOTTOMLEFT", 0, -1) - else - if (button.type == "header") or (button.type == "collapser") then - button:SetPoint("TOPLEFT", lastShown, "BOTTOMLEFT", 0, -4) - elseif (lastShown.type == "header") or (lastShown.type == "collapser") then - button:SetPoint("TOPLEFT", lastShown, "BOTTOMLEFT", 0, -3) - else - button:SetPoint("TOPLEFT", lastShown, "BOTTOMLEFT", 0, -2) - end - end - button:Render() - - lastShown = button - end - - if (postCombat) then -- we already check for combat in timer func, no need here - local freePool = WatchButton.freePool - for i = 1, #freePool do - local button = freePool[i] - if (button.itemButton) then - button:RemoveItemButton() - end - end - end - - WatchButton:FreeUnused() - - Tracker:Resize(lastShown) - - QuestKing:PostCheckQuestTracking() - - local hooks = QuestKing.updateHooks - if (#hooks) then - for i = 1, #hooks do - hooks[i]() - end - end - end -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/core/util.lua b/ElvUI_SLE/modules/quests/questking/core/util.lua deleted file mode 100644 index 87b8e77..0000000 --- a/ElvUI_SLE/modules/quests/questking/core/util.lua +++ /dev/null @@ -1,179 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local function Replace() -local QuestKing = _G["QuestKing"] - -local knownTypesTag = { - [0] = "", -- Normal - [1] = "G", -- Group - [21] = "C", -- Class - [41] = "P", -- PVP - [62] = "R", -- Raid - [81] = "D", -- Dungeon - [82] = "V", -- World Event (?) - [83] = "L", -- Legendary - [84] = "E", -- Escort (?) - [85] = "H", -- Heroic - [88] = "R10", -- 10 Player (?) - [89] = "R25", -- 25 Player (?) - [98] = "S", -- Scenario - [102] = "A", -- Account - -- Y = Daily - -- W = Weekly - -- F = Faction (Alliance/Horde) - -- e = Starts event - -- a = Autocomplete -} - -local knownTypesTagFull = { - [0] = "", -- Normal - [1] = GROUP, -- Group - [21] = CLASS, -- Class - [41] = "PvP", -- PVP - [62] = RAID, -- Raid - [81] = TRACKER_HEADER_DUNGEON, -- Dungeon - [82] = "V", -- World Event (?) - [83] = ITEM_QUALITY5_DESC, -- Legendary - [84] = "E", -- Escort (?) - [85] = PLAYER_DIFFICULTY2, -- Heroic - [88] = RAID.."10", -- 10 Player (?) - [89] = RAID.."25", -- 25 Player (?) - [98] = TRACKER_HEADER_SCENARIO, -- Scenario - [102] = "A", -- Account - -- Y = Daily - -- W = Weekly - -- F = Faction (Alliance/Horde) - -- e = Starts event - -- a = Autocomplete -} - -function QuestKing.GetQuestTaggedTitle (questIndex, isBonus) - local questTitle, level, suggestedGroup, _, _, _, frequency, questID, startEvent = GetQuestLogTitle(questIndex) - local questType = GetQuestLogQuestType(questIndex) - -- local questTagID, questTag = GetQuestTagInfo(questID) - - local levelString - local typeTag = knownTypesTag[questType] - local typeTagFull = knownTypesTagFull[questType] - - if (typeTag == nil) then - typeTag = format("|cffff00ff(%d)|r", questType) -- Alert user to unknown tags - end - - -- Add primary tags - if (questType == 1) and (suggestedGroup) and (suggestedGroup > 1) then - -- Group - if E.private.sle.skins.QuestKing.questTypes.group == "DEFAULT" then - levelString = format("%d%s%d", level, typeTag, suggestedGroup) - else - levelString = format("%d %s(%d)", level, typeTagFull, suggestedGroup) - end - elseif (questType == 1) and (suggestedGroup) and (suggestedGroup == 0) then - -- Group - if E.private.sle.skins.QuestKing.questTypes.group == "DEFAULT" then - levelString = format("%d%s", level, typeTag) - else - levelString = format("%d %s", level, typeTagFull) - end - elseif (questType == 102) then - -- Account - local factionGroup = GetQuestFactionGroup(questID) - if (factionGroup) then - levelString = format("%d%s", level, "F") - else - levelString = format("%d %s", level, typeTag) - end - elseif (questType == 62) or (questType == 88) or (questType == 89) then - if E.private.sle.skins.QuestKing.questTypes.raid == "DEFAULT" then - levelString = format("%d%s", level, typeTag) - else - levelString = format("%d %s", level, typeTagFull) - end - elseif (questType == 81) then - if E.private.sle.skins.QuestKing.questTypes.dungeon == "DEFAULT" then - levelString = format("%d%s", level, typeTag) - else - levelString = format("%d %s", level, typeTagFull) - end - elseif (questType == 85) then - if E.private.sle.skins.QuestKing.questTypes.heroic == "DEFAULT" then - levelString = format("%d%s", level, typeTag) - else - levelString = format("%d %s", level, typeTagFull) - end - elseif (questType == 83) then - if E.private.sle.skins.QuestKing.questTypes.legend == "DEFAULT" then - levelString = format("%d%s", level, typeTag) - else - levelString = format("%d %s", level, typeTagFull) - end - elseif (questType == 98) then - if E.private.sle.skins.QuestKing.questTypes.scenario == "DEFAULT" then - levelString = format("%d%s", level, typeTag) - else - levelString = format("%d %s", level, typeTagFull) - end - elseif (questType > 0) then - -- Other types - levelString = format("%d%s", level, typeTag) - else - -- Normal - levelString = tostring(level) - end - - -- Extra tags - local hasIcon = false - local icon = "" - if (frequency == LE_QUEST_FREQUENCY_DAILY) then - if E.private.sle.skins.QuestKing.questTypes.daily == "DEFAULT" then - levelString = format("%sY", levelString) - elseif E.private.sle.skins.QuestKing.questTypes.daily == "FULL" then - levelString = format("%s "..DAILY, levelString) - else - hasIcon = true - icon = "|T"..QK.Icons["Daily"]..":14|t" - end - elseif (frequency == LE_QUEST_FREQUENCY_WEEKLY) then - if E.private.sle.skins.QuestKing.questTypes.weekly == "DEFAULT" then - levelString = format("%sW", levelString) - elseif E.private.sle.skins.QuestKing.questTypes.weekly == "FULL" then - levelString = format("%s "..WEEKLY, levelString) - else - hasIcon = true - icon = "|T"..QK.Icons["Weekly"]..":14|t" - end - -- levelString = format("%s Weekly", levelString) - end - - if (startEvent) then - levelString = format("%se", levelString) - end - - if (GetQuestLogIsAutoComplete(questIndex)) and (not isBonus) then - levelString = format("%sa", levelString) - end - - -- Return - if (isBonus) then - questTitle = gsub(questTitle, BONUS_OBJECTIVE_BANNER..": ", "") - if hasIcon then - return format("%s[%s] %s", icon, levelString, questTitle), level - else - return format("[%s] %s", levelString, questTitle), level - end - else - if hasIcon then - return format("%s[%s] %s", icon, levelString, questTitle) - else - return format("[%s] %s", levelString, questTitle) - end - end -end - -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/load_questking.xml b/ElvUI_SLE/modules/quests/questking/load_questking.xml deleted file mode 100644 index 7949909..0000000 --- a/ElvUI_SLE/modules/quests/questking/load_questking.xml +++ /dev/null @@ -1,14 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file='questking.lua'/> - <Script file='core\util.lua'/> - <Script file='ui\rewardsframe.lua'/> - <Script file='ui\timerbar.lua'/> - <Script file='ui\progressbar.lua'/> - <Script file='ui\tracker.lua'/> - <Script file='buttons\quest.lua'/> - <Script file='buttons\scenario.lua'/> - <Script file='buttons\achievement.lua'/> - <Script file='buttons\challengetimer.lua'/> - <Script file='buttons\bonusobjective.lua'/> - <Script file='core\core.lua'/> -</Ui> \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/questking.lua b/ElvUI_SLE/modules/quests/questking/questking.lua deleted file mode 100644 index e9aef75..0000000 --- a/ElvUI_SLE/modules/quests/questking/questking.lua +++ /dev/null @@ -1,35 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:NewModule("QuestKingSkinner", "AceEvent-3.0") - -QK.Replaces = {} -QK.Icons = { - ["Achievement_small"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Achievement_small]], - ["Daily"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Daily]], - ["Factions"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Factions]], - ["Flightmaster"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Flightmaster]], - ["Legendary"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Legendary]], - ["LFG"] = [[Interface\LFGFRAME\BattlenetWorking0]], - ["Portal_Blue"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Portal_Blue]], - ["Portal_Red"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Portal_Red]], - ["Quest"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Quest]], - ["Raid"] = [[Interface\LFGFRAME\UI-LFR-PORTRAIT]], - ["Skull"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Skull]], - ["Skull_Event"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Skull_Event]], - ["Swords"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Swords]], - ["Swords_Event"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Swords_Event]], - ["Weekly"] = [[Interface\AddOns\ElvUI_SLE\media\textures\Weekly]], -} - -local function StartReplacement() - if #QK.Replaces == 0 then E:Delay(1, function() StartReplacement() return end) end - for i = 1, #QK.Replaces do - QK.Replaces[i]() - end -end - -function QK:Initialize() - if not E.private.sle.skins.QuestKing.enable or not SLE._Compatibility["QuestKing"] then return end - StartReplacement() -end - -SLE:RegisterModule(QK:GetName()) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/ui/progressbar.lua b/ElvUI_SLE/modules/quests/questking/ui/progressbar.lua deleted file mode 100644 index 61af603..0000000 --- a/ElvUI_SLE/modules/quests/questking/ui/progressbar.lua +++ /dev/null @@ -1,181 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local classColor = RAID_CLASS_COLORS[E.myclass] -local progressBarPool = {} -QK.numProgressBars = 0 -local freeProgressBar - -local function Replace() - local QuestKing = _G["QuestKing"] - local opt = QuestKing.options - local opt_buttonWidth = opt.buttonWidth - local opt_lineHeight = opt.lineHeight - local opt_itemButtonScale = opt.itemButtonScale - local opt_font = opt.font - local opt_fontSize = opt.fontSize - local opt_fontStyle = opt.fontStyle - - local function SetProgressBarsColor(progressBar) - local COLOR - if E.private.sle.skins.objectiveTracker.class then - COLOR = classColor - else - COLOR = E.private.sle.skins.objectiveTracker.color - end - progressBar:SetStatusBarColor(COLOR.r, COLOR.g, COLOR.b) - end - - function freeProgressBar (self) - self:Hide() - self:ClearAllPoints() - - self.baseLine.progressBar = nil - self.baseLine = nil - self.baseButton = nil - - self._lastPercent = nil - - T.tinsert(progressBarPool, self) - end - - function QuestKing.WatchButton:AddProgressBar(duration, startTime) - local line = self:AddLine() - local progressBar = line.progressBar - - if (not progressBar) then - if (#progressBarPool > 0) then - progressBar = tremove(progressBarPool) - else - QK.numProgressBars = QK.numProgressBars + 1 - - progressBar = CreateFrame("StatusBar", "QuestKing_ProgressBar"..QK.numProgressBars, QuestKing.Tracker) - progressBar:SetStatusBarTexture(E.LSM:Fetch('statusbar', E.private.sle.skins.objectiveTracker.texture)) - progressBar:GetStatusBarTexture():SetHorizTile(false) - SetProgressBarsColor(progressBar) - progressBar:SetMinMaxValues(0, 100) - progressBar:SetValue(100) - progressBar:SetWidth(opt_buttonWidth - 36) - progressBar:SetHeight(15) - progressBar:CreateBackdrop("Transparent") - progressBar.sle_skinned = true - - local text = progressBar:CreateFontString(nil, "OVERLAY") - text:SetFont(opt_font, opt_fontSize - 1, opt_fontStyle) - text:SetJustifyH("CENTER") - text:SetJustifyV("CENTER") - - text:SetPoint("TOPLEFT", progressBar, "TOPLEFT", 0, 0) - text:SetPoint("BOTTOMRIGHT", progressBar, "BOTTOMRIGHT", 0, 2) - - text:SetTextColor(1, 1, 1) - text:SetShadowOffset(1, -1) - text:SetShadowColor(0, 0, 0, 1) - text:SetWordWrap(false) - text:SetVertexColor(0.8, 0.8, 0.8) - text:SetText("0%") - progressBar.text = text - - local glow = progressBar:CreateTexture(nil, "OVERLAY") - glow:SetPoint("RIGHT", progressBar, "LEFT", 0, 0) - glow:SetWidth(5) - glow:SetHeight(progressBar:GetHeight() - 4) - glow:SetTexture([[Interface\AddOns\QuestKing\textures\Full-Line-Glow-White]]) - glow:SetVertexColor(0.6, 0.8, 1, 0) - glow:SetBlendMode("ADD") - progressBar.glow = glow - - local animGroup = glow:CreateAnimationGroup() - local a0 = animGroup:CreateAnimation("Alpha") - a0:SetStartDelay(0); a0:SetChange(1); a0:SetDuration(0.25); a0:SetOrder(1); - local a1 = animGroup:CreateAnimation("Alpha") - a1:SetStartDelay(0.3); a1:SetChange(-1); a1:SetDuration(0.2); a1:SetOrder(1); - glow.animGroup = animGroup - - local topLineBurst = progressBar:CreateTexture(nil, "OVERLAY") - topLineBurst:SetPoint("CENTER", glow, "TOP", -3, 0) - topLineBurst:SetWidth(progressBar:GetWidth() * 0.6) - topLineBurst:SetHeight(8) - topLineBurst:SetTexture([[Interface\QuestFrame\ObjectiveTracker]]) - topLineBurst:SetTexCoord(0.1640625, 0.33203125, 0.66796875, 0.74609375) - topLineBurst:SetVertexColor(0.6, 0.8, 1, 0) - topLineBurst:SetBlendMode("ADD") - progressBar.topLineBurst = topLineBurst - - local animGroup = topLineBurst:CreateAnimationGroup() - local a0 = animGroup:CreateAnimation("Alpha") - a0:SetStartDelay(0); a0:SetChange(1); a0:SetDuration(0.25); a0:SetOrder(1); - local a1 = animGroup:CreateAnimation("Alpha") - a1:SetStartDelay(0.3); a1:SetChange(-1); a1:SetDuration(0.2); a1:SetOrder(1); - local a2 = animGroup:CreateAnimation("Translation") - a2:SetStartDelay(0); a2:SetOffset(5, 0); a2:SetDuration(0.25); a2:SetOrder(1); - topLineBurst.animGroup = animGroup - - local bottomLineBurst = progressBar:CreateTexture(nil, "OVERLAY") - bottomLineBurst:SetPoint("CENTER", glow, "BOTTOM", -3, 0) - bottomLineBurst:SetWidth(progressBar:GetWidth() * 0.6) - bottomLineBurst:SetHeight(8) - bottomLineBurst:SetTexture([[Interface\QuestFrame\ObjectiveTracker]]) - bottomLineBurst:SetTexCoord(0.1640625, 0.33203125, 0.66796875, 0.74609375) - bottomLineBurst:SetVertexColor(0.6, 0.8, 1, 0) - bottomLineBurst:SetBlendMode("ADD") - progressBar.bottomLineBurst = bottomLineBurst - - local animGroup = bottomLineBurst:CreateAnimationGroup() - local a0 = animGroup:CreateAnimation("Alpha") - a0:SetStartDelay(0); a0:SetChange(1); a0:SetDuration(0.25); a0:SetOrder(1); - local a1 = animGroup:CreateAnimation("Alpha") - a1:SetStartDelay(0.3); a1:SetChange(-1); a1:SetDuration(0.2); a1:SetOrder(1); - local a2 = animGroup:CreateAnimation("Translation") - a2:SetStartDelay(0); a2:SetOffset(5, 0); a2:SetDuration(0.25); a2:SetOrder(1); - bottomLineBurst.animGroup = animGroup - - local pulse = progressBar:CreateTexture(nil, "OVERLAY") - pulse:SetAllPoints(progressBar) - pulse:SetTexture([[Interface\QuestFrame\UI-QuestLogTitleHighlight]]) - pulse:SetVertexColor(0.6, 0.8, 1, 0) - pulse:SetBlendMode("ADD") - progressBar.pulse = pulse - - local animGroup = pulse:CreateAnimationGroup() - local a1 = animGroup:CreateAnimation("Alpha") - a1:SetStartDelay(0); a1:SetDuration(0.25); a1:SetChange(1); a1:SetOrder(1); - local a2 = animGroup:CreateAnimation("Alpha") - a2:SetStartDelay(0.3); a2:SetDuration(0.2); a2:SetChange(-1); a2:SetOrder(1); - pulse.animGroup = animGroup - - progressBar.Free = freeProgressBar - progressBar.SetPercent = setPercent - end - - line.progressBar = progressBar - line.progressBarText = progressBarText - - progressBar.baseButton = self - progressBar.baseLine = line - - progressBar._lastPercent = nil - - progressBar:SetPoint("TOPLEFT", line, "TOPLEFT", 16, -3) - progressBar:Show() - end - - return progressBar - end - - for i = 1, 3 do - local progressBar = _G["QuestKing_ProgressBar"..i] - if progressBar and not progressBar.sle_skinned then - progressBar:StripTextures() - progressBar:SetStatusBarTexture(E.LSM:Fetch('statusbar', E.private.sle.skins.objectiveTracker.texture)) - progressBar:SetWidth(opt_buttonWidth - 36) - SetProgressBarsColor(progressBar) - progressBar:CreateBackdrop("Transparent") - end - end -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/ui/rewardsframe.lua b/ElvUI_SLE/modules/quests/questking/ui/rewardsframe.lua deleted file mode 100644 index 6472de8..0000000 --- a/ElvUI_SLE/modules/quests/questking/ui/rewardsframe.lua +++ /dev/null @@ -1,191 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local function Replace() - local QuestKing = _G["QuestKing"] - local rewardQueue = {} - local animatingData - - function QuestKing:AddReward (button, questID, xp, money) - local data = {} - data.button = button - data.questID = questID - - -- save all the rewards - data.rewards = {} - - -- xp - if ((not xp) and (questID)) then - xp = GetQuestLogRewardXP(questID) - end - - if ((xp) and (xp > 0) and (UnitLevel("player") < MAX_PLAYER_LEVEL)) then - local t = {} - t.label = xp - t.texture = "Interface\\Icons\\XP_Icon" - t.count = 0 - t.font = "NumberFontNormal" - tinsert(data.rewards, t) - end - - if (questID) then - -- currencies - local numCurrencies = GetNumQuestLogRewardCurrencies(questID) - for i = 1, numCurrencies do - local name, texture, count = GetQuestLogRewardCurrencyInfo(i, questID) - local t = {} - t.label = name - t.texture = texture - t.count = count - t.font = "GameFontHighlightSmall" - tinsert(data.rewards, t) - end - - -- items - local numItems = GetNumQuestLogRewards(questID) - for i = 1, numItems do - local name, texture, count, quality, isUsable = GetQuestLogRewardInfo(i, questID) - local t = { } - t.label = name - t.texture = texture - t.count = count - t.font = "GameFontHighlightSmall" - tinsert(data.rewards, t) - end - end - - -- money - if ((not money) and (questID)) then - money = GetQuestLogRewardMoney(questID) - end - if (money) and (money > 0) then - local t = {} - t.label = GetMoneyString(money) - t.texture = "Interface\\Icons\\inv_misc_coin_01" - t.count = 0 - t.font = "GameFontHighlight" - tinsert(data.rewards, t) - end - - -- try to play it - if (#data.rewards > 0) then - tinsert(rewardQueue, data) - QuestKing:AnimateReward() - elseif (questID) then - C_Timer.After(10, function () - QuestKing:ClearDummyTask(questID) - QuestKing:UpdateTracker() - end) - end - end - - local function IsFramePositionedLeft(frame) - local x = frame:GetCenter() - local screenWidth = GetScreenWidth() - local screenHeight = GetScreenHeight() - local positionedLeft = false - - if x and x < (screenWidth / 2) then - positionedLeft = true; - end - - return positionedLeft; - end - - function QuestKing:AnimateReward (block) - local rewardsFrame = QuestKing_RewardsFrame - - if (rewardsFrame.Anim:IsPlaying()) then - return - end - - if (#rewardQueue == 0) then - rewardsFrame:Hide() - return - end - - local data = tremove(rewardQueue, 1) - animatingData = data - - local button = data.button - if ((not button) or (not button:IsVisible())) then - button = QuestKing.Tracker - data.button = button - end - - -- rewardsFrame:SetParent(button) - rewardsFrame:ClearAllPoints() - -- rewardsFrame:SetPoint("TOPRIGHT", button, "TOPLEFT", 10, -4) - local scale = QuestKing.Tracker:GetScale() - - if E.db.general.bonusObjectivePosition == "RIGHT" or (E.db.general.bonusObjectivePosition == "AUTO" and IsFramePositionedLeft(ObjectiveTrackerFrame)) then - rewardsFrame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", button:GetRight() * scale - 10, button:GetTop() * scale + 0) - else - rewardsFrame:SetPoint("TOPRIGHT", UIParent, "BOTTOMLEFT", button:GetLeft() * scale + 10, button:GetTop() * scale + 0) - end - rewardsFrame:Show() - - local numRewards = #data.rewards - local contentsHeight = 12 + numRewards * 36 - - rewardsFrame.Anim.RewardsBottomAnim:SetOffset(0, -contentsHeight) - rewardsFrame.Anim.RewardsShadowAnim:SetToScale(0.8, contentsHeight / 16) - rewardsFrame.Anim:Play() - - PlaySoundKitID(45142) --UI_BonusEventSystemVignettes - - -- configure reward frames - for i = 1, numRewards do - local rewardItem = rewardsFrame.Rewards[i] - if (not rewardItem) then - rewardItem = CreateFrame("FRAME", nil, rewardsFrame, "QuestKing_RewardTemplate") - rewardItem:SetPoint("TOPLEFT", rewardsFrame.Rewards[i-1], "BOTTOMLEFT", 0, -4) - end - - local rewardData = data.rewards[i] - if (rewardData.count > 1) then - rewardItem.Count:Show() - rewardItem.Count:SetText(rewardData.count) - else - rewardItem.Count:Hide() - end - - rewardItem.Label:SetFontObject(rewardData.font) - rewardItem.Label:SetText(rewardData.label) - rewardItem.ItemIcon:SetTexture(rewardData.texture) - rewardItem:Show() - - if (rewardItem.Anim:IsPlaying()) then - rewardItem.Anim:Stop() - end - - rewardItem.Anim:Play() - end - - -- hide unused reward items - for i = numRewards + 1, #rewardsFrame.Rewards do - rewardsFrame.Rewards[i]:Hide() - end - end - - function QuestKing_OnAnimateRewardDone() - local completedData = animatingData - if (completedData.questID) then - local questID = completedData.questID - C_Timer.After(3, function () - QuestKing:ClearDummyTask(questID) - QuestKing:UpdateTracker() - end) - end - - animatingData = nil - QuestKing:AnimateReward() - end - - QuestKing_RewardsFrame.Anim:SetScript("OnFinished", QuestKing_OnAnimateRewardDone) -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/ui/timerbar.lua b/ElvUI_SLE/modules/quests/questking/ui/timerbar.lua deleted file mode 100644 index ac5fc38..0000000 --- a/ElvUI_SLE/modules/quests/questking/ui/timerbar.lua +++ /dev/null @@ -1,123 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local classColor = RAID_CLASS_COLORS[E.myclass] - --- local functions -local freeTimerBar -local timerBarPool = {} -local numTimerBars = 0 -local timerBar_OnUpdate - -local function Replace() - local QuestKing = _G["QuestKing"] - local GetTimeStringFromSecondsShort = QuestKing.GetTimeStringFromSecondsShort - local opt = QuestKing.options - local opt_buttonWidth = opt.buttonWidth - local opt_lineHeight = opt.lineHeight - local opt_itemButtonScale = opt.itemButtonScale - local opt_font = opt.font - local opt_fontSize = opt.fontSize - local opt_fontStyle = opt.fontStyle - - local function SetProgressBarsColor(timerBar) - local COLOR - if E.private.sle.skins.objectiveTracker.class then - COLOR = classColor - else - COLOR = E.private.sle.skins.objectiveTracker.color - end - timerBar:SetStatusBarColor(COLOR.r, COLOR.g, COLOR.b) - end - - function freeTimerBar (self) - self:Hide() - self:ClearAllPoints() - - self.baseLine.timerBar = nil - self.baseLine = nil - self.baseButton = nil - - tinsert(timerBarPool, self) - end - - function timerBar_OnUpdate(self, elapsed) - local timeNow = GetTime() - local timeRemaining = self.duration - (timeNow - self.startTime) - self:SetValue(timeRemaining) - - if (timeRemaining < 0) then - -- hold at 0 for a moment - if (timeRemaining > -0.5) then - timeRemaining = 0 - else - QuestKing:UpdateTracker() - return - end - end - - self.text:SetText(GetTimeStringFromSecondsShort(timeRemaining)) - -- self.text:SetTextColor(ObjectiveTrackerTimerBar_GetTextColor(self.duration, self.duration - timeRemaining)); - end - - function QuestKing.WatchButton:AddTimerBar (duration, startTime) - local line = self:AddLine() - local timerBar = line.timerBar - - if (not timerBar) then - if (#timerBarPool > 0) then - timerBar = tremove(timerBarPool) - else - numTimerBars = numTimerBars + 1 - - timerBar = CreateFrame("StatusBar", "QuestKing_TimerBar"..numTimerBars, QuestKing.Tracker) - timerBar:SetStatusBarTexture(E.LSM:Fetch('statusbar', E.private.sle.skins.objectiveTracker.texture)) - timerBar:GetStatusBarTexture():SetHorizTile(false) - SetProgressBarsColor(timerBar) - timerBar:SetMinMaxValues(0, 100) - timerBar:SetValue(100) - timerBar:SetWidth(opt_buttonWidth - 36) - timerBar:SetHeight(15) - timerBar:CreateBackdrop("Transparent") - -- timerBar.sle_skinned = true - - local text = timerBar:CreateFontString(nil, "OVERLAY") - text:SetFont(opt_font, opt_fontSize, opt_fontStyle) - text:SetJustifyH("CENTER") - text:SetJustifyV("CENTER") - text:SetAllPoints(true) - text:SetTextColor(1, 1, 1) - text:SetShadowOffset(1, -1) - text:SetShadowColor(0, 0, 0, 1) - text:SetWordWrap(false) - text:SetText("0:00") - timerBar.text = text - - timerBar:SetScript("OnUpdate", timerBar_OnUpdate) - - timerBar.Free = freeTimerBar - end - - line.timerBar = timerBar - line.timerBarText = timerBarText - - timerBar.baseButton = self - timerBar.baseLine = line - - timerBar:SetPoint("TOPLEFT", line, "TOPLEFT", 16, -3) - timerBar:Show() - end - - timerBar:SetMinMaxValues(0, duration) - timerBar.duration = duration - timerBar.startTime = startTime - timerBar.block = block - - return timerBar - end -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/ui/tracker.lua b/ElvUI_SLE/modules/quests/questking/ui/tracker.lua deleted file mode 100644 index 0a9ef99..0000000 --- a/ElvUI_SLE/modules/quests/questking/ui/tracker.lua +++ /dev/null @@ -1,29 +0,0 @@ -local SLE, T, E, L, V, P, G = unpack(select(2, ...)) -local QK = SLE:GetModule("QuestKingSkinner") -local _G = _G - -if not SLE._Compatibility["QuestKing"] then return end - -local function Replace() - local QuestKing = _G["QuestKing"] - local Tracker = QuestKing.Tracker - function Tracker:ToggleDrag() - DEFAULT_CHAT_FRAME:AddMessage(T.format("|cff99ccffQuestKing|cff6090ff:|r This option is no longer available")) - return true - end - - function Tracker:CheckDrag() - self.titlebarText2:Hide() - self:EnableMouse(false) - self:SetMovable(false) - self:RegisterForDrag() - self:SetScript("OnDragStart", nil) - self:SetScript("OnDragStop", nil) - end - - Tracker.titlebar:ClearAllPoints() - Tracker.titlebar:SetPoint("TOP", ObjectiveFrameHolder) - Tracker:CheckDrag() -end - -T.tinsert(QK.Replaces, Replace) \ No newline at end of file diff --git a/ElvUI_SLE/modules/quests/questking/ui/watchbutton.lua b/ElvUI_SLE/modules/quests/questking/ui/watchbutton.lua deleted file mode 100644 index e69de29..0000000