Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes for goto and rarescanner icons #377

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions Carbonite.Notes/NxFav.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ local function notesConfig()
return Nx.fdb.profile.Notes.HandyNotes
end,
set = function()
local map = Nx.Map:GetMap (1)
local map = Nx.Map:GetMap (1)
Nx.fdb.profile.Notes.HandyNotes = not Nx.fdb.profile.Notes.HandyNotes
if Nx.fdb.profile.Notes.HandyNotes then
Nx.Notes:HandyNotes(Nx.Map:GetCurrentMapAreaID())
Expand All @@ -98,15 +98,15 @@ local function notesConfig()
order = 3,
type = "range",
width = "normal",
min = 10,
min = 10,
max = 60,
step = 5,
name = L["Handnotes Icon Size"],
get = function()
return Nx.fdb.profile.Notes.HandyNotesSize
end,
set = function(input,value)
local map = Nx.Map:GetMap (1)
local map = Nx.Map:GetMap (1)
Nx.fdb.profile.Notes.HandyNotesSize = value
map:ClearIconType("!HANDY")
Nx.Notes:HandyNotes(Nx.Map:GetCurrentMapAreaID())
Expand All @@ -119,7 +119,7 @@ local function notesConfig()
end,
},
rarescanner = {
order = 2,
order = 4,
type = "toggle",
width = "full",
name = L["Display RareScanner icons On Map"],
Expand All @@ -128,13 +128,12 @@ local function notesConfig()
return Nx.fdb.profile.Notes.RareScanner
end,
set = function()
local map = Nx.Map:GetMap (1)
local map = Nx.Map:GetMap (1)
Nx.fdb.profile.Notes.RareScanner = not Nx.fdb.profile.Notes.RareScanner
if Nx.fdb.profile.Notes.RareScanner then
Nx.Notes:RareScanner(Nx.Map:GetCurrentMapAreaID())
else
map:ClearIconType("!RSR")
map:ClearIconType("!RSRC")
end
end,
disabled = function()
Expand All @@ -145,21 +144,20 @@ local function notesConfig()
end,
},
raresize = {
order = 3,
order = 5,
type = "range",
width = "normal",
min = 10,
min = 10,
max = 60,
step = 5,
name = L["RareScanner Icon Size"],
get = function()
return Nx.fdb.profile.Notes.RareScannerSize
end,
set = function(input,value)
local map = Nx.Map:GetMap (1)
local map = Nx.Map:GetMap (1)
Nx.fdb.profile.Notes.RareScannerSize = value
map:ClearIconType("!RSR")
map:ClearIconType("!RSRC")
Nx.Notes:RareScanner(Nx.Map:GetCurrentMapAreaID())
end,
disabled = function()
Expand Down Expand Up @@ -1680,10 +1678,6 @@ function Nx.Notes:RareScanner(mapId)
map:SetIconTypeChop ("!RSR", true)
map:SetIconTypeLevel ("!RSR", 20)

map:InitIconType ("!RSRC", "WP", "", Nx.fdb.profile.Notes.RareScannerSize or 32, Nx.fdb.profile.Notes.RareScannerSize or 32)
map:SetIconTypeChop ("!RSRC", true)
map:SetIconTypeLevel ("!RSRC", 20)

for _,rspin in ipairs(rspins) do
if rspin.POI then
if rspin.POI.mapID == map.MapId then
Expand Down Expand Up @@ -1731,9 +1725,9 @@ function Nx.Notes:RareScanner(mapId)
icon:SetPoint("CENTER", tmpFrame, "TOPLEFT", x*tmpFrame:GetWidth(), -y*tmpFrame:GetHeight())
local tooltip = rspin.pin.POI.name
local tooltipName = "GameTooltip"
local rsnote = map:AddIconPt("!RSRC", wx, wy, level, color, texture)
local rsnote = map:AddIconPt("!RSR", wx, wy, level, color, texture)
map:SetIconTip(rsnote,tooltip)
map:SetIconUserData(rsnote, rspin)
map:SetIconUserData(rsnote, rspin.pin)
end
end
end
Expand Down
6 changes: 4 additions & 2 deletions Carbonite/NxMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3034,8 +3034,10 @@ end
-- Generic icon goto

function Nx.Map:GMenu_OnGoto()
if Nx.Quest.Watch then
Nx.Quest.Watch:ClearAutoTarget()
if Nx.Quest then
if Nx.Quest.Watch then
Nx.Quest.Watch:ClearAutoTarget()
end
end
if self.ClickType == 3001 then
if Nx.Social then
Expand Down