Add files via upload
This commit is contained in:
+39
-12
@@ -56,12 +56,8 @@ local LOCKBOX_ITEMS = {
|
|||||||
-- In 1.12.1 we can check GameTooltip target via mouseover; object names are
|
-- In 1.12.1 we can check GameTooltip target via mouseover; object names are
|
||||||
-- the most reliable hook available since object IDs aren't directly exposed
|
-- the most reliable hook available since object IDs aren't directly exposed
|
||||||
-- in the 1.12 API the same way item IDs are.
|
-- in the 1.12 API the same way item IDs are.
|
||||||
local LOCKABLE_OBJECTS = {
|
-- Doors always use simple green/red colouring regardless of colour mode setting
|
||||||
-- ===== Rogue training objects =====
|
local LOCKABLE_DOORS = {
|
||||||
["Buccaneer's Strongbox"] = 0, -- Horde rogue quest, ship near Ratchet in The Barrens
|
|
||||||
["Practice Lockbox"] = 0, -- Alliance rogue quest, Alther's Mill in Redridge
|
|
||||||
|
|
||||||
-- ===== Doors =====
|
|
||||||
["Ironclad Cove Gate"] = 150, -- Deadmines
|
["Ironclad Cove Gate"] = 150, -- Deadmines
|
||||||
["Water Gate"] = 150, -- Deadmines
|
["Water Gate"] = 150, -- Deadmines
|
||||||
["Gnomeregan Door"] = 150, -- Gnomeregan backdoor
|
["Gnomeregan Door"] = 150, -- Gnomeregan backdoor
|
||||||
@@ -78,6 +74,12 @@ local LOCKABLE_OBJECTS = {
|
|||||||
["Scholomance Door"] = 280, -- Scholomance main entrance
|
["Scholomance Door"] = 280, -- Scholomance main entrance
|
||||||
["Service Entrance Door"] = 300, -- Stratholme servant's entrance
|
["Service Entrance Door"] = 300, -- Stratholme servant's entrance
|
||||||
["Stratholme Gate"] = 300, -- Stratholme (alternate name)
|
["Stratholme Gate"] = 300, -- Stratholme (alternate name)
|
||||||
|
}
|
||||||
|
|
||||||
|
local LOCKABLE_OBJECTS = {
|
||||||
|
-- ===== Rogue training objects =====
|
||||||
|
["Buccaneer's Strongbox"] = 0, -- Horde rogue quest, ship near Ratchet in The Barrens
|
||||||
|
["Practice Lockbox"] = 0, -- Alliance rogue quest, Alther's Mill in Redridge
|
||||||
|
|
||||||
-- ===== Silverpine Forest =====
|
-- ===== Silverpine Forest =====
|
||||||
["Decrepit Chest"] = 1,
|
["Decrepit Chest"] = 1,
|
||||||
@@ -208,7 +210,10 @@ local orig_SetHyperlink = GameTooltip.SetHyperlink
|
|||||||
|
|
||||||
-- Returns the colour code to use for a tooltip line.
|
-- Returns the colour code to use for a tooltip line.
|
||||||
-- "simple" mode: green if pickable, red if not.
|
-- "simple" mode: green if pickable, red if not.
|
||||||
-- "match" mode: copy the r,g,b from the game's own "Locked" text line.
|
-- "match" mode: copy the r,g,b from the game's own "Locked" text line,
|
||||||
|
-- but only if a Locked line is actually present and skill-gated
|
||||||
|
-- (i.e. its colour is not just default white/grey descriptive text).
|
||||||
|
-- Falls back to simple if no usable Locked line is found.
|
||||||
local function GetLineColor(pickable)
|
local function GetLineColor(pickable)
|
||||||
if LockpickTooltipDB.colorMode == "match" then
|
if LockpickTooltipDB.colorMode == "match" then
|
||||||
for i = 1, 30 do
|
for i = 1, 30 do
|
||||||
@@ -217,14 +222,23 @@ local function GetLineColor(pickable)
|
|||||||
local t = left:GetText()
|
local t = left:GetText()
|
||||||
if t and string.find(t, "Locked") then
|
if t and string.find(t, "Locked") then
|
||||||
local r, g, b = left:GetTextColor()
|
local r, g, b = left:GetTextColor()
|
||||||
r = math.floor((r or 0) * 255)
|
r = r or 0
|
||||||
g = math.floor((g or 0) * 255)
|
g = g or 0
|
||||||
b = math.floor((b or 0) * 255)
|
b = b or 0
|
||||||
return string.format("|cff%02x%02x%02x", r, g, b)
|
-- Only use this colour if it looks like a skill-gated line:
|
||||||
|
-- skill-gated Locked lines are red, orange, yellow, green, or grey
|
||||||
|
-- but NOT plain white (r~1, g~1, b~1) which is just descriptive text
|
||||||
|
local isWhite = r > 0.9 and g > 0.9 and b > 0.9
|
||||||
|
if not isWhite then
|
||||||
|
local ri = math.floor(r * 255)
|
||||||
|
local gi = math.floor(g * 255)
|
||||||
|
local bi = math.floor(b * 255)
|
||||||
|
return string.format("|cff%02x%02x%02x", ri, gi, bi)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- simple mode fallback
|
end
|
||||||
|
-- simple mode or no usable Locked line found
|
||||||
if pickable then
|
if pickable then
|
||||||
return "|cff00ff00"
|
return "|cff00ff00"
|
||||||
else
|
else
|
||||||
@@ -319,6 +333,19 @@ end
|
|||||||
-- Append lockpick line for a known object name
|
-- Append lockpick line for a known object name
|
||||||
local function AppendObjectLockLine(name)
|
local function AppendObjectLockLine(name)
|
||||||
if not name then return end
|
if not name then return end
|
||||||
|
|
||||||
|
-- Doors: always use simple green/red, no colour matching
|
||||||
|
local doorReq = LOCKABLE_DOORS[name]
|
||||||
|
if doorReq then
|
||||||
|
if CanPickLock(doorReq) then
|
||||||
|
GameTooltip:AddLine("|cff00ff00Pickable (" .. doorReq .. ")|r")
|
||||||
|
else
|
||||||
|
GameTooltip:AddLine("|cffff2020Skill Level Too Low (" .. doorReq .. ")|r")
|
||||||
|
end
|
||||||
|
GameTooltip:Show()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if not IsTooltipLocked() then return end
|
if not IsTooltipLocked() then return end
|
||||||
|
|
||||||
local zone = GetRealZoneText()
|
local zone = GetRealZoneText()
|
||||||
|
|||||||
Reference in New Issue
Block a user