Skip to content

Commit

Permalink
Merge pull request #377 from artscout/master
Browse files Browse the repository at this point in the history
Small fixes for goto and rarescanner icons
  • Loading branch information
IrcDirk authored Jul 24, 2024
2 parents 87c0980 + f6178d5 commit d6c0764
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
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

0 comments on commit d6c0764

Please sign in to comment.