Skip to content

Commit

Permalink
Added options to adjust the quest location size per world maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Aug 30, 2024
1 parent 502defe commit a2c5167
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 12 deletions.
6 changes: 6 additions & 0 deletions WorldQuestTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ function WorldQuestTracker:OnInit()
DF.Language.SetCurrentLanguage(addonId, WQTrackerLanguage.language)
end

for hubMapID, defaultScale in pairs(WorldQuestTracker.MapData.HubMapIconsScale) do
if (not WorldQuestTracker.db.profile.world_map_hubscale[hubMapID]) then
WorldQuestTracker.db.profile.world_map_hubscale[hubMapID] = defaultScale
end
end

hooksecurefunc(_G, "StaticPopup_Show", function(token)
if (token == "ABANDON_QUEST") then
if (WorldQuestTracker.db.profile.close_blizz_popups.ABANDON_QUEST) then
Expand Down
10 changes: 5 additions & 5 deletions WorldQuestTracker_IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ WorldQuestTracker.MapData.ExpMaps = {
}

WorldQuestTracker.MapData.HubMapIconsScale = {
[zoneIDs.DRAGONISLES] = 1,
[zoneIDs.DRAGONISLES] = 0.85,
[zoneIDs.THESHADOWLANDS] = 1,
[zoneIDs.ZANDALAR] = 1,
[zoneIDs.KULTIRAS] = 1,
[zoneIDs.ZANDALAR] = 0.9,
[zoneIDs.KULTIRAS] = 0.9,
[zoneIDs.AZEROTH] = 1,
[zoneIDs.BROKENISLES] = 0.8,
[zoneIDs.KHAZALGAR] = 0.8,
[zoneIDs.BROKENISLES] = 0.30,
[zoneIDs.KHAZALGAR] = 0.95,
}

--list of map ids for world quest hubs
Expand Down
4 changes: 3 additions & 1 deletion WorldQuestTracker_Initialize.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,16 @@ do

world_map_config = {
onmap_show = true,
onmap_scale_offset = 0.6,
onmap_scale_offset = 1.0,
summary_show = true,
summary_scale = 0.95,
summary_showby = "bytype", --"bytype" or "byzone"
summary_anchor = "left",
summary_widgets_per_row = 8,
},

world_map_hubscale = {},

speed_run = {
auto_accept = false,
auto_complete = false,
Expand Down
6 changes: 1 addition & 5 deletions WorldQuestTracker_MapAPI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ local ItemTooltipScan = CreateFrame ("GameTooltip", "WQTItemTooltipScan", UIPare
local numQuestCurrencies = GetNumQuestLogRewardCurrencies(questID)

if (numQuestCurrencies == 1) then

--is artifact power? bfa
do
local name, texture, numItems, currencyId, quality = GetQuestLogRewardCurrencyInfo(1, questID)
Expand All @@ -598,17 +597,14 @@ local ItemTooltipScan = CreateFrame ("GameTooltip", "WQTItemTooltipScan", UIPare
return name, texture, 0, 1, 1, false, 0, 8, baseRewardAmount or 0, false, 1
end
end

--print("currency: ", name, texture, numItems, currencyId, quality)
--aaaa[currencyId] = {name, texture, numItems, currencyId, quality}
end

local numQuestRewards = GetNumQuestLogRewards(questID)

if (numQuestRewards > 0) then
local itemName, itemTexture, quantity, itemQuality, isUsable, itemID, itemLevel = GetQuestLogRewardInfo(1, questID)
itemLevel = itemLevel or 0


if (itemID) then
local itemName, itemLink, itemRarity, nopItemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice, itemClassID, itemSubClassID = GetItemInfo(itemID)
local borderTexture
Expand Down
36 changes: 36 additions & 0 deletions WorldQuestTracker_OptionsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,42 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
DF:BuildMenu(worldMapSettingsFrame, optionsTable, xStart, yStart, tabFrameHeight, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
end

do
local worldMapPinScaleFrame = CreateFrame("frame", "WorldQuestTrackerWorldMapPinScaleFrameOptions", worldMapSettingsFrame, "BackdropTemplate")
worldMapPinScaleFrame:SetPoint("topright", WQTOptionsPanelContainerWorldMapConfig, "topright", -5, yStart)
worldMapPinScaleFrame:SetSize(250, 300)

local optionsTable = {
{
type = "label",
get = function() return "S_OPTTIONS_QUESTLOCATIONSCALE_BYWORLDMAP" end,
text_template = DF:GetTemplate("font", "ORANGE_FONT_TEMPLATE")
},
}

for hubMapID, scale in pairs(WorldQuestTracker.db.profile.world_map_hubscale) do
local mapInfo = C_Map.GetMapInfo(hubMapID)
optionsTable[#optionsTable+1] = {
type = "range",
get = function() return WorldQuestTracker.db.profile.world_map_hubscale[hubMapID] end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.world_map_hubscale[hubMapID] = value
WorldQuestTracker.UpdateWorldQuestsOnWorldMap()
end,
min = 0.6,
max = 1.5,
step = 1,
thumbscale = 1.8,
usedecimals = true,
name = mapInfo.name,
desc = "S_SCALE",
}
end

DF:BuildMenu(worldMapPinScaleFrame, optionsTable, xStart, -5, tabFrameHeight, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
end


do --Zone Map Settings
local optionsTable = {
always_boxfirst = true,
Expand Down
2 changes: 1 addition & 1 deletion WorldQuestTracker_WorldMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ local scheduledIconUpdate = function(questTable)

local pinScale = DF:MapRangeClamped(rangeValues[1], rangeValues[2], rangeValues[3], rangeValues[4], mapScale)

local finalScaleScalar = WorldQuestTracker.MapData.HubMapIconsScale[WorldMapFrame.mapID] or 1
local finalScaleScalar = WorldQuestTracker.db.profile.world_map_hubscale[WorldMapFrame.mapID] or 1
pinScale = pinScale * finalScaleScalar

if (WorldMapFrame.mapID == WorldQuestTracker.MapData.ZoneIDs.THESHADOWLANDS) then
Expand Down
2 changes: 2 additions & 0 deletions locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local addonId = ...
local languageTable = DetailsFramework.Language.RegisterLanguage(addonId, "enUS")
local L = languageTable

L["S_OPTTIONS_QUESTLOCATIONSCALE_BYWORLDMAP"] = "Quest Scale by World Map"

L["S_SPEEDRUN"] = "Speed Run"
L["S_SPEEDRUN_AUTO_ACCEPT"] = "Auto Accept Quests"
L["S_SPEEDRUN_AUTO_COMPLETE"] = "Auto Complete Quests"
Expand Down

0 comments on commit a2c5167

Please sign in to comment.