Add files via upload

This commit is contained in:
totalllyswede
2026-06-05 22:41:20 -07:00
committed by GitHub
parent 6131be57a8
commit e0af01125c
3 changed files with 80 additions and 23 deletions
+67 -15
View File
@@ -9,6 +9,14 @@ local function GetItemIDFromLink(link)
return tonumber(idStr) return tonumber(idStr)
end end
-------------------------------------------------------------------------------
-- SETTINGS
-- LockpickTooltipDB is a SavedVariable persisted across sessions.
-- colorMode: "simple" = green (pickable) / red (too low)
-- "match" = copy the colour of the game's own "Locked" text
-------------------------------------------------------------------------------
LockpickTooltipDB = LockpickTooltipDB or { colorMode = "simple" }
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- LOCKPICKING SKILL REQUIREMENTS -- LOCKPICKING SKILL REQUIREMENTS
-- --
@@ -198,15 +206,43 @@ local orig_SetQuestItem = GameTooltip.SetQuestItem
local orig_SetQuestLogItem = GameTooltip.SetQuestLogItem local orig_SetQuestLogItem = GameTooltip.SetQuestLogItem
local orig_SetHyperlink = GameTooltip.SetHyperlink local orig_SetHyperlink = GameTooltip.SetHyperlink
-- Returns the colour code to use for a tooltip line.
-- "simple" mode: green if pickable, red if not.
-- "match" mode: copy the r,g,b from the game's own "Locked" text line.
local function GetLineColor(pickable)
if LockpickTooltipDB.colorMode == "match" then
for i = 1, 30 do
local left = getglobal("GameTooltipTextLeft" .. i)
if not left then break end
local t = left:GetText()
if t and string.find(t, "Locked") then
local r, g, b = left:GetTextColor()
r = math.floor((r or 0) * 255)
g = math.floor((g or 0) * 255)
b = math.floor((b or 0) * 255)
return string.format("|cff%02x%02x%02x", r, g, b)
end
end
end
-- simple mode fallback
if pickable then
return "|cff00ff00"
else
return "|cffff2020"
end
end
-- Append lockpick line for a known item ID -- Append lockpick line for a known item ID
local function AppendItemLockLine(itemID) local function AppendItemLockLine(itemID)
if not itemID then return end if not itemID then return end
local req = LOCKBOX_ITEMS[itemID] local req = LOCKBOX_ITEMS[itemID]
if req then if req then
if CanPickLock(req) then local pickable = CanPickLock(req)
GameTooltip:AddLine("|cff00ff00Pickable (" .. req .. ")|r") local color = GetLineColor(pickable)
if pickable then
GameTooltip:AddLine(color .. "Pickable (" .. req .. ")|r")
else else
GameTooltip:AddLine("|cffff2020Skill Level Too Low (" .. req .. ")|r") GameTooltip:AddLine(color .. "Skill Level Too Low (" .. req .. ")|r")
end end
GameTooltip:Show() GameTooltip:Show()
end end
@@ -248,10 +284,12 @@ local function AddMultiLevelLine(levels)
-- Single level: straightforward -- Single level: straightforward
if table.getn(levels) == 1 then if table.getn(levels) == 1 then
local req = levels[1] local req = levels[1]
if CanPickLock(req) then local pickable = CanPickLock(req)
GameTooltip:AddLine("|cff00ff00Pickable (" .. req .. ")|r") local color = GetLineColor(pickable)
if pickable then
GameTooltip:AddLine(color .. "Pickable (" .. req .. ")|r")
else else
GameTooltip:AddLine("|cffff2020Skill Level Too Low (" .. req .. ")|r") GameTooltip:AddLine(color .. "Skill Level Too Low (" .. req .. ")|r")
end end
GameTooltip:Show() GameTooltip:Show()
return return
@@ -264,13 +302,16 @@ local function AddMultiLevelLine(levels)
if lockedColor == "red" and CanPickLock(low) then if lockedColor == "red" and CanPickLock(low) then
-- Locked is red but player can pick the low variant - must be the higher one -- Locked is red but player can pick the low variant - must be the higher one
GameTooltip:AddLine("|cffff2020Skill Level Too Low (" .. high .. ")|r") local color = GetLineColor(false)
GameTooltip:AddLine(color .. "Skill Level Too Low (" .. high .. ")|r")
elseif lockedColor == "red" then elseif lockedColor == "red" then
-- Locked is red and player can't pick either - too low for even the lowest -- Locked is red and player can't pick either - too low for even the lowest
GameTooltip:AddLine("|cffff2020Skill Level Too Low (" .. low .. ")|r") local color = GetLineColor(false)
GameTooltip:AddLine(color .. "Skill Level Too Low (" .. low .. ")|r")
else else
-- Locked is not red (orange/yellow/green/grey) - player can pick it -- Locked is not red (orange/yellow/green/grey) - player can pick it
GameTooltip:AddLine("|cff00ff00Pickable (" .. low .. ")|r") local color = GetLineColor(true)
GameTooltip:AddLine(color .. "Pickable (" .. low .. ")|r")
end end
GameTooltip:Show() GameTooltip:Show()
end end
@@ -349,10 +390,12 @@ local function AppendObjectLockLine(name)
-- ----------------------------------------------------------------------- -- -----------------------------------------------------------------------
local req = LOCKABLE_OBJECTS[name] local req = LOCKABLE_OBJECTS[name]
if req then if req then
if CanPickLock(req) then local pickable = CanPickLock(req)
GameTooltip:AddLine("|cff00ff00Pickable (" .. req .. ")|r") local color = GetLineColor(pickable)
if pickable then
GameTooltip:AddLine(color .. "Pickable (" .. req .. ")|r")
else else
GameTooltip:AddLine("|cffff2020Skill Level Too Low (" .. req .. ")|r") GameTooltip:AddLine(color .. "Skill Level Too Low (" .. req .. ")|r")
end end
GameTooltip:Show() GameTooltip:Show()
end end
@@ -496,13 +539,22 @@ SlashCmdList["LOCKPICKTIP"] = function(msg)
for name, req in pairs(LOCKABLE_OBJECTS) do for name, req in pairs(LOCKABLE_OBJECTS) do
DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff" .. name .. "|r - Requires: " .. req) DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff" .. name .. "|r - Requires: " .. req)
end end
elseif arg == "color" or arg == "colour" then
if LockpickTooltipDB.colorMode == "simple" then
LockpickTooltipDB.colorMode = "match"
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00LockpickTooltip|r: Color mode set to |cffaaddffMatch|r - tooltip text will match the game's Locked color.")
else
LockpickTooltipDB.colorMode = "simple"
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00LockpickTooltip|r: Color mode set to |cffaaddffSimple|r - |cff00ff00green|r = pickable, |cffff2020red|r = too low.")
end
else else
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00LockpickTooltip v1.0|r - Tooltip skill hints for rogues") DEFAULT_CHAT_FRAME:AddMessage("|cffffff00LockpickTooltip|r (1.2.0) - Tooltip skill hints for rogues")
DEFAULT_CHAT_FRAME:AddMessage("Commands:") DEFAULT_CHAT_FRAME:AddMessage("Commands:")
DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff/lpt items|r - list known lockboxes") DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff/lpt items|r - list known lockboxes")
DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff/lpt objects|r - list known lockable objects") DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff/lpt objects|r - list known lockable objects")
DEFAULT_CHAT_FRAME:AddMessage("Tooltip colors: |cff00ff00Green|r = can pick, |cffffff00Yellow|r = within 25 skill, |cffff4444Red|r = too low") DEFAULT_CHAT_FRAME:AddMessage(" |cffaaddff/lpt color|r - toggle color mode (currently: " .. LockpickTooltipDB.colorMode .. ")")
DEFAULT_CHAT_FRAME:AddMessage("Color modes: |cffaaddffSimple|r = green/red | |cffaaddffMatch|r = mirrors game Locked color")
end end
end end
DEFAULT_CHAT_FRAME:AddMessage("|cffffff00LockpickTooltip v1.2.0|r loaded. Type |cffaaddff/lpt|r for help.") DEFAULT_CHAT_FRAME:AddMessage("|cffffff00LockpickTooltip|r (1.2.0) loaded. Type |cffaaddff/lpt|r for help.")
+1 -1
View File
@@ -3,6 +3,6 @@
## Notes: Shows required lockpicking skill on item/object tooltips ## Notes: Shows required lockpicking skill on item/object tooltips
## Author: Olzon ## Author: Olzon
## Version: 1.2.0 ## Version: 1.2.0
## SavedVariables: ## SavedVariables: LockpickTooltipDB
LockpickTooltip.lua LockpickTooltip.lua
+12 -7
View File
@@ -1,7 +1,7 @@
# LockpickTooltip # LockpickTooltip
### World of Warcraft 1.12.1 (Vanilla) Addon — v1.2.0 Stable ### World of Warcraft 1.12.1 (Vanilla) Addon — v1.2.0 Stable
Adds a line to item and world-object tooltips showing the required Lockpicking skill, colour-coded green if you can pick it or red if your skill is too low. Adds a line to item and world-object tooltips showing the required Lockpicking skill, colour-coded based on whether you can pick it or not.
--- ---
@@ -10,10 +10,13 @@ Adds a line to item and world-object tooltips showing the required Lockpicking s
- Works on **bag items** (lockboxes, junkboxes) - Works on **bag items** (lockboxes, junkboxes)
- Works on **world objects** (chests, doors, footlockers) - Works on **world objects** (chests, doors, footlockers)
- Works in **loot windows**, **merchant windows**, **chat item links**, and **quest windows** - Works in **loot windows**, **merchant windows**, **chat item links**, and **quest windows**
- Colour-coded tooltip line: - Only shows on locked objects — unlocked chests are ignored
- Green **Pickable (175)** — your skill meets the requirement - Zone-aware skill requirements for footlockers with multiple variants (Battered, Waterlogged, Mossy, Dented)
- Red **Skill Level Too Low (225)** — your skill is too low - Uses the game's own "Locked" text colour to determine which variant a footlocker is when multiple exist in a zone
- Slash command `/lpt` or `/lockpick` for help and item lists - Two colour modes selectable via `/lpt color`:
- **Simple** (default): Green = Pickable, Red = Skill Level Too Low
- **Match**: mirrors the colour of the game's own "Locked" text (red, orange, yellow, green, or grey)
- Setting is saved between sessions
--- ---
@@ -34,6 +37,7 @@ Adds a line to item and world-object tooltips showing the required Lockpicking s
| `/lpt` | Show help | | `/lpt` | Show help |
| `/lpt items` | List all known lockbox items and their requirements | | `/lpt items` | List all known lockbox items and their requirements |
| `/lpt objects` | List all known lockable world objects and their requirements | | `/lpt objects` | List all known lockable world objects and their requirements |
| `/lpt color` | Toggle between Simple and Match colour modes |
--- ---
@@ -46,15 +50,16 @@ Adds a line to item and world-object tooltips showing the required Lockpicking s
**World Objects** **World Objects**
- Rogue training boxes: Buccaneer's Strongbox, Practice Lockbox - Rogue training boxes: Buccaneer's Strongbox, Practice Lockbox
- Footlockers with zone-aware requirements: Battered, Waterlogged, Mossy, Dented, Scarlet
- Outdoor chests across all Classic zones - Outdoor chests across all Classic zones
- Dungeon chests: Shadowfang Keep, Gnomeregan, Scarlet Monastery, Uldaman, Zul'Farrak, Maraudon, Sunken Temple, Blackrock Depths, Blackrock Spire, Dire Maul, Scholomance, Stratholme - Dungeon chests: Shadowfang Keep, Gnomeregan, Scarlet Monastery, Uldaman, Zul'Farrak, Maraudon, Sunken Temple, Blackrock Depths, Blackrock Spire, Dire Maul, Scholomance, Stratholme
- Lockable doors: SM Cathedral, Gnomeregan, Scholomance, Stratholme Service Entrance - Lockable doors: Deadmines, Gnomeregan, SM Armory, SM Cathedral, Searing Gorge Gate, Blackrock Depths, Dire Maul (Crescent Door, Gordok Inner Door, Hidden Reach Door), Scholomance, Stratholme Service Entrance
--- ---
## Version History ## Version History
**1.2.0** — Stable. Full zone-aware footlocker coverage from spreadsheet data (Battered, Waterlogged, Mossy, Dented). Multi-variant footlockers now use the game's own "Locked" text colour to determine which variant is present, showing a single accurate line instead of multiple. Added Scarlet Footlocker (Eastern Plaguelands, 250). All dungeon door skill requirements corrected. Added Deadmines and Dire Maul doors. **1.2.0** — Stable. Full zone-aware footlocker coverage (Battered, Waterlogged, Mossy, Dented, Scarlet). Multi-variant footlockers use the game's Locked text colour to identify which variant is present. Added colour mode toggle (/lpt color) saved between sessions. All dungeon door requirements corrected. Added Deadmines and Dire Maul doors.
**1.1.0** — Zone-aware skill requirements for Battered Footlocker. Corrected all item IDs against wowhead.com/classic. Tooltip now shows Pickable/Skill Level Too Low in green/red. **1.1.0** — Zone-aware skill requirements for Battered Footlocker. Corrected all item IDs against wowhead.com/classic. Tooltip now shows Pickable/Skill Level Too Low in green/red.