Skip to content

Commit

Permalink
Quests with no reputation reward won't show the reputation icon, won'…
Browse files Browse the repository at this point in the history
…t be counter toward quests of the faction.
  • Loading branch information
Tercioo committed Aug 26, 2024
1 parent ec9113d commit 241a155
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 37 deletions.
8 changes: 6 additions & 2 deletions WorldQuestTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1161,9 +1161,13 @@ function SlashCmdList.WQTRACKER (msg, editbox)
return

elseif (msg == "info") then
local widget = GetMouseFocus()
--local widget = GetMouseFocus()
---@type uiobject[]
local uiObjects = GetMouseFoci()

if (uiObjects and uiObjects[1]) then
local widget = uiObjects[1]

if (widget) then
local info = {}

--quest info
Expand Down
12 changes: 9 additions & 3 deletions WorldQuestTracker_Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2381,14 +2381,20 @@ WorldQuestTracker.OnToggleWorldMap = function(self)
--play quick flash on squares showing quests of this faction
for _, widget in ipairs(WorldQuestTracker.WorldSummaryQuestsSquares) do
if (widget.FactionID == self.MyObject.FactionID) then
widget.LoopFlash:Play()
local bAwardReputation = C_QuestLog.DoesQuestAwardReputationWithFaction(widget.questID, factionID)
if (bAwardReputation) then
widget.LoopFlash:Play()
end
end
end

--play quick flash on widgets shown in the world map(quest locations)
for questCounter, button in pairs(WorldQuestTracker.WorldMapSmallWidgets) do
if (button.FactionID == self.MyObject.FactionID) then
button.FactionPulseAnimation:Play()
local bAwardReputation = C_QuestLog.DoesQuestAwardReputationWithFaction(button.questID, factionID)
if (bAwardReputation) then
button.FactionPulseAnimation:Play()
end
end
end

Expand Down Expand Up @@ -3476,7 +3482,7 @@ WorldQuestTracker.OnToggleWorldMap = function(self)
button.Text = button:CreateFontString(nil, "overlay", "GameFontNormal")
button.Text:SetText(name)

WorldQuestTracker:SetFontSize(button.Text, 10)
WorldQuestTracker:SetFontSize(button.Text, 11)
WorldQuestTracker:SetFontColor(button.Text, "orange")
button.Text:SetPoint("center")

Expand Down
10 changes: 5 additions & 5 deletions WorldQuestTracker_OptionsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
WorldQuestTracker.SetSetting("use_old_icons", not WorldQuestTracker.db.profile.use_old_icons)
end,
name = "S_MAPBAR_OPTIONSMENU_EQUIPMENTICONS",
desc = "S_MAPBAR_OPTIONSMENU_EQUIPMENTICONS",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 49 .. ":" .. 87 .. ":0:0:256:256:" .. (0) .. ":" .. (87) .. ":" .. (131) .. ":" .. (131+49) .. "|t"
},
{
type = "toggle",
Expand All @@ -598,7 +598,7 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
DB.profile.close_blizz_popups.ABANDON_QUEST = value
end,
name = "S_OPTTIONS_AUTOACCEPT_ABANDONQUEST",
desc = "S_OPTTIONS_AUTOACCEPT_ABANDONQUEST_DESC",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 36 .. ":" .. 173 .. ":0:0:256:256:" .. (80) .. ":" .. (253) .. ":" .. (0) .. ":" .. (36) .. "|t"
},
{
type = "toggle",
Expand All @@ -609,7 +609,7 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
DB.profile.numerate_quests = value
end,
name = "S_OPTTIONS_NUMERATE_QUEST",
desc = "S_OPTTIONS_NUMERATE_QUEST_DESC",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 90 .. ":0:0:256:256:" .. (0) .. ":" .. (90) .. ":" .. (100) .. ":" .. (130) .. "|t"
},

{type = "blank"},
Expand All @@ -628,7 +628,7 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
WorldQuestTracker.SetSetting("pathdots", "enabled", value)
end,
name = "S_ENABLE",
desc = "S_ENABLE",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 30 .. ":" .. 134 .. ":0:0:256:256:" .. (91) .. ":" .. (225) .. ":" .. (100) .. ":" .. (130) .. "|t"
},

{type = "blank"},
Expand Down Expand Up @@ -732,7 +732,7 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()

end,
name = "S_OPTIONS_SHOWFACTIONS",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 33 .. ":" .. 208 .. ":0:0:256:256:" .. (0) .. ":" .. (208) .. ":" .. (36+30) .. ":" .. (36+30+33) .. "|t\n\n" .. "S_OPTIONS_SHOWFACTIONS",
desc = "|TInterface\\AddOns\\WorldQuestTracker\\media\\options_visibility_context:" .. 33 .. ":" .. 208 .. ":0:0:256:256:" .. (0) .. ":" .. (208) .. ":" .. (36+30) .. ":" .. (36+30+33) .. "|t",
},
{
type = "toggle",
Expand Down
6 changes: 6 additions & 0 deletions WorldQuestTracker_WorldMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,12 @@ function WorldQuestTracker.UpdateWorldWidget(widget, questID, numObjectives, map
widget.IsCriteria = isCriteria
widget.TimeLeft = timeLeft

local bAwardReputation = C_QuestLog.DoesQuestAwardReputationWithFaction(questID, factionID)
if (not bAwardReputation) then
widget.FactionID = nil
factionID = nil
end

if (isArtifact) then
artifactPowerIcon = WorldQuestTracker.GetArtifactPowerIcon(isArtifact, true, questID)
widget.isArtifact = isArtifact
Expand Down
16 changes: 15 additions & 1 deletion WorldQuestTracker_ZoneMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,21 @@ function WorldQuestTracker.SetupZoneSummaryButton(summaryWidget, zoneWidget)
summaryWidget.timeLeftText:SetJustifyH("center")
summaryWidget.timeLeftText:Show()

summaryWidget.factionIcon:SetTexture(WorldQuestTracker.MapData.FactionIcons [widget.FactionID]) --faction texture
local factionID = widget.FactionID
if (factionID) then
local factionTexture = WorldQuestTracker.MapData.FactionIcons[factionID]
if (factionTexture) then
--check if this quest is realy giving reputation
local bAwardReputation = C_QuestLog.DoesQuestAwardReputationWithFaction(questID, factionID)
if (bAwardReputation) then
summaryWidget.factionIcon:SetTexture(factionTexture)
end
else
summaryWidget.factionIcon:SetTexture("")
end
else
summaryWidget.factionIcon:SetTexture("")
end

summaryWidget:Show()
end
Expand Down
38 changes: 21 additions & 17 deletions libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 563
local dversion = 565
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -1840,12 +1840,14 @@ function DF:GetAllTalents()
local borderTypes = Enum.TraitNodeEntryType
if (traitEntryInfo.type) then -- == borderTypes.SpendCircle
local definitionId = traitEntryInfo.definitionID
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
if (spellName) then
local talentInfo = {Name = spellName, ID = spellId, Texture = spellTexture, IsSelected = (activeEntry and activeEntry.rank and activeEntry.rank > 0) or false}
allTalents[#allTalents+1] = talentInfo
if definitionId then
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
if (spellName) then
local talentInfo = {Name = spellName, ID = spellId, Texture = spellTexture, IsSelected = (activeEntry and activeEntry.rank and activeEntry.rank > 0) or false}
allTalents[#allTalents+1] = talentInfo
end
end
end
end
Expand Down Expand Up @@ -4889,16 +4891,18 @@ function DF:GetCharacterTalents(bOnlySelected, bOnlySelectedHash)

if (traitEntryInfo.type) then -- == borderTypes.SpendCircle
local definitionId = traitEntryInfo.definitionID
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
local bIsSelected = (activeEntry and activeEntry.rank and activeEntry.rank > 0) or false
if (spellName and bIsSelected) then
local talentInfo = {Name = spellName, ID = spellId, Texture = spellTexture, IsSelected = true}
if (bOnlySelectedHash) then
talentList[spellId] = talentInfo
else
table.insert(talentList, talentInfo)
if definitionId then
local traitDefinitionInfo = C_Traits.GetDefinitionInfo(definitionId)
local spellId = traitDefinitionInfo.overriddenSpellID or traitDefinitionInfo.spellID
local spellName, _, spellTexture = GetSpellInfo(spellId)
local bIsSelected = (activeEntry and activeEntry.rank and activeEntry.rank > 0) or false
if (spellName and bIsSelected) then
local talentInfo = {Name = spellName, ID = spellId, Texture = spellTexture, IsSelected = true}
if (bOnlySelectedHash) then
talentList[spellId] = talentInfo
else
table.insert(talentList, talentInfo)
end
end
end
end
Expand Down
16 changes: 9 additions & 7 deletions libs/DF/icon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,19 @@ detailsFramework.IconMixin = {
--iconFrame.Border:SetColorTexture(0, 0, 0, 1)

if (startTime) then
CooldownFrame_Set(iconFrame.Cooldown, startTime, duration, true, true, modRate)
local now = GetTime()

iconFrame.timeRemaining = (startTime + duration - now) / (modRate or 1)
iconFrame.expirationTime = startTime + duration

if iconFrame.timeRemaining > 0 then
CooldownFrame_Set(iconFrame.Cooldown, startTime, duration, true, true, modRate)
end

if (self.options.show_text) then
iconFrame.CountdownText:Show()

local now = GetTime()

iconFrame.timeRemaining = (startTime + duration - now) / modRate
iconFrame.expirationTime = startTime + duration

local formattedTime = (iconFrame.timeRemaining > 0) and self.options.decimal_timer and iconFrame.parentIconRow.FormatCooldownTimeDecimal(iconFrame.timeRemaining) or iconFrame.parentIconRow.FormatCooldownTime(iconFrame.timeRemaining) or ""
local formattedTime = (iconFrame.timeRemaining > 0) and (self.options.decimal_timer and iconFrame.parentIconRow.FormatCooldownTimeDecimal(iconFrame.timeRemaining) or iconFrame.parentIconRow.FormatCooldownTime(iconFrame.timeRemaining)) or ""
iconFrame.CountdownText:SetText(formattedTime)

iconFrame.CountdownText:SetPoint(self.options.text_anchor or "center", iconFrame, self.options.text_rel_anchor or "center", self.options.text_x_offset or 0, self.options.text_y_offset or 0)
Expand Down
2 changes: 0 additions & 2 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@ L["S_SPEEDRUN_AUTO_COMPLETE"] = "Auto Complete Quests"
L["S_SPEEDRUN_CANCEL_CINEMATIC"] = "Auto Skip Cinematics"

L["S_OPTTIONS_NUMERATE_QUEST"] = "Enumerate Quests"
L["S_OPTTIONS_NUMERATE_QUEST_DESC"] = "Show a number for each quest in the map frame and in the objective tracker."

L["S_OPTTIONS_AUTOACCEPT_ABANDONQUEST"] = "Auto Accept Abandon Quests"
L["S_OPTTIONS_AUTOACCEPT_ABANDONQUEST_DESC"] = "Don't show the confirmation dialog when abandoning a quest."

L["S_TRACKEROPTIONS_BACKGROUNDALPHA"] = "Background Alpha"

Expand Down
Binary file modified media/options_visibility_context.tga
Binary file not shown.

0 comments on commit 241a155

Please sign in to comment.