|
|
@ -7,6 +7,12 @@ local Builder = Tinkr.Util.GUIBuilder:New { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
local nodes = { |
|
|
|
local nodes = { |
|
|
|
|
|
|
|
-- Fishing nods |
|
|
|
|
|
|
|
[451678] = {name = "Blood in the Water", type = "fishing" }, |
|
|
|
|
|
|
|
[451669] = {name = "Glimmerpool", type = "fishing" }, |
|
|
|
|
|
|
|
[451670] = {name = "Calm Surfacing Ripple", type = "fishing" }, |
|
|
|
|
|
|
|
[451680] = {name = "Royal Ripple", type = "fishing" }, |
|
|
|
|
|
|
|
|
|
|
|
-- Mining nodes |
|
|
|
-- Mining nodes |
|
|
|
[413047] = {name = "Aqirite", type = "mining"}, |
|
|
|
[413047] = {name = "Aqirite", type = "mining"}, |
|
|
|
[434556] = {name = "Aqirite Chunk", type = "mining"}, |
|
|
|
[434556] = {name = "Aqirite Chunk", type = "mining"}, |
|
|
@ -240,6 +246,9 @@ local function DrawNode(draw, nodeInfo, nx, ny, nz, objectId) |
|
|
|
elseif nodeType == "herb" and Builder:GetConfig("show_herbs") == "yes" and Builder:GetConfig("show_herb_" .. objectId) == "yes" then |
|
|
|
elseif nodeType == "herb" and Builder:GetConfig("show_herbs") == "yes" and Builder:GetConfig("show_herb_" .. objectId) == "yes" then |
|
|
|
color = {0, 255, 0} |
|
|
|
color = {0, 255, 0} |
|
|
|
shouldDraw = true |
|
|
|
shouldDraw = true |
|
|
|
|
|
|
|
elseif nodeType == "fishing" and Builder:GetConfig("show_fish") == "yes" and Builder:GetConfig("show_fish_" .. objectId) == "yes" then |
|
|
|
|
|
|
|
color = {255, 0, 0} |
|
|
|
|
|
|
|
shouldDraw = true |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
if shouldDraw then |
|
|
|
if shouldDraw then |
|
|
@ -257,19 +266,35 @@ local function DrawNode(draw, nodeInfo, nx, ny, nz, objectId) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
Draw:Sync(function(draw) |
|
|
|
Draw:Sync(function(draw) |
|
|
|
|
|
|
|
local px, py, pz = ObjectPosition('player') |
|
|
|
|
|
|
|
local nearestNode = nil |
|
|
|
|
|
|
|
local nearestDist = 100000 -- Start with a very large distance |
|
|
|
|
|
|
|
|
|
|
|
for _, object in ipairs(Objects()) do |
|
|
|
for _, object in ipairs(Objects()) do |
|
|
|
if ObjectType(object) == 8 then |
|
|
|
if ObjectType(object) == 8 then |
|
|
|
local objectId = ObjectId(object) |
|
|
|
local objectId = ObjectId(object) |
|
|
|
local nodeInfo = GetNodeInfo(objectId) |
|
|
|
local nodeInfo = GetNodeInfo(objectId) |
|
|
|
|
|
|
|
|
|
|
|
if nodeInfo and ObjectLootable(object) then |
|
|
|
if nodeInfo then |
|
|
|
local nx, ny, nz = ObjectRawPosition(object) |
|
|
|
local nx, ny, nz = ObjectPosition(object) |
|
|
|
DrawNode(draw, nodeInfo, nx, ny, nz, objectId) |
|
|
|
local dist = ObjectDistance('player',object) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Check if this node is the nearest so far |
|
|
|
|
|
|
|
if dist and dist < nearestDist then |
|
|
|
|
|
|
|
nearestNode = { nodeInfo = nodeInfo, nx = nx, ny = ny, nz = nz, objectId = objectId } |
|
|
|
|
|
|
|
nearestDist = dist |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Draw the nearest node if one was found |
|
|
|
|
|
|
|
if nearestNode then |
|
|
|
|
|
|
|
DrawNode(draw, nearestNode.nodeInfo, nearestNode.nx, nearestNode.ny, nearestNode.nz, nearestNode.objectId) |
|
|
|
|
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Modify the SavePreferences function |
|
|
|
-- Modify the SavePreferences function |
|
|
|
local function SavePreferences() |
|
|
|
local function SavePreferences() |
|
|
|
for id, node in pairs(nodes) do |
|
|
|
for id, node in pairs(nodes) do |
|
|
@ -295,6 +320,11 @@ local MainSettingsTab = Builder:Tab { |
|
|
|
-- description = "Toggle visibility of herb nodes.", |
|
|
|
-- description = "Toggle visibility of herb nodes.", |
|
|
|
default = "yes" |
|
|
|
default = "yes" |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
Builder:Checkbox { |
|
|
|
|
|
|
|
key = "show_fish", |
|
|
|
|
|
|
|
label = "Show School of Fish", |
|
|
|
|
|
|
|
default = "yes" |
|
|
|
|
|
|
|
}, |
|
|
|
Builder:Checkbox { |
|
|
|
Builder:Checkbox { |
|
|
|
key = "draw_lines", |
|
|
|
key = "draw_lines", |
|
|
|
label = "Draw Lines to Nodes", |
|
|
|
label = "Draw Lines to Nodes", |
|
|
@ -343,6 +373,24 @@ local DetailedFilterTab = Builder:Tab { |
|
|
|
return elements |
|
|
|
return elements |
|
|
|
end)() |
|
|
|
end)() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
Builder:Group { |
|
|
|
|
|
|
|
key = "fish_nodes_group", |
|
|
|
|
|
|
|
title = "School of Fish", |
|
|
|
|
|
|
|
content = (function() |
|
|
|
|
|
|
|
local elements = {} |
|
|
|
|
|
|
|
for id, node in pairs(nodes) do |
|
|
|
|
|
|
|
if node.type == "fishing" then |
|
|
|
|
|
|
|
table.insert(elements, Builder:Checkbox { |
|
|
|
|
|
|
|
key = "show_fish_" .. id, |
|
|
|
|
|
|
|
label = node.name, |
|
|
|
|
|
|
|
-- description = "Toggle visibility of " .. node.name, |
|
|
|
|
|
|
|
default = "yes" |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
return elements |
|
|
|
|
|
|
|
end)() |
|
|
|
|
|
|
|
}, |
|
|
|
Builder:Button { |
|
|
|
Builder:Button { |
|
|
|
key = "save_preferences_button", |
|
|
|
key = "save_preferences_button", |
|
|
|
text = "Save Preferences", |
|
|
|
text = "Save Preferences", |
|
|
|