Tames were landing in "Pets with unknown skin". The pet's name often
arrives (UNIT_NAME_UPDATE) before UNIT_PET, and the tracker refused to
count a tame on a name event, so the pet was filed as unknown and
UNIT_PET then found that record. A tame now counts on whichever event
comes first; renames are told apart by GUID or the rename popup.
An old pet sharing the default family name ("Scorpid") could also
swallow a new tame through the name match. A name-only match no longer
blocks a pending tame when the pet has the tamed beast's level, and
FindPet skips namesakes above the current level (pets never lose
levels) and prefers an exact level match. GUIDs are still tried first
but a miss proves nothing, since they change with every summon.
Renames seen by GUID now update the record and keep firstName.
SuperWoW's FAIL for Tame Beast clears the pending tame.
Unknown pets get a best guess from the abilities they knew when first
seen and their level: the beast that teaches the most of what the pet
knew wins. A single fitting skin shows a "Use guess" button.
New Combat.lua: Auto Shot and melee swing bars (SuperWoW cast events,
or ammo count plus a global cooldown probe and the combat log without
it), with the last half second of Auto Shot marked as the aim, and an
Arcane Shot icon showing cooldown, mana and range. The range, feed,
swing and Arcane toggles and the icon lock move into a Hunter tools
panel, and Search gets the freed width.
Level ranges like "9-10" were parsed as 0 (string.sub took "9-"), which
hid "tameable now" and sorted those beasts first. HPL.LowLevel fixes it.
162 lines
8.2 KiB
Lua
162 lines
8.2 KiB
Lua
-- PokeHuntLog: "How to use" window. Opens with the Help button in the log, /petlog help, or Shift-clicking
|
|
-- the minimap icon.
|
|
|
|
local HPL = PokeHuntLog
|
|
|
|
local GOLD = "|cffffd100"
|
|
local GREEN = "|cff40ff40"
|
|
local RED = "|cffff4040"
|
|
local ORANGE = "|cffff9933"
|
|
local GREY = "|cff9d9d9d"
|
|
local WHITE = "|cffffffff"
|
|
local END = "|r"
|
|
|
|
local HELP_TEXT = table.concat({
|
|
GOLD .. "Pet log" .. END,
|
|
"- Open it with the " .. WHITE .. "beast icon on your minimap" .. END .. " or " .. WHITE .. "/petlog" .. END .. ".",
|
|
"- Tamed beasts are added automatically. Call each of your pets and visit a stable master once so the pets you already have are added too.",
|
|
"- Tick " .. WHITE .. "Show uncaught" .. END .. " to see every skin and where to tame it.",
|
|
"- Hover a wild beast and its tooltip says " .. GREEN .. "NEW skin!" .. END .. " if you haven't caught that look yet.",
|
|
"- " .. WHITE .. "Collapse all" .. END .. " folds the whole list up; press it again to open it.",
|
|
"- " .. WHITE .. "Search" .. END .. " filters by skin, creature or zone, for example " .. WHITE .. "durotar" .. END .. ".",
|
|
"- Hover a family for its role, stat modifiers, abilities and diet. Hover a skin for your best pet's stats.",
|
|
"- " .. WHITE .. "Export" .. END .. " gives you the whole collection as text to paste into Discord.",
|
|
"- A pet under " .. ORANGE .. "Pets with unknown skin" .. END .. ": click it. If the log can work out which beast " ..
|
|
"it was from what it knows, press " .. WHITE .. "Use guess" .. END .. ". Otherwise press " .. WHITE .. "Assign skin" .. END ..
|
|
" and click its skin in the list.",
|
|
" ",
|
|
GOLD .. "Range icon" .. END,
|
|
"- " .. WHITE .. "Put Auto Shot and Wing Clip on your action bars." .. END .. " Any slot works, even a bar page you never show. " ..
|
|
"Drag the real spells from your spellbook; macros don't count.",
|
|
"- " .. GREEN .. "In range" .. END .. " " .. RED .. "Dead zone" .. END .. " " .. ORANGE .. "Melee" .. END .. " " ..
|
|
GREY .. "Out of range" .. END,
|
|
"- Without Wing Clip (learned at level 12) it can only say " .. RED .. "Too close" .. END .. ".",
|
|
" ",
|
|
GOLD .. "Training" .. END,
|
|
"- " .. WHITE .. "Training" .. END .. " shows your pet's unspent training points, what its family can learn, " ..
|
|
"which ranks you have unlocked by taming, and where to tame the next one.",
|
|
"- Taming a beast unlocks the ability rank it knows; a pet trainer then teaches it to any of your pets.",
|
|
"- Visit a pet trainer once and the log remembers what it offers, then tells you when something is ready.",
|
|
"- " .. WHITE .. "All abilities" .. END .. " in the Training panel lists every pet ability, each rank with its pet level and cost, and which beast teaches it.",
|
|
" ",
|
|
GOLD .. "Roles" .. END,
|
|
"- " .. WHITE .. "Tank" .. END .. " takes hits, " .. WHITE .. "DPS" .. END .. " deals damage, " ..
|
|
WHITE .. "Balanced" .. END .. " is in between, and gorillas are " .. WHITE .. "AoE tank" .. END ..
|
|
" because Thunderstomp grabs everything nearby.",
|
|
" ",
|
|
GOLD .. "Feed reminder" .. END,
|
|
"- A happiness face pops up when your pet stops being happy. Click it to cast Feed Pet, then click a food in your bags.",
|
|
"- Hover the face: at " .. WHITE .. "Content" .. END .. " a full meal fits with nothing wasted; at " ..
|
|
WHITE .. "Happy" .. END .. " most of the food is wasted.",
|
|
"- You are warned in chat when you are down to 200 and 50 shots.",
|
|
" ",
|
|
GOLD .. "Swing timer and Arcane Shot" .. END,
|
|
"- Two bars count down to your next " .. WHITE .. "Auto Shot" .. END .. " and melee swing. The " .. RED .. "red" .. END ..
|
|
" end of the Auto Shot bar is the aim: stand still then, or the shot is delayed.",
|
|
"- The " .. WHITE .. "Arcane Shot" .. END .. " icon lights up " .. GREEN .. "READY" .. END ..
|
|
" when it is off cooldown, you have the mana and your target is in range.",
|
|
" ",
|
|
GOLD .. "Hunter tools and moving the icons" .. END,
|
|
"- " .. WHITE .. "Hunter tools" .. END .. " (bottom left of the log) turns the range icon, feed reminder, swing timer " ..
|
|
"and Arcane Shot icon on or off.",
|
|
"- In it, press " .. WHITE .. "Unlock icons" .. END .. ", drag them where you want, then press " ..
|
|
WHITE .. "Lock icons" .. END .. ".",
|
|
" ",
|
|
GOLD .. "Commands" .. END,
|
|
WHITE .. "/petlog" .. END .. " - open the log " .. WHITE .. "/petlog help" .. END .. " - this window",
|
|
WHITE .. "/petlog move" .. END .. " - unlock or lock the icons",
|
|
WHITE .. "/petlog range" .. END .. ", " .. WHITE .. "/petlog feed" .. END .. " - turn the range icon or feed reminder on/off",
|
|
WHITE .. "/petlog feed unhappy" .. END .. " - only remind when the pet is unhappy",
|
|
WHITE .. "/petlog swing" .. END .. ", " .. WHITE .. "/petlog arcane" .. END .. " - swing timer or Arcane Shot icon on/off",
|
|
WHITE .. "/petlog uncaught" .. END .. " - show or hide skins you haven't caught",
|
|
WHITE .. "/petlog tooltip" .. END .. " - turn the beast tooltip line on or off",
|
|
WHITE .. "/petlog export" .. END .. " - collection as text " .. WHITE .. "/petlog ammo" .. END .. " - ammo warnings on/off",
|
|
WHITE .. "/petlog training" .. END .. " - the training panel " .. WHITE .. "/petlog trainer" .. END .. " - reminders on/off",
|
|
WHITE .. "/petlog commands" .. END .. " - list every command in chat",
|
|
WHITE .. "/petlog debug on" .. END .. " - show what the addon notices in chat (handy for bug reports)",
|
|
}, "\n")
|
|
|
|
local frame, lockButton
|
|
|
|
local function LockText()
|
|
return HPL.movingIcons and "Lock icons" or "Unlock icons"
|
|
end
|
|
|
|
function HPL.UpdateLockButtons()
|
|
if lockButton then lockButton:SetText(LockText()) end
|
|
if HPL.UpdateLogLockButton then HPL.UpdateLogLockButton() end
|
|
end
|
|
|
|
local function CreateHelp()
|
|
frame = CreateFrame("Frame", "PokeHuntLogHelpFrame", UIParent)
|
|
frame:SetWidth(500)
|
|
frame:SetHeight(560)
|
|
frame:SetPoint("CENTER", UIParent, "CENTER", 0, 20)
|
|
frame:SetFrameStrata("DIALOG")
|
|
frame:SetClampedToScreen(true)
|
|
frame:EnableMouse(true)
|
|
frame:SetMovable(true)
|
|
frame:RegisterForDrag("LeftButton")
|
|
frame:SetScript("OnDragStart", function() this:StartMoving() end)
|
|
frame:SetScript("OnDragStop", function() this:StopMovingOrSizing() end)
|
|
HPL.Opaque(frame, 11)
|
|
frame:SetBackdrop({
|
|
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
|
|
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
|
|
tile = true, tileSize = 32, edgeSize = 32,
|
|
insets = { left = 11, right = 12, top = 12, bottom = 11 },
|
|
})
|
|
frame:Hide()
|
|
table.insert(UISpecialFrames, "PokeHuntLogHelpFrame")
|
|
|
|
local title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
|
|
title:SetPoint("TOP", frame, "TOP", 0, -20)
|
|
title:SetText("PokeHuntLog - How to use")
|
|
local version = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
|
version:SetPoint("TOP", title, "BOTTOM", 0, -2)
|
|
version:SetText(GREY .. "version " .. HPL.VERSION .. END)
|
|
|
|
local close = CreateFrame("Button", "PokeHuntLogHelpCloseButton", frame, "UIPanelCloseButton")
|
|
close:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -6, -6)
|
|
close:SetScript("OnClick", function() frame:Hide() end)
|
|
|
|
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
|
text:SetPoint("TOPLEFT", frame, "TOPLEFT", 26, -68)
|
|
text:SetWidth(448)
|
|
text:SetHeight(430)
|
|
text:SetJustifyH("LEFT")
|
|
text:SetJustifyV("TOP")
|
|
text:SetText(HELP_TEXT)
|
|
|
|
lockButton = CreateFrame("Button", "PokeHuntLogHelpLockButton", frame, "UIPanelButtonTemplate")
|
|
lockButton:SetWidth(120)
|
|
lockButton:SetHeight(24)
|
|
lockButton:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 24, 20)
|
|
lockButton:SetScript("OnClick", function() HPL.ToggleMoveIcons() end)
|
|
|
|
local ok = CreateFrame("Button", "PokeHuntLogHelpOkButton", frame, "UIPanelButtonTemplate")
|
|
ok:SetWidth(120)
|
|
ok:SetHeight(24)
|
|
ok:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -24, 20)
|
|
ok:SetText("Got it")
|
|
ok:SetScript("OnClick", function() frame:Hide() end)
|
|
|
|
local credit = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
|
credit:SetPoint("BOTTOM", frame, "BOTTOM", 0, 26)
|
|
credit:SetText(GREY .. "Made by " .. END .. "|cffabd473stealthzi" .. END)
|
|
end
|
|
|
|
function HPL.ShowHelp()
|
|
if not frame then CreateHelp() end
|
|
lockButton:SetText(LockText())
|
|
frame:Show()
|
|
end
|
|
|
|
function HPL.ToggleHelp()
|
|
if frame and frame:IsShown() then
|
|
frame:Hide()
|
|
else
|
|
HPL.ShowHelp()
|
|
end
|
|
end
|