Skip to content

Commit

Permalink
Bug Fixes and added an option to hide the "options" button on the LGF…
Browse files Browse the repository at this point in the history
… panel
  • Loading branch information
Tercioo committed Oct 6, 2023
1 parent 5e73503 commit c83e0d2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
6 changes: 5 additions & 1 deletion WorldQuestTracker_GroupFinder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,11 @@ kspam:SetScript("OnUpdate", function()
if (LFGListFrame:IsShown()) then
local selectedCategory = LFGListFrame.SearchPanel.categoryID
if (selectedCategory == 2 or selectedCategory == 3) then --dungeon | raid
configButton:Show()
if (WorldQuestTracker.db.profile.groupfinder.kfilter.show_button) then
configButton:Show()
else
configButton:Hide()
end
else
configButton:Hide()
end
Expand Down
14 changes: 14 additions & 0 deletions WorldQuestTracker_OptionsPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,20 @@ function WorldQuestTrackerAddon.OpenOptionsPanel()
name = "S_GROUPFINDER_SECONDS",
desc = "S_GROUPFINDER_SECONDS",
},

{type = "breakline"},

{
type = "toggle",
get = function()
return WorldQuestTracker.db.profile.groupfinder.kfilter.show_button
end,
set = function(self, fixedparam, value)
WorldQuestTracker.db.profile.groupfinder.kfilter.show_button = value
end,
name = "S_OPTIONS_GF_SHOWOPTIONS_BUTTON",
desc = "S_OPTIONS_GF_SHOWOPTIONS_BUTTON",
},
}

DF:BuildMenu(groupFinderSettingsFrame, optionsTable, xStart, yStart, tabFrameHeight, false, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template, globalCallback)
Expand Down
36 changes: 19 additions & 17 deletions WorldQuestTracker_ZoneMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -731,25 +731,27 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
pin.TextureShadow:SetAlpha(0.4)
end

--get the player position in the map
local playerPosition = C_Map.GetPlayerMapPosition(WorldMapFrame.mapID, "player")

if (playerPosition) then
--find the closest flight point to the player position
local closestFlightPoint
local closestDist
for i = 1, #flightPoints do
local flightPoint = flightPoints[i]
local distance = DF:GetDistance_Point(playerPosition.x, playerPosition.y, flightPoint.x, flightPoint.y)
if (not closestDist or distance < closestDist) then
closestDist = distance
closestFlightPoint = flightPoint
if (WorldMapFrame.mapID) then
--get the player position in the map
local playerPosition = C_Map.GetPlayerMapPosition(WorldMapFrame.mapID, "player")

if (playerPosition) then
--find the closest flight point to the player position
local closestFlightPoint
local closestDist
for i = 1, #flightPoints do
local flightPoint = flightPoints[i]
local distance = DF:GetDistance_Point(playerPosition.x, playerPosition.y, flightPoint.x, flightPoint.y)
if (not closestDist or distance < closestDist) then
closestDist = distance
closestFlightPoint = flightPoint
end
end
end

if (closestFlightPoint) then
closestFlightPoint.pin.Texture:SetAlpha(1)
closestFlightPoint.pin.TextureShadow:SetAlpha(0.924)
if (closestFlightPoint) then
closestFlightPoint.pin.Texture:SetAlpha(1)
closestFlightPoint.pin.TextureShadow:SetAlpha(0.924)
end
end
end

Expand Down

0 comments on commit c83e0d2

Please sign in to comment.