Skip to content

Commit

Permalink
General Updates (see commit information)
Browse files Browse the repository at this point in the history
- Added 'Show Factions', toggles the list of factions in the world map.
- Fixed an issue with the options panel, where the title bar was too big.
- Fixed the Dragon Isles map, where it was showing Zaralek Cavers quests mixed with the regular quests of the 4 maps.
- Fixed an issue with some indicators not respecting the alpha set at the options panel.
  • Loading branch information
Tercioo committed Dec 19, 2023
1 parent f65323a commit 5da94ca
Show file tree
Hide file tree
Showing 20 changed files with 1,603 additions and 1,412 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ locales/zhTW.lua
api.lua
*.png
media/options_visibility_context.afphoto~lock~
luac.out
41 changes: 41 additions & 0 deletions Vignette Extra Icons.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[zoneIDs.EMERALDDREAM] = {
{
dataType = "vignette",
id = 5971,
texture = "SeedPlanting-Full",
filterFunc = function() return true end, --this function is called before the icon is added to the map
tooltipFunc = function()end, --called on OnEnter
amountFunc = function()end, --called to se the number which goes bellow the icon
onAddFunc = function()end, --called when the icon is added to the map
onRemoveFunc = function()end, --called when the icon is removed from the map
}
},


--[=[
[1] = {
["widgetSetID"] = 1005,
["atlasName"] = "SeedPlanting-Full",
["hasTooltip"] = true,
["onMinimap"] = false,
["rewardQuestID"] = 0,
["type"] = 0,
["isDead"] = false,
["objectGUID"] = "Creature-0-3020-2548-66-209880-00005006E7",
["addPaddingAboveWidgets"] = true,
["onWorldMap"] = true,
["name"] = "Emerald Bounty",
["vignetteGUID"] = "Vignette-0-3020-2548-66-5971-00005006E7",
["vignetteID"] = 5971,
["inFogOfWar"] = false,
["isUnique"] = true,
["zoneInfiniteAOI"] = true,
},
--]=]




/run LFGListFrame.ApplicationViewer.InfoBackground
/run LFGListFrame.SearchPanel:Show()
/run LFGListFrame.ApplicationViewer:Hide()
4 changes: 4 additions & 0 deletions WorldQuestTracker_IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ WorldQuestTracker.mapTables = {
},
}

WorldQuestTracker.extraIcons = {

}

WorldQuestTracker.MapData.EquipmentIcons = {
["INVTYPE_HEAD"] = "Interface\\ICONS\\" .. "INV_Helmet_29",
["INVTYPE_NECK" ] = "Interface\\ICONS\\" .. "INV_Jewelry_Necklace_07",
Expand Down
25 changes: 13 additions & 12 deletions WorldQuestTracker_OptionsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -505,18 +505,6 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
name = "S_OPTIONS_MAPFRAME_ALIGN",
desc = "S_OPTIONS_MAPFRAME_ALIGN",
},
{
type = "toggle",
get = function()
return DB.profile.show_faction_frame
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("show_faction_frame", not WorldQuestTracker.db.profile.show_faction_frame)

end,
name = "S_OPTIONS_SHOWFACTIONS",
desc = "S_OPTIONS_SHOWFACTIONS",
},
{
type = "toggle",
get = function()
Expand Down Expand Up @@ -707,6 +695,19 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
get = function() return "S_VISIBILITY" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},

{
type = "toggle",
get = function()
return DB.profile.show_faction_frame
end,
set = function(self, fixedparam, value)
WorldQuestTracker.SetSetting("show_faction_frame", not WorldQuestTracker.db.profile.show_faction_frame)

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",
},
{
type = "toggle",
get = function()
Expand Down
13 changes: 13 additions & 0 deletions WorldQuestTracker_WorldMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,19 @@ local scheduledIconUpdate = function(questTable)
WorldQuestTracker.SetupWorldQuestButton(button, worldQuestType, rarity, isElite, tradeskillLineIndex, nil, nil, isCriteria, nil, mapID)

local newX, newY = HereBeDragons:TranslateZoneCoordinates(x, y, mapID, WorldMapFrame.mapID, false)

if (mapID == WorldQuestTracker.MapData.ZoneIDs.ZARALEK) then
if (x and y) then --no zaralek mapID, but zaralek quests shown on worldmap
newX = 0.75 + x * 0.25
newY = 0.75 + y * 0.25
--button.blackGradient:Hide()
--button.flagText:Hide()
--self.bgFlag:Hide()
WorldQuestTracker.ClearZoneWidget(button)
button.circleBorder:Show()
end
end

pin:SetPosition(newX, newY)
pin:SetSize(22, 22)
pin.IsInUse = true
Expand Down
119 changes: 94 additions & 25 deletions WorldQuestTracker_ZoneMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ local worldFramePOIs = WorldMapFrame.BorderFrame
local UpdateDebug = false

local ZoneWidgetPool = WorldQuestTracker.ZoneWidgetPool
local VignettePool = WorldQuestTracker.VignettePool

local clear_widget = function(self)
self.highlight:Hide()
Expand All @@ -56,6 +57,12 @@ local clear_widget = function(self)
self.flagCriteriaMatchGlow:Hide()
self.TextureCustom:Hide()
self.RareOverlay:Hide()
self.Shadow:Hide()
self.flagTextShadow:SetText("")
end

WorldQuestTracker.ClearZoneWidget = function(widget)
clear_widget(widget)
end

local on_show_alpha_animation = function(self)
Expand Down Expand Up @@ -503,17 +510,29 @@ function WorldQuestTracker.CreateZoneWidget(index, name, parent, pinTemplate) --
end

--cria os widgets no mapa da zona
function WorldQuestTracker.GetOrCreateZoneWidget(index)
local taskPOI = ZoneWidgetPool [index]
function WorldQuestTracker.GetOrCreateZoneWidget(index, widgetType)
if (widgetType == "vignette") then
local icon = VignettePool[index]

if (not taskPOI) then
taskPOI = WorldQuestTracker.CreateZoneWidget(index, "WorldQuestTrackerZonePOIWidget", WorldQuestTracker.AnchoringFrame)
taskPOI.IsZoneQuestButton = true
ZoneWidgetPool [index] = taskPOI
end
if (not icon) then
icon = WorldQuestTracker.CreateZoneWidget(index, "WorldQuestTrackerZoneVignetteWidget", WorldQuestTracker.AnchoringFrame)
VignettePool[index] = icon
end

icon.Texture:Show()
return icon
else
local taskPOI = ZoneWidgetPool[index]

if (not taskPOI) then
taskPOI = WorldQuestTracker.CreateZoneWidget(index, "WorldQuestTrackerZonePOIWidget", WorldQuestTracker.AnchoringFrame)
taskPOI.IsZoneQuestButton = true
ZoneWidgetPool[index] = taskPOI
end

taskPOI.Texture:Show()
return taskPOI
taskPOI.Texture:Show()
return taskPOI
end
end

--esconde todos os widgets de zona
Expand All @@ -524,14 +543,6 @@ function WorldQuestTracker.HideZoneWidgets()
end
end

--update anchors when zoomed
function WorldQuestTracker.UpdateZoneWidgetAnchors()
for i = 1, #WorldQuestTracker.Cache_ShownWidgetsOnZoneMap do
local widget = WorldQuestTracker.Cache_ShownWidgetsOnZoneMap [i]
WorldMapPOIFrame_AnchorPOI(widget, widget.PosX, widget.PosY, WORLD_MAP_POI_FRAME_LEVEL_OFFSETS.WORLD_QUEST)
end
end

local quest_bugged = {}
local dazaralor_quests = {
{0.441, 0.322},
Expand All @@ -545,7 +556,7 @@ local dazaralor_quests = {
function WorldQuestTracker.AdjustThatThingInTheBottomLeftCorner()
--looks like this dropdown is opened by default
if (_G["DropDownList1MenuBackdrop"] and _G["DropDownList1MenuBackdrop"]:IsShown()) then
_G["DropDownList1MenuBackdrop"]:Hide()
--_G["DropDownList1MenuBackdrop"]:Hide()
end

local children = {WorldMapFrame:GetChildren()}
Expand Down Expand Up @@ -594,6 +605,8 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
--get the map shown in the map frame
local mapID = WorldQuestTracker.GetCurrentMapAreaID()

WorldQuestTracker.UpdateZonePOIs(forceUpdate)

if (WorldQuestTracker.IsWorldQuestHub(mapID)) then
return WorldQuestTracker.HideZoneWidgets()

Expand Down Expand Up @@ -916,7 +929,8 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
widget.AnchorFrame.questID = questID
widget.AnchorFrame.numObjectives = widget.numObjectives

WorldQuestTrackerAddon.DataProvider:GetMap():SetPinPosition(widget.AnchorFrame, widget.PosX, widget.PosY)
local posX, posY = widget.PosX, widget.PosY
WorldQuestTrackerAddon.DataProvider:GetMap():SetPinPosition(widget.AnchorFrame, posX, posY)

widget.AnchorFrame:Show()
widget:SetFrameLevel(WorldQuestTracker.DefaultFrameLevel + floor(random(1, 30)))
Expand Down Expand Up @@ -1097,6 +1111,56 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)

end

--check if the zone has extra data to show like quests, pois, etc
function WorldQuestTracker.UpdateZonePOIs(forceUpdate)
local mapID = WorldQuestTracker.GetCurrentMapAreaID()
local extraIcons = WorldQuestTracker.extraIcons[mapID]

local index = 1

if (extraIcons) then
--extraIcons is an array with iconData
for i = 1, #extraIcons do
local iconData = extraIcons[i]
if (iconData.dataType == "vignette") then
local id = iconData.id
local allVignetteSerials = C_VignetteInfo.GetVignettes()

for o = 1, #allVignetteSerials do
local vignetteSerial = allVignetteSerials[o]
local vignetteInfo = C_VignetteInfo.GetVignetteInfo(vignetteSerial)

if (vignetteInfo) then
if (vignetteInfo.vignetteID == id) then
local vec2Pos = C_VignetteInfo.GetVignettePosition(vignetteSerial, mapID)
if (vec2Pos) then
local widget = WorldQuestTracker.GetOrCreateZoneWidget(index, "vignette")
index = index + 1

widget.questID = 0
widget.PosX = vec2Pos.x
widget.PosY = vec2Pos.y

--the zone widget need to be updated here
WorldQuestTracker.ResetWorldQuestZoneButton(widget)
widget.Texture:SetAtlas(vignetteInfo.atlasName)

widget.Texture:SetSize(16, 16)
widget:SetSize(16, 16)
widget:SetAlpha(0.8)
WorldQuestTrackerAddon.DataProvider:GetMap():SetPinPosition(widget.AnchorFrame, widget.PosX, widget.PosY)
widget:Show()
end
end
end
end

--elseif (iconData.dataType == "icon") then
end
end
end
end

--reset the button
function WorldQuestTracker.ResetWorldQuestZoneButton(self)
self.isArtifact = nil
Expand Down Expand Up @@ -1194,8 +1258,7 @@ function WorldQuestTracker.SetupWorldQuestButton(self, worldQuestType, rarity, i
end

--default alpha
--self:SetAlpha(WQT_ZONEWIDGET_ALPHA - 0.05)
self:SetAlpha(ALPHA_BLEND_AMOUNT)
self:SetAlpha(WorldQuestTracker.db.profile.worldmap_widget_alpha)
self.FactionID = factionID

if (self.isCriteria) then
Expand Down Expand Up @@ -1459,6 +1522,11 @@ end
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--> zone summary ~summaryframe

function WorldQuestTracker.RefreshZoneSummaryAlpha()
local alpha = WorldQuestTracker.db.profile.world_summary_alpha
WorldQuestTrackerZoneSummaryFrame:SetAlpha(alpha)
end

local ZoneSumaryFrame = CreateFrame("frame", "WorldQuestTrackerZoneSummaryFrame", worldFramePOIs, "BackdropTemplate")
ZoneSumaryFrame:SetPoint("topleft", worldFramePOIs, "topleft", 2, -380)
ZoneSumaryFrame:SetSize(200, 400)
Expand Down Expand Up @@ -1506,7 +1574,7 @@ local GetOrCreateZoneSummaryWidget = function(index)
end

local button = CreateFrame("button", "WorldQuestTrackerZoneSummaryFrame_Widget" .. index, ZoneSumaryFrame, "BackdropTemplate")
button:SetAlpha(WQT_ZONEWIDGET_ALPHA)
button:SetAlpha(WorldQuestTracker.db.profile.world_summary_alpha)

--button:SetPoint("bottomleft", ZoneSumaryFrame, "bottomleft", 0,((index-1)*(ZoneSumaryFrame.WidgetHeight + 1)) -2) --grow bottom to top
button:SetPoint("topleft", ZoneSumaryFrame, "topleft", 0,(((index-1) *(ZoneSumaryFrame.WidgetHeight + 1)) -2) * -1) --grow top to bottom
Expand Down Expand Up @@ -1663,7 +1731,7 @@ function WorldQuestTracker.SetupZoneSummaryButton(summaryWidget, zoneWidget)
--update the quest icon
local okay, gold, resource, apower = WorldQuestTracker.UpdateWorldWidget(widget, questID, numObjectives, mapID, isCriteria, isNew, isUsingTracker, timeLeft, artifactPowerIcon)
widget.texture:SetTexCoord(.1, .9, .1, .9)
widget:SetAlpha(WQT_ZONEWIDGET_ALPHA)
widget:SetAlpha(WorldQuestTracker.db.profile.world_summary_alpha)

widget.background:Hide()
widget.factionBorder:Hide()
Expand All @@ -1689,7 +1757,7 @@ function WorldQuestTracker.SetupZoneSummaryButton(summaryWidget, zoneWidget)

--set the time left
local timePriority = WorldQuestTracker.db.profile.sort_time_priority
local alphaAmount = WQT_WORLDWIDGET_BLENDED + 0.06
local alphaAmount = 0.923

if (timePriority and timePriority > 0) then
if (timePriority < 4) then
Expand Down Expand Up @@ -1726,7 +1794,7 @@ function WorldQuestTracker.SetupZoneSummaryButton(summaryWidget, zoneWidget)
summaryWidget:SetAlpha(1)
end

summaryWidget.timeLeftText:SetText(timeLeft > 1440 and floor(timeLeft/1440) .. "d" or timeLeft > 60 and floor(timeLeft/60) .. "h" or timeLeft .. "m")
summaryWidget.timeLeftText:SetText((timeLeft > 1440 and floor(timeLeft/1440) .. "d") or (timeLeft > 60 and floor(timeLeft/60) .. "h") or (timeLeft .. "m"))
summaryWidget.timeLeftText:SetJustifyH("center")
summaryWidget.timeLeftText:Show()

Expand Down Expand Up @@ -1848,6 +1916,7 @@ function WorldQuestTracker.UpdateZoneSummaryFrame()
end

WorldQuestTracker.QuestSummaryShown = true
WorldQuestTracker.RefreshZoneSummaryAlpha()
end


Expand Down
Loading

0 comments on commit 5da94ca

Please sign in to comment.